]> git.wh0rd.org Git - patches.git/blob - avp-cleanup.patch
more random patches. who knows.
[patches.git] / avp-cleanup.patch
1 - change all 'unsigned int' vars that are used with ffreadbuf() to 'size_t'
2 - create headers with prototypes to get ride of implicit warnings
3   main.h smacker.h avp/win95/winmain.h win95/dd_func.h
4 - declare all the render funcs as using a const char for the textPtr (only
5   some do atm instead of all of them)
6 - fix warning in LoadWavFromFastFile about pointer ... func returns a bool
7 - fix pointer warning in opengl.c
8 - use %p instead of %x when outputting pointers
9 - tweak how debug vars are declared to get rid of 'unused variable' warnings
10 - cast the 2nd param to an int in avp/support/coordstr.cpp to get rid of
11   implicit double->int cast warning
12 - use a regular C cast instead of CXX in win95/hash_tem.hpp to get rid of
13   error about losing precision
14
15 Index: main.c
16 ===================================================================
17 RCS file: /cvs/cvsroot/avp/main.c,v
18 retrieving revision 1.65
19 diff -u -p -r1.65 main.c
20 --- main.c      12 Jan 2004 20:39:35 -0000      1.65
21 +++ main.c      12 Dec 2005 22:50:24 -0000
22 @@ -43,6 +43,7 @@
23  #include "progress_bar.h"
24  #include "scrshot.hpp"
25  #include "version.h"
26 +#include "main.h"
27  
28  char LevelName[] = {"predbit6\0QuiteALongNameActually"}; /* the real way to load levels */
29  
30 Index: menus.c
31 ===================================================================
32 RCS file: /cvs/cvsroot/avp/menus.c,v
33 retrieving revision 1.9
34 diff -u -p -r1.9 menus.c
35 --- menus.c     9 Jan 2002 23:07:34 -0000       1.9
36 +++ menus.c     12 Dec 2005 22:50:24 -0000
37 @@ -290,7 +290,7 @@ static void LoadMenuFont()
38  {
39         AVPMENUGFX *gfxPtr;
40         char buffer[100];
41 -       unsigned int fastFileLength;
42 +       size_t fastFileLength;
43         void const *pFastFileData;
44         
45         IntroFont_Light.height = 33;
46 @@ -600,7 +600,7 @@ int RenderMenuText_Clipped(char *textPtr
47  
48  }
49  
50 -static int RenderSmallFontString(char *textPtr,int sx,int sy,int alpha, int red, int green, int blue)
51 +static int RenderSmallFontString(const char *textPtr,int sx,int sy,int alpha, int red, int green, int blue)
52  {
53         unsigned char *srcPtr;
54         unsigned short *destPtr;
55 @@ -851,10 +851,10 @@ Determine area used by text , so we can 
56         if(output_y) *output_y=sy;
57  }
58  
59 -int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format)
60 +int RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format)
61  {
62         int length;
63 -       char *ptr;
64 +       const char *ptr;
65         
66         switch(format) {
67                 default:
68 @@ -889,10 +889,10 @@ int RenderSmallMenuText(char *textPtr, i
69         return RenderSmallFontString(textPtr,x,y,alpha,ONE_FIXED,ONE_FIXED,ONE_FIXED);
70  }
71  
72 -int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
73 +int RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
74  {
75         int length;
76 -       char *ptr;
77 +       const char *ptr;
78         
79         switch(format) {
80                 default:
81 @@ -1050,7 +1050,7 @@ void LoadAvPMenuGfx(enum AVPMENUGFX_ID m
82  {
83         AVPMENUGFX *gfxPtr;
84         char buffer[100];
85 -       unsigned int fastFileLength;
86 +       size_t fastFileLength;
87         void const *pFastFileData;
88         
89         GLOBALASSERT(menuGfxID < MAX_NO_OF_AVPMENUGFXS);
90 Index: openal.c
91 ===================================================================
92 RCS file: /cvs/cvsroot/avp/openal.c,v
93 retrieving revision 1.24
94 diff -u -p -r1.24 openal.c
95 --- openal.c    10 Aug 2003 02:38:08 -0000      1.24
96 +++ openal.c    12 Dec 2005 22:50:24 -0000
97 @@ -1029,7 +1029,7 @@ int LoadWavFromFastFile(int soundNum, ch
98                 strcpy (buf, wavFileName);
99                 ffread (&buf[strlen(wavFileName)+1], len, 1, fp);
100                 ffclose (fp);
101 -               len = (int)ExtractWavFile (soundNum, buf);              
102 +               len = (ExtractWavFile (soundNum, buf) == NULL ? 0 : 1);
103                 free (buf);
104         }
105  
106 Index: opengl.c
107 ===================================================================
108 RCS file: /cvs/cvsroot/avp/opengl.c,v
109 retrieving revision 1.40
110 diff -u -p -r1.40 opengl.c
111 --- opengl.c    15 Oct 2003 06:10:42 -0000      1.40
112 +++ opengl.c    12 Dec 2005 22:50:25 -0000
113 @@ -334,7 +334,7 @@ static void CheckTriangleBuffer(int rver
114                 FlushTriangleBuffers(0);
115         }
116  
117 -       if ((int)tex != -1)
118 +       if (tex != (D3DTexture *)-1)
119                 CheckBoundTextureIsCorrect(tex);
120         if (mode != -1)
121                 CheckTranslucencyModeIsCorrect(mode);
122 @@ -1598,7 +1598,7 @@ void D3D_RenderHUDNumber_Centred(unsigne
123         } while (--noOfDigits);
124  }
125  
126 -void D3D_RenderHUDString(char *stringPtr,int x,int y,int colour)
127 +void D3D_RenderHUDString(const char *stringPtr,int x,int y,int colour)
128  {
129         struct VertexTag quadVertices[4];
130  
131 @@ -1809,7 +1809,7 @@ void RenderStringVertically(char *string
132         }
133  }
134  
135 -int Hardware_RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
136 +int Hardware_RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
137  {
138         switch(format)
139         {
140 @@ -1825,7 +1825,7 @@ int Hardware_RenderSmallMenuText(char *t
141                 case AVPMENUFORMAT_RIGHTJUSTIFIED:
142                 {
143                         int length = 0;
144 -                       signed char *ptr = textPtr;
145 +                       const signed char *ptr = textPtr;
146  
147                         while(*ptr)
148                         {
149 @@ -1838,7 +1838,7 @@ int Hardware_RenderSmallMenuText(char *t
150                 case AVPMENUFORMAT_CENTREJUSTIFIED:
151                 {
152                         int length = 0;
153 -                       signed char *ptr = textPtr;
154 +                       const signed char *ptr = textPtr;
155  
156                         while(*ptr)
157                         {
158 @@ -1861,7 +1861,7 @@ int Hardware_RenderSmallMenuText(char *t
159         return x;
160  }
161  
162 -int Hardware_RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
163 +int Hardware_RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
164  {
165         switch(format)
166         {
167 @@ -1877,7 +1877,7 @@ int Hardware_RenderSmallMenuText_Coloure
168                 case AVPMENUFORMAT_RIGHTJUSTIFIED:
169                 {
170                         int length = 0;
171 -                       signed char *ptr = textPtr;
172 +                       const signed char *ptr = textPtr;
173  
174                         while(*ptr)
175                         {
176 @@ -1890,7 +1890,7 @@ int Hardware_RenderSmallMenuText_Coloure
177                 case AVPMENUFORMAT_CENTREJUSTIFIED:
178                 {
179                         int length = 0;
180 -                       signed char *ptr = textPtr;
181 +                       const signed char *ptr = textPtr;
182  
183                         while(*ptr)
184                         {
185 Index: avp/avpview.c
186 ===================================================================
187 RCS file: /cvs/cvsroot/avp/avp/avpview.c,v
188 retrieving revision 1.6
189 diff -u -p -r1.6 avpview.c
190 --- avp/avpview.c       18 Dec 2001 02:23:40 -0000      1.6
191 +++ avp/avpview.c       12 Dec 2005 22:50:25 -0000
192 @@ -9,6 +9,7 @@
193  #include "avpview.h"
194  #include "opengl.h"
195  
196 +#include "smacker.h"
197  #include "kshape.h"
198  #include "kzsort.h"
199  #include "frustum.h"
200 Index: avp/bh_near.c
201 ===================================================================
202 RCS file: /cvs/cvsroot/avp/avp/bh_near.c,v
203 retrieving revision 1.4
204 diff -u -p -r1.4 bh_near.c
205 --- avp/bh_near.c       22 Dec 2001 00:49:58 -0000      1.4
206 +++ avp/bh_near.c       12 Dec 2005 22:50:26 -0000
207 @@ -1646,7 +1646,7 @@ static void AlienNearState_Retreat(STRAT
208  
209                 if (targetModule) {
210                         //textprint("Target module is %s\n",targetModule->name);
211 -                       textprint("Target AI module found, %x.\n",(int)targetModule);
212 +                       textprint("Target AI module found, %p.\n",targetModule);
213                 } else {
214                         textprint("Target module is NULL!\n");
215                 }
216 @@ -1830,7 +1830,7 @@ static void AlienNearState_Hunt(STRATEGY
217  
218                 if (targetModule) {
219                         //textprint("Target module is %s\n",targetModule->name);
220 -                       textprint("Target AI module for hunt found, %x.\n",(int)targetModule);
221 +                       textprint("Target AI module for hunt found, %p.\n",targetModule);
222                 } else {
223                         textprint("Target module is NULL!\n");
224                 }
225 Index: avp/bh_queen.c
226 ===================================================================
227 RCS file: /cvs/cvsroot/avp/avp/bh_queen.c,v
228 retrieving revision 1.6
229 diff -u -p -r1.6 bh_queen.c
230 --- avp/bh_queen.c      22 May 2003 00:23:07 -0000      1.6
231 +++ avp/bh_queen.c      12 Dec 2005 22:50:27 -0000
232 @@ -505,10 +505,9 @@ void MakeQueenFar(STRATEGYBLOCK *sbPtr) 
233  
234         /* get the queen's status block */
235         int i;
236 -       QUEEN_STATUS_BLOCK *queenStatusPointer= (QUEEN_STATUS_BLOCK *)(sbPtr->SBdataptr);    
237  
238         LOCALASSERT(sbPtr);
239 -    LOCALASSERT(queenStatusPointer);
240 +    LOCALASSERT((QUEEN_STATUS_BLOCK *)(sbPtr->SBdataptr));
241         LOCALASSERT(sbPtr->SBdptr != NULL);
242  
243         /* get rid of the displayblock */
244 Index: avp/bh_waypt.c
245 ===================================================================
246 RCS file: /cvs/cvsroot/avp/avp/bh_waypt.c,v
247 retrieving revision 1.3
248 diff -u -p -r1.3 bh_waypt.c
249 --- avp/bh_waypt.c      22 Dec 2001 00:49:58 -0000      1.3
250 +++ avp/bh_waypt.c      12 Dec 2005 22:50:27 -0000
251 @@ -131,7 +131,7 @@ int NPCGetWaypointDirection(WAYPOINT_HEA
252  
253         //Base shift value on strategy block so that the aliens don't keep changing their minds
254         //about which route to take
255 -       GlobalLinkShift=(((int)sbPtr)&0xffff)>>4;
256 +       GlobalLinkShift=(((size_t)sbPtr)&0xffff)>>4;
257         if (FindBestRoute(&current_route,waypoints)==0) {
258                 /* Yuck! */
259                 textprint("Waypoint dropout: no continuous route!\n");
260 Index: avp/dynamics.c
261 ===================================================================
262 RCS file: /cvs/cvsroot/avp/avp/dynamics.c,v
263 retrieving revision 1.4
264 diff -u -p -r1.4 dynamics.c
265 --- avp/dynamics.c      22 Dec 2001 00:49:58 -0000      1.4
266 +++ avp/dynamics.c      12 Dec 2005 22:50:28 -0000
267 @@ -43,8 +43,10 @@ you should have seen the previous versio
268  #if 0
269         extern int GlobalFrameCounter;
270         #define LogInfo LOGDXFMT
271 +       #define LogInfoVar(x) x
272  #else
273         #define LogInfo(args) (void)0
274 +       #define LogInfoVar(x)
275  #endif
276  
277  extern MORPHDISPLAY MorphDisplay;
278 @@ -295,7 +297,7 @@ extern void ObjectDynamics(void)
279         InitialiseDynamicObjectsList();
280  
281         {
282 -               DYNAMICSBLOCK *dynPtr = Player->ObStrategyBlock->DynPtr;
283 +               LogInfoVar(DYNAMICSBLOCK *dynPtr = Player->ObStrategyBlock->DynPtr);
284                 LogInfo
285                 ((
286                         "Dynamics Logging: frame %d\nDL: player's Position %d,%d,%d\nDL: player's Displacement %d,%d,%d\nDL: NormalFrameTime %d\n",
287 Index: avp/game.c
288 ===================================================================
289 RCS file: /cvs/cvsroot/avp/avp/game.c,v
290 retrieving revision 1.7
291 diff -u -p -r1.7 game.c
292 --- avp/game.c  22 Dec 2001 00:49:58 -0000      1.7
293 +++ avp/game.c  12 Dec 2005 22:50:28 -0000
294 @@ -10,6 +10,7 @@
295  #include "dynblock.h"
296  #include "dynamics.h"
297  
298 +#include "winmain.h"
299  #include "bh_types.h"
300  #include "bh_alien.h"
301  #include "pheromon.h"
302 Index: avp/psndproj.c
303 ===================================================================
304 RCS file: /cvs/cvsroot/avp/avp/psndproj.c,v
305 retrieving revision 1.6
306 diff -u -p -r1.6 psndproj.c
307 --- avp/psndproj.c      9 Jan 2002 23:07:35 -0000       1.6
308 +++ avp/psndproj.c      12 Dec 2005 22:50:28 -0000
309 @@ -856,7 +856,7 @@ int FindAndLoadWavFile(int soundNum,char
310  #if LOAD_SOUND_FROM_FAST_FILE
311         //first look in fast file
312         {
313 -               unsigned nLen;
314 +               size_t nLen;
315                 if(ffreadbuf(sound_name,&nLen))
316                 {
317                         return LoadWavFromFastFile(soundNum,sound_name);
318 Index: avp/pvisible.c
319 ===================================================================
320 RCS file: /cvs/cvsroot/avp/avp/pvisible.c,v
321 retrieving revision 1.3
322 diff -u -p -r1.3 pvisible.c
323 --- avp/pvisible.c      9 Jan 2002 23:07:35 -0000       1.3
324 +++ avp/pvisible.c      12 Dec 2005 22:50:29 -0000
325 @@ -236,7 +236,7 @@ void DoObjectVisibility(STRATEGYBLOCK *s
326                  module. However, we will do a paranoia check for a null containingModule... */ 
327                  if(!sbPtr->containingModule)    
328                  {
329 -                        textprint("Calling Far EmergencyRelocateObject, On object %x, type %d!\n",(int)sbPtr, sbPtr->I_SBtype);
330 +                        textprint("Calling Far EmergencyRelocateObject, On object %p, type %d!\n",sbPtr, sbPtr->I_SBtype);
331                          IdentifyObject(sbPtr);
332                          if(!(EmergencyRelocateObject(sbPtr))) {
333                                  textprint("Relocate failed!\n");
334 @@ -432,7 +432,7 @@ void DoObjectVisibility(STRATEGYBLOCK *s
335                  if(!(newModule))
336                  {
337                          /* attempt to relocate object */
338 -                        textprint("Calling Near EmergencyRelocateObject, On object %x, type %d!\n",(int)sbPtr, sbPtr->I_SBtype);
339 +                        textprint("Calling Near EmergencyRelocateObject, On object %p, type %d!\n",sbPtr, sbPtr->I_SBtype);
340                          IdentifyObject(sbPtr);
341                          if(!(EmergencyRelocateObject(sbPtr))) {
342                                  textprint("Relocate failed!\n");
343 Index: avp/savegame.c
344 ===================================================================
345 RCS file: /cvs/cvsroot/avp/avp/savegame.c,v
346 retrieving revision 1.7
347 diff -u -p -r1.7 savegame.c
348 --- avp/savegame.c      22 May 2003 00:23:07 -0000      1.7
349 +++ avp/savegame.c      12 Dec 2005 22:50:29 -0000
350 @@ -8,6 +8,7 @@
351  #include "comp_shp.h"
352  #include "dynblock.h"
353  
354 +#include "smacker.h"
355  #include "bh_alien.h"
356  #include "pvisible.h"
357  #include "bh_pred.h"
358 Index: avp/weapons.c
359 ===================================================================
360 RCS file: /cvs/cvsroot/avp/avp/weapons.c,v
361 retrieving revision 1.8
362 diff -u -p -r1.8 weapons.c
363 --- avp/weapons.c       22 May 2003 00:23:07 -0000      1.8
364 +++ avp/weapons.c       12 Dec 2005 22:50:31 -0000
365 @@ -10138,8 +10138,7 @@ SECTION_DATA *CheckBiteIntegrity(void) {
366         if ((targetpos.vz >0) 
367                 && (targetpos.vz <  (BITE_RANGE<<1))) {
368         
369 -               DYNAMICSBLOCK *dynPtr = Biting->DynPtr;
370 -               GLOBALASSERT(dynPtr);
371 +               GLOBALASSERT(Biting->DynPtr);
372                 
373                 if (IsThisObjectVisibleFromThisPosition_WithIgnore(objectPtr,Player,&Global_VDB_Ptr->VDB_World,(BITE_RANGE<<1))) {
374         
375 Index: avp/support/coordstr.cpp
376 ===================================================================
377 RCS file: /cvs/cvsroot/avp/avp/support/coordstr.cpp,v
378 retrieving revision 1.3
379 diff -u -p -r1.3 coordstr.cpp
380 --- avp/support/coordstr.cpp    9 Jan 2002 23:07:35 -0000       1.3
381 +++ avp/support/coordstr.cpp    12 Dec 2005 22:50:31 -0000
382 @@ -210,7 +210,7 @@ ACTIVITY_RETURN_TYPE AcyclicPulsingCoord
383         textprint("AcyclicPulsingCoordinate :: Activity(%i)\n", FixP_Time);
384         #endif
385  
386 -       int Int_CurrentCoord_Old = Int_CurrentCoord_Val;
387 +       ACTIVITY_RVAL_TEMP(int Int_CurrentCoord_Old = Int_CurrentCoord_Val);
388  
389         ApplyVelocity( FixP_Time );
390  
391 @@ -276,7 +276,7 @@ ACTIVITY_RETURN_TYPE CyclicPulsingCoordi
392         textprint("CyclicPulsingCoordinate :: Activity(%i)\n", FixP_Time);
393         #endif
394  
395 -       int Int_CurrentCoord_Old = Int_CurrentCoord_Val;
396 +       ACTIVITY_RVAL_TEMP(int Int_CurrentCoord_Old = Int_CurrentCoord_Val);
397         
398         ApplyVelocity( FixP_Time );
399         
400 @@ -343,7 +343,7 @@ HomingCoordinate::HomingCoordinate
401         FixP_IdealVelocity_Val = DIV_FIXED
402         (
403                 (FixP_TargetCoord_Val - FixP_Position_Val),
404 -               FIXP_SECONDS_FOR_STANDARD_HOMING
405 +               (int)FIXP_SECONDS_FOR_STANDARD_HOMING
406         );
407  }
408  
409 @@ -383,7 +383,7 @@ AcyclicHomingCoordinate :: AcyclicHoming
410  
411  ACTIVITY_RETURN_TYPE AcyclicHomingCoordinate :: Activity(ACTIVITY_INPUT)
412  {
413 -       int Int_CurrentCoord_Old = Int_CurrentCoord_Val;
414 +       ACTIVITY_RVAL_TEMP(int Int_CurrentCoord_Old = Int_CurrentCoord_Val);
415  
416         #if 0
417         textprint("acyclic homing coord for time %i\n",FixP_Time);
418 @@ -503,7 +503,7 @@ void AcyclicHomingCoordinate :: SetTarge
419         
420         FixP_IdealVelocity_Val = DIV_FIXED(
421                 (FixP_TargetCoord_Val - FixP_Position_Val),
422 -               FIXP_SECONDS_FOR_STANDARD_HOMING
423 +               (int)FIXP_SECONDS_FOR_STANDARD_HOMING
424         );
425  
426         
427 @@ -553,7 +553,7 @@ AcyclicFixedSpeedHoming :: ~AcyclicFixed
428  
429  ACTIVITY_RETURN_TYPE AcyclicFixedSpeedHoming :: Activity(ACTIVITY_INPUT)
430  {
431 -       int Int_CurrentCoord_Old = Int_CurrentCoord_Val;
432 +       ACTIVITY_RVAL_TEMP(int Int_CurrentCoord_Old = Int_CurrentCoord_Val);
433  
434         #if 0
435         textprint("acyclic homing coord for time %i\n",FixP_Time);
436 Index: avp/support/daemon.h
437 ===================================================================
438 RCS file: /cvs/cvsroot/avp/avp/support/daemon.h,v
439 retrieving revision 1.2
440 diff -u -p -r1.2 daemon.h
441 --- avp/support/daemon.h        29 Jul 2001 02:29:46 -0000      1.2
442 +++ avp/support/daemon.h        12 Dec 2005 22:50:31 -0000
443 @@ -30,12 +30,14 @@
444         #if SupportCallbackHooks
445                 #define ACTIVITY_RETURN_TYPE    OurBool
446  
447 +               #define ACTIVITY_RVAL_TEMP(b)   b
448                 #define ACTIVITY_RVAL_CHANGE    {return Yes;}
449                 #define ACTIVITY_RVAL_NOCHANGE  {return No;}
450                 #define ACTIVITY_RVAL_BOOL(b)   {return b;}
451         #else
452                 #define ACTIVITY_RETURN_TYPE            void
453  
454 +               #define ACTIVITY_RVAL_TEMP(b)
455                 #define ACTIVITY_RVAL_CHANGE            {return;}
456                 #define ACTIVITY_RVAL_NOCHANGE          {return;}
457                 #define ACTIVITY_RVAL_BOOL(ignore)      {return;}
458 Index: avp/win95/progress_bar.cpp
459 ===================================================================
460 RCS file: /cvs/cvsroot/avp/avp/win95/progress_bar.cpp,v
461 retrieving revision 1.10
462 diff -u -p -r1.10 progress_bar.cpp
463 --- avp/win95/progress_bar.cpp  22 Dec 2001 00:49:59 -0000      1.10
464 +++ avp/win95/progress_bar.cpp  12 Dec 2005 22:50:31 -0000
465 @@ -59,7 +59,7 @@ void Start_Progress_Bar()
466                 CL_GetImageFileName(buffer, 100,Loading_Bar_Empty_Image_Name, LIO_RELATIVEPATH);
467                 
468                 //see if graphic can be found in fast file
469 -               unsigned int fastFileLength;
470 +               size_t fastFileLength;
471                 void const * pFastFileData = ffreadbuf(buffer,&fastFileLength);
472                 
473                 if(pFastFileData)
474 @@ -89,7 +89,7 @@ void Start_Progress_Bar()
475                 CL_GetImageFileName(buffer, 100,Loading_Bar_Full_Image_Name, LIO_RELATIVEPATH);
476                 
477                 //see if graphic can be found in fast file
478 -               unsigned int fastFileLength;
479 +               size_t fastFileLength;
480                 void const * pFastFileData = ffreadbuf(buffer,&fastFileLength);
481                 
482                 if(pFastFileData)
483 @@ -128,7 +128,7 @@ void Start_Progress_Bar()
484         
485  
486         //see if graphic can be found in fast file
487 -       unsigned int fastFileLength;
488 +       size_t fastFileLength;
489         void const * pFastFileData = ffreadbuf(buffer,&fastFileLength);
490         
491         if(pFastFileData)
492 Index: avp/win95/system.c
493 ===================================================================
494 RCS file: /cvs/cvsroot/avp/avp/win95/system.c,v
495 retrieving revision 1.10
496 diff -u -p -r1.10 system.c
497 --- avp/win95/system.c  9 Jan 2002 23:07:36 -0000       1.10
498 +++ avp/win95/system.c  12 Dec 2005 22:50:31 -0000
499 @@ -12,6 +12,7 @@
500  #include "messagehistory.h"
501  #include "particle.h"
502  #include "pldnet.h"
503 +#include "smacker.h"
504  #define UseLocalAssert Yes
505  #include "ourasert.h"
506  
507 Index: avp/win95/frontend/avp_intro.cpp
508 ===================================================================
509 RCS file: /cvs/cvsroot/avp/avp/win95/frontend/avp_intro.cpp,v
510 retrieving revision 1.3
511 diff -u -p -r1.3 avp_intro.cpp
512 --- avp/win95/frontend/avp_intro.cpp    22 Dec 2001 00:49:59 -0000      1.3
513 +++ avp/win95/frontend/avp_intro.cpp    12 Dec 2005 22:50:31 -0000
514 @@ -4,7 +4,8 @@ extern "C"
515         #include "3dc.h"
516         //#include "intro.hpp"
517         #include "inline.h"
518 -       //#include "smacker.h"
519 +       #include "smacker.h"
520 +       #include "winmain.h"
521         #include "avp_menus.h"
522      #include "avp_intro.h"
523         extern int NormalFrameTime;
524 @@ -24,7 +25,6 @@ void Show_ARebellionGame(void);
525  void Show_AvPLogo(void);
526  extern void ShowSplashScreens(void);
527  extern void Show_WinnerScreen(void);
528 -extern void PlayBinkedFMV(char *filenamePtr);
529  extern void DrawMainMenusBackdrop(void);
530  extern void FadedScreen(int alpha);
531  
532 Index: avp/win95/frontend/avp_menugfx.cpp
533 ===================================================================
534 RCS file: /cvs/cvsroot/avp/avp/win95/frontend/avp_menugfx.cpp,v
535 retrieving revision 1.4
536 diff -u -p -r1.4 avp_menugfx.cpp
537 --- avp/win95/frontend/avp_menugfx.cpp  9 Jan 2002 23:07:36 -0000       1.4
538 +++ avp/win95/frontend/avp_menugfx.cpp  12 Dec 2005 22:50:32 -0000
539 @@ -256,7 +256,7 @@ extern int RenderMenuText_Clipped(char *
540  }
541  
542  
543 -extern int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
544 +extern int RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
545  {
546         switch(format)
547         {
548 @@ -300,7 +300,7 @@ extern int RenderSmallMenuText(char *tex
549         x = RenderSmallFontString(textPtr,x,y,alpha,ONE_FIXED,ONE_FIXED,ONE_FIXED);
550         return x;
551  }
552 -extern int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue) 
553 +extern int RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue) 
554  {
555         switch(format)
556         {
557 @@ -345,7 +345,7 @@ extern int RenderSmallMenuText_Coloured(
558         return x;
559  }
560  
561 -extern int Hardware_RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
562 +extern int Hardware_RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) 
563  {
564         switch(format)
565         {
566 @@ -395,7 +395,7 @@ extern int Hardware_RenderSmallMenuText(
567         return x;
568  }
569  
570 -extern int Hardware_RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
571 +extern int Hardware_RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
572  {
573         switch(format)
574         {
575 Index: avp/win95/frontend/avp_menugfx.hpp
576 ===================================================================
577 RCS file: /cvs/cvsroot/avp/avp/win95/frontend/avp_menugfx.hpp,v
578 retrieving revision 1.6
579 diff -u -p -r1.6 avp_menugfx.hpp
580 --- avp/win95/frontend/avp_menugfx.hpp  9 Jan 2002 23:07:36 -0000       1.6
581 +++ avp/win95/frontend/avp_menugfx.hpp  12 Dec 2005 22:50:32 -0000
582 @@ -99,11 +99,11 @@ extern void ReleaseAllAvPMenuGfx(void);
583  
584  extern int RenderMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
585  
586 -extern int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
587 -extern int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue); 
588 +extern int RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
589 +extern int RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue); 
590  
591 -extern int Hardware_RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
592 -extern int Hardware_RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue);
593 +extern int Hardware_RenderSmallMenuText(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
594 +extern int Hardware_RenderSmallMenuText_Coloured(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue);
595  
596  extern int RenderMenuText_Clipped(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int topY, int bottomY);
597  extern void RenderSmallFontString_Wrapped(const char *textPtr,RECT* area,int alpha,int* output_x,int* output_y);
598 Index: avp/win95/frontend/avp_menus.c
599 ===================================================================
600 RCS file: /cvs/cvsroot/avp/avp/win95/frontend/avp_menus.c,v
601 retrieving revision 1.11
602 diff -u -p -r1.11 avp_menus.c
603 --- avp/win95/frontend/avp_menus.c      22 May 2003 01:55:16 -0000      1.11
604 +++ avp/win95/frontend/avp_menus.c      12 Dec 2005 22:50:33 -0000
605 @@ -8,6 +8,10 @@
606  #include "net.h"
607  #include "opengl.h"
608  #include "pldnet.h"
609 +#include "main.h"
610 +#include "winmain.h"
611 +#include "smacker.h"
612 +#include "dd_func.h"
613  
614  #include "avp_menudata.h"
615  #include "avp_menus.h"
616 @@ -1788,7 +1792,7 @@ static void RenderLoadGameMenu(void)
617         AVPMENU_ELEMENT *elementPtr = AvPMenus.MenuElements;
618         int e;
619         int y;
620 -       int (*RenderText)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
621 +       int (*RenderText)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
622         
623         if (AvPMenus.MenusState == MENUSSTATE_MAINMENUS)
624         {
625 @@ -3224,8 +3228,8 @@ int LengthOfSmallMenuText(char *textPtr)
626  
627  static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y)
628  {
629 -       int (*RenderText)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
630 -       int (*RenderText_Coloured)(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int r, int g, int b);
631 +       int (*RenderText)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format);
632 +       int (*RenderText_Coloured)(const char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int r, int g, int b);
633         int (*MenuTextLength)(char *textPtr);
634         
635         if (AvPMenus.FontToUse==AVPMENU_FONT_BIG)
636 Index: win95/chnktexi.cpp
637 ===================================================================
638 RCS file: /cvs/cvsroot/avp/win95/chnktexi.cpp,v
639 retrieving revision 1.4
640 diff -u -p -r1.4 chnktexi.cpp
641 --- win95/chnktexi.cpp  18 Dec 2001 05:08:53 -0000      1.4
642 +++ win95/chnktexi.cpp  12 Dec 2005 22:50:33 -0000
643 @@ -102,7 +102,7 @@ static char * RiffBasename(Chunk_With_Ch
644  #if CL_SUPPORT_FASTFILE
645  static inline bool IsFileInFastFile(char const * pszFileName)
646  {
647 -       unsigned nLen;
648 +       size_t nLen;
649         return ffreadbuf(pszFileName,&nLen) ? true : false;
650  }
651  #endif
652 @@ -714,7 +714,7 @@ int CL_LoadImageOnce(char const * pszFil
653                 case LIO_DDSURFACE:
654                 {
655                         #if CL_SUPPORT_FASTFILE
656 -                       unsigned nFastFileLen;
657 +                       size_t nFastFileLen;
658                         void const * pFastFileData = ffreadbuf(szBuf,&nFastFileLen);
659                         if (pFastFileData)
660                         {
661 @@ -823,7 +823,7 @@ int CL_LoadImageOnce(char const * pszFil
662                 {
663                         fAwLoad |= AW_TLF_COMPRESS; // required on some cards!!
664                         #if CL_SUPPORT_FASTFILE
665 -                       unsigned nFastFileLen;
666 +                       size_t nFastFileLen;
667                         void const * pFastFileData = ffreadbuf(szBuf,&nFastFileLen);
668                         if (pFastFileData)
669                         {
670 Index: win95/hash_tem.hpp
671 ===================================================================
672 RCS file: /cvs/cvsroot/avp/win95/hash_tem.hpp,v
673 retrieving revision 1.5
674 diff -u -p -r1.5 hash_tem.hpp
675 --- win95/hash_tem.hpp  18 Aug 2004 04:20:41 -0000      1.5
676 +++ win95/hash_tem.hpp  12 Dec 2005 22:50:33 -0000
677 @@ -242,7 +242,7 @@
678         inline unsigned HashFunction(void const * const _vP)
679         {
680                 // treat as integer
681 -               return HashFunction(reinterpret_cast<unsigned>(_vP));
682 +               return HashFunction((unsigned long)(_vP));
683         }
684  
685         // a hash function for strings
686 --- /dev/null   2005-12-12 17:15:01.544366500 -0500
687 +++ main.h      2005-12-12 16:33:39.000000000 -0500
688 @@ -0,0 +1,11 @@
689 +#ifndef __MAIN_H__
690 +#define __MAIN_H__
691 +
692 +extern void LoadDeviceAndVideoModePreferences(void);
693 +extern void SaveDeviceAndVideoModePreferences(void);
694 +extern void PreviousVideoMode2(void);
695 +extern void NextVideoMode2(void);
696 +extern char *GetVideoModeDescription2(void);
697 +extern char *GetVideoModeDescription3(void);
698 +
699 +#endif
700 --- /dev/null   2005-12-12 17:15:01.544366500 -0500
701 +++ smacker.h   2005-12-12 16:29:16.000000000 -0500
702 @@ -0,0 +1,11 @@
703 +#ifndef __SMACKER_H__
704 +#define __SMACKER_H__
705 +
706 +extern void GetFMVInformation(int *messageNumberPtr, int *frameNumberPtr);
707 +extern void InitialiseTriggeredFMVs(void);
708 +extern void StartFMVAtFrame(int number, int frame);
709 +extern void StartTriggerPlotFMV(int number);
710 +extern void UpdateAllFMVTextures(void);
711 +extern void EndMenuMusic(void);
712 +
713 +#endif
714 --- /dev/null   2005-12-12 17:15:01.544366500 -0500
715 +++ avp/win95/winmain.h 2005-12-12 16:26:06.000000000 -0500
716 @@ -0,0 +1,10 @@
717 +#ifndef __WINMAIN_H__
718 +#define __WINMAIN_H__
719 +
720 +extern void PlayBinkedFMV(char *filenamePtr);
721 +extern void StartMenuBackgroundBink(void);
722 +extern int PlayMenuBackgroundBink(void);
723 +extern void EndMenuBackgroundBink(void);
724 +extern void InitialiseTriggeredFMVs(void);
725 +
726 +#endif
727 --- /dev/null   2005-12-12 17:15:01.544366500 -0500
728 +++ win95/dd_func.h     2005-12-12 16:34:43.000000000 -0500
729 @@ -0,0 +1,6 @@
730 +#ifndef __DD_FUNC_H__
731 +#define __DD_FUNC_H__
732 +
733 +extern int SelectDirectDrawObject(void *pGUID);
734 +
735 +#endif