mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-16 04:30:38 +00:00
- ported the load level screen and deleted some dead code in game.cpp
This commit is contained in:
parent
aa8113cf06
commit
f0150569a4
7 changed files with 188 additions and 688 deletions
|
@ -3,7 +3,6 @@ set( PCH_SOURCES
|
|||
src/2d.cpp
|
||||
src/actor.cpp
|
||||
src/ai.cpp
|
||||
src/anim.cpp
|
||||
src/border.cpp
|
||||
src/break.cpp
|
||||
src/bunny.cpp
|
||||
|
|
|
@ -36,6 +36,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
#include "misc.h"
|
||||
#include "network.h"
|
||||
#include "pal.h"
|
||||
#include "demo.h"
|
||||
|
||||
|
||||
BEGIN_SW_NS
|
||||
|
@ -95,6 +96,129 @@ void Logo(const CompletionFunc& completion)
|
|||
else completion(false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
DScreenJob* GetFinishAnim(int num)
|
||||
{
|
||||
static const AnimSound serpsound[] =
|
||||
{
|
||||
{ 1, DIGI_SERPTAUNTWANG },
|
||||
{ 16, DIGI_SHAREND_TELEPORT },
|
||||
{ 35, DIGI_WANGTAUNTSERP1 },
|
||||
{ 51, DIGI_SHAREND_UGLY1 },
|
||||
{ 64, DIGI_SHAREND_UGLY2 },
|
||||
{ -1, -1 }
|
||||
};
|
||||
static const int serpzillaframetimes[] = { 16, 16, 136 };
|
||||
|
||||
static const AnimSound sumosound[] =
|
||||
{
|
||||
{ 2, DIGI_JG41012 },
|
||||
{ 30, DIGI_HOTHEADSWITCH },
|
||||
{ 42, DIGI_HOTHEADSWITCH },
|
||||
{ 59, DIGI_JG41028 },
|
||||
{ -1, -1 }
|
||||
};
|
||||
static const int sumoframetimes[] = { 40, 10, 130 };
|
||||
|
||||
static const AnimSound zillasound[] =
|
||||
{
|
||||
{ 1, DIGI_ZC1 },
|
||||
{ 5, DIGI_JG94024 },
|
||||
{ 14, DIGI_ZC2 },
|
||||
{ 30, DIGI_ZC3 },
|
||||
{ 32, DIGI_ZC4 },
|
||||
{ 37, DIGI_ZC5 },
|
||||
{ 63, DIGI_Z16043 },
|
||||
{ 63, DIGI_ZC6 },
|
||||
{ 63, DIGI_ZC7 },
|
||||
{ 72, DIGI_ZC7 },
|
||||
{ 73, DIGI_ZC4 },
|
||||
{ 77, DIGI_ZC5 },
|
||||
{ 87, DIGI_ZC8 },
|
||||
{ 103, DIGI_ZC7 },
|
||||
{ 108, DIGI_ZC9 },
|
||||
{ 120, DIGI_JG94039 },
|
||||
{ -1, -1 }
|
||||
};
|
||||
|
||||
static const char* const ANIMname[] =
|
||||
{
|
||||
"swend.anm",
|
||||
"sumocinm.anm",
|
||||
"zfcin.anm",
|
||||
};
|
||||
|
||||
switch (num)
|
||||
{
|
||||
case ANIM_SERP: return PlayVideo("swend.anm", serpsound, serpzillaframetimes);
|
||||
case ANIM_SUMO: return PlayVideo("sumocinm.anm", sumosound, sumoframetimes);
|
||||
case ANIM_ZILLA:return PlayVideo("zfcin.anm", zillasound, serpzillaframetimes);
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class DSWCreditsScreen : public DScreenJob
|
||||
{
|
||||
enum
|
||||
{
|
||||
CREDITS1_PIC = 5111,
|
||||
CREDITS2_PIC = 5118
|
||||
};
|
||||
int state = 0;
|
||||
int starttime;
|
||||
int curpic;
|
||||
|
||||
int Frame(uint64_t clock, bool skiprequest)
|
||||
{
|
||||
twod->ClearScreen();
|
||||
int seconds = int(clock * 120 / 1'000'000'000);
|
||||
if (clock == 0)
|
||||
{
|
||||
// Lo Wang feel like singing!
|
||||
PlaySound(DIGI_JG95012, v3df_none, CHAN_VOICE, CHANF_UI);
|
||||
}
|
||||
if (state == 0)
|
||||
{
|
||||
if (skiprequest || !soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE))
|
||||
{
|
||||
skiprequest = false;
|
||||
starttime = seconds;
|
||||
state = 1;
|
||||
StopSound();
|
||||
curpic = CREDITS1_PIC;
|
||||
|
||||
// try 14 then 2 then quit
|
||||
if (!PlaySong(nullptr, ThemeSongs[5], ThemeTrack[5], true))
|
||||
{
|
||||
PlaySong(nullptr, nullptr, 2, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (seconds >= starttime + 8)
|
||||
{
|
||||
curpic = CREDITS1_PIC + CREDITS2_PIC - curpic;
|
||||
starttime = seconds;
|
||||
}
|
||||
DrawTexture(twod, tileGetTexture(curpic, true), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE);
|
||||
}
|
||||
if (skiprequest) StopSound();
|
||||
return skiprequest ? -1 : 1;
|
||||
}
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Summary screen
|
||||
|
@ -448,4 +572,55 @@ class DSWMultiSummaryScreen : public DScreenJob
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void SybexScreen(CompletionFunc completion)
|
||||
{
|
||||
if (!SW_SHAREWARE || CommEnabled) completion(false);
|
||||
else
|
||||
{
|
||||
JobDesc job = { Create<DImageScreen>(tileGetTexture(5261), DScreenJob::fadein | DScreenJob::fadeout, 0x7fffffff) };
|
||||
RunScreenJob(&job, 1, completion, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class DSWLoadScreen : public DScreenJob
|
||||
{
|
||||
std::function<int(void)> callback;
|
||||
MapRecord* rec;
|
||||
|
||||
public:
|
||||
DSWLoadScreen(MapRecord* maprec, std::function<int(void)> callback_) : DScreenJob(fadein | fadeout), callback(callback_), rec(maprec) {}
|
||||
|
||||
int Frame(uint64_t clock, bool skiprequest)
|
||||
{
|
||||
const int TITLE_PIC = 2324;
|
||||
twod->ClearScreen();
|
||||
DrawTexture(twod, tileGetTexture(TITLE_PIC), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE);
|
||||
|
||||
MNU_DrawString(160, 170, DemoMode ? GStrings("TXT_LBDEMO") : GStrings("TXT_ENTERING"), 1, 16, 0);
|
||||
MNU_DrawString(160, 180, currentLevel->DisplayName(), 1, 16, 0);
|
||||
|
||||
// Initiate the level load once the page has been faded in completely.
|
||||
if (callback && GetFadeState() == visible)
|
||||
{
|
||||
callback();
|
||||
callback = nullptr;
|
||||
}
|
||||
if (clock > 5'000'000'000) return 0; // make sure the screen stays long enough to be seen.
|
||||
return skiprequest ? -1 : 1;
|
||||
}
|
||||
};
|
||||
|
||||
END_SW_NS
|
||||
|
|
|
@ -1,325 +0,0 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Shadow Warrior version 1.2
|
||||
|
||||
Shadow Warrior is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Original Source: 1997 - Frank Maddin and Jim Norwood
|
||||
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#include "ns.h"
|
||||
#include "build.h"
|
||||
|
||||
|
||||
#include "mytypes.h"
|
||||
#include "gamedefs.h"
|
||||
|
||||
#include "sounds.h"
|
||||
#include "gamecontrol.h"
|
||||
|
||||
#include "game.h"
|
||||
#include "misc.h"
|
||||
#include "network.h"
|
||||
|
||||
#include "animlib.h"
|
||||
#include "anim.h"
|
||||
#include "../glbackend/glbackend.h"
|
||||
#include "v_2ddrawer.h"
|
||||
#include "animtexture.h"
|
||||
#include "screenjob.h"
|
||||
#include "raze_music.h"
|
||||
|
||||
|
||||
BEGIN_SW_NS
|
||||
|
||||
#define MAX_ANMS 10
|
||||
anim_t *anm_ptr[MAX_ANMS];
|
||||
|
||||
int ANIMnumframes;
|
||||
unsigned char ANIMpal[3*256];
|
||||
unsigned char ANIMnum = 0;
|
||||
short SoundState;
|
||||
static TArray<uint8_t> buffer;
|
||||
|
||||
const char *ANIMname[] =
|
||||
{
|
||||
"sw.anm",
|
||||
"swend.anm",
|
||||
"sumocinm.anm",
|
||||
"zfcin.anm",
|
||||
};
|
||||
|
||||
#define ANIM_TILE(num) (MAXTILES-11 + (num))
|
||||
|
||||
|
||||
void AnimSerp(int frame, int numframes)
|
||||
{
|
||||
int zero=0;
|
||||
ototalclock += 16;
|
||||
|
||||
if (frame == numframes-1)
|
||||
ototalclock += 1*120;
|
||||
|
||||
if (frame == 1)
|
||||
{
|
||||
PlaySound(DIGI_SERPTAUNTWANG, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 16)
|
||||
{
|
||||
PlaySound(DIGI_SHAREND_TELEPORT, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 35)
|
||||
{
|
||||
SoundState++;
|
||||
PlaySound(DIGI_WANGTAUNTSERP1, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 51)
|
||||
{
|
||||
SoundState++;
|
||||
PlaySound(DIGI_SHAREND_UGLY1, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 64)
|
||||
{
|
||||
SoundState++;
|
||||
PlaySound(DIGI_SHAREND_UGLY2, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
}
|
||||
|
||||
void AnimSumo(int frame, int numframes)
|
||||
{
|
||||
int zero=0;
|
||||
ototalclock += 10;
|
||||
|
||||
if (frame == numframes-1)
|
||||
ototalclock += 1*120;
|
||||
|
||||
if (frame == 1)
|
||||
ototalclock += 30;
|
||||
|
||||
if (frame == 2)
|
||||
{
|
||||
// hungry
|
||||
PlaySound(DIGI_JG41012, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 30)
|
||||
{
|
||||
PlaySound(DIGI_HOTHEADSWITCH, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 42)
|
||||
{
|
||||
PlaySound(DIGI_HOTHEADSWITCH, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 59)
|
||||
{
|
||||
PlaySound(DIGI_JG41028, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
}
|
||||
|
||||
void AnimZilla(int frame, int numframes)
|
||||
{
|
||||
int zero=0;
|
||||
ototalclock += 16;
|
||||
|
||||
if (frame == numframes-1)
|
||||
ototalclock += 1*120;
|
||||
|
||||
if (frame == 1)
|
||||
{
|
||||
PlaySound(DIGI_ZC1, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 5)
|
||||
{
|
||||
PlaySound(DIGI_JG94024, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 14)
|
||||
{
|
||||
PlaySound(DIGI_ZC2, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 30)
|
||||
{
|
||||
PlaySound(DIGI_ZC3, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 32)
|
||||
{
|
||||
PlaySound(DIGI_ZC4, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 37)
|
||||
{
|
||||
PlaySound(DIGI_ZC5, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 63)
|
||||
{
|
||||
PlaySound(DIGI_Z16043, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
PlaySound(DIGI_ZC6, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
PlaySound(DIGI_ZC7, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 72)
|
||||
{
|
||||
PlaySound(DIGI_ZC7, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 73)
|
||||
{
|
||||
PlaySound(DIGI_ZC4, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 77)
|
||||
{
|
||||
PlaySound(DIGI_ZC5, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 87)
|
||||
{
|
||||
PlaySound(DIGI_ZC8, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 103)
|
||||
{
|
||||
PlaySound(DIGI_ZC7, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 108)
|
||||
{
|
||||
PlaySound(DIGI_ZC9, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
else if (frame == 120)
|
||||
{
|
||||
PlaySound(DIGI_JG94039, v3df_none, CHAN_BODY, CHANF_UI);
|
||||
}
|
||||
}
|
||||
|
||||
// Used nowhere else anymore, will go away with the rest of this file.
|
||||
static void rotatesprite_fs(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
|
||||
int8_t dashade, uint8_t dapalnum, int32_t dastat, FGameTexture* pic = nullptr, int basepal = 0)
|
||||
{
|
||||
rotatesprite_(sx, sy, z, a, picnum, dashade, dapalnum, dastat, 0, 0, 0,0,xdim-1,ydim-1, pic, basepal);
|
||||
}
|
||||
|
||||
void
|
||||
playanm(short anim_num)
|
||||
{
|
||||
unsigned char *animbuf;
|
||||
int i, length = 0, numframes = 0;
|
||||
int32_t handle = -1;
|
||||
|
||||
ANIMnum = anim_num;
|
||||
|
||||
inputState.ClearAllInput();
|
||||
|
||||
DSPRINTF(ds,"PlayAnm");
|
||||
MONO_PRINT(ds);
|
||||
|
||||
DSPRINTF(ds,"PlayAnm");
|
||||
MONO_PRINT(ds);
|
||||
|
||||
TArray<uint8_t> buffer;
|
||||
auto fr = fileSystem.OpenFileReader(ANIMname[ANIMnum]);
|
||||
|
||||
if (!fr.isOpen())
|
||||
goto ENDOFANIMLOOP;
|
||||
|
||||
buffer = fr.ReadPadded(1);
|
||||
fr.Close();
|
||||
|
||||
DSPRINTF(ds,"PlayAnm - Palette Stuff");
|
||||
MONO_PRINT(ds);
|
||||
anim_t anm;
|
||||
|
||||
if (ANIM_LoadAnim(&anm, buffer.Data(), buffer.Size() - 1) < 0)
|
||||
{
|
||||
Printf("Error: malformed ANM file \"%s\".\n", ANIMname[ANIMnum]);
|
||||
goto ENDOFANIMLOOP;
|
||||
}
|
||||
|
||||
ANIMnumframes = ANIM_NumFrames(&anm);
|
||||
numframes = ANIMnumframes;
|
||||
|
||||
|
||||
videoClearViewableArea(0L);
|
||||
|
||||
{
|
||||
AnimTextures animtex;
|
||||
animtex.SetSize(AnimTexture::Paletted, 320, 200);
|
||||
if (ANIMnum == 1)
|
||||
{
|
||||
// draw the first frame
|
||||
animtex.SetFrame(ANIM_GetPalette(&anm), ANIM_DrawFrame(&anm, 1));
|
||||
rotatesprite_fs(160 << 16, 100 << 16, 65536, 0, -1, 0, 0, 2 | 8 | 64, animtex.GetFrame());
|
||||
}
|
||||
|
||||
SoundState = 0;
|
||||
//ototalclock = totalclock + 120*2;
|
||||
ototalclock = (int32_t)totalclock;
|
||||
|
||||
for (i = 1; i < numframes; i++)
|
||||
{
|
||||
while (totalclock < ototalclock)
|
||||
{
|
||||
handleevents();
|
||||
switch (ANIMnum)
|
||||
{
|
||||
case ANIM_INTRO:
|
||||
case ANIM_SERP:
|
||||
if (inputState.CheckAllInput())
|
||||
{
|
||||
goto ENDOFANIMLOOP;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
getpackets();
|
||||
}
|
||||
|
||||
switch (ANIMnum)
|
||||
{
|
||||
case ANIM_INTRO:
|
||||
//AnimShareIntro(i, numframes);
|
||||
break;
|
||||
case ANIM_SERP:
|
||||
AnimSerp(i, numframes);
|
||||
break;
|
||||
case ANIM_SUMO:
|
||||
AnimSumo(i, numframes);
|
||||
break;
|
||||
case ANIM_ZILLA:
|
||||
AnimZilla(i, numframes);
|
||||
break;
|
||||
}
|
||||
|
||||
videoClearViewableArea(0L);
|
||||
animtex.SetFrame(ANIM_GetPalette(&anm), ANIM_DrawFrame(&anm, i));
|
||||
rotatesprite_fs(160 << 16, 100 << 16, 65536, 0, -1, 0, 0, 2 | 8 | 64, animtex.GetFrame());
|
||||
videoNextPage();
|
||||
handleevents();
|
||||
if (inputState.CheckAllInput())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// pause on final frame
|
||||
while (totalclock < ototalclock)
|
||||
{
|
||||
handleevents();
|
||||
getpackets();
|
||||
}
|
||||
|
||||
ENDOFANIMLOOP:
|
||||
|
||||
twod->ClearScreen();
|
||||
videoNextPage();
|
||||
|
||||
inputState.ClearAllInput();
|
||||
}
|
||||
END_SW_NS
|
|
@ -1,35 +0,0 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Shadow Warrior version 1.2
|
||||
|
||||
Shadow Warrior is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Original Source: 1997 - Frank Maddin and Jim Norwood
|
||||
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
BEGIN_SW_NS
|
||||
|
||||
#define ANIM_INTRO 0
|
||||
#define ANIM_SERP 1
|
||||
#define ANIM_SUMO 2
|
||||
#define ANIM_ZILLA 3
|
||||
|
||||
unsigned char *LoadAnm(short anim_num, int *);
|
||||
void playanm(short anim_num);
|
||||
END_SW_NS
|
|
@ -25,20 +25,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
//-------------------------------------------------------------------------
|
||||
|
||||
#include "ns.h"
|
||||
// CTW NOTE
|
||||
/*
|
||||
Known remaining issues:
|
||||
- Audio stuttering.
|
||||
- CD Audio not looping properly (currently hard coded to restart about every 200 seconds.
|
||||
- Hitting F5 to change resolution causes a crash (currently disabled).
|
||||
- Multiplayer untested.
|
||||
|
||||
Things required to make savegames work:
|
||||
- Load makesym.wpj and build it.
|
||||
- In a DOS prompt, run "makesym sw.map swdata.map swcode.map"
|
||||
- Copy swcode.map to swcode.sym and swdata.map to swdata.sym
|
||||
*/
|
||||
// CTW NOTE END
|
||||
|
||||
#define MAIN
|
||||
#define QUIET
|
||||
|
@ -73,8 +59,6 @@ Things required to make savegames work:
|
|||
#include "misc.h"
|
||||
//#include "exports.h"
|
||||
|
||||
#include "anim.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "break.h"
|
||||
#include "ninja.h"
|
||||
|
@ -124,7 +108,6 @@ extern int sw_snd_scratch;
|
|||
#define BETA 0
|
||||
#endif
|
||||
|
||||
#define TITLE_PIC 2324
|
||||
#define TITLE_ROT_FLAGS (RS_TOPLEFT|ROTATE_SPRITE_SCREEN_CLIP|ROTATE_SPRITE_NON_MASK)
|
||||
#define PAL_SIZE (256*3)
|
||||
|
||||
|
@ -283,6 +266,7 @@ int SyncScreenJob()
|
|||
{
|
||||
while (gamestate == GS_INTERMISSION || gamestate == GS_INTRO)
|
||||
{
|
||||
DoUpdateSounds();
|
||||
handleevents();
|
||||
updatePauseStatus();
|
||||
D_ProcessEvents();
|
||||
|
@ -333,13 +317,6 @@ Distance(int x1, int y1, int x2, int y2)
|
|||
return x2 + y2 - DIV2(min);
|
||||
}
|
||||
|
||||
void
|
||||
setup2dscreen(void)
|
||||
{
|
||||
// qsetmode640350();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TerminateGame(void)
|
||||
{
|
||||
|
@ -351,8 +328,7 @@ void TerminateGame(void)
|
|||
|
||||
if (CleanExit)
|
||||
{
|
||||
SybexScreen();
|
||||
//TenScreen();
|
||||
//SybexScreen();
|
||||
}
|
||||
throw CExitEvent(3);
|
||||
}
|
||||
|
@ -372,44 +348,6 @@ bool LoadLevel(const char *filename)
|
|||
return true;
|
||||
}
|
||||
|
||||
void LoadDemoRun(void)
|
||||
{
|
||||
short i;
|
||||
FILE *fin;
|
||||
|
||||
fin = fopen("demos.run","r");
|
||||
if (fin)
|
||||
{
|
||||
memset(DemoName,'\0',sizeof(DemoName));
|
||||
for (i = 0; i < ARRAY_SSIZE(DemoName); i++)
|
||||
{
|
||||
if (fscanf(fin, "%s", DemoName[i]) == EOF)
|
||||
break;
|
||||
}
|
||||
if (i == ARRAY_SSIZE(DemoName))
|
||||
Printf("WARNING: demos.run is too long, ignoring remaining files\n");
|
||||
|
||||
fclose(fin);
|
||||
}
|
||||
|
||||
memset(DemoText,'\0',sizeof(DemoText));
|
||||
fin = fopen("demotxt.run","r");
|
||||
if (fin)
|
||||
{
|
||||
fgets(ds, 6, fin);
|
||||
sscanf(ds,"%d",&DemoTextYstart);
|
||||
for (i = 0; i < ARRAY_SSIZE(DemoText); i++)
|
||||
{
|
||||
if (fgets(DemoText[i], SIZ(DemoText[0])-1, fin) == NULL)
|
||||
break;
|
||||
}
|
||||
if (i == ARRAY_SSIZE(DemoText))
|
||||
Printf("WARNING: demotxt.run is too long, trimming the text\n");
|
||||
|
||||
fclose(fin);
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayDemoText(void)
|
||||
{
|
||||
short w,h;
|
||||
|
@ -456,30 +394,6 @@ void InitAutoNet(void)
|
|||
}
|
||||
|
||||
|
||||
void AnimateCacheCursor(void)
|
||||
{
|
||||
#if 0
|
||||
struct rccoord old_pos;
|
||||
static short cursor_num = 0;
|
||||
static char cache_cursor[] = {'|','/','-','\\'};
|
||||
|
||||
if (GraphicsMode)
|
||||
return;
|
||||
|
||||
cursor_num++;
|
||||
if (cursor_num > 3)
|
||||
cursor_num = 0;
|
||||
|
||||
//old_pos = _gettextposition();
|
||||
//_settextposition( old_pos.row, old_pos.col );
|
||||
//_settextposition( 24, 25);
|
||||
_settextposition(25, 0);
|
||||
sprintf(ds,"Loading sound and graphics %c", cache_cursor[cursor_num]);
|
||||
_outtext(ds);
|
||||
//_settextposition( old_pos.row, old_pos.col );
|
||||
#endif
|
||||
}
|
||||
|
||||
static int firstnet = 0; // JBF
|
||||
|
||||
void SW_InitMultiPsky(void)
|
||||
|
@ -552,9 +466,7 @@ bool InitGame()
|
|||
gNet.MultiGameType = MULTI_GAME_COMMBAT;
|
||||
}
|
||||
|
||||
LoadDemoRun();
|
||||
|
||||
TileFiles.LoadArtSet("tiles%03d.art");
|
||||
TileFiles.LoadArtSet("tiles%03d.art");
|
||||
|
||||
Connect();
|
||||
SortBreakInfo();
|
||||
|
@ -588,17 +500,13 @@ bool InitGame()
|
|||
// precache as much stuff as you can
|
||||
if (UserMapName[0] == '\0')
|
||||
{
|
||||
AnimateCacheCursor();
|
||||
if (!LoadLevel("$dozer.map")) return false;
|
||||
AnimateCacheCursor();
|
||||
SetupPreCache();
|
||||
DoTheCache();
|
||||
}
|
||||
else
|
||||
{
|
||||
AnimateCacheCursor();
|
||||
if (!LoadLevel(UserMapName)) return false;
|
||||
AnimateCacheCursor();
|
||||
SetupPreCache();
|
||||
DoTheCache();
|
||||
}
|
||||
|
@ -610,23 +518,6 @@ bool InitGame()
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Directory of C:\DEV\SW\MIDI
|
||||
EXECUT11 MID
|
||||
HROSHMA6 MID
|
||||
HOSHIA02 MID
|
||||
INTRO131 MID
|
||||
KOTEC2 MID
|
||||
KOTOKI12 MID
|
||||
NIPPON34 MID
|
||||
NOKI41 MID
|
||||
SANAI MID
|
||||
SIANRA23 MID
|
||||
TKYO2007 MID
|
||||
TYTAIK16 MID
|
||||
YOKOHA03 MID
|
||||
*/
|
||||
|
||||
short SongLevelNum;
|
||||
|
||||
FString ThemeSongs[6];
|
||||
|
@ -805,7 +696,7 @@ InitLevel(void)
|
|||
if (NewGame)
|
||||
InitNewGame();
|
||||
|
||||
LoadingLevelScreen();
|
||||
//LoadingLevelScreen();
|
||||
if (!DemoMode && !DemoInitOnce)
|
||||
DemoPlaySetup();
|
||||
|
||||
|
@ -1050,134 +941,17 @@ void NewLevel(void)
|
|||
}
|
||||
|
||||
|
||||
uint8_t* KeyPressedRange(uint8_t* kb, uint8_t* ke)
|
||||
{
|
||||
uint8_t* k;
|
||||
|
||||
for (k = kb; k <= ke; k++)
|
||||
{
|
||||
if (*k)
|
||||
return k;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ResetKeyRange(uint8_t* kb, uint8_t* ke)
|
||||
{
|
||||
uint8_t* k;
|
||||
|
||||
for (k = kb; k <= ke; k++)
|
||||
{
|
||||
*k = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void PlayTheme()
|
||||
{
|
||||
// start music at logo
|
||||
PlaySong(nullptr, ThemeSongs[0], ThemeTrack[0]);
|
||||
}
|
||||
|
||||
void CreditsLevel(void)
|
||||
{
|
||||
int curpic;
|
||||
int handle;
|
||||
uint32_t timer = 0;
|
||||
int zero=0;
|
||||
short save;
|
||||
#define CREDITS1_PIC 5111
|
||||
#define CREDITS2_PIC 5118
|
||||
|
||||
twod->ClearScreen();
|
||||
videoNextPage();
|
||||
inputState.ClearAllInput();
|
||||
|
||||
// Lo Wang feel like singing!
|
||||
PlaySound(DIGI_JG95012, v3df_none, CHAN_VOICE, CHANF_UI);
|
||||
while (soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE))
|
||||
{
|
||||
DoUpdateSounds();
|
||||
handleevents();
|
||||
if (inputState.CheckAllInput())
|
||||
break;
|
||||
videoNextPage();
|
||||
}
|
||||
StopSound();
|
||||
|
||||
// try 14 then 2 then quit
|
||||
if (!PlaySong(nullptr, ThemeSongs[5], ThemeTrack[5], true))
|
||||
{
|
||||
PlaySong(nullptr, nullptr, 2, true);
|
||||
}
|
||||
|
||||
ready2send = 0;
|
||||
totalclock = 0;
|
||||
ototalclock = 0;
|
||||
|
||||
inputState.ClearAllInput();
|
||||
curpic = CREDITS1_PIC;
|
||||
|
||||
while (!inputState.CheckAllInput())
|
||||
{
|
||||
handleevents();
|
||||
|
||||
// limits checks to max of 40 times a second
|
||||
if (totalclock >= ototalclock + synctics)
|
||||
{
|
||||
ototalclock += synctics;
|
||||
timer += synctics;
|
||||
}
|
||||
|
||||
rotatesprite(0, 0, RS_SCALE, 0, curpic, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
|
||||
|
||||
videoNextPage();
|
||||
|
||||
if (timer > 8*120)
|
||||
{
|
||||
curpic = CREDITS2_PIC;
|
||||
}
|
||||
|
||||
if (timer > 16*120)
|
||||
{
|
||||
timer = 0;
|
||||
curpic = CREDITS1_PIC;
|
||||
}
|
||||
handleevents();
|
||||
}
|
||||
|
||||
// put up a blank screen while loading
|
||||
twod->ClearScreen();
|
||||
videoNextPage();
|
||||
inputState.ClearAllInput();
|
||||
Mus_Stop();
|
||||
}
|
||||
|
||||
|
||||
void SybexScreen(void)
|
||||
{
|
||||
if (!SW_SHAREWARE) return;
|
||||
|
||||
if (CommEnabled)
|
||||
return;
|
||||
|
||||
rotatesprite(0, 0, RS_SCALE, 0, 5261, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
|
||||
videoNextPage();
|
||||
|
||||
inputState.ClearAllInput();
|
||||
while (!inputState.CheckAllInput()) handleevents();
|
||||
}
|
||||
|
||||
// CTW REMOVED END
|
||||
|
||||
void DrawMenuLevelScreen(void)
|
||||
{
|
||||
twod->ClearScreen();
|
||||
rotatesprite(0, 0, RS_SCALE, 0, TITLE_PIC, 20, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
|
||||
}
|
||||
|
||||
void DrawLoadLevelScreen(void)
|
||||
{
|
||||
const int TITLE_PIC = 2324;
|
||||
twod->ClearScreen();
|
||||
rotatesprite(0, 0, RS_SCALE, 0, TITLE_PIC, 20, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1);
|
||||
}
|
||||
|
@ -1313,27 +1087,6 @@ void MenuLevel(void)
|
|||
videoNextPage();
|
||||
}
|
||||
|
||||
void
|
||||
LoadingLevelScreen(void)
|
||||
{
|
||||
short w,h;
|
||||
extern SWBOOL DemoMode;
|
||||
DrawLoadLevelScreen();
|
||||
|
||||
if (DemoMode)
|
||||
sprintf(ds,"DEMO");
|
||||
else
|
||||
sprintf(ds,"ENTERING");
|
||||
|
||||
MNU_MeasureString(ds, &w, &h);
|
||||
MNU_DrawString(TEXT_TEST_COL(w), 170, ds,1,16);
|
||||
|
||||
auto ds = currentLevel->DisplayName();
|
||||
MNU_MeasureString(ds, &w, &h);
|
||||
MNU_DrawString(TEXT_TEST_COL(w), 180, ds,1,16);
|
||||
|
||||
videoNextPage();
|
||||
}
|
||||
|
||||
extern SWBOOL FinishedLevel;
|
||||
|
||||
|
@ -1342,7 +1095,7 @@ void EndGameSequence(void)
|
|||
{
|
||||
StopSound();
|
||||
|
||||
playanm(FinishAnim);
|
||||
//playanm(FinishAnim);
|
||||
|
||||
//BonusScreen();
|
||||
|
||||
|
@ -1350,8 +1103,8 @@ void EndGameSequence(void)
|
|||
QuitFlag = FALSE;
|
||||
AutoNet = FALSE;
|
||||
|
||||
if (FinishAnim == ANIM_ZILLA)
|
||||
CreditsLevel();
|
||||
//if (FinishAnim == ANIM_ZILLA)
|
||||
// CreditsLevel();
|
||||
|
||||
ExitLevel = FALSE;
|
||||
QuitFlag = FALSE;
|
||||
|
@ -1493,10 +1246,6 @@ void MoveLoop(void)
|
|||
|
||||
domovethings();
|
||||
|
||||
#if DEBUG
|
||||
//if (DemoSyncRecord)
|
||||
// demosync_record();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1663,56 +1412,6 @@ void RunLevel(void)
|
|||
ready2send = 0;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char notshareware;
|
||||
const char *arg_switch;
|
||||
short arg_match_len;
|
||||
const char *arg_fmt;
|
||||
const char *arg_descr;
|
||||
} CLI_ARG;
|
||||
|
||||
|
||||
|
||||
|
||||
CLI_ARG cli_arg[] =
|
||||
{
|
||||
{0, "/?", 2, "-?", "This help message" },
|
||||
//#ifndef SW_SHAREWARE
|
||||
//{"/l", 2, "-l#", "Level (1-11)" },
|
||||
//{"/v", 2, "-v#", "Volume (1-3)" },
|
||||
{1, "/map", 4, "-map [mapname]", "Load a map" },
|
||||
{1, "/nocdaudio", 5, "-nocd<audio>", "No CD Red Book Audio" },
|
||||
//#endif
|
||||
|
||||
{0, "/name", 5, "-name [playername]", "Player Name" },
|
||||
{0, "/s", 2, "-s#", "Skill (1-4)" },
|
||||
{0, "/f#", 3, "-f#", "Packet Duplication - 2, 4, 8" },
|
||||
{0, "/nopredict", 7, "-nopred<ict>", "Disable Net Prediction Method" },
|
||||
{0, "/level#", 5, "-level#", "Start at level# (Shareware: 1-4, full version 1-28)" },
|
||||
{0, "/dr", 3, "-dr[filename.dmo]", "Demo record. NOTE: Must use -level# with this option." },
|
||||
{0, "/dp", 3, "-dp[filename.dmo]", "Demo playback. NOTE: Must use -level# with this option." },
|
||||
{0, "/m", 6, "-monst<ers>", "No Monsters" },
|
||||
{0, "/nodemo", 6, "-nodemo", "No demos on game startup" },
|
||||
{0, "/nometers", 9, "-nometers", "Don't show air or boss meter bars in game"},
|
||||
{0, "/movescale #", 9, "-movescale", "Adjust movement scale: 256 = 1 unit"},
|
||||
{0, "/turnscale #", 9, "-turnscale", "Adjust turning scale: 256 = 1 unit"},
|
||||
{0, "/extcompat", 9, "-extcompat", "Controller compatibility mode (with Duke 3D)"},
|
||||
{1, "/g#", 2, "-g[filename.grp]", "Load an extra GRP or ZIP file"},
|
||||
{1, "/h#", 2, "-h[filename.def]", "Use filename.def instead of SW.DEF"},
|
||||
{0, "/setup", 5, "-setup", "Displays the configuration dialogue box"},
|
||||
#if DEBUG
|
||||
{0, "/coop", 5, "-coop#", "Single Player Cooperative Mode" },
|
||||
{0, "/commbat", 8, "-commbat#", "Single Player Commbat Mode" },
|
||||
{0, "/debug", 6, "-debug", "Debug Help Options" },
|
||||
#endif
|
||||
|
||||
#if 0 //def NET_MODE_MASTER_SLAVE
|
||||
{0, "/broadcast", 6, "-broad<cast>", "Broadcast network method (default)" },
|
||||
{0, "/masterslave", 7, "-master<slave>", "Master/Slave network method" },
|
||||
#endif
|
||||
};
|
||||
|
||||
#if 0
|
||||
Map -> User Map Name
|
||||
Auto -> Auto Start Game
|
||||
|
@ -2501,13 +2200,6 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
|||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
DebugKeys(pp);
|
||||
|
||||
if (!CommEnabled) // Single player only keys
|
||||
SinglePlayInput(pp);
|
||||
#endif
|
||||
|
||||
if (!tied)
|
||||
FunctionKeys(pp);
|
||||
|
||||
|
@ -2916,10 +2608,6 @@ int StdRandomRange(int range)
|
|||
return value;
|
||||
}
|
||||
|
||||
// [JM] Probably will need some doing over. !CHECKME!
|
||||
void G_Polymer_UnInit(void) { }
|
||||
|
||||
|
||||
#include "saveable.h"
|
||||
|
||||
saveable_module saveable_build{};
|
||||
|
|
|
@ -141,11 +141,7 @@ void _Assert(const char *expr, const char *strFile, unsigned uLine);
|
|||
_Assert(#f,ERR_STD_ARG); \
|
||||
} while (0)
|
||||
|
||||
#if DEBUG || defined DEBUGGINGAIDS
|
||||
#define ASSERT(f) PRODUCTION_ASSERT(f)
|
||||
#else
|
||||
#define ASSERT(f) do { } while (0)
|
||||
#endif
|
||||
#define ASSERT assert
|
||||
|
||||
#define MONO_PRINT(str)
|
||||
|
||||
|
@ -2342,7 +2338,6 @@ int DoRipper2RipHeart(short SpriteNum); // ripper2.c
|
|||
int BunnyHatch2(short Weapon); // bunny.c
|
||||
int DoSkullBeginDeath(int16_t SpriteNum); // skull.c
|
||||
|
||||
void AnimateCacheCursor(void); // game.c
|
||||
void TerminateGame(void); // game.c
|
||||
void TerminateLevel(void); // game.c
|
||||
void drawoverheadmap(int cposx,int cposy,int czoom,short cang); // game.c
|
||||
|
@ -2432,6 +2427,10 @@ extern short LevelSecrets;
|
|||
extern short TotalKillable;
|
||||
extern int OrigCommPlayers;
|
||||
|
||||
#define ANIM_SERP 1
|
||||
#define ANIM_SUMO 2
|
||||
#define ANIM_ZILLA 3
|
||||
|
||||
struct GameInterface : ::GameInterface
|
||||
{
|
||||
const char* Name() override { return "ShadowWarrior"; }
|
||||
|
|
|
@ -40,7 +40,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "ai.h"
|
||||
#include "weapon.h"
|
||||
#include "anim.h"
|
||||
#include "sector.h"
|
||||
#include "sprite.h"
|
||||
#include "misc.h"
|
||||
|
|
Loading…
Reference in a new issue