ref: e3a806cc094848794d6115914eeb8bf0e0ae1b2a
parent: c8ef0c4a75b12d1c35f9a6994bdca36aa8897055
author: Simon Howard <[email protected]>
date: Mon Dec 1 17:16:53 EST 2008
Do endianness conversion when accessing patch->width fields. Subversion-branch: /branches/raven-branch Subversion-revision: 1399
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -28,6 +28,7 @@
#include "doomdef.h"
#include "doomkeys.h"
#include "i_system.h"
+#include "i_swap.h"
#include "p_local.h"
#include "r_local.h"
#include "s_sound.h"
@@ -347,7 +348,7 @@
{
p = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
V_DrawPatch(x, y, p);
- x += p->width - 1;
+ x += SHORT(p->width) - 1;
}
}
}
@@ -376,7 +377,7 @@
else
{
p = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
- width += p->width - 1;
+ width += SHORT(p->width) - 1;
}
}
return (width);
@@ -405,7 +406,7 @@
{
p = W_CacheLumpNum(FontBBaseLump + c - 33, PU_CACHE);
V_DrawPatch(x, y, p);
- x += p->width - 1;
+ x += SHORT(p->width) - 1;
}
}
}
@@ -434,7 +435,7 @@
else
{
p = W_CacheLumpNum(FontBBaseLump + c - 33, PU_CACHE);
- width += p->width - 1;
+ width += SHORT(p->width) - 1;
}
}
return (width);
--- a/src/hexen/mn_menu.c
+++ b/src/hexen/mn_menu.c
@@ -29,6 +29,7 @@
#include "h2def.h"
#include "doomkeys.h"
#include "i_system.h"
+#include "i_swap.h"
#include "i_video.h"
#include "p_local.h"
#include "r_local.h"
@@ -359,7 +360,7 @@
{
p = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
V_DrawPatch(x, y, p);
- x += p->width - 1;
+ x += SHORT(p->width) - 1;
}
}
}
@@ -414,7 +415,7 @@
else
{
p = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
- width += p->width - 1;
+ width += SHORT(p->width) - 1;
}
}
return (width);
@@ -443,7 +444,7 @@
{
p = W_CacheLumpNum(FontBBaseLump + c - 33, PU_CACHE);
V_DrawPatch(x, y, p);
- x += p->width - 1;
+ x += SHORT(p->width) - 1;
}
}
}
@@ -472,7 +473,7 @@
else
{
p = W_CacheLumpNum(FontBBaseLump + c - 33, PU_CACHE);
- width += p->width - 1;
+ width += SHORT(p->width) - 1;
}
}
return (width);