From 854097ba03763b8f56a5c255a65438bd30d6182d Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 26 Mar 2009 02:06:14 +0000 Subject: [PATCH] - Changed gameinfo_t and gameborder_t to be named structs instead of typedef'ed anonymous structs. - Fixed: P_AutoUseHealth() used autousemodes 0 and 1 instead of 1 and 2. - Fixed: SBARINFO did not recognize 5:4 aspect ratio. - Fixed: screenshot_dir was ignored. SVN r1505 (trunk) --- docs/rh-log.txt | 9 ++++++++- src/g_shared/sbarinfo.h | 2 +- src/gi.h | 8 ++++---- src/m_misc.cpp | 4 ++-- src/p_interaction.cpp | 4 ++-- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f9f349257c..f46b28d88d 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,11 @@ -March 25, 2009 (Changes by Graf Zahl) +March 25, 2009 +- Changed gameinfo_t and gameborder_t to be named structs instead of + typedef'ed anonymous structs. +- Fixed: P_AutoUseHealth() used autousemodes 0 and 1 instead of 1 and 2. +- Fixed: SBARINFO did not recognize 5:4 aspect ratio. +- Fixed: screenshot_dir was ignored. + +March 25, 2009 (Changes by Graf Zahl) - Removed some obsolete code from G_InitLevelLocals that was causing problems with maps that have no name. - Fixed: The inner loop in AWeaponSlot::PickWeapon could endlessly loop when diff --git a/src/g_shared/sbarinfo.h b/src/g_shared/sbarinfo.h index daa1360952..539d6a7b51 100644 --- a/src/g_shared/sbarinfo.h +++ b/src/g_shared/sbarinfo.h @@ -275,7 +275,7 @@ enum //aspect ratios ASPECTRATIO_4_3 = 0, ASPECTRATIO_16_9 = 1, ASPECTRATIO_16_10 = 2, - ASPECTRATIO_5_4 = 3, + ASPECTRATIO_5_4 = 4, }; enum //Key words diff --git a/src/gi.h b/src/gi.h index 73a7d946ff..0e3ad50a26 100644 --- a/src/gi.h +++ b/src/gi.h @@ -47,7 +47,7 @@ extern const char *GameNames[17]; -typedef struct +struct gameborder_t { BYTE offset; BYTE size; @@ -59,9 +59,9 @@ typedef struct char bl[8]; char b[8]; char br[8]; -} gameborder_t; +}; -typedef struct +struct gameinfo_t { int flags; EGameType gametype; @@ -94,7 +94,7 @@ typedef struct FString intermissionMusic; const char *GetFinalePage(unsigned int num) const; -} gameinfo_t; +}; extern gameinfo_t gameinfo; diff --git a/src/m_misc.cpp b/src/m_misc.cpp index 0ce267d1ce..c68c754539 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -648,7 +648,7 @@ void M_ScreenShot (const char *filename) { size_t dirlen; autoname = Args->CheckValue("-shotdir"); - if (autoname == NULL) + if (autoname.IsEmpty()) { autoname = screenshot_dir; } @@ -671,6 +671,7 @@ void M_ScreenShot (const char *filename) } } autoname = NicePath(autoname); + CreatePath(autoname); if (!FindFreeName (autoname, writepcx ? "pcx" : "png")) { Printf ("M_ScreenShot: Delete some screenshots\n"); @@ -682,7 +683,6 @@ void M_ScreenShot (const char *filename) autoname = filename; DefaultExtension (autoname, writepcx ? ".pcx" : ".png"); } - CreatePath(screenshot_dir); // save the screenshot const BYTE *buffer; diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 5adcbdbbb3..bd3f47a80f 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -779,8 +779,8 @@ void P_AutoUseHealth(player_t *player, int saveHealth) { int mode = static_cast(inv)->autousemode; - if (mode == 0) NormalHealthItems.Push(inv); - else if (mode == 1) LargeHealthItems.Push(inv); + if (mode == 1) NormalHealthItems.Push(inv); + else if (mode == 2) LargeHealthItems.Push(inv); } }