remove ctx.update_multiplicity
This commit is contained in:
parent
688d71953a
commit
851ab80292
@ -72,11 +72,6 @@ typedef struct EngineContext {
|
|||||||
SDL_Window *window;
|
SDL_Window *window;
|
||||||
uint32_t window_id;
|
uint32_t window_id;
|
||||||
|
|
||||||
/* this should be a multiple of the current ticks per second */
|
|
||||||
/* use it to simulate low framerate (e.g. at 60 tps, set to 2 for 30 fps) */
|
|
||||||
/* it can be changed at runtime; any resulting logic anomalies are bugs */
|
|
||||||
uint32_t update_multiplicity;
|
|
||||||
|
|
||||||
bool is_running;
|
bool is_running;
|
||||||
bool window_size_has_changed;
|
bool window_size_has_changed;
|
||||||
bool resync_flag;
|
bool resync_flag;
|
||||||
|
@ -204,9 +204,8 @@ static void main_loop(void) {
|
|||||||
|
|
||||||
/* finally, let's get to work */
|
/* finally, let's get to work */
|
||||||
int frames = 0;
|
int frames = 0;
|
||||||
while (ctx.frame_accumulator >= ctx.desired_frametime * ctx.update_multiplicity) {
|
while (ctx.frame_accumulator >= ctx.desired_frametime) {
|
||||||
frames += 1;
|
frames += 1;
|
||||||
for (size_t i = 0; i < ctx.update_multiplicity; ++i) {
|
|
||||||
/* TODO: disable rendering pushes on not-last ? */
|
/* TODO: disable rendering pushes on not-last ? */
|
||||||
render_queue_clear();
|
render_queue_clear();
|
||||||
poll_events();
|
poll_events();
|
||||||
@ -232,7 +231,6 @@ static void main_loop(void) {
|
|||||||
ctx.game.frame_number = 0;
|
ctx.game.frame_number = 0;
|
||||||
ctx.game.initialization_needed = false;
|
ctx.game.initialization_needed = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: in some cases machine might want to assume frames will be fed as much as possible */
|
/* TODO: in some cases machine might want to assume frames will be fed as much as possible */
|
||||||
/* which for now is broken as glBufferData with NULL is used all over right after render */
|
/* which for now is broken as glBufferData with NULL is used all over right after render */
|
||||||
@ -555,9 +553,6 @@ static bool initialize(void) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* you could change this at runtime if you wanted */
|
|
||||||
ctx.update_multiplicity = 1;
|
|
||||||
|
|
||||||
/* random seeding */
|
/* random seeding */
|
||||||
/* SDL_GetPerformanceCounter returns some platform-dependent number. */
|
/* SDL_GetPerformanceCounter returns some platform-dependent number. */
|
||||||
/* it should vary between game instances. i checked! random enough for me. */
|
/* it should vary between game instances. i checked! random enough for me. */
|
||||||
|
Loading…
Reference in New Issue
Block a user