mirror of
https://github.com/st3fan/ewm.git
synced 2025-01-28 03:35:20 +00:00
Performance improvements part III
This commit is contained in:
parent
c3097ea5ed
commit
0d2844d505
@ -509,9 +509,6 @@ static bool ewm_two_poll_event(struct ewm_two_t *two, SDL_Window *window) { // T
|
|||||||
SDL_SetWindowSize(window, 40*7*3, 24*8*3 + (two->status_bar_visible ? (9*3) : 0));
|
SDL_SetWindowSize(window, 40*7*3, 24*8*3 + (two->status_bar_visible ? (9*3) : 0));
|
||||||
SDL_RenderSetLogicalSize(two->scr->renderer, 40*7*3, 24*8*3 + (two->status_bar_visible ? (9*3) : 0));
|
SDL_RenderSetLogicalSize(two->scr->renderer, 40*7*3, 24*8*3 + (two->status_bar_visible ? (9*3) : 0));
|
||||||
break;
|
break;
|
||||||
case SDLK_p:
|
|
||||||
two->paused = !two->paused;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else if (event.key.keysym.mod == KMOD_NONE) {
|
} else if (event.key.keysym.mod == KMOD_NONE) {
|
||||||
switch (event.key.keysym.sym) {
|
switch (event.key.keysym.sym) {
|
||||||
@ -885,7 +882,7 @@ int ewm_two_main(int argc, char **argv) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!two->paused && (SDL_GetTicks() - ticks) >= (1000 / fps)) {
|
if ((SDL_GetTicks() - ticks) >= (1000 / fps)) {
|
||||||
if (!ewm_two_step_cpu(two, EWM_TWO_SPEED / fps)) {
|
if (!ewm_two_step_cpu(two, EWM_TWO_SPEED / fps)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -96,8 +96,6 @@ struct ewm_two_t {
|
|||||||
|
|
||||||
int lua_key_down_fn;
|
int lua_key_down_fn;
|
||||||
int lua_key_up_fn;
|
int lua_key_up_fn;
|
||||||
|
|
||||||
bool paused;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ewm_two_t *ewm_two_create(int type, SDL_Renderer *renderer, SDL_Joystick *joystick);
|
struct ewm_two_t *ewm_two_create(int type, SDL_Renderer *renderer, SDL_Joystick *joystick);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user