- [FIX] Non-turbo mode was buggy
This commit is contained in:
8
mini.cpp
8
mini.cpp
@@ -9,7 +9,7 @@
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
DECLSPEC int SDLCALL (*event_handler_ptr)(SDL_Event*) = &SDL_PollEvent;
|
||||
//DECLSPEC int SDLCALL (*event_handler_ptr)(SDL_Event*) = &SDL_PollEvent;
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace ds {
|
||||
bool fill_trans = false;
|
||||
}
|
||||
|
||||
bool turbo_mode = true;
|
||||
bool should_exit = false;
|
||||
bool should_quit = false;
|
||||
SDL_Window *mini_win;
|
||||
@@ -288,7 +289,8 @@ int main(int argc,char*argv[]){
|
||||
mouse_just_pressed = 0;
|
||||
while(!should_exit) {
|
||||
mouse_wheel = 0;
|
||||
while(event_handler_ptr(&mini_eve)) {
|
||||
if (!turbo_mode) SDL_WaitEvent(NULL);
|
||||
while(SDL_PollEvent(&mini_eve)) {
|
||||
if (mini_eve.type == SDL_QUIT) { should_exit=true; should_quit=true; break; }
|
||||
if (mini_eve.type == SDL_KEYDOWN) {
|
||||
/*
|
||||
@@ -1256,7 +1258,7 @@ const char *configfolder() {
|
||||
}
|
||||
|
||||
void setturbo(const bool value) {
|
||||
event_handler_ptr = value ? &SDL_PollEvent : &SDL_WaitEvent;
|
||||
turbo_mode = value;
|
||||
}
|
||||
|
||||
void exit() {
|
||||
|
||||
Reference in New Issue
Block a user