summaryrefslogtreecommitdiff
path: root/src/strife/hu_lib.c
diff options
context:
space:
mode:
authorJames Haley2011-02-14 02:21:42 +0000
committerJames Haley2011-02-14 02:21:42 +0000
commit63903f9aac430d321a3063fbc79d61ccae6db22e (patch)
tree01b4a185fd2aad40b7427ac8c98ef89764bdd9d2 /src/strife/hu_lib.c
parent4c4a67ef7ad1b53d5b13e37e2ff3744320a0f1ac (diff)
downloadchocolate-doom-63903f9aac430d321a3063fbc79d61ccae6db22e.tar.gz
chocolate-doom-63903f9aac430d321a3063fbc79d61ccae6db22e.tar.bz2
chocolate-doom-63903f9aac430d321a3063fbc79d61ccae6db22e.zip
Fix to HUlib_drawYellowText (more Hex-Rays code-skipping shenanigans),
and finished ST_drawKeysPopup for drawing keys (TODO: in deathmatch it draws frags instead). Fix to buffer overflow in V_ScreenShot - *ATTN fraggle* - needs fix in trunk! Subversion-branch: /branches/strife-branch Subversion-revision: 2265
Diffstat (limited to 'src/strife/hu_lib.c')
-rw-r--r--src/strife/hu_lib.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/src/strife/hu_lib.c b/src/strife/hu_lib.c
index 2033c7b5..6d29115b 100644
--- a/src/strife/hu_lib.c
+++ b/src/strife/hu_lib.c
@@ -47,7 +47,7 @@ extern boolean D_PatchClipCallback(patch_t *patch, int x, int y); // [STRIFE]
//
// HUlib_drawYellowText
//
-// haleyjd 09/18/10: [STRIFE] New function.
+// haleyjd 20100918: [STRIFE] New function.
//
void HUlib_drawYellowText(int x, int y, char *text)
{
@@ -61,37 +61,43 @@ void HUlib_drawYellowText(int x, int y, char *text)
{
x = start_x;
y += 12;
+ continue;
}
- else if(c == '_' || c != ' ' || x != start_x)
+
+ // haleyjd 20110213: found MORE code ignored/misinterpreted by Hex-Rays:
+ // Underscores are replaced by spaces.
+ if(c == '_')
+ c = ' ';
+ else if (c == ' ' && x == start_x) // skip spaces at the start of a line
+ continue;
+
+ c = toupper(c) - HU_FONTSTART;
+
+ if(c >= 0 && c < HU_FONTSIZE)
{
- c = toupper(c) - HU_FONTSTART;
+ patch_t *patch = yfont[(int) c];
+ int width = SHORT(patch->width);
- if(c >= 0 && c < HU_FONTSIZE)
+ if(x + width <= (SCREENWIDTH - 20))
{
- patch_t *patch = yfont[(int) c];
- int width = SHORT(patch->width);
-
- if(x + width <= (SCREENWIDTH - 20))
- {
- // haleyjd: STRIFE-TODO: bit different than the exe... for now
- if(!D_PatchClipCallback(patch, x + SHORT(patch->leftoffset),
- y + SHORT(patch->topoffset)))
- return;
- V_DrawPatchDirect(x, y, patch);
- x = x + width;
- }
- else
- {
- x = start_x;
- --rover;
- y += 12;
- }
+ // haleyjd: STRIFE-TODO: bit different than the exe... for now
+ if(!D_PatchClipCallback(patch, x + SHORT(patch->leftoffset),
+ y + SHORT(patch->topoffset)))
+ return;
+ V_DrawPatchDirect(x, y, patch);
+ x = x + width;
}
else
{
- x += 4;
+ x = start_x;
+ --rover;
+ y += 12;
}
}
+ else
+ {
+ x += 4;
+ }
}
}