Fix an SDL crash, minor tweak to BESS SGB
This commit is contained in:
parent
87a2d48675
commit
9fcdc082d2
@ -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) {
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user