X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=076ea586309c008e3332e9eb4fa49602c89fc6bb;hb=7f8f5498ebbb9cbfd0857dce7e53b64bf6603aa4;hp=af3e053607781e7e1b83ed5dfb911396584f6441;hpb=544783044dc509bba661c1bf4a9d7fa64877d8cf;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index af3e0536..076ea586 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -4,7 +4,7 @@ // (c) 1995-2014 by Artsoft Entertainment // Holger Schemel // info@artsoft.org -// http://www.artsoft.org/ +// https://www.artsoft.org/ // ---------------------------------------------------------------------------- // system.c // ============================================================================ @@ -57,6 +57,7 @@ int button_status = MB_NOT_PRESSED; boolean motion_status = FALSE; int wheel_steps = DEFAULT_WHEEL_STEPS; boolean keyrepeat_status = TRUE; +boolean textinput_status = FALSE; int redraw_mask = REDRAW_NONE; @@ -113,6 +114,9 @@ void InitNetworkInfo(boolean enabled, boolean connected, boolean serveronly, network.server_host = server_host; network.server_port = server_port; + + network.server_thread = NULL; + network.is_server_thread = FALSE; } void InitRuntimeInfo() @@ -136,14 +140,14 @@ void InitScoresInfo(void) { if (program.global_scores) { - Error(ERR_DEBUG, "Using global, multi-user scores directory '%s'.", + Debug("internal:path", "Using global, multi-user scores directory '%s'.", global_scores_dir); - Error(ERR_DEBUG, "Remove to enable single-user scores directory."); - Error(ERR_DEBUG, "(This enables multipe score entries per user.)"); + Debug("internal:path", "Remove to enable single-user scores directory."); + Debug("internal:path", "(This enables multipe score entries per user.)"); } else { - Error(ERR_DEBUG, "Using private, single-user scores directory."); + Debug("internal:path", "Using private, single-user scores directory."); } } #endif @@ -1168,7 +1172,8 @@ void ReloadCustomImage(Bitmap *bitmap, char *basename) if (filename == NULL) // (should never happen) { - Error(ERR_WARN, "ReloadCustomImage(): cannot find file '%s'", basename); + Warn("ReloadCustomImage(): cannot find file '%s'", basename); + return; } @@ -1183,16 +1188,19 @@ void ReloadCustomImage(Bitmap *bitmap, char *basename) if ((new_bitmap = LoadImage(filename)) == NULL) { - Error(ERR_WARN, "LoadImage('%s') failed: %s", basename, GetError()); + Warn("LoadImage('%s') failed: %s", basename, GetError()); + return; } if (bitmap->width != new_bitmap->width || bitmap->height != new_bitmap->height) { - Error(ERR_WARN, "ReloadCustomImage: new image '%s' has wrong dimensions", + Warn("ReloadCustomImage: new image '%s' has wrong dimensions", filename); + FreeBitmap(new_bitmap); + return; } @@ -1753,6 +1761,8 @@ KeyMod GetKeyModStateFromEvents(void) void StartTextInput(int x, int y, int width, int height) { + textinput_status = TRUE; + #if defined(HAS_SCREEN_KEYBOARD) SDL_StartTextInput(); @@ -1767,6 +1777,8 @@ void StartTextInput(int x, int y, int width, int height) void StopTextInput(void) { + textinput_status = FALSE; + #if defined(HAS_SCREEN_KEYBOARD) SDL_StopTextInput();