]> git.wh0rd.org - patches.git/blobdiff - avp-cleanup.patch
more random patches. who knows.
[patches.git] / avp-cleanup.patch
diff --git a/avp-cleanup.patch b/avp-cleanup.patch
new file mode 100644 (file)
index 0000000..7f23ec0
--- /dev/null
@@ -0,0 +1,735 @@
+- change all 'unsigned int' vars that are used with ffreadbuf() to 'size_t'
+- create headers with prototypes to get ride of implicit warnings
+  main.h smacker.h avp/win95/winmain.h win95/dd_func.h
+- declare all the render funcs as using a const char for the textPtr (only
+  some do atm instead of all of them)
+- fix warning in LoadWavFromFastFile about pointer ... func returns a bool
+- fix pointer warning in opengl.c
+- use %p instead of %x when outputting pointers
+- tweak how debug vars are declared to get rid of 'unused variable' warnings
+- cast the 2nd param to an int in avp/support/coordstr.cpp to get rid of
+  implicit double->int cast warning
+- use a regular C cast instead of CXX in win95/hash_tem.hpp to get rid of
+  error about losing precision
+
+Index: main.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/main.c,v
+retrieving revision 1.65
+diff -u -p -r1.65 main.c
+--- main.c     12 Jan 2004 20:39:35 -0000      1.65
++++ main.c     12 Dec 2005 22:50:24 -0000
+@@ -43,6 +43,7 @@
+ #include "progress_bar.h"
+ #include "scrshot.hpp"
+ #include "version.h"
++#include "main.h"
+ char LevelName[] = {"predbit6\0QuiteALongNameActually"}; /* the real way to load levels */
+Index: menus.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/menus.c,v
+retrieving revision 1.9
+diff -u -p -r1.9 menus.c
+--- menus.c    9 Jan 2002 23:07:34 -0000       1.9
++++ menus.c    12 Dec 2005 22:50:24 -0000
+@@ -290,7 +290,7 @@ static void LoadMenuFont()
+ {
+       AVPMENUGFX *gfxPtr;
+       char buffer[100];
+-      unsigned int fastFileLength;
++      size_t fastFileLength;
+       void const *pFastFileData;
+       
+       IntroFont_Light.height = 33;
+@@ -600,7 +600,7 @@ int RenderMenuText_Clipped(char *textPtr
+ }
+-static int RenderSmallFontString(char *textPtr,int sx,int sy,int alpha, int red, int green, int blue)
++static int RenderSmallFontString(const char *textPtr,int sx,int sy,int alpha, int red, int green, int blue)
+ {
+       unsigned char *srcPtr;
+       unsigned short *destPtr;
+@@ -851,10 +851,10 @@ Determine area used by text , so we can 
+       if(output_y) *output_y=sy;
+ }
+-int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format)
++int RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format)
+ {
+       int length;
+-      char *ptr;
++      const char *ptr;
+       
+       switch(format) {
+               default:
+@@ -889,10 +889,10 @@ int RenderSmallMenuText(char *textPtr, i
+       return RenderSmallFontString(textPtr,x,y,alpha,ONE_FIXED,ONE_FIXED,ONE_FIXED);
+ }
+-int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
++int RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
+ {
+       int length;
+-      char *ptr;
++      const char *ptr;
+       
+       switch(format) {
+               default:
+@@ -1050,7 +1050,7 @@ void LoadAvPMenuGfx(enum AVPMENUGFX_ID m
+ {
+       AVPMENUGFX *gfxPtr;
+       char buffer[100];
+-      unsigned int fastFileLength;
++      size_t fastFileLength;
+       void const *pFastFileData;
+       
+       GLOBALASSERT(menuGfxID < MAX_NO_OF_AVPMENUGFXS);
+Index: openal.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/openal.c,v
+retrieving revision 1.24
+diff -u -p -r1.24 openal.c
+--- openal.c   10 Aug 2003 02:38:08 -0000      1.24
++++ openal.c   12 Dec 2005 22:50:24 -0000
+@@ -1029,7 +1029,7 @@ int LoadWavFromFastFile(int soundNum, ch
+               strcpy (buf, wavFileName);
+               ffread (&buf[strlen(wavFileName)+1], len, 1, fp);
+               ffclose (fp);
+-              len = (int)ExtractWavFile (soundNum, buf);              
++              len = (ExtractWavFile (soundNum, buf) == NULL ? 0 : 1);
+               free (buf);
+       }
+Index: opengl.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/opengl.c,v
+retrieving revision 1.40
+diff -u -p -r1.40 opengl.c
+--- opengl.c   15 Oct 2003 06:10:42 -0000      1.40
++++ opengl.c   12 Dec 2005 22:50:25 -0000
+@@ -334,7 +334,7 @@ static void CheckTriangleBuffer(int rver
+               FlushTriangleBuffers(0);
+       }
+-      if ((int)tex != -1)
++      if (tex != (D3DTexture *)-1)
+               CheckBoundTextureIsCorrect(tex);
+       if (mode != -1)
+               CheckTranslucencyModeIsCorrect(mode);
+@@ -1598,7 +1598,7 @@ void D3D_RenderHUDNumber_Centred(unsigne
+       } while (--noOfDigits);
+ }
+-void D3D_RenderHUDString(char *stringPtr,int x,int y,int colour)
++void D3D_RenderHUDString(const char *stringPtr,int x,int y,int colour)
+ {
+       struct VertexTag quadVertices[4];
+@@ -1809,7 +1809,7 @@ void RenderStringVertically(char *string
+       }
+ }
+-int Hardware_RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
++int Hardware_RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
+ {
+       switch(format)
+       {
+@@ -1825,7 +1825,7 @@ int Hardware_RenderSmallMenuText(char *t
+               case AVPMENUFORMAT_RIGHTJUSTIFIED:
+               {
+                       int length = 0;
+-                      signed char *ptr = textPtr;
++                      const signed char *ptr = textPtr;
+                       while(*ptr)
+                       {
+@@ -1838,7 +1838,7 @@ int Hardware_RenderSmallMenuText(char *t
+               case AVPMENUFORMAT_CENTREJUSTIFIED:
+               {
+                       int length = 0;
+-                      signed char *ptr = textPtr;
++                      const signed char *ptr = textPtr;
+                       while(*ptr)
+                       {
+@@ -1861,7 +1861,7 @@ int Hardware_RenderSmallMenuText(char *t
+       return x;
+ }
+-int Hardware_RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
++int Hardware_RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
+ {
+       switch(format)
+       {
+@@ -1877,7 +1877,7 @@ int Hardware_RenderSmallMenuText_Coloure
+               case AVPMENUFORMAT_RIGHTJUSTIFIED:
+               {
+                       int length = 0;
+-                      signed char *ptr = textPtr;
++                      const signed char *ptr = textPtr;
+                       while(*ptr)
+                       {
+@@ -1890,7 +1890,7 @@ int Hardware_RenderSmallMenuText_Coloure
+               case AVPMENUFORMAT_CENTREJUSTIFIED:
+               {
+                       int length = 0;
+-                      signed char *ptr = textPtr;
++                      const signed char *ptr = textPtr;
+                       while(*ptr)
+                       {
+Index: avp/avpview.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/avpview.c,v
+retrieving revision 1.6
+diff -u -p -r1.6 avpview.c
+--- avp/avpview.c      18 Dec 2001 02:23:40 -0000      1.6
++++ avp/avpview.c      12 Dec 2005 22:50:25 -0000
+@@ -9,6 +9,7 @@
+ #include "avpview.h"
+ #include "opengl.h"
++#include "smacker.h"
+ #include "kshape.h"
+ #include "kzsort.h"
+ #include "frustum.h"
+Index: avp/bh_near.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/bh_near.c,v
+retrieving revision 1.4
+diff -u -p -r1.4 bh_near.c
+--- avp/bh_near.c      22 Dec 2001 00:49:58 -0000      1.4
++++ avp/bh_near.c      12 Dec 2005 22:50:26 -0000
+@@ -1646,7 +1646,7 @@ static void AlienNearState_Retreat(STRAT
+               if (targetModule) {
+                       //textprint("Target module is %s\n",targetModule->name);
+-                      textprint("Target AI module found, %x.\n",(int)targetModule);
++                      textprint("Target AI module found, %p.\n",targetModule);
+               } else {
+                       textprint("Target module is NULL!\n");
+               }
+@@ -1830,7 +1830,7 @@ static void AlienNearState_Hunt(STRATEGY
+               if (targetModule) {
+                       //textprint("Target module is %s\n",targetModule->name);
+-                      textprint("Target AI module for hunt found, %x.\n",(int)targetModule);
++                      textprint("Target AI module for hunt found, %p.\n",targetModule);
+               } else {
+                       textprint("Target module is NULL!\n");
+               }
+Index: avp/bh_queen.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/bh_queen.c,v
+retrieving revision 1.6
+diff -u -p -r1.6 bh_queen.c
+--- avp/bh_queen.c     22 May 2003 00:23:07 -0000      1.6
++++ avp/bh_queen.c     12 Dec 2005 22:50:27 -0000
+@@ -505,10 +505,9 @@ void MakeQueenFar(STRATEGYBLOCK *sbPtr) 
+       /* get the queen's status block */
+       int i;
+-      QUEEN_STATUS_BLOCK *queenStatusPointer= (QUEEN_STATUS_BLOCK *)(sbPtr->SBdataptr);    
+       LOCALASSERT(sbPtr);
+-    LOCALASSERT(queenStatusPointer);
++    LOCALASSERT((QUEEN_STATUS_BLOCK *)(sbPtr->SBdataptr));
+       LOCALASSERT(sbPtr->SBdptr != NULL);
+       /* get rid of the displayblock */
+Index: avp/bh_waypt.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/bh_waypt.c,v
+retrieving revision 1.3
+diff -u -p -r1.3 bh_waypt.c
+--- avp/bh_waypt.c     22 Dec 2001 00:49:58 -0000      1.3
++++ avp/bh_waypt.c     12 Dec 2005 22:50:27 -0000
+@@ -131,7 +131,7 @@ int NPCGetWaypointDirection(WAYPOINT_HEA
+       //Base shift value on strategy block so that the aliens don't keep changing their minds
+       //about which route to take
+-      GlobalLinkShift=(((int)sbPtr)&0xffff)>>4;
++      GlobalLinkShift=(((size_t)sbPtr)&0xffff)>>4;
+       if (FindBestRoute(&current_route,waypoints)==0) {
+               /* Yuck! */
+               textprint("Waypoint dropout: no continuous route!\n");
+Index: avp/dynamics.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/dynamics.c,v
+retrieving revision 1.4
+diff -u -p -r1.4 dynamics.c
+--- avp/dynamics.c     22 Dec 2001 00:49:58 -0000      1.4
++++ avp/dynamics.c     12 Dec 2005 22:50:28 -0000
+@@ -43,8 +43,10 @@ you should have seen the previous versio
+ #if 0
+       extern int GlobalFrameCounter;
+       #define LogInfo LOGDXFMT
++      #define LogInfoVar(x) x
+ #else
+       #define LogInfo(args) (void)0
++      #define LogInfoVar(x)
+ #endif
+ extern MORPHDISPLAY MorphDisplay;
+@@ -295,7 +297,7 @@ extern void ObjectDynamics(void)
+       InitialiseDynamicObjectsList();
+       {
+-              DYNAMICSBLOCK *dynPtr = Player->ObStrategyBlock->DynPtr;
++              LogInfoVar(DYNAMICSBLOCK *dynPtr = Player->ObStrategyBlock->DynPtr);
+               LogInfo
+               ((
+                       "Dynamics Logging: frame %d\nDL: player's Position %d,%d,%d\nDL: player's Displacement %d,%d,%d\nDL: NormalFrameTime %d\n",
+Index: avp/game.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/game.c,v
+retrieving revision 1.7
+diff -u -p -r1.7 game.c
+--- avp/game.c 22 Dec 2001 00:49:58 -0000      1.7
++++ avp/game.c 12 Dec 2005 22:50:28 -0000
+@@ -10,6 +10,7 @@
+ #include "dynblock.h"
+ #include "dynamics.h"
++#include "winmain.h"
+ #include "bh_types.h"
+ #include "bh_alien.h"
+ #include "pheromon.h"
+Index: avp/psndproj.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/psndproj.c,v
+retrieving revision 1.6
+diff -u -p -r1.6 psndproj.c
+--- avp/psndproj.c     9 Jan 2002 23:07:35 -0000       1.6
++++ avp/psndproj.c     12 Dec 2005 22:50:28 -0000
+@@ -856,7 +856,7 @@ int FindAndLoadWavFile(int soundNum,char
+ #if LOAD_SOUND_FROM_FAST_FILE
+       //first look in fast file
+       {
+-              unsigned nLen;
++              size_t nLen;
+               if(ffreadbuf(sound_name,&nLen))
+               {
+                       return LoadWavFromFastFile(soundNum,sound_name);
+Index: avp/pvisible.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/pvisible.c,v
+retrieving revision 1.3
+diff -u -p -r1.3 pvisible.c
+--- avp/pvisible.c     9 Jan 2002 23:07:35 -0000       1.3
++++ avp/pvisible.c     12 Dec 2005 22:50:29 -0000
+@@ -236,7 +236,7 @@ void DoObjectVisibility(STRATEGYBLOCK *s
+                 module. However, we will do a paranoia check for a null containingModule... */ 
+                 if(!sbPtr->containingModule)    
+                 {
+-                        textprint("Calling Far EmergencyRelocateObject, On object %x, type %d!\n",(int)sbPtr, sbPtr->I_SBtype);
++                        textprint("Calling Far EmergencyRelocateObject, On object %p, type %d!\n",sbPtr, sbPtr->I_SBtype);
+                         IdentifyObject(sbPtr);
+                         if(!(EmergencyRelocateObject(sbPtr))) {
+                                 textprint("Relocate failed!\n");
+@@ -432,7 +432,7 @@ void DoObjectVisibility(STRATEGYBLOCK *s
+                 if(!(newModule))
+                 {
+                         /* attempt to relocate object */
+-                        textprint("Calling Near EmergencyRelocateObject, On object %x, type %d!\n",(int)sbPtr, sbPtr->I_SBtype);
++                        textprint("Calling Near EmergencyRelocateObject, On object %p, type %d!\n",sbPtr, sbPtr->I_SBtype);
+                         IdentifyObject(sbPtr);
+                         if(!(EmergencyRelocateObject(sbPtr))) {
+                                 textprint("Relocate failed!\n");
+Index: avp/savegame.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/savegame.c,v
+retrieving revision 1.7
+diff -u -p -r1.7 savegame.c
+--- avp/savegame.c     22 May 2003 00:23:07 -0000      1.7
++++ avp/savegame.c     12 Dec 2005 22:50:29 -0000
+@@ -8,6 +8,7 @@
+ #include "comp_shp.h"
+ #include "dynblock.h"
++#include "smacker.h"
+ #include "bh_alien.h"
+ #include "pvisible.h"
+ #include "bh_pred.h"
+Index: avp/weapons.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/weapons.c,v
+retrieving revision 1.8
+diff -u -p -r1.8 weapons.c
+--- avp/weapons.c      22 May 2003 00:23:07 -0000      1.8
++++ avp/weapons.c      12 Dec 2005 22:50:31 -0000
+@@ -10138,8 +10138,7 @@ SECTION_DATA *CheckBiteIntegrity(void) {
+       if ((targetpos.vz >0) 
+               && (targetpos.vz <  (BITE_RANGE<<1))) {
+       
+-              DYNAMICSBLOCK *dynPtr = Biting->DynPtr;
+-              GLOBALASSERT(dynPtr);
++              GLOBALASSERT(Biting->DynPtr);
+               
+               if (IsThisObjectVisibleFromThisPosition_WithIgnore(objectPtr,Player,&Global_VDB_Ptr->VDB_World,(BITE_RANGE<<1))) {
+       
+Index: avp/support/coordstr.cpp
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/support/coordstr.cpp,v
+retrieving revision 1.3
+diff -u -p -r1.3 coordstr.cpp
+--- avp/support/coordstr.cpp   9 Jan 2002 23:07:35 -0000       1.3
++++ avp/support/coordstr.cpp   12 Dec 2005 22:50:31 -0000
+@@ -210,7 +210,7 @@ ACTIVITY_RETURN_TYPE AcyclicPulsingCoord
+       textprint("AcyclicPulsingCoordinate :: Activity(%i)\n", FixP_Time);
+       #endif
+-      int Int_CurrentCoord_Old = Int_CurrentCoord_Val;
++      ACTIVITY_RVAL_TEMP(int Int_CurrentCoord_Old = Int_CurrentCoord_Val);
+       ApplyVelocity( FixP_Time );
+@@ -276,7 +276,7 @@ ACTIVITY_RETURN_TYPE CyclicPulsingCoordi
+       textprint("CyclicPulsingCoordinate :: Activity(%i)\n", FixP_Time);
+       #endif
+-      int Int_CurrentCoord_Old = Int_CurrentCoord_Val;
++      ACTIVITY_RVAL_TEMP(int Int_CurrentCoord_Old = Int_CurrentCoord_Val);
+       
+       ApplyVelocity( FixP_Time );
+       
+@@ -343,7 +343,7 @@ HomingCoordinate::HomingCoordinate
+       FixP_IdealVelocity_Val = DIV_FIXED
+       (
+               (FixP_TargetCoord_Val - FixP_Position_Val),
+-              FIXP_SECONDS_FOR_STANDARD_HOMING
++              (int)FIXP_SECONDS_FOR_STANDARD_HOMING
+       );
+ }
+@@ -383,7 +383,7 @@ AcyclicHomingCoordinate :: AcyclicHoming
+ ACTIVITY_RETURN_TYPE AcyclicHomingCoordinate :: Activity(ACTIVITY_INPUT)
+ {
+-      int Int_CurrentCoord_Old = Int_CurrentCoord_Val;
++      ACTIVITY_RVAL_TEMP(int Int_CurrentCoord_Old = Int_CurrentCoord_Val);
+       #if 0
+       textprint("acyclic homing coord for time %i\n",FixP_Time);
+@@ -503,7 +503,7 @@ void AcyclicHomingCoordinate :: SetTarge
+       
+       FixP_IdealVelocity_Val = DIV_FIXED(
+               (FixP_TargetCoord_Val - FixP_Position_Val),
+-              FIXP_SECONDS_FOR_STANDARD_HOMING
++              (int)FIXP_SECONDS_FOR_STANDARD_HOMING
+       );
+       
+@@ -553,7 +553,7 @@ AcyclicFixedSpeedHoming :: ~AcyclicFixed
+ ACTIVITY_RETURN_TYPE AcyclicFixedSpeedHoming :: Activity(ACTIVITY_INPUT)
+ {
+-      int Int_CurrentCoord_Old = Int_CurrentCoord_Val;
++      ACTIVITY_RVAL_TEMP(int Int_CurrentCoord_Old = Int_CurrentCoord_Val);
+       #if 0
+       textprint("acyclic homing coord for time %i\n",FixP_Time);
+Index: avp/support/daemon.h
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/support/daemon.h,v
+retrieving revision 1.2
+diff -u -p -r1.2 daemon.h
+--- avp/support/daemon.h       29 Jul 2001 02:29:46 -0000      1.2
++++ avp/support/daemon.h       12 Dec 2005 22:50:31 -0000
+@@ -30,12 +30,14 @@
+       #if SupportCallbackHooks
+               #define ACTIVITY_RETURN_TYPE    OurBool
++              #define ACTIVITY_RVAL_TEMP(b)   b
+               #define ACTIVITY_RVAL_CHANGE    {return Yes;}
+               #define ACTIVITY_RVAL_NOCHANGE  {return No;}
+               #define ACTIVITY_RVAL_BOOL(b)   {return b;}
+       #else
+               #define ACTIVITY_RETURN_TYPE            void
++              #define ACTIVITY_RVAL_TEMP(b)
+               #define ACTIVITY_RVAL_CHANGE            {return;}
+               #define ACTIVITY_RVAL_NOCHANGE          {return;}
+               #define ACTIVITY_RVAL_BOOL(ignore)      {return;}
+Index: avp/win95/progress_bar.cpp
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/win95/progress_bar.cpp,v
+retrieving revision 1.10
+diff -u -p -r1.10 progress_bar.cpp
+--- avp/win95/progress_bar.cpp 22 Dec 2001 00:49:59 -0000      1.10
++++ avp/win95/progress_bar.cpp 12 Dec 2005 22:50:31 -0000
+@@ -59,7 +59,7 @@ void Start_Progress_Bar()
+               CL_GetImageFileName(buffer, 100,Loading_Bar_Empty_Image_Name, LIO_RELATIVEPATH);
+               
+               //see if graphic can be found in fast file
+-              unsigned int fastFileLength;
++              size_t fastFileLength;
+               void const * pFastFileData = ffreadbuf(buffer,&fastFileLength);
+               
+               if(pFastFileData)
+@@ -89,7 +89,7 @@ void Start_Progress_Bar()
+               CL_GetImageFileName(buffer, 100,Loading_Bar_Full_Image_Name, LIO_RELATIVEPATH);
+               
+               //see if graphic can be found in fast file
+-              unsigned int fastFileLength;
++              size_t fastFileLength;
+               void const * pFastFileData = ffreadbuf(buffer,&fastFileLength);
+               
+               if(pFastFileData)
+@@ -128,7 +128,7 @@ void Start_Progress_Bar()
+       
+       //see if graphic can be found in fast file
+-      unsigned int fastFileLength;
++      size_t fastFileLength;
+       void const * pFastFileData = ffreadbuf(buffer,&fastFileLength);
+       
+       if(pFastFileData)
+Index: avp/win95/system.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/win95/system.c,v
+retrieving revision 1.10
+diff -u -p -r1.10 system.c
+--- avp/win95/system.c 9 Jan 2002 23:07:36 -0000       1.10
++++ avp/win95/system.c 12 Dec 2005 22:50:31 -0000
+@@ -12,6 +12,7 @@
+ #include "messagehistory.h"
+ #include "particle.h"
+ #include "pldnet.h"
++#include "smacker.h"
+ #define UseLocalAssert Yes
+ #include "ourasert.h"
+Index: avp/win95/frontend/avp_intro.cpp
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/win95/frontend/avp_intro.cpp,v
+retrieving revision 1.3
+diff -u -p -r1.3 avp_intro.cpp
+--- avp/win95/frontend/avp_intro.cpp   22 Dec 2001 00:49:59 -0000      1.3
++++ avp/win95/frontend/avp_intro.cpp   12 Dec 2005 22:50:31 -0000
+@@ -4,7 +4,8 @@ extern "C"
+       #include "3dc.h"
+       //#include "intro.hpp"
+       #include "inline.h"
+-      //#include "smacker.h"
++      #include "smacker.h"
++      #include "winmain.h"
+       #include "avp_menus.h"
+     #include "avp_intro.h"
+       extern int NormalFrameTime;
+@@ -24,7 +25,6 @@ void Show_ARebellionGame(void);
+ void Show_AvPLogo(void);
+ extern void ShowSplashScreens(void);
+ extern void Show_WinnerScreen(void);
+-extern void PlayBinkedFMV(char *filenamePtr);
+ extern void DrawMainMenusBackdrop(void);
+ extern void FadedScreen(int alpha);
+Index: avp/win95/frontend/avp_menugfx.cpp
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/win95/frontend/avp_menugfx.cpp,v
+retrieving revision 1.4
+diff -u -p -r1.4 avp_menugfx.cpp
+--- avp/win95/frontend/avp_menugfx.cpp 9 Jan 2002 23:07:36 -0000       1.4
++++ avp/win95/frontend/avp_menugfx.cpp 12 Dec 2005 22:50:32 -0000
+@@ -256,7 +256,7 @@ extern int RenderMenuText_Clipped(char *
+ }
+-extern int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
++extern int RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
+ {
+       switch(format)
+       {
+@@ -300,7 +300,7 @@ extern int RenderSmallMenuText(char *tex
+       x = RenderSmallFontString(textPtr,x,y,alpha,ONE_FIXED,ONE_FIXED,ONE_FIXED);
+       return x;
+ }
+-extern int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue) 
++extern int RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue) 
+ {
+       switch(format)
+       {
+@@ -345,7 +345,7 @@ extern int RenderSmallMenuText_Coloured(
+       return x;
+ }
+-extern int Hardware_RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
++extern int Hardware_RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
+ {
+       switch(format)
+       {
+@@ -395,7 +395,7 @@ extern int Hardware_RenderSmallMenuText(
+       return x;
+ }
+-extern int Hardware_RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
++extern int Hardware_RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
+ {
+       switch(format)
+       {
+Index: avp/win95/frontend/avp_menugfx.hpp
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/win95/frontend/avp_menugfx.hpp,v
+retrieving revision 1.6
+diff -u -p -r1.6 avp_menugfx.hpp
+--- avp/win95/frontend/avp_menugfx.hpp 9 Jan 2002 23:07:36 -0000       1.6
++++ avp/win95/frontend/avp_menugfx.hpp 12 Dec 2005 22:50:32 -0000
+@@ -99,11 +99,11 @@ extern void ReleaseAllAvPMenuGfx(void);
+ extern int RenderMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
+-extern int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
+-extern int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue); 
++extern int RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
++extern int RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue); 
+-extern int Hardware_RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
+-extern int Hardware_RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue);
++extern int Hardware_RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
++extern int Hardware_RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue);
+ extern int RenderMenuText_Clipped(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int topY, int bottomY);
+ extern void RenderSmallFontString_Wrapped(const char *textPtr,RECT* area,int alpha,int* output_x,int* output_y);
+Index: avp/win95/frontend/avp_menus.c
+===================================================================
+RCS file: /cvs/cvsroot/avp/avp/win95/frontend/avp_menus.c,v
+retrieving revision 1.11
+diff -u -p -r1.11 avp_menus.c
+--- avp/win95/frontend/avp_menus.c     22 May 2003 01:55:16 -0000      1.11
++++ avp/win95/frontend/avp_menus.c     12 Dec 2005 22:50:33 -0000
+@@ -8,6 +8,10 @@
+ #include "net.h"
+ #include "opengl.h"
+ #include "pldnet.h"
++#include "main.h"
++#include "winmain.h"
++#include "smacker.h"
++#include "dd_func.h"
+ #include "avp_menudata.h"
+ #include "avp_menus.h"
+@@ -1788,7 +1792,7 @@ static void RenderLoadGameMenu(void)
+       AVPMENU_ELEMENT *elementPtr = AvPMenus.MenuElements;
+       int e;
+       int y;
+-      int (*RenderText)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
++      int (*RenderText)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
+       
+       if (AvPMenus.MenusState == MENUSSTATE_MAINMENUS)
+       {
+@@ -3224,8 +3228,8 @@ int LengthOfSmallMenuText(char *textPtr)
+ static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y)
+ {
+-      int (*RenderText)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
+-      int (*RenderText_Coloured)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int r, int g, int b);
++      int (*RenderText)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
++      int (*RenderText_Coloured)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int r, int g, int b);
+       int (*MenuTextLength)(char *textPtr);
+       
+       if (AvPMenus.FontToUse==AVPMENU_FONT_BIG)
+Index: win95/chnktexi.cpp
+===================================================================
+RCS file: /cvs/cvsroot/avp/win95/chnktexi.cpp,v
+retrieving revision 1.4
+diff -u -p -r1.4 chnktexi.cpp
+--- win95/chnktexi.cpp 18 Dec 2001 05:08:53 -0000      1.4
++++ win95/chnktexi.cpp 12 Dec 2005 22:50:33 -0000
+@@ -102,7 +102,7 @@ static char * RiffBasename(Chunk_With_Ch
+ #if CL_SUPPORT_FASTFILE
+ static inline bool IsFileInFastFile(char const * pszFileName)
+ {
+-      unsigned nLen;
++      size_t nLen;
+       return ffreadbuf(pszFileName,&nLen) ? true : false;
+ }
+ #endif
+@@ -714,7 +714,7 @@ int CL_LoadImageOnce(char const * pszFil
+               case LIO_DDSURFACE:
+               {
+                       #if CL_SUPPORT_FASTFILE
+-                      unsigned nFastFileLen;
++                      size_t nFastFileLen;
+                       void const * pFastFileData = ffreadbuf(szBuf,&nFastFileLen);
+                       if (pFastFileData)
+                       {
+@@ -823,7 +823,7 @@ int CL_LoadImageOnce(char const * pszFil
+               {
+                       fAwLoad |= AW_TLF_COMPRESS; // required on some cards!!
+                       #if CL_SUPPORT_FASTFILE
+-                      unsigned nFastFileLen;
++                      size_t nFastFileLen;
+                       void const * pFastFileData = ffreadbuf(szBuf,&nFastFileLen);
+                       if (pFastFileData)
+                       {
+Index: win95/hash_tem.hpp
+===================================================================
+RCS file: /cvs/cvsroot/avp/win95/hash_tem.hpp,v
+retrieving revision 1.5
+diff -u -p -r1.5 hash_tem.hpp
+--- win95/hash_tem.hpp 18 Aug 2004 04:20:41 -0000      1.5
++++ win95/hash_tem.hpp 12 Dec 2005 22:50:33 -0000
+@@ -242,7 +242,7 @@
+       inline unsigned HashFunction(void const * const _vP)
+       {
+               // treat as integer
+-              return HashFunction(reinterpret_cast<unsigned>(_vP));
++              return HashFunction((unsigned long)(_vP));
+       }
+       // a hash function for strings
+--- /dev/null  2005-12-12 17:15:01.544366500 -0500
++++ main.h     2005-12-12 16:33:39.000000000 -0500
+@@ -0,0 +1,11 @@
++#ifndef __MAIN_H__
++#define __MAIN_H__
++
++extern void LoadDeviceAndVideoModePreferences(void);
++extern void SaveDeviceAndVideoModePreferences(void);
++extern void PreviousVideoMode2(void);
++extern void NextVideoMode2(void);
++extern char *GetVideoModeDescription2(void);
++extern char *GetVideoModeDescription3(void);
++
++#endif
+--- /dev/null  2005-12-12 17:15:01.544366500 -0500
++++ smacker.h  2005-12-12 16:29:16.000000000 -0500
+@@ -0,0 +1,11 @@
++#ifndef __SMACKER_H__
++#define __SMACKER_H__
++
++extern void GetFMVInformation(int *messageNumberPtr, int *frameNumberPtr);
++extern void InitialiseTriggeredFMVs(void);
++extern void StartFMVAtFrame(int number, int frame);
++extern void StartTriggerPlotFMV(int number);
++extern void UpdateAllFMVTextures(void);
++extern void EndMenuMusic(void);
++
++#endif
+--- /dev/null  2005-12-12 17:15:01.544366500 -0500
++++ avp/win95/winmain.h        2005-12-12 16:26:06.000000000 -0500
+@@ -0,0 +1,10 @@
++#ifndef __WINMAIN_H__
++#define __WINMAIN_H__
++
++extern void PlayBinkedFMV(char *filenamePtr);
++extern void StartMenuBackgroundBink(void);
++extern int PlayMenuBackgroundBink(void);
++extern void EndMenuBackgroundBink(void);
++extern void InitialiseTriggeredFMVs(void);
++
++#endif
+--- /dev/null  2005-12-12 17:15:01.544366500 -0500
++++ win95/dd_func.h    2005-12-12 16:34:43.000000000 -0500
+@@ -0,0 +1,6 @@
++#ifndef __DD_FUNC_H__
++#define __DD_FUNC_H__
++
++extern int SelectDirectDrawObject(void *pGUID);
++
++#endif