mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-04 04:48:09 +03:00
parts: only render on PE_Update/PE_UpdateParts
Also, fix an issue in Rance 01 where a bad frame would be displayed when loading a save (this is a bug present in the original game).
This commit is contained in:
+2
-2
@@ -957,7 +957,7 @@ void PE_Update(int passed_time, bool message_window_show)
|
||||
audio_update();
|
||||
parts_update_animation(passed_time);
|
||||
PE_UpdateInputState(passed_time);
|
||||
parts_engine_dirty();
|
||||
parts_render_update(passed_time);
|
||||
}
|
||||
|
||||
void PE_UpdateParts(int passed_time, possibly_unused bool is_skip, bool message_window_show)
|
||||
@@ -965,7 +965,7 @@ void PE_UpdateParts(int passed_time, possibly_unused bool is_skip, bool message_
|
||||
parts_message_window_show = message_window_show;
|
||||
audio_update();
|
||||
parts_update_animation(passed_time);
|
||||
parts_engine_dirty();
|
||||
parts_render_update(passed_time);
|
||||
}
|
||||
|
||||
void PE_SetDelegateIndex(int parts_no, int delegate_index)
|
||||
|
||||
@@ -360,7 +360,9 @@ struct string *parts_text_get(struct parts_text *t);
|
||||
|
||||
// render.c
|
||||
void parts_render_init(void);
|
||||
void parts_render_update(int passed_time);
|
||||
void parts_engine_dirty(void);
|
||||
void parts_engine_clean(void);
|
||||
void parts_dirty(struct parts *parts);
|
||||
void parts_render(struct parts *parts);
|
||||
void parts_render_family(struct parts *parts);
|
||||
|
||||
+23
-2
@@ -262,14 +262,35 @@ void parts_engine_render(possibly_unused struct sprite *_)
|
||||
}
|
||||
}
|
||||
|
||||
static bool pe_dirty = false;
|
||||
|
||||
void parts_render_update(int passed_time)
|
||||
{
|
||||
// XXX: hack for Rance 01 load issue
|
||||
// There is a bug in Rance 01 where a single bad frame is displayed after
|
||||
// loading a save. When this happens, the game passes a negative time delta
|
||||
// to PE_Update. We fix this issue by ignoring such calls.
|
||||
if (passed_time < 0)
|
||||
return;
|
||||
if (pe_dirty) {
|
||||
scene_sprite_dirty(&goat_sprite);
|
||||
pe_dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
void parts_engine_dirty(void)
|
||||
{
|
||||
scene_sprite_dirty(&goat_sprite);
|
||||
pe_dirty = true;
|
||||
}
|
||||
|
||||
void parts_engine_clean(void)
|
||||
{
|
||||
pe_dirty = false;
|
||||
}
|
||||
|
||||
void parts_dirty(possibly_unused struct parts *parts)
|
||||
{
|
||||
parts_engine_dirty();
|
||||
pe_dirty = true;
|
||||
}
|
||||
|
||||
void parts_render_init(void)
|
||||
|
||||
+1
-2
@@ -642,7 +642,6 @@ bool PE_Load(struct page **buffer)
|
||||
load_parts(&r, version);
|
||||
}
|
||||
|
||||
PE_UpdateComponent(0);
|
||||
|
||||
parts_engine_clean();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user