X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=ea8288e033870af9f9e2308300a5850a993b40d7;hb=800ce81b46cf929b5da0723f2ed5b3e0759d8196;hp=9f8e3075cc468ce87647497d090c302571245522;hpb=380f1f693d72b034d9b56dbc9c974ba8c6c490e7;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index 9f8e3075..ea8288e0 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -103,6 +103,8 @@ void InitProgramInfo(char *argv0, char *config_filename, char *userdata_subdir, program.log_file[LOG_OUT_ID] = program.log_file_default[LOG_OUT_ID] = stdout; program.log_file[LOG_ERR_ID] = program.log_file_default[LOG_ERR_ID] = stderr; + program.api_thread_count = 0; + program.headless = FALSE; } @@ -128,7 +130,7 @@ void InitRuntimeInfo() runtime.uses_touch_device = FALSE; #endif - runtime.api_server = setup.api_server; + runtime.use_api_server = setup.use_api_server; } void SetWindowTitle(void) @@ -1193,7 +1195,7 @@ void ReloadCustomImage(Bitmap *bitmap, char *basename) free(new_bitmap); } -static Bitmap *ZoomBitmap(Bitmap *src_bitmap, int zoom_width, int zoom_height) +Bitmap *ZoomBitmap(Bitmap *src_bitmap, int zoom_width, int zoom_height) { return SDLZoomBitmap(src_bitmap, zoom_width, zoom_height); } @@ -1843,6 +1845,24 @@ void PushUserEvent(int code, int value1, int value2) SDL_PushEvent((SDL_Event *)&event); } +boolean PendingEscapeKeyEvent(void) +{ + if (PendingEvent()) + { + Event event; + + // check if any key press event is pending + if (SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYDOWN, SDL_KEYDOWN) != 1) + return FALSE; + + // check if pressed key is "Escape" key + if (event.key.keysym.sym == KSYM_Escape) + return TRUE; + } + + return FALSE; +} + // ============================================================================ // joystick functions