Merge branch 'bess' into gbs

This commit is contained in:
Lior Halphon 2021-04-17 16:57:05 +03:00
commit e8158be454
3 changed files with 13 additions and 4 deletions

View File

@ -1117,6 +1117,9 @@ done:
read_bess_buffer(&sgb.attribute_map, file, (void *)gb->sgb->attribute_map, sizeof(gb->sgb->attribute_map)); read_bess_buffer(&sgb.attribute_map, file, (void *)gb->sgb->attribute_map, sizeof(gb->sgb->attribute_map));
read_bess_buffer(&sgb.attribute_files, file, (void *)gb->sgb->attribute_files, sizeof(gb->sgb->attribute_files)); read_bess_buffer(&sgb.attribute_files, file, (void *)gb->sgb->attribute_files, sizeof(gb->sgb->attribute_files));
gb->sgb->effective_palettes[12] = gb->sgb->effective_palettes[8] =
gb->sgb->effective_palettes[4] = gb->sgb->effective_palettes[0];
gb->sgb->player_count = sgb.multiplayer_state >> 4; gb->sgb->player_count = sgb.multiplayer_state >> 4;
gb->sgb->current_player = sgb.multiplayer_state & 0xF; gb->sgb->current_player = sgb.multiplayer_state & 0xF;
if (gb->sgb->player_count > 4 || gb->sgb->player_count == 3 || gb->sgb->player_count == 0) { if (gb->sgb->player_count > 4 || gb->sgb->player_count == 3 || gb->sgb->player_count == 0) {

View File

@ -1302,9 +1302,15 @@ void run_gui(bool is_running)
} }
case SDL_DROPFILE: { case SDL_DROPFILE: {
if (GB_is_stave_state(event.drop.file)) { if (GB_is_stave_state(event.drop.file)) {
if (GB_is_inited(&gb)) {
dropped_state_file = event.drop.file; dropped_state_file = event.drop.file;
pending_command = GB_SDL_LOAD_STATE_FROM_FILE_COMMAND; pending_command = GB_SDL_LOAD_STATE_FROM_FILE_COMMAND;
} }
else {
SDL_free(event.drop.file);
}
break;
}
else { else {
set_filename(event.drop.file, SDL_free); set_filename(event.drop.file, SDL_free);
pending_command = GB_SDL_NEW_FILE_COMMAND; pending_command = GB_SDL_NEW_FILE_COMMAND;