diff options
author | Simon Howard | 2012-12-14 01:18:38 +0000 |
---|---|---|
committer | Simon Howard | 2012-12-14 01:18:38 +0000 |
commit | a42a4824fa7e4d883a2f710c91655b2edb02f525 (patch) | |
tree | 484960f038069245c8a442d1f02aa905f7e50806 /src | |
parent | 993315afc4b1fddaf8952e7e55d1373b5052dd7c (diff) | |
parent | f5e5190c421c5a880ff3e6638e793b64195f4f02 (diff) | |
download | chocolate-doom-a42a4824fa7e4d883a2f710c91655b2edb02f525.tar.gz chocolate-doom-a42a4824fa7e4d883a2f710c91655b2edb02f525.tar.bz2 chocolate-doom-a42a4824fa7e4d883a2f710c91655b2edb02f525.zip |
Merge from trunk.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2546
Diffstat (limited to 'src')
-rw-r--r-- | src/d_iwad.c | 38 | ||||
-rw-r--r-- | src/i_video.c | 10 |
2 files changed, 22 insertions, 26 deletions
diff --git a/src/d_iwad.c b/src/d_iwad.c index aefb6872..7e850d53 100644 --- a/src/d_iwad.c +++ b/src/d_iwad.c @@ -190,36 +190,30 @@ static char *GetRegistryString(registry_value_t *reg_val) // Open the key (directory where the value is stored) - if (RegOpenKeyEx(reg_val->root, reg_val->path, 0, KEY_READ, &key) - != ERROR_SUCCESS) + if (RegOpenKeyEx(reg_val->root, reg_val->path, + 0, KEY_READ, &key) != ERROR_SUCCESS) { return NULL; } - // Find the type and length of the string + result = NULL; - if (RegQueryValueEx(key, reg_val->value, NULL, &valtype, NULL, &len) - != ERROR_SUCCESS) - { - return NULL; - } - - // Only accept strings + // Find the type and length of the string, and only accept strings. - if (valtype != REG_SZ) + if (RegQueryValueEx(key, reg_val->value, + NULL, &valtype, NULL, &len) == ERROR_SUCCESS + && valtype == REG_SZ) { - return NULL; - } - - // Allocate a buffer for the value and read the value + // Allocate a buffer for the value and read the value - result = malloc(len); + result = malloc(len); - if (RegQueryValueEx(key, reg_val->value, NULL, &valtype, (unsigned char *) result, &len) - != ERROR_SUCCESS) - { - free(result); - return NULL; + if (RegQueryValueEx(key, reg_val->value, NULL, &valtype, + (unsigned char *) result, &len) != ERROR_SUCCESS) + { + free(result); + result = NULL; + } } // Close the key @@ -317,6 +311,8 @@ static void CheckSteamEdition(void) AddIWADDir(subpath); } + + free(install_path); } // Default install directories for DOS Doom diff --git a/src/i_video.c b/src/i_video.c index 959a1472..6b850941 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -381,7 +381,7 @@ static void UpdateFocus(void) // Show or hide the mouse cursor. We have to use different techniques // depending on the OS. -static void ShowCursor(boolean show) +static void SetShowCursor(boolean show) { // On Windows, using SDL_ShowCursor() adds lag to the mouse input, // so work around this by setting an invisible cursor instead. On @@ -563,7 +563,7 @@ void I_ShutdownGraphics(void) { if (initialized) { - ShowCursor(true); + SetShowCursor(true); SDL_QuitSubSystem(SDL_INIT_VIDEO); @@ -924,15 +924,15 @@ static void UpdateGrab(void) { // Hide the cursor in screensaver mode - ShowCursor(false); + SetShowCursor(false); } else if (grab && !currently_grabbed) { - ShowCursor(false); + SetShowCursor(false); } else if (!grab && currently_grabbed) { - ShowCursor(true); + SetShowCursor(true); } currently_grabbed = grab; |