mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-07 14:28:12 +03:00
Remove scene_flip function
It was a bug to call this function outside of sact_Update, because it set scene_is_dirty to false without first rendering the scene. This can cause the scene to not be rendered in a timely manner.
This commit is contained in:
@@ -44,7 +44,6 @@ extern bool scene_is_dirty;
|
||||
void scene_register_sprite(struct sprite *sp);
|
||||
void scene_unregister_sprite(struct sprite *sp);
|
||||
void scene_render(void);
|
||||
void scene_flip(void);
|
||||
int scene_set_wp(int cg_no);
|
||||
int scene_set_wp_color(int r, int g, int b);
|
||||
void scene_set_sprite_z(struct sprite *sp, int z);
|
||||
|
||||
+2
-1
@@ -138,7 +138,8 @@ int sact_Update(void)
|
||||
dungeon_update();
|
||||
if (scene_is_dirty) {
|
||||
scene_render();
|
||||
scene_flip();
|
||||
gfx_swap();
|
||||
scene_is_dirty = false;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
+2
-2
@@ -298,7 +298,7 @@ void handle_events(void)
|
||||
case SDL_WINDOWEVENT:
|
||||
switch (e.window.event) {
|
||||
case SDL_WINDOWEVENT_EXPOSED:
|
||||
scene_flip();
|
||||
gfx_swap();
|
||||
break;
|
||||
case SDL_WINDOWEVENT_ENTER:
|
||||
mouse_focus = true;
|
||||
@@ -314,7 +314,7 @@ void handle_events(void)
|
||||
break;
|
||||
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
||||
gfx_update_screen_scale();
|
||||
scene_flip();
|
||||
gfx_swap();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -81,12 +81,6 @@ void scene_render(void)
|
||||
}
|
||||
}
|
||||
|
||||
void scene_flip(void)
|
||||
{
|
||||
gfx_swap();
|
||||
scene_is_dirty = false;
|
||||
}
|
||||
|
||||
int scene_set_wp(int cg_no) {
|
||||
if (!cg_no) {
|
||||
gfx_delete_texture(&wp);
|
||||
|
||||
Reference in New Issue
Block a user