Commit 06648dab authored by Steven Fuller's avatar Steven Fuller

Now compile with -Wall -pedantic. Now compiles without warnings except one

set of warnings (all the same thing).

Fixed small bug with the ceiling/floor code.
parent b8f18ac7
CC = gcc CC = gcc
#CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro #CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
CFLAGS = -g -Wall #CFLAGS = -g -Wall
#CFLAGS = -g -Wall -pedantic CFLAGS = -g -Wall -pedantic
#CFLAGS = -Os -Wall #CFLAGS = -Os -Wall
#CFLAGS = -Os -Wall -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro #CFLAGS = -Os -Wall -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
......
...@@ -926,7 +926,7 @@ memptr PM_GetPage(int pagenum) ...@@ -926,7 +926,7 @@ memptr PM_GetPage(int pagenum)
// Calls the update function after each load, indicating the current // Calls the update function after each load, indicating the current
// page, and the total pages that need to be loaded (for thermometer). // page, and the total pages that need to be loaded (for thermometer).
// //
void PM_Preload(boolean (*update)(word current, word total)) void PM_Preload(boolean (*update)(int current, int total))
{ {
int i; int i;
......
...@@ -77,7 +77,7 @@ extern PageListStruct *PMPages; ...@@ -77,7 +77,7 @@ extern PageListStruct *PMPages;
void PM_Startup(); void PM_Startup();
void PM_Shutdown(); void PM_Shutdown();
void PM_Preload(boolean (*update)(word current,word total)); void PM_Preload(boolean (*update)(int current, int total));
memptr PM_GetPage(int pagenum); memptr PM_GetPage(int pagenum);
......
...@@ -31,7 +31,7 @@ void VL_DirectPlotFlush(); ...@@ -31,7 +31,7 @@ void VL_DirectPlotFlush();
#define MaxJoys 2 #define MaxJoys 2
#define NumCodes 128 #define NumCodes 128
typedef byte ScanCode; typedef int8_t ScanCode;
#define sc_None 0 #define sc_None 0
#define sc_Bad 0xff #define sc_Bad 0xff
......
...@@ -258,7 +258,7 @@ void VL_Startup() ...@@ -258,7 +258,7 @@ void VL_Startup()
gb = (char *)malloc(320); gb = (char *)malloc(320);
imgtmp = XCreateImage(dpy, vi->visual, vi->depth, ZPixmap, 0, imgtmp = XCreateImage(dpy, vi->visual, vi->depth, ZPixmap, 0,
gfxbuf, 16, 1, 8, 16*4); gb, 16, 1, 8, 16*4);
if (gfxbuf == NULL) if (gfxbuf == NULL)
gfxbuf = malloc(vwidth * vheight * 1); gfxbuf = malloc(vwidth * vheight * 1);
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
statobj_t statobjlist[MAXSTATS], *laststatobj; statobj_t statobjlist[MAXSTATS], *laststatobj;
struct struct
{ {
int picnum; int picnum;
...@@ -26,9 +25,6 @@ struct ...@@ -26,9 +25,6 @@ struct
{SPR_STAT_5,block}, // Hanged man " {SPR_STAT_5,block}, // Hanged man "
{SPR_STAT_6,bo_alpo}, // Bad food " {SPR_STAT_6,bo_alpo}, // Bad food "
{SPR_STAT_7,block}, // Red pillar " {SPR_STAT_7,block}, // Red pillar "
//
// NEW PAGE
//
{SPR_STAT_8,block}, // Tree spr2v {SPR_STAT_8,block}, // Tree spr2v
{SPR_STAT_9}, // Skeleton flat " {SPR_STAT_9}, // Skeleton flat "
{SPR_STAT_10,block}, // Sink " (SOD:gibs) {SPR_STAT_10,block}, // Sink " (SOD:gibs)
...@@ -36,14 +32,13 @@ struct ...@@ -36,14 +32,13 @@ struct
{SPR_STAT_12,block}, // Urn " {SPR_STAT_12,block}, // Urn "
{SPR_STAT_13,block}, // Bare table " {SPR_STAT_13,block}, // Bare table "
{SPR_STAT_14}, // Ceiling light " {SPR_STAT_14}, // Ceiling light "
#ifndef SPEAR #ifndef SPEAR
{SPR_STAT_15}, // Kitchen stuff " {SPR_STAT_15}, // Kitchen stuff "
#else #else
{SPR_STAT_15,block}, // Gibs! {SPR_STAT_15,block}, // Gibs!
#endif #endif
//
// NEW PAGE
//
{SPR_STAT_16,block}, // suit of armor spr3v {SPR_STAT_16,block}, // suit of armor spr3v
{SPR_STAT_17,block}, // Hanging cage " {SPR_STAT_17,block}, // Hanging cage "
{SPR_STAT_18,block}, // SkeletoninCage " {SPR_STAT_18,block}, // SkeletoninCage "
...@@ -52,9 +47,6 @@ struct ...@@ -52,9 +47,6 @@ struct
{SPR_STAT_21,bo_key2}, // Key 2 " {SPR_STAT_21,bo_key2}, // Key 2 "
{SPR_STAT_22,block}, // stuff (SOD:gibs) {SPR_STAT_22,block}, // stuff (SOD:gibs)
{SPR_STAT_23}, // stuff {SPR_STAT_23}, // stuff
//
// NEW PAGE
//
{SPR_STAT_24,bo_food}, // Good food spr4v {SPR_STAT_24,bo_food}, // Good food spr4v
{SPR_STAT_25,bo_firstaid}, // First aid " {SPR_STAT_25,bo_firstaid}, // First aid "
{SPR_STAT_26,bo_clip}, // Clip " {SPR_STAT_26,bo_clip}, // Clip "
...@@ -63,9 +55,6 @@ struct ...@@ -63,9 +55,6 @@ struct
{SPR_STAT_29,bo_cross}, // Cross " {SPR_STAT_29,bo_cross}, // Cross "
{SPR_STAT_30,bo_chalice}, // Chalice " {SPR_STAT_30,bo_chalice}, // Chalice "
{SPR_STAT_31,bo_bible}, // Bible " {SPR_STAT_31,bo_bible}, // Bible "
//
// NEW PAGE
//
{SPR_STAT_32,bo_crown}, // crown spr5v {SPR_STAT_32,bo_crown}, // crown spr5v
{SPR_STAT_33,bo_fullheal}, // one up " {SPR_STAT_33,bo_fullheal}, // one up "
{SPR_STAT_34,bo_gibs}, // gibs " {SPR_STAT_34,bo_gibs}, // gibs "
...@@ -74,31 +63,27 @@ struct ...@@ -74,31 +63,27 @@ struct
{SPR_STAT_37,block}, // Empty well " {SPR_STAT_37,block}, // Empty well "
{SPR_STAT_38,bo_gibs}, // Gibs 2 " {SPR_STAT_38,bo_gibs}, // Gibs 2 "
{SPR_STAT_39,block}, // flag " {SPR_STAT_39,block}, // flag "
//
// NEW PAGE
//
#ifndef SPEAR #ifndef SPEAR
{SPR_STAT_40,block}, // Call Apogee spr7v {SPR_STAT_40,block}, // Call Apogee spr7v
#else #else
{SPR_STAT_40}, // Red light {SPR_STAT_40}, // Red light
#endif #endif
//
// NEW PAGE
//
{SPR_STAT_41}, // junk " {SPR_STAT_41}, // junk "
{SPR_STAT_42}, // junk " {SPR_STAT_42}, // junk "
{SPR_STAT_43}, // junk " {SPR_STAT_43}, // junk "
#ifndef SPEAR #ifndef SPEAR
{SPR_STAT_44}, // pots " {SPR_STAT_44}, // pots "
#else #else
{SPR_STAT_44,block}, // Gibs! {SPR_STAT_44,block}, // Gibs!
#endif #endif
{SPR_STAT_45,block}, // stove " (SOD:gibs) {SPR_STAT_45,block}, // stove " (SOD:gibs)
{SPR_STAT_46,block}, // spears " (SOD:gibs) {SPR_STAT_46,block}, // spears " (SOD:gibs)
{SPR_STAT_47}, // vines " {SPR_STAT_47}, // vines "
//
// NEW PAGE
//
#ifdef SPEAR #ifdef SPEAR
{SPR_STAT_48,block}, // marble pillar {SPR_STAT_48,block}, // marble pillar
{SPR_STAT_49,bo_25clip}, // bonus 25 clip {SPR_STAT_49,bo_25clip}, // bonus 25 clip
...@@ -255,7 +240,7 @@ Open doors conect two areas, so sounds will travel between them and sight ...@@ -255,7 +240,7 @@ Open doors conect two areas, so sounds will travel between them and sight
Areaconnect is incremented/decremented by each door. If >0 they connect Areaconnect is incremented/decremented by each door. If >0 they connect
Every time a door opens or closes the areabyplayer matrix gets recalculated. Every time a door opens or closes the areabyplayer matrix gets recalculated.
An area is true if it connects with the player's current spor. An area is true if it connects with the player's current spot.
============================================================================= =============================================================================
*/ */
...@@ -267,7 +252,6 @@ int doornum; ...@@ -267,7 +252,6 @@ int doornum;
unsigned doorposition[MAXDOORS]; // leading edge of door 0=closed unsigned doorposition[MAXDOORS]; // leading edge of door 0=closed
// 0xffff = fully open // 0xffff = fully open
byte areaconnect[NUMAREAS][NUMAREAS]; byte areaconnect[NUMAREAS][NUMAREAS];
boolean areabyplayer[NUMAREAS]; boolean areabyplayer[NUMAREAS];
...@@ -724,7 +708,7 @@ void PushWall(int checkx, int checky, int dir) ...@@ -724,7 +708,7 @@ void PushWall(int checkx, int checky, int dir)
case di_north: case di_north:
if (actorat[checkx][checky-1]) if (actorat[checkx][checky-1])
{ {
SD_PlaySound (NOWAYSND); SD_PlaySound(NOWAYSND);
return; return;
} }
(unsigned)actorat[checkx][checky-1] = (unsigned)actorat[checkx][checky-1] =
...@@ -734,7 +718,7 @@ void PushWall(int checkx, int checky, int dir) ...@@ -734,7 +718,7 @@ void PushWall(int checkx, int checky, int dir)
case di_east: case di_east:
if (actorat[checkx+1][checky]) if (actorat[checkx+1][checky])
{ {
SD_PlaySound (NOWAYSND); SD_PlaySound(NOWAYSND);
return; return;
} }
(unsigned)actorat[checkx+1][checky] = (unsigned)actorat[checkx+1][checky] =
...@@ -744,7 +728,7 @@ void PushWall(int checkx, int checky, int dir) ...@@ -744,7 +728,7 @@ void PushWall(int checkx, int checky, int dir)
case di_south: case di_south:
if (actorat[checkx][checky+1]) if (actorat[checkx][checky+1])
{ {
SD_PlaySound (NOWAYSND); SD_PlaySound(NOWAYSND);
return; return;
} }
(unsigned)actorat[checkx][checky+1] = (unsigned)actorat[checkx][checky+1] =
...@@ -754,7 +738,7 @@ void PushWall(int checkx, int checky, int dir) ...@@ -754,7 +738,7 @@ void PushWall(int checkx, int checky, int dir)
case di_west: case di_west:
if (actorat[checkx-1][checky]) if (actorat[checkx-1][checky])
{ {
SD_PlaySound (NOWAYSND); SD_PlaySound(NOWAYSND);
return; return;
} }
(unsigned)actorat[checkx-1][checky] = (unsigned)actorat[checkx-1][checky] =
...@@ -771,7 +755,7 @@ void PushWall(int checkx, int checky, int dir) ...@@ -771,7 +755,7 @@ void PushWall(int checkx, int checky, int dir)
tilemap[pwallx][pwally] |= 0xc0; tilemap[pwallx][pwally] |= 0xc0;
*(mapsegs[1]+farmapylookup[pwally]+pwallx) = 0; // remove P tile info *(mapsegs[1]+farmapylookup[pwally]+pwallx) = 0; // remove P tile info
SD_PlaySound (PUSHWALLSND); SD_PlaySound(PUSHWALLSND);
} }
......
...@@ -791,7 +791,7 @@ extern int controlx,controly; // range from -100 to 100 ...@@ -791,7 +791,7 @@ extern int controlx,controly; // range from -100 to 100
extern boolean buttonstate[NUMBUTTONS]; extern boolean buttonstate[NUMBUTTONS];
extern boolean demorecord,demoplayback; extern boolean demorecord,demoplayback;
extern char *demoptr, *lastdemoptr; extern byte *demoptr, *lastdemoptr;
extern memptr demobuffer; extern memptr demobuffer;
......
...@@ -39,10 +39,11 @@ static void AsmRefresh(); ...@@ -39,10 +39,11 @@ static void AsmRefresh();
#ifndef NOASM #ifndef NOASM
#define FixedByFrac(x, y) \ #define FixedByFrac(x, y) \
({ unsigned long z; \ __extension__ \
({ unsigned long z; \
asm("imull %2; shrdl $16, %%edx, %%eax" : "=a" (z) : "a" (x), "q" (y) : "%edx"); \ asm("imull %2; shrdl $16, %%edx, %%eax" : "=a" (z) : "a" (x), "q" (y) : "%edx"); \
z; \ z; \
}) })
#endif #endif
void ScaleShape(int xcenter, int shapenum, unsigned height); void ScaleShape(int xcenter, int shapenum, unsigned height);
...@@ -157,7 +158,6 @@ static boolean TransformTile(int tx, int ty, int *dispx, int *dispheight) ...@@ -157,7 +158,6 @@ static boolean TransformTile(int tx, int ty, int *dispx, int *dispheight)
gyt = FixedByFrac(gy,viewcos); gyt = FixedByFrac(gy,viewcos);
ny = gyt+gxt; ny = gyt+gxt;
// //
// calculate perspective ratio // calculate perspective ratio
// //
...@@ -180,44 +180,8 @@ static boolean TransformTile(int tx, int ty, int *dispx, int *dispheight) ...@@ -180,44 +180,8 @@ static boolean TransformTile(int tx, int ty, int *dispx, int *dispheight)
return false; return false;
} }
/* ======================================================================== */ /* ======================================================================== */
static unsigned int Ceiling[]=
{
#ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,
0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd
#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};
/*
=====================
=
= ClearScreen
=
=====================
*/
static void ClearScreen()
{
unsigned int ceiling = Ceiling[gamestate.episode*10+mapon] & 0xFF;
unsigned int floor = 0x19;
VL_Bar(xoffset, yoffset, viewwidth, viewheight / 2, ceiling);
VL_Bar(xoffset, yoffset + viewheight / 2, viewwidth, viewheight / 2, floor);
}
//==========================================================================
/* /*
===================== =====================
= =
...@@ -467,20 +431,20 @@ static int spanstart[MAXVIEWHEIGHT/2]; ...@@ -467,20 +431,20 @@ static int spanstart[MAXVIEWHEIGHT/2];
static fixed basedist[MAXVIEWHEIGHT/2]; static fixed basedist[MAXVIEWHEIGHT/2];
static unsigned char planepics[8192]; /* 4k of ceiling, 4k of floor */ static byte planepics[8192]; /* 4k of ceiling, 4k of floor */
static int halfheight = 0; static int halfheight = 0;
static byte *planeylookup[MAXVIEWHEIGHT/2]; static byte *planeylookup[MAXVIEWHEIGHT/2];
static unsigned mirrorofs[MAXVIEWHEIGHT/2]; static unsigned mirrorofs[MAXVIEWHEIGHT/2];
static unsigned short int mr_rowofs; static int mr_rowofs;
static unsigned short int mr_count; static int mr_count;
static unsigned short int mr_xstep; static unsigned short int mr_xstep;
static unsigned short int mr_ystep; static unsigned short int mr_ystep;
static unsigned short int mr_xfrac; static unsigned short int mr_xfrac;
static unsigned short int mr_yfrac; static unsigned short int mr_yfrac;
static char *mr_dest; static byte *mr_dest;
static void MapRow() static void MapRow()
{ {
...@@ -628,6 +592,41 @@ void DrawPlanes() ...@@ -628,6 +592,41 @@ void DrawPlanes()
/* ======================================================================== */ /* ======================================================================== */
static unsigned int Ceiling[]=
{
#ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,
0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd
#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};
/*
=====================
=
= ClearScreen
=
=====================
*/
static void ClearScreen()
{
unsigned int ceiling = Ceiling[gamestate.episode*10+mapon] & 0xFF;
unsigned int floor = 0x19;
VL_Bar(xoffset, yoffset, viewwidth, viewheight / 2, ceiling);
VL_Bar(xoffset, yoffset + viewheight / 2, viewwidth, viewheight / 2, floor);
}
/* ======================================================================== */
/* /*
======================== ========================
= =
......
...@@ -681,9 +681,9 @@ void DrawPlayScreen() ...@@ -681,9 +681,9 @@ void DrawPlayScreen()
void StartDemoRecord(int levelnumber) void StartDemoRecord(int levelnumber)
{ {
MM_GetPtr(&demobuffer,MAXDEMOSIZE); MM_GetPtr(&demobuffer, MAXDEMOSIZE);
MM_SetLock(&demobuffer,true); MM_SetLock(&demobuffer,true);
demoptr = (char *)demobuffer; demoptr = (byte *)demobuffer;
lastdemoptr = demoptr+MAXDEMOSIZE; lastdemoptr = demoptr+MAXDEMOSIZE;
*demoptr = levelnumber; *demoptr = levelnumber;
...@@ -707,10 +707,12 @@ void FinishDemoRecord() ...@@ -707,10 +707,12 @@ void FinishDemoRecord()
demorecord = false; demorecord = false;
length = demoptr - (char *)demobuffer; length = demoptr - (byte *)demobuffer;
demoptr = ((char *)demobuffer)+1; demoptr = ((byte *)demobuffer)+1;
*(word *)demoptr = length;
demoptr[0] = length & 0xFF;
demoptr[1] = (length >> 8) & 0xFF;
CenterWindow(24,3); CenterWindow(24,3);
PrintY+=6; PrintY+=6;
...@@ -821,14 +823,14 @@ void PlayDemo(int demonumber) ...@@ -821,14 +823,14 @@ void PlayDemo(int demonumber)
NewGame (1,0); NewGame (1,0);
gamestate.mapon = *demoptr++; gamestate.mapon = *demoptr++;
gamestate.difficulty = gd_hard; gamestate.difficulty = gd_hard;
length = *((word *)demoptr)++; length = demoptr[0] | (demoptr[1] << 8); // *((word *)demoptr)++;
demoptr++; demoptr += 3;
lastdemoptr = demoptr-4+length; lastdemoptr = demoptr-4+length;
VW_FadeOut (); VW_FadeOut();
SETFONTCOLOR(0,15); SETFONTCOLOR(0,15);
DrawPlayScreen (); DrawPlayScreen();
VW_UpdateScreen(); /* force redraw */ VW_UpdateScreen(); /* force redraw */
VW_FadeIn(); VW_FadeIn();
...@@ -837,10 +839,10 @@ void PlayDemo(int demonumber) ...@@ -837,10 +839,10 @@ void PlayDemo(int demonumber)
demoplayback = true; demoplayback = true;
SetupGameLevel (); SetupGameLevel ();
StartMusic (); StartMusic();
fizzlein = true; fizzlein = true;
PlayLoop (); PlayLoop();
CA_UnCacheGrChunk(dems[demonumber]); CA_UnCacheGrChunk(dems[demonumber]);
...@@ -862,13 +864,13 @@ int PlayDemoFromFile(char *demoname) ...@@ -862,13 +864,13 @@ int PlayDemoFromFile(char *demoname)
} }
MM_SetLock(&demobuffer,true); MM_SetLock(&demobuffer,true);
demoptr = (char *)demobuffer; demoptr = (byte *)demobuffer;
NewGame(1,0); NewGame(1,0);
gamestate.mapon = *demoptr++; gamestate.mapon = *demoptr++;
gamestate.difficulty = gd_hard; gamestate.difficulty = gd_hard;
length = *((word *)demoptr)++; length = demoptr[0] | (demoptr[1] << 8); // *((word *)demoptr)++;
demoptr++; demoptr += 3;
lastdemoptr = demoptr-4+length; lastdemoptr = demoptr-4+length;
VW_FadeOut(); VW_FadeOut();
...@@ -1134,14 +1136,14 @@ startplayloop: ...@@ -1134,14 +1136,14 @@ startplayloop:
{ {
died = true; // don't "get psyched!" died = true; // don't "get psyched!"
VW_FadeOut (); VW_FadeOut();
ClearMemory (); ClearMemory();
CheckHighScore (gamestate.score,gamestate.mapon+1); CheckHighScore(gamestate.score,gamestate.mapon+1);
strcpy(MainMenu[viewscores].string,STR_VS); strcpy(MainMenu[viewscores].string,STR_VS);
MainMenu[viewscores].routine = (void *)CP_ViewScores; MainMenu[viewscores].routine = (MenuFunc)CP_ViewScores;
return; return;
} }
...@@ -1209,7 +1211,7 @@ startplayloop: ...@@ -1209,7 +1211,7 @@ startplayloop:
CheckHighScore(gamestate.score,gamestate.mapon+1); CheckHighScore(gamestate.score,gamestate.mapon+1);
strcpy(MainMenu[viewscores].string,STR_VS); strcpy(MainMenu[viewscores].string,STR_VS);
MainMenu[viewscores].routine = (void *)CP_ViewScores; MainMenu[viewscores].routine = (MenuFunc)CP_ViewScores;
return; return;
...@@ -1229,7 +1231,7 @@ startplayloop: ...@@ -1229,7 +1231,7 @@ startplayloop:
CheckHighScore(gamestate.score,gamestate.mapon+1); CheckHighScore(gamestate.score,gamestate.mapon+1);
strcpy(MainMenu[viewscores].string,STR_VS); strcpy(MainMenu[viewscores].string,STR_VS);
MainMenu[viewscores].routine = (void *)CP_ViewScores; MainMenu[viewscores].routine = (MenuFunc)CP_ViewScores;
return; return;
......
...@@ -856,7 +856,7 @@ void LevelCompleted() ...@@ -856,7 +856,7 @@ void LevelCompleted()
================= =================
*/ */
boolean PreloadUpdate(unsigned current, unsigned total) boolean PreloadUpdate(int current, int total)
{ {
int w = WindowW - 10; int w = WindowW - 10;
...@@ -887,8 +887,8 @@ void PreloadGraphics() ...@@ -887,8 +887,8 @@ void PreloadGraphics()
VW_UpdateScreen(); VW_UpdateScreen();
VW_FadeIn(); VW_FadeIn();
PM_Preload((void *)PreloadUpdate); PM_Preload(PreloadUpdate);
IN_UserInput (70); IN_UserInput(70);
VW_FadeOut(); VW_FadeOut();
DrawPlayBorder(); DrawPlayBorder();
......
...@@ -260,8 +260,12 @@ int ReadConfig() ...@@ -260,8 +260,12 @@ int ReadConfig()
MainMenu[readthis].active = 1; MainMenu[readthis].active = 1;
MainItems.curpos = 0; MainItems.curpos = 0;
#endif #endif
} else {
viewsize = 15;
} }
viewsize = 15;
mouseenabled = false; mouseenabled = false;
joystickenabled = false; joystickenabled = false;
......
...@@ -46,16 +46,16 @@ CP_iteminfo ...@@ -46,16 +46,16 @@ CP_iteminfo
CP_itemtype CP_itemtype
MainMenu[]= MainMenu[]=
{ {
{1,STR_NG,(void *)CP_NewGame}, {1,STR_NG,(MenuFunc)CP_NewGame},
{1,STR_SD,(void *)CP_Sound}, {1,STR_SD,(MenuFunc)CP_Sound},
{1,STR_CL,(void *)CP_Control}, {1,STR_CL,(MenuFunc)CP_Control},
{1,STR_LG,(void *)CP_LoadGame}, {1,STR_LG,(MenuFunc)CP_LoadGame},
{0,STR_SG,(void *)CP_SaveGame}, {0,STR_SG,(MenuFunc)CP_SaveGame},
{1,STR_CV,(void *)CP_ChangeView}, {1,STR_CV,(MenuFunc)CP_ChangeView},
#ifdef UPLOAD #ifdef UPLOAD
{2,"Read This!",(void *)CP_ReadThis}, {2,"Read This!",(MenuFunc)CP_ReadThis},
#endif #endif
{1,STR_VS,(void *)CP_ViewScores}, {1,STR_VS,(MenuFunc)CP_ViewScores},
{1,STR_BD,0}, {1,STR_BD,0},
{1,STR_QT,0} {1,STR_QT,0}
}, },
...@@ -82,8 +82,8 @@ CtlMenu[]= ...@@ -82,8 +82,8 @@ CtlMenu[]=
{0,STR_JOYEN,0}, {0,STR_JOYEN,0},
{0,STR_PORT2,0}, {0,STR_PORT2,0},
{0,STR_GAMEPAD,0}, {0,STR_GAMEPAD,0},
{0,STR_SENS,(void *)MouseSensitivity}, {0,STR_SENS,(MenuFunc)MouseSensitivity},
{1,STR_CUSTOM,(void *)CustomControls} {1,STR_CUSTOM,(MenuFunc)CustomControls}
}, },
#ifndef SPEAR #ifndef SPEAR
...@@ -204,7 +204,7 @@ char *IN_GetScanName(ScanCode scan) ...@@ -204,7 +204,7 @@ char *IN_GetScanName(ScanCode scan)
#else #else
static byte static char
*ScanNames[] = // Scan code names with single chars *ScanNames[] = // Scan code names with single chars
{ {
"?","?","1","2","3","4","5","6","7","8","9","0","-","+","?","?", "?","?","1","2","3","4","5","6","7","8","9","0","-","+","?","?",
...@@ -233,14 +233,14 @@ static byte ...@@ -233,14 +233,14 @@ static byte
char *IN_GetScanName(ScanCode scan) char *IN_GetScanName(ScanCode scan)
{ {
byte **p; char **p;
ScanCode *s; ScanCode *s;
for (s = ExtScanCodes, p = ExtScanNames; *s; p++, s++) for (s = (ScanCode *)ExtScanCodes, p = (char **)ExtScanNames; *s; p++, s++)
if (*s == scan) if (*s == scan)
return *p; return *p;
return ScanNames[scan]; return ScanNames[(int)scan];
} }
#endif #endif
...@@ -704,7 +704,7 @@ int CP_EndGame() ...@@ -704,7 +704,7 @@ int CP_EndGame()
playstate = ex_died; playstate = ex_died;
MainMenu[savegame].active = 0; MainMenu[savegame].active = 0;
MainMenu[viewscores].routine= (void *)CP_ViewScores; MainMenu[viewscores].routine = (MenuFunc)CP_ViewScores;
strcpy(MainMenu[viewscores].string,STR_VS); strcpy(MainMenu[viewscores].string,STR_VS);
return 1; return 1;
......
...@@ -94,10 +94,12 @@ typedef struct { ...@@ -94,10 +94,12 @@ typedef struct {
int x,y,amount,curpos,indent; int x,y,amount,curpos,indent;
} CP_iteminfo; } CP_iteminfo;
typedef void (* MenuFunc)(int temp1);
typedef struct { typedef struct {
int active; int active;
char string[36]; char string[36];
void (* routine)(int temp1); MenuFunc routine;
} CP_itemtype; } CP_itemtype;
typedef struct { typedef struct {
......
...@@ -41,7 +41,7 @@ int buttonjoy[4]={bt_attack,bt_strafe,bt_use,bt_run}; ...@@ -41,7 +41,7 @@ int buttonjoy[4]={bt_attack,bt_strafe,bt_use,bt_run};
boolean buttonheld[NUMBUTTONS]; boolean buttonheld[NUMBUTTONS];
boolean demorecord,demoplayback; boolean demorecord,demoplayback;
char *demoptr, *lastdemoptr; byte *demoptr, *lastdemoptr;
memptr demobuffer; memptr demobuffer;
// //
......
...@@ -1400,5 +1400,3 @@ boolean SightPlayer (objtype *ob) ...@@ -1400,5 +1400,3 @@ boolean SightPlayer (objtype *ob)
return true; return true;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment