Commit 328d9220 authored by Steven Fuller's avatar Steven Fuller

Temp checkin.

id_vh.c, vi_*: added VL_DirectPlotFlush (used by FizzleFade) to just update
the screen

wl_act2.c, wl_def.h, wl_agent.c, wl_act3.h, wl_act3.c: moved all statetype
declarations to wl_act3.c/wl_act3.h

wl_act2.c, wl_state.c: removed some UPLOAD ifndefs (from when the older wl1
sound header was used)

wl_menu.c: fixed the music functions again (no more trying to free null
chunk warnings)

rest: most likely whitespace changes
parent 60d51311
...@@ -7,7 +7,7 @@ CFLAGS = -g -Wall ...@@ -7,7 +7,7 @@ CFLAGS = -g -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
OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \ OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \
wl_act1.o wl_act2.o wl_agent.o wl_game.o \ wl_act1.o wl_act2.o wl_act3.o wl_agent.o wl_game.o \
wl_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o \ wl_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o \
wl_debug.o gfxsave.o wl_debug.o gfxsave.o
ROBJS = wl_draw.o ROBJS = wl_draw.o
......
...@@ -20,7 +20,9 @@ SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]); ...@@ -20,7 +20,9 @@ SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]);
=> =>
SD_StartMusic(chunk); SD_StartMusic(chunk);
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
* serialize reads/writes
* fix fix fix different size stuff * fix fix fix different size stuff
works alright at some res, but breaks on most others currently
* add ylookup * add ylookup
* remove farmapylookup? * remove farmapylookup?
* would be nice if Quit() used vsnprintf, etc * would be nice if Quit() used vsnprintf, etc
......
...@@ -49,6 +49,7 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -49,6 +49,7 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
int pixperframe; int pixperframe;
unsigned x, y, p, frame; unsigned x, y, p, frame;
long rndval; long rndval;
int retr;
rndval = 1; rndval = 1;
pixperframe = 64000/frames; pixperframe = 64000/frames;
...@@ -61,9 +62,12 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -61,9 +62,12 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
if (vwidth != 320) if (vwidth != 320)
return false; return false;
retr = -1;
do { do {
if (abortable && IN_CheckAck()) if (abortable && IN_CheckAck())
return true; retr = true;
else
for (p = 0; p < pixperframe; p++) { for (p = 0; p < pixperframe; p++) {
y = (rndval & 0x00FF) - 1; y = (rndval & 0x00FF) - 1;
x = (rndval & 0x00FFFF00) >> 8; x = (rndval & 0x00FFFF00) >> 8;
...@@ -79,13 +83,22 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -79,13 +83,22 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
VL_DirectPlot(xx+x, yy+y, xx+x, yy+y); VL_DirectPlot(xx+x, yy+y, xx+x, yy+y);
if (rndval == 1) /* entire sequence has been completed */ if (rndval == 1) {
return false; /* entire sequence has been completed */
retr = false;
break;
}
} }
VL_DirectPlotFlush();
frame++; frame++;
while (get_TimeCount() < frame); while (get_TimeCount() < frame);
} while (1); } while (retr == -1);
VL_DirectPlotFlush();
return retr;
} }
void VL_FillPalette(int red, int green, int blue) void VL_FillPalette(int red, int green, int blue)
......
...@@ -25,7 +25,7 @@ void VL_MemToScreen(const byte *source, int width, int height, int x, int y); ...@@ -25,7 +25,7 @@ void VL_MemToScreen(const byte *source, int width, int height, int x, int y);
void VL_DeModeXize(byte *buf, int width, int height); void VL_DeModeXize(byte *buf, int width, int height);
void VL_DirectPlot(int x1, int y1, int x2, int y2); void VL_DirectPlot(int x1, int y1, int x2, int y2);
void VL_DirectPlotFlush();
#define MaxPlayers 4 #define MaxPlayers 4
#define MaxJoys 2 #define MaxJoys 2
......
...@@ -143,9 +143,6 @@ void VL_SetPalette(const byte *palette) ...@@ -143,9 +143,6 @@ void VL_SetPalette(const byte *palette)
SDL_SetColors(surface, colors, 0, 256); SDL_SetColors(surface, colors, 0, 256);
} }
//===========================================================================
/* /*
================= =================
= =
...@@ -168,7 +165,11 @@ void VL_GetPalette(byte *palette) ...@@ -168,7 +165,11 @@ void VL_GetPalette(byte *palette)
void VL_DirectPlot(int x1, int y1, int x2, int y2) void VL_DirectPlot(int x1, int y1, int x2, int y2)
{ {
*(((Uint8 *)surface->pixels) + x1 + y1 * vwidth) = *(gfxbuf + x2 + y2 * vwidth); *(((Uint8 *)surface->pixels) + x1 + y1 * vwidth) = *(gfxbuf + x2 + y2 * vwidth);
//SDL_UpdateRect(surface, x1,y1,x1,y1); }
void VL_DirectPlotFlush()
{
SDL_UpdateRect(surface, 0, 0, 0, 0);
} }
/* /*
......
...@@ -143,6 +143,10 @@ void VL_DirectPlot(int x1, int y1, int x2, int y2) ...@@ -143,6 +143,10 @@ void VL_DirectPlot(int x1, int y1, int x2, int y2)
*(graph_mem + x1 + y1 * 320) = *(gfxbuf + x2 + y2 * 320); *(graph_mem + x1 + y1 * 320) = *(gfxbuf + x2 + y2 * 320);
} }
void VL_DirectPlotFlush()
{
}
/* /*
============================================================================= =============================================================================
......
...@@ -526,6 +526,10 @@ void VL_DirectPlot(int x1, int y1, int x2, int y2) ...@@ -526,6 +526,10 @@ void VL_DirectPlot(int x1, int y1, int x2, int y2)
} }
} }
void VL_DirectPlotFlush()
{
}
/* /*
============================================================================= =============================================================================
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -41,12 +41,6 @@ objtype *LastAttacker; ...@@ -41,12 +41,6 @@ objtype *LastAttacker;
*/ */
void T_Player(objtype *ob);
void T_Attack(objtype *ob);
statetype s_player = {false,0,0,T_Player,NULL,NULL};
statetype s_attack = {false,0,0,T_Attack,NULL,NULL};
struct atkinf struct atkinf
{ {
char tics, attack, frame; // attack is 1 for gun, 2 for knife char tics, attack, frame; // attack is 1 for gun, 2 for knife
...@@ -62,13 +56,6 @@ void DrawWeapon (void); ...@@ -62,13 +56,6 @@ void DrawWeapon (void);
void GiveWeapon (int weapon); void GiveWeapon (int weapon);
void GiveAmmo (int ammo); void GiveAmmo (int ammo);
//===========================================================================
boolean TryMove (objtype *ob);
void T_Player (objtype *ob);
void ClipMove (objtype *ob, long xmove, long ymove);
/* /*
============================================================================= =============================================================================
...@@ -87,7 +74,7 @@ void ClipMove (objtype *ob, long xmove, long ymove); ...@@ -87,7 +74,7 @@ void ClipMove (objtype *ob, long xmove, long ymove);
====================== ======================
*/ */
void CheckWeaponChange (void) void CheckWeaponChange()
{ {
int i; int i;
...@@ -264,7 +251,6 @@ void UpdateFace() ...@@ -264,7 +251,6 @@ void UpdateFace()
} }
/* /*
=============== ===============
= =
...@@ -734,11 +720,11 @@ void GetBonus (statobj_t *check) ...@@ -734,11 +720,11 @@ void GetBonus (statobj_t *check)
= TryMove = TryMove
= =
= returns true if move ok = returns true if move ok
= debug: use pointers to optimize =
=================== ===================
*/ */
boolean TryMove (objtype *ob) boolean TryMove(objtype *ob)
{ {
int xl,yl,xh,yh,x,y; int xl,yl,xh,yh,x,y;
objtype *check; objtype *check;
...@@ -803,7 +789,7 @@ boolean TryMove (objtype *ob) ...@@ -803,7 +789,7 @@ boolean TryMove (objtype *ob)
=================== ===================
*/ */
void ClipMove (objtype *ob, long xmove, long ymove) void ClipMove(objtype *ob, long xmove, long ymove)
{ {
long basex,basey; long basex,basey;
...@@ -847,12 +833,11 @@ void ClipMove (objtype *ob, long xmove, long ymove) ...@@ -847,12 +833,11 @@ void ClipMove (objtype *ob, long xmove, long ymove)
=================== ===================
*/ */
void VictoryTile (void) void VictoryTile()
{ {
#ifndef SPEAR #ifndef SPEAR
SpawnBJVictory (); SpawnBJVictory();
#endif #endif
gamestate.victoryflag = true; gamestate.victoryflag = true;
} }
...@@ -870,14 +855,13 @@ void Thrust(int angle, long speed) ...@@ -870,14 +855,13 @@ void Thrust(int angle, long speed)
long xmove,ymove; long xmove,ymove;
unsigned offset; unsigned offset;
#ifdef SPEAR
// //
// ZERO FUNNY COUNTER IF MOVED! // ZERO FUNNY COUNTER IF MOVED!
// //
#ifdef SPEAR
if (speed) if (speed)
funnyticount = 0; funnyticount = 0;
#endif #endif
thrustspeed += speed; thrustspeed += speed;
// //
...@@ -919,7 +903,7 @@ void Thrust(int angle, long speed) ...@@ -919,7 +903,7 @@ void Thrust(int angle, long speed)
=============== ===============
*/ */
void Cmd_Fire (void) void Cmd_Fire()
{ {
buttonheld[bt_attack] = true; buttonheld[bt_attack] = true;
...@@ -946,7 +930,7 @@ void Cmd_Fire (void) ...@@ -946,7 +930,7 @@ void Cmd_Fire (void)
void Cmd_Use() void Cmd_Use()
{ {
int checkx,checky,doornum,dir; int checkx, checky, doornum, dir;
boolean elevatorok; boolean elevatorok;
// //
...@@ -1003,16 +987,16 @@ void Cmd_Use() ...@@ -1003,16 +987,16 @@ void Cmd_Use()
playstate = ex_secretlevel; playstate = ex_secretlevel;
else else
playstate = ex_completed; playstate = ex_completed;
SD_PlaySound (LEVELDONESND); SD_PlaySound(LEVELDONESND);
SD_WaitSoundDone(); SD_WaitSoundDone();
} }
else if (!buttonheld[bt_use] && doornum & 0x80) else if (!buttonheld[bt_use] && doornum & 0x80)
{ {
buttonheld[bt_use] = true; buttonheld[bt_use] = true;
OperateDoor (doornum & ~0x80); OperateDoor(doornum & ~0x80);
} }
else else
SD_PlaySound (DONOTHINGSND); SD_PlaySound(DONOTHINGSND);
} }
...@@ -1191,7 +1175,7 @@ void GunAttack(objtype *ob) ...@@ -1191,7 +1175,7 @@ void GunAttack(objtype *ob)
=============== ===============
*/ */
void VictorySpin (void) void VictorySpin()
{ {
long desty; long desty;
...@@ -1233,11 +1217,11 @@ void T_Attack(objtype *ob) ...@@ -1233,11 +1217,11 @@ void T_Attack(objtype *ob)
{ {
struct atkinf *cur; struct atkinf *cur;
UpdateFace (); UpdateFace();
if (gamestate.victoryflag) // watching the BJ actor if (gamestate.victoryflag) // watching the BJ actor
{ {
VictorySpin (); VictorySpin();
return; return;
} }
...@@ -1317,10 +1301,6 @@ void T_Attack(objtype *ob) ...@@ -1317,10 +1301,6 @@ void T_Attack(objtype *ob)
} }
//===========================================================================
/* /*
=============== ===============
= =
...@@ -1329,32 +1309,29 @@ void T_Attack(objtype *ob) ...@@ -1329,32 +1309,29 @@ void T_Attack(objtype *ob)
=============== ===============
*/ */
void T_Player (objtype *ob) void T_Player(objtype *ob)
{ {
if (gamestate.victoryflag) // watching the BJ actor if (gamestate.victoryflag) // watching the BJ actor
{ {
VictorySpin (); VictorySpin();
return; return;
} }
UpdateFace (); UpdateFace();
CheckWeaponChange (); CheckWeaponChange();
if ( buttonstate[bt_use] ) if (buttonstate[bt_use])
Cmd_Use (); Cmd_Use();
if ( buttonstate[bt_attack] && !buttonheld[bt_attack]) if (buttonstate[bt_attack] && !buttonheld[bt_attack])
Cmd_Fire (); Cmd_Fire();
ControlMovement (ob); ControlMovement(ob);
if (gamestate.victoryflag) // watching the BJ actor if (gamestate.victoryflag) // watching the BJ actor
return; return;
plux = player->x >> UNSIGNEDSHIFT; // scale to fit in unsigned plux = player->x >> UNSIGNEDSHIFT; // scale to fit in unsigned
pluy = player->y >> UNSIGNEDSHIFT; pluy = player->y >> UNSIGNEDSHIFT;
player->tilex = player->x >> TILESHIFT; // scale to tile values player->tilex = player->x >> TILESHIFT; // scale to tile values
player->tiley = player->y >> TILESHIFT; player->tiley = player->y >> TILESHIFT;
} }
...@@ -862,9 +862,6 @@ extern fixed viewsin,viewcos; ...@@ -862,9 +862,6 @@ extern fixed viewsin,viewcos;
extern int horizwall[],vertwall[]; extern int horizwall[],vertwall[];
extern unsigned pwallpos;
fixed FixedByFrac (fixed a, fixed b); fixed FixedByFrac (fixed a, fixed b);
void BuildTables (void); void BuildTables (void);
void CalcTics (void); void CalcTics (void);
...@@ -977,66 +974,6 @@ void InitAreas (void); ...@@ -977,66 +974,6 @@ void InitAreas (void);
============================================================================= =============================================================================
*/ */
extern statetype s_grddie1;
extern statetype s_dogdie1;
extern statetype s_ofcdie1;
extern statetype s_mutdie1;
extern statetype s_ssdie1;
extern statetype s_bossdie1;
extern statetype s_schabbdie1;
extern statetype s_fakedie1;
extern statetype s_mechadie1;
extern statetype s_hitlerdie1;
extern statetype s_greteldie1;
extern statetype s_giftdie1;
extern statetype s_fatdie1;
extern statetype s_spectredie1;
extern statetype s_angeldie1;
extern statetype s_transdie0;
extern statetype s_uberdie0;
extern statetype s_willdie1;
extern statetype s_deathdie1;
extern statetype s_grdchase1;
extern statetype s_dogchase1;
extern statetype s_ofcchase1;
extern statetype s_sschase1;
extern statetype s_mutchase1;
extern statetype s_bosschase1;
extern statetype s_schabbchase1;
extern statetype s_fakechase1;
extern statetype s_mechachase1;
extern statetype s_gretelchase1;
extern statetype s_giftchase1;
extern statetype s_fatchase1;
extern statetype s_spectrechase1;
extern statetype s_angelchase1;
extern statetype s_transchase1;
extern statetype s_uberchase1;
extern statetype s_willchase1;
extern statetype s_deathchase1;
extern statetype s_blinkychase1;
extern statetype s_hitlerchase1;
extern statetype s_grdpain;
extern statetype s_grdpain1;
extern statetype s_ofcpain;
extern statetype s_ofcpain1;
extern statetype s_sspain;
extern statetype s_sspain1;
extern statetype s_mutpain;
extern statetype s_mutpain1;
extern statetype s_deathcam;
extern statetype s_schabbdeathcam2;
extern statetype s_hitlerdeathcam2;
extern statetype s_giftdeathcam2;
extern statetype s_fatdeathcam2;
void A_DeathScream(objtype *ob); void A_DeathScream(objtype *ob);
void SpawnBJVictory(void); void SpawnBJVictory(void);
...@@ -1073,4 +1010,6 @@ void SpawnHitler (int tilex, int tiley); ...@@ -1073,4 +1010,6 @@ void SpawnHitler (int tilex, int tiley);
extern void HelpScreens(); extern void HelpScreens();
extern void EndText(); extern void EndText();
#include "wl_act3.h"
#endif #endif
...@@ -56,9 +56,10 @@ void EndSpear() ...@@ -56,9 +56,10 @@ void EndSpear()
WindowW = 320; WindowW = 320;
PrintX = 0; PrintX = 0;
PrintY = 180; PrintY = 180;
US_CPrint (STR_ENDGAME1"\n"); US_CPrint(STR_ENDGAME1"\n");
US_CPrint (STR_ENDGAME2); US_CPrint(STR_ENDGAME2);
VW_UpdateScreen (); VW_UpdateScreen();
IN_StartAck (); IN_StartAck ();
set_TimeCount(0); set_TimeCount(0);
while ( !IN_CheckAck () && (get_TimeCount() < 700) ); while ( !IN_CheckAck () && (get_TimeCount() < 700) );
...@@ -66,9 +67,10 @@ void EndSpear() ...@@ -66,9 +67,10 @@ void EndSpear()
PrintX = 0; PrintX = 0;
PrintY = 180; PrintY = 180;
VW_Bar(0,180,320,20,0); VW_Bar(0,180,320,20,0);
US_CPrint (STR_ENDGAME3"\n"); US_CPrint(STR_ENDGAME3"\n");
US_CPrint (STR_ENDGAME4); US_CPrint(STR_ENDGAME4);
VW_UpdateScreen (); VW_UpdateScreen();
IN_StartAck (); IN_StartAck ();
set_TimeCount(0); set_TimeCount(0);
while ( !IN_CheckAck () && (get_TimeCount() < 700) ); while ( !IN_CheckAck () && (get_TimeCount() < 700) );
...@@ -493,7 +495,7 @@ void LevelCompleted() ...@@ -493,7 +495,7 @@ void LevelCompleted()
}; };
CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END);
ClearSplitVWB (); // set up for double buffering in split screen ClearSplitVWB(); // set up for double buffering in split screen
VW_Bar (0,0,320,200-STATUSLINES,127); VW_Bar (0,0,320,200-STATUSLINES,127);
StartCPMusic(ENDLEVEL_MUS); StartCPMusic(ENDLEVEL_MUS);
...@@ -814,14 +816,14 @@ void LevelCompleted() ...@@ -814,14 +816,14 @@ void LevelCompleted()
#ifdef SPEARDEMO #ifdef SPEARDEMO
if (gamestate.mapon == 1) if (gamestate.mapon == 1)
{ {
SD_PlaySound (BONUS1UPSND); SD_PlaySound(BONUS1UPSND);
CA_CacheGrChunk (STARTFONT+1); CA_CacheGrChunk(STARTFONT+1);
Message ("This concludes your demo\n" Message("This concludes your demo\n"
"of Spear of Destiny! Now,\n" "of Spear of Destiny! Now,\n"
"go to your local software\n" "go to your local software\n"
"store and buy it!"); "store and buy it!");
CA_UnCacheGrChunk (STARTFONT+1); CA_UnCacheGrChunk(STARTFONT+1);
IN_ClearKeysDown(); IN_ClearKeysDown();
IN_Ack(); IN_Ack();
...@@ -933,14 +935,14 @@ void DrawHighScores() ...@@ -933,14 +935,14 @@ void DrawHighScores()
fontnumber = 0; fontnumber = 0;
#else #else
CacheLump (BACKDROP_LUMP_START,BACKDROP_LUMP_END); CacheLump(BACKDROP_LUMP_START,BACKDROP_LUMP_END);
ClearMScreen(); ClearMScreen();
DrawStripes(10); DrawStripes(10);
UnCacheLump (BACKDROP_LUMP_START,BACKDROP_LUMP_END); UnCacheLump(BACKDROP_LUMP_START,BACKDROP_LUMP_END);
CacheLump (HIGHSCORES_LUMP_START,HIGHSCORES_LUMP_END); CacheLump(HIGHSCORES_LUMP_START,HIGHSCORES_LUMP_END);
CA_CacheGrChunk (STARTFONT+1); CA_CacheGrChunk(STARTFONT+1);
VWB_DrawPic (0,0,HIGHSCORESPIC); VWB_DrawPic(0,0,HIGHSCORESPIC);
fontnumber = 1; fontnumber = 1;
#endif #endif
...@@ -979,15 +981,13 @@ void DrawHighScores() ...@@ -979,15 +981,13 @@ void DrawHighScores()
PrintX = 194 - w; PrintX = 194 - w;
#endif #endif
#ifndef UPLOAD #if !defined(UPLOAD) || !defined(SPEAR)
#ifndef SPEAR
PrintX -= 6; PrintX -= 6;
itoa(s->episode+1,buffer1,10); itoa(s->episode+1,buffer1,10);
US_Print("E"); US_Print("E");
US_Print(buffer1); US_Print(buffer1);
US_Print("/L"); US_Print("/L");
#endif #endif
#endif
#ifdef SPEAR #ifdef SPEAR
if (s->completed == 21) if (s->completed == 21)
...@@ -1015,14 +1015,11 @@ void DrawHighScores() ...@@ -1015,14 +1015,11 @@ void DrawHighScores()
VW_UpdateScreen(); VW_UpdateScreen();
#ifdef SPEAR #ifdef SPEAR
UnCacheLump (HIGHSCORES_LUMP_START,HIGHSCORES_LUMP_END); UnCacheLump(HIGHSCORES_LUMP_START, HIGHSCORES_LUMP_END);
fontnumber = 0; fontnumber = 0;
#endif #endif
} }
//===========================================================================
/* /*
======================= =======================
= =
...@@ -1031,27 +1028,22 @@ void DrawHighScores() ...@@ -1031,27 +1028,22 @@ void DrawHighScores()
======================= =======================
*/ */
void CheckHighScore (long score,word other) void CheckHighScore(long score, word other)
{ {
word i,j; word i, j;
int n; int n;
HighScore myscore; HighScore myscore;
strcpy(myscore.name,""); strcpy(myscore.name, "");
myscore.score = score; myscore.score = score;
myscore.episode = gamestate.episode; myscore.episode = gamestate.episode;
myscore.completed = other; myscore.completed = other;
for (i = 0,n = -1;i < MaxScores;i++) for (i = 0, n = -1; i < MaxScores;i++)
{ {
if if ((myscore.score > Scores[i].score) ||
( ((myscore.score == Scores[i].score) &&
(myscore.score > Scores[i].score) (myscore.completed > Scores[i].completed)))
|| (
(myscore.score == Scores[i].score)
&& (myscore.completed > Scores[i].completed)
)
)
{ {
for (j = MaxScores;--j > i;) for (j = MaxScores;--j > i;)
Scores[j] = Scores[j - 1]; Scores[j] = Scores[j - 1];
...@@ -1062,13 +1054,13 @@ void CheckHighScore (long score,word other) ...@@ -1062,13 +1054,13 @@ void CheckHighScore (long score,word other)
} }
#ifdef SPEAR #ifdef SPEAR
StartCPMusic (XAWARD_MUS); StartCPMusic(XAWARD_MUS);
#else #else
StartCPMusic (ROSTER_MUS); StartCPMusic(ROSTER_MUS);
#endif #endif
DrawHighScores (); DrawHighScores();
VW_FadeIn (); VW_FadeIn();
if (n != -1) if (n != -1)
{ {
...@@ -1085,7 +1077,7 @@ void CheckHighScore (long score,word other) ...@@ -1085,7 +1077,7 @@ void CheckHighScore (long score,word other)
PrintX = 16; PrintX = 16;
fontnumber = 1; fontnumber = 1;
VW_Bar(PrintX-2,PrintY-2,145,15,0x9c); VW_Bar(PrintX-2,PrintY-2,145,15,0x9c);
VW_UpdateScreen (); VW_UpdateScreen();
backcolor = 0x9c; backcolor = 0x9c;
fontcolor = 15; fontcolor = 15;
US_LineInput(PrintX,PrintY,Scores[n].name,NULL,true,MaxHighName,130); US_LineInput(PrintX,PrintY,Scores[n].name,NULL,true,MaxHighName,130);
...@@ -1093,7 +1085,7 @@ void CheckHighScore (long score,word other) ...@@ -1093,7 +1085,7 @@ void CheckHighScore (long score,word other)
} }
else else
{ {
IN_ClearKeysDown (); IN_ClearKeysDown();
IN_UserInput(500); IN_UserInput(500);
} }
......
...@@ -282,9 +282,9 @@ void DiskFlopAnim(int x, int y) ...@@ -282,9 +282,9 @@ void DiskFlopAnim(int x, int y)
long DoChecksum(byte *source, unsigned size, long checksum) long DoChecksum(byte *source, unsigned size, long checksum)
{ {
unsigned i; int i;
for (i=0;i<size-1;i++) for (i = 0; i < size-1; i++)
checksum += source[i]^source[i+1]; checksum += source[i]^source[i+1];
return checksum; return checksum;
...@@ -427,9 +427,9 @@ boolean LoadTheGame(int file,int x,int y) ...@@ -427,9 +427,9 @@ boolean LoadTheGame(int file,int x,int y)
if (nullobj.active == ac_badobject) if (nullobj.active == ac_badobject)
break; break;
GetNewActor (); GetNewActor();
// don't copy over the links // don't copy over the links
memcpy(new,&nullobj,sizeof(nullobj)-4); memcpy(new, &nullobj, sizeof(nullobj)-4);
} }
......
...@@ -440,7 +440,7 @@ void US_ControlPanel(byte scancode) ...@@ -440,7 +440,7 @@ void US_ControlPanel(byte scancode)
#ifdef SPEAR #ifdef SPEAR
UnCacheLump (OPTIONS_LUMP_START,OPTIONS_LUMP_END); UnCacheLump (OPTIONS_LUMP_START,OPTIONS_LUMP_END);
MM_SortMem (); MM_SortMem();
#endif #endif
} }
...@@ -1344,7 +1344,6 @@ int CP_SaveGame(int quick) ...@@ -1344,7 +1344,6 @@ int CP_SaveGame(int quick)
if (SaveGamesAvail[which]) if (SaveGamesAvail[which])
{ {
name[7]=which+'0'; name[7]=which+'0';
unlink(name);
handle=creat(name,S_IREAD|S_IWRITE); handle=creat(name,S_IREAD|S_IWRITE);
strcpy(input,&SaveGameNames[which][0]); strcpy(input,&SaveGameNames[which][0]);
...@@ -1399,16 +1398,15 @@ int CP_SaveGame(int quick) ...@@ -1399,16 +1398,15 @@ int CP_SaveGame(int quick)
if (US_LineInput(LSM_X+LSItems.indent+2,LSM_Y+which*13+1,input,input,true,31,LSM_W-LSItems.indent-30)) if (US_LineInput(LSM_X+LSItems.indent+2,LSM_Y+which*13+1,input,input,true,31,LSM_W-LSItems.indent-30))
{ {
SaveGamesAvail[which]=1; SaveGamesAvail[which] = 1;
strcpy(&SaveGameNames[which][0],input); strcpy(&SaveGameNames[which][0],input);
unlink(name); handle = creat(name, S_IREAD|S_IWRITE);
handle=creat(name,S_IREAD|S_IWRITE); nwritten = write(handle, (void *)input, 32);
nwritten = write(handle,(void *)input,32); lseek(handle, 32, SEEK_SET);
lseek(handle,32,SEEK_SET);
DrawLSAction(1); DrawLSAction(1);
SaveTheGame(handle,LSA_X+8,LSA_Y+5); SaveTheGame(handle, LSA_X+8, LSA_Y+5);
close(handle); close(handle);
...@@ -3244,7 +3242,6 @@ void StartCPMusic(int song) ...@@ -3244,7 +3242,6 @@ void StartCPMusic(int song)
lastmusic = song; lastmusic = song;
CA_CacheAudioChunk(STARTMUSIC + song); CA_CacheAudioChunk(STARTMUSIC + song);
MM_SetLock((memptr *)&(audiosegs[STARTMUSIC + song]), true);
SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + song]); SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + song]);
} }
...@@ -3252,8 +3249,10 @@ void FreeMusic() ...@@ -3252,8 +3249,10 @@ void FreeMusic()
{ {
SD_MusicOff(); SD_MusicOff();
if (lastmusic >= 0) if (lastmusic >= 0) {
CA_UnCacheAudioChunk(STARTMUSIC + lastmusic); CA_UnCacheAudioChunk(STARTMUSIC + lastmusic);
lastmusic = -1;
}
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
......
...@@ -1104,7 +1104,7 @@ void FinishPaletteShifts (void) ...@@ -1104,7 +1104,7 @@ void FinishPaletteShifts (void)
===================== =====================
*/ */
void DoActor (objtype *ob) void DoActor(objtype *ob)
{ {
void (*think)(objtype *); void (*think)(objtype *);
...@@ -1134,7 +1134,7 @@ void DoActor (objtype *ob) ...@@ -1134,7 +1134,7 @@ void DoActor (objtype *ob)
if (ob->flags&FL_NEVERMARK) if (ob->flags&FL_NEVERMARK)
return; return;
if ( (ob->flags&FL_NONMARK) && actorat[ob->tilex][ob->tiley]) if ((ob->flags&FL_NONMARK) && actorat[ob->tilex][ob->tiley])
return; return;
actorat[ob->tilex][ob->tiley] = ob; actorat[ob->tilex][ob->tiley] = ob;
...@@ -1153,7 +1153,7 @@ void DoActor (objtype *ob) ...@@ -1153,7 +1153,7 @@ void DoActor (objtype *ob)
think (ob); think (ob);
if (!ob->state) if (!ob->state)
{ {
RemoveObj (ob); RemoveObj(ob);
return; return;
} }
} }
...@@ -1185,7 +1185,7 @@ think: ...@@ -1185,7 +1185,7 @@ think:
think (ob); think (ob);
if (!ob->state) if (!ob->state)
{ {
RemoveObj (ob); RemoveObj(ob);
return; return;
} }
} }
...@@ -1193,7 +1193,7 @@ think: ...@@ -1193,7 +1193,7 @@ think:
if (ob->flags&FL_NEVERMARK) if (ob->flags&FL_NEVERMARK)
return; return;
if ( (ob->flags&FL_NONMARK) && actorat[ob->tilex][ob->tiley]) if ((ob->flags&FL_NONMARK) && actorat[ob->tilex][ob->tiley])
return; return;
actorat[ob->tilex][ob->tiley] = ob; actorat[ob->tilex][ob->tiley] = ob;
......
...@@ -1214,25 +1214,19 @@ void FirstSighting (objtype *ob) ...@@ -1214,25 +1214,19 @@ void FirstSighting (objtype *ob)
break; break;
case gretelobj: case gretelobj:
#ifndef UPLOAD
SD_PlaySound(KEINSND); SD_PlaySound(KEINSND);
#endif
NewState (ob,&s_gretelchase1); NewState (ob,&s_gretelchase1);
ob->speed *= 3; // go faster when chasing player ob->speed *= 3; // go faster when chasing player
break; break;
case giftobj: case giftobj:
#ifndef UPLOAD
SD_PlaySound(EINESND); SD_PlaySound(EINESND);
#endif
NewState (ob,&s_giftchase1); NewState (ob,&s_giftchase1);
ob->speed *= 3; // go faster when chasing player ob->speed *= 3; // go faster when chasing player
break; break;
case fatobj: case fatobj:
#ifndef UPLOAD
SD_PlaySound(ERLAUBENSND); SD_PlaySound(ERLAUBENSND);
#endif
NewState (ob,&s_fatchase1); NewState (ob,&s_fatchase1);
ob->speed *= 3; // go faster when chasing player ob->speed *= 3; // go faster when chasing player
break; break;
......
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