foxygit / doom Log in
commit e3a806cc094848794d6115914eeb8bf0e0ae1b2a
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Mon Dec 1 22:16:53 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Mon Dec 1 22:16:53 2008 +0000

    Do endianness conversion when accessing patch->width fields.

    Subversion-branch: /branches/raven-branch
    Subversion-revision: 1399
---
 src/heretic/mn_menu.c | 9 +++++----
 src/hexen/mn_menu.c   | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c
index f376edb2..0bc9d994 100644
--- 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 @@ void MN_DrTextA(char *text, int x, int y)
         {
             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 @@ int MN_TextAWidth(char *text)
         else
         {
             p = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
-            width += p->width - 1;
+            width += SHORT(p->width) - 1;
         }
     }
     return (width);
@@ -405,7 +406,7 @@ void MN_DrTextB(char *text, int x, int y)
         {
             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 @@ int MN_TextBWidth(char *text)
         else
         {
             p = W_CacheLumpNum(FontBBaseLump + c - 33, PU_CACHE);
-            width += p->width - 1;
+            width += SHORT(p->width) - 1;
         }
     }
     return (width);
diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c
index e166022d..dd508e28 100644
--- 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 @@ void MN_DrTextA(char *text, int x, int y)
         {
             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 @@ int MN_TextAWidth(char *text)
         else
         {
             p = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
-            width += p->width - 1;
+            width += SHORT(p->width) - 1;
         }
     }
     return (width);
@@ -443,7 +444,7 @@ void MN_DrTextB(char *text, int x, int y)
         {
             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 @@ int MN_TextBWidth(char *text)
         else
         {
             p = W_CacheLumpNum(FontBBaseLump + c - 33, PU_CACHE);
-            width += p->width - 1;
+            width += SHORT(p->width) - 1;
         }
     }
     return (width);