mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 18:50:47 +00:00
NAM support
git-svn-id: https://svn.eduke32.com/eduke32@234 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
2cea1c5a9f
commit
7cd91e3fc2
7 changed files with 79 additions and 46 deletions
|
@ -38,12 +38,12 @@ extern "C" {
|
|||
|
||||
#include "function.h"
|
||||
|
||||
extern int conversion;
|
||||
extern int shareware;
|
||||
extern int conversion, shareware, namversion;
|
||||
|
||||
#define VOLUMEALL (shareware==0)
|
||||
#define PLUTOPAK (conversion==14)
|
||||
#define VOLUMEONE (shareware==1)
|
||||
#define NAM (namversion==1)
|
||||
|
||||
#define MAXSLEEPDIST 16384
|
||||
#define SLEEPTIME 24*64
|
||||
|
|
|
@ -127,7 +127,8 @@ void pitch_test( void );
|
|||
char restorepalette,screencapt,nomorelogohack;
|
||||
int sendmessagecommand = -1;
|
||||
|
||||
char *duke3dgrp = "duke3d.grp"; // JBF 20030925
|
||||
char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp";
|
||||
char *duke3dgrp = defaultduke3dgrp;
|
||||
static char *duke3ddef = "duke3d.def";
|
||||
|
||||
extern long lastvisinc;
|
||||
|
@ -4498,7 +4499,7 @@ short spawn( short j, short pn )
|
|||
|
||||
sp->shade = -8;
|
||||
|
||||
if (sp->yvel == 1)
|
||||
if (sp->yvel == 1 || NAM)
|
||||
{
|
||||
sp->ang = a+512;
|
||||
sp->xvel = 30;
|
||||
|
@ -7755,6 +7756,10 @@ void checkcommandline(int argc,char **argv)
|
|||
c = argv[i];
|
||||
if (((*c == '/') || (*c == '-')) && (!firstnet))
|
||||
{
|
||||
if (!Bstrcasecmp(c+1,"nam")) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (!Bstrcasecmp(c+1,"setup")) {
|
||||
i++;
|
||||
continue;
|
||||
|
@ -8234,6 +8239,7 @@ void Logo(void)
|
|||
if (logoflags & LOGO_FLAG_PLAYMUSIC)
|
||||
playmusic(&env_music_fn[0][0]);
|
||||
|
||||
if (!NAM) {
|
||||
fadepal(0,0,0, 0,64,7);
|
||||
//ps[myconnectindex].palette = drealms;
|
||||
//palto(0,0,0,63);
|
||||
|
@ -8250,6 +8256,7 @@ void Logo(void)
|
|||
}
|
||||
}
|
||||
KB_ClearKeysDown(); // JBF
|
||||
}
|
||||
|
||||
fadepal(0,0,0, 0,64,7);
|
||||
clearview(0L);
|
||||
|
@ -8789,6 +8796,7 @@ void backtomenu(void)
|
|||
}
|
||||
|
||||
int shareware = 0;
|
||||
int namversion = 0;
|
||||
|
||||
int load_script(char *szScript)
|
||||
{
|
||||
|
@ -8863,21 +8871,24 @@ void app_main(int argc,char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
// JBF 20030925: Because it's annoying renaming GRP files whenever I want to test different game data
|
||||
if (getenv("DUKE3DGRP")) {
|
||||
duke3dgrp = getenv("DUKE3DGRP");
|
||||
initprintf("Using `%s' as main GRP file\n", duke3dgrp);
|
||||
}
|
||||
|
||||
for (i=1;i<argc;i++) {
|
||||
if (argv[i][0] != '-' && argv[i][0] != '/') continue;
|
||||
if (!Bstrcasecmp(argv[i]+1, "setup")) CommandSetup = TRUE;
|
||||
else if (!Bstrcasecmp(argv[i]+1, "nam")) {
|
||||
strcpy(defaultduke3dgrp, "nam.grp");
|
||||
namversion = 1;
|
||||
}
|
||||
else if (!Bstrcasecmp(argv[i]+1, "?")) {
|
||||
comlinehelp(argv);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getenv("DUKE3DGRP")) {
|
||||
duke3dgrp = getenv("DUKE3DGRP");
|
||||
initprintf("Using `%s' as main GRP file\n", duke3dgrp);
|
||||
}
|
||||
|
||||
checkcommandline(argc,argv);
|
||||
|
||||
i = CONFIG_ReadSetup();
|
||||
|
@ -8897,6 +8908,13 @@ void app_main(int argc,char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (namversion) {
|
||||
// overwrite the default GRP and CON so that if the user chooses
|
||||
// something different, they get what they asked for
|
||||
Bsprintf(defaultduke3dgrp,"nam.grp");
|
||||
Bsprintf(confilename, "nam.con");
|
||||
}
|
||||
|
||||
initgroupfile(duke3dgrp);
|
||||
i = kopen4load("DUKESW.BIN",1); // JBF 20030810
|
||||
if (i!=-1) {
|
||||
|
@ -10824,6 +10842,7 @@ FRAGBONUS:
|
|||
{
|
||||
gametext(10,59+9,"Your Time:",0,2+8+16);
|
||||
gametext(10,69+9,"Par time:",0,2+8+16);
|
||||
if (!NAM)
|
||||
gametext(10,78+9,"3D Realms' Time:",0,2+8+16);
|
||||
if(bonuscnt == 0)
|
||||
bonuscnt++;
|
||||
|
@ -10846,11 +10865,12 @@ FRAGBONUS:
|
|||
(partime[ud.volume_number*11+ud.last_level-1]/26)%60);
|
||||
gametext((320>>2)+71,69+9,tempbuf,0,2+8+16);
|
||||
|
||||
if (!NAM) {
|
||||
Bsprintf(tempbuf,"%0*ld:%02ld",clockpad,
|
||||
(designertime[ud.volume_number*11+ud.last_level-1]/(26*60)),
|
||||
(designertime[ud.volume_number*11+ud.last_level-1]/26)%60);
|
||||
gametext((320>>2)+71,78+9,tempbuf,0,2+8+16);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if( totalclock > (60*6) )
|
||||
|
|
|
@ -5000,9 +5000,9 @@ void AddSystemVars()
|
|||
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",PISTOL_WEAPON);
|
||||
AddGameVar(aszBuf, PISTOL_WEAPON, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_CLIP",PISTOL_WEAPON);
|
||||
AddGameVar(aszBuf, 12, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, NAM?20:12, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_RELOAD",PISTOL_WEAPON);
|
||||
AddGameVar(aszBuf, 27, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, NAM?50:27, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",PISTOL_WEAPON);
|
||||
AddGameVar(aszBuf, 2, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",PISTOL_WEAPON);
|
||||
|
@ -5010,7 +5010,7 @@ void AddSystemVars()
|
|||
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",PISTOL_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLAGS",PISTOL_WEAPON);
|
||||
AddGameVar(aszBuf, WEAPON_FLAG_RELOAD_TIMING, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, NAM?WEAPON_FLAG_HOLSTER_CLEARS_CLIP:0 | WEAPON_FLAG_RELOAD_TIMING, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",PISTOL_WEAPON);
|
||||
AddGameVar(aszBuf, SHOTSPARK1, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",PISTOL_WEAPON);
|
||||
|
@ -5186,7 +5186,7 @@ void AddSystemVars()
|
|||
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",SHRINKER_WEAPON);
|
||||
AddGameVar(aszBuf, 10, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",SHRINKER_WEAPON);
|
||||
AddGameVar(aszBuf, 12, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, NAM?30:12, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",SHRINKER_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLAGS",SHRINKER_WEAPON);
|
||||
|
@ -5364,9 +5364,9 @@ void AddSystemVars()
|
|||
Bsprintf(aszBuf,"WEAPON%d_RELOAD",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 4, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, 3, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 5, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, NAM?30:5, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLAGS",GROW_WEAPON);
|
||||
|
@ -5374,15 +5374,15 @@ void AddSystemVars()
|
|||
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, GROWSPARK, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, NAM?2:0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SPAWN",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, NAM?SHELL:0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, EXPANDERSHOOT, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar(aszBuf, NAM?0:EXPANDERSHOOT, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",GROW_WEAPON);
|
||||
AddGameVar(aszBuf, 0, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",GROW_WEAPON);
|
||||
|
@ -5399,7 +5399,7 @@ void AddSystemVars()
|
|||
AddGameVar("STICKYBOMB_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
|
||||
AddGameVar("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar("PIPEBOMB_CONTROL", PIPEBOMB_REMOTE, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
AddGameVar("PIPEBOMB_CONTROL", NAM?PIPEBOMB_TIMER:PIPEBOMB_REMOTE, GAMEVAR_FLAG_PERPLAYER | GAMEVAR_FLAG_SYSTEM);
|
||||
|
||||
AddGameVar("RESPAWN_MONSTERS", (long)&ud.respawn_monsters,GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
AddGameVar("RESPAWN_ITEMS",(long)&ud.respawn_items, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
|
||||
|
|
|
@ -48,7 +48,7 @@ CAPTION "Dialog"
|
|||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "&Game or addon:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 5, 100, 8
|
||||
CONTROL "", IDGDATA, "LISTBOX", LBS_NOINTEGRALHEIGHT | LBS_USETABSTOPS | LBS_SORT | WS_CHILD | WS_BORDER | WS_VISIBLE | WS_TABSTOP, 10, 15, 226, 50
|
||||
CONTROL "", IDGDATA, "LISTBOX", LBS_NOINTEGRALHEIGHT | LBS_USETABSTOPS | LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 15, 226, 70
|
||||
END
|
||||
|
||||
1 24 "rsrc/manifest.game.xml"
|
||||
|
|
|
@ -8,12 +8,13 @@
|
|||
#include "startdlg.h"
|
||||
|
||||
struct grpfile grpfiles[numgrpfiles] = {
|
||||
{ "Registered Version 1.3d", 0xBBC9CE44, 26524524, NULL },
|
||||
{ "Registered Version 1.4", 0x00000000, 0, NULL },
|
||||
{ "Registered Version 1.5", 0xFD3DCFF1, 44356548, NULL },
|
||||
{ "Shareware Version", 0x983AD923, 11035779, NULL },
|
||||
{ "Mac Shareware Version", 0xC5F71561, 10444391, NULL },
|
||||
{ "Mac Registered Version", 0x00000000, 0, NULL },
|
||||
{ "Registered Version 1.3d", 0xBBC9CE44, 26524524, GAMEDUKE, NULL },
|
||||
{ "Registered Version 1.4", 0xF514A6AC, 44348015, GAMEDUKE, NULL },
|
||||
{ "Registered Version 1.5", 0xFD3DCFF1, 44356548, GAMEDUKE, NULL },
|
||||
{ "Shareware Version", 0x983AD923, 11035779, GAMEDUKE, NULL },
|
||||
{ "Mac Shareware Version", 0xC5F71561, 10444391, GAMEDUKE, NULL },
|
||||
{ "Mac Registered Version", 0x00000000, 0, GAMEDUKE, NULL },
|
||||
{ "NAM", 0x75C1F07B, 43448927, GAMENAM, NULL },
|
||||
};
|
||||
struct grpfile *foundgrps = NULL;
|
||||
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
// List of internally-known GRP files
|
||||
#define numgrpfiles 6
|
||||
#define numgrpfiles 7
|
||||
struct grpfile {
|
||||
const char *name;
|
||||
int crcval;
|
||||
int size;
|
||||
int game;
|
||||
struct grpfile *next;
|
||||
} grpfiles[numgrpfiles], *foundgrps;
|
||||
|
||||
#define GAMEDUKE 0
|
||||
#define GAMENAM 1
|
||||
|
||||
int ScanGroups(void);
|
||||
void FreeGroups(void);
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ static struct {
|
|||
int forcesetup;
|
||||
int usemouse, usejoy;
|
||||
char selectedgrp[BMAX_PATH+1];
|
||||
int game;
|
||||
} settings;
|
||||
|
||||
static HWND startupdlg = NULL;
|
||||
|
@ -121,6 +122,7 @@ static void PopulateForm(int pgs)
|
|||
if (i == numgrpfiles) continue; // unrecognised grp file
|
||||
|
||||
Bsprintf(buf, "%s\t%s", grpfiles[i].name, fg->name);
|
||||
fg->game = grpfiles[i].game;
|
||||
j = ListBox_AddString(hwnd, buf);
|
||||
ListBox_SetItemData(hwnd, j, (LPARAM)fg);
|
||||
if (!Bstrcasecmp(fg->name, settings.selectedgrp)) ListBox_SetCurSel(hwnd, j);
|
||||
|
@ -173,9 +175,13 @@ static INT_PTR CALLBACK GamePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
|
|||
switch (LOWORD(wParam)) {
|
||||
case IDGDATA: {
|
||||
int i;
|
||||
if (HIWORD(wParam) != LBN_SELCHANGE) break;
|
||||
i = ListBox_GetCurSel((HWND)lParam);
|
||||
if (i != CB_ERR) i = ListBox_GetItemData((HWND)lParam, i);
|
||||
if (i != CB_ERR) strcpy(settings.selectedgrp, ((struct grpfile*)i)->name);
|
||||
if (i != CB_ERR) {
|
||||
strcpy(settings.selectedgrp, ((struct grpfile*)i)->name);
|
||||
settings.game = ((struct grpfile*)i)->game;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
default: break;
|
||||
|
@ -511,6 +517,7 @@ int startwin_run(void)
|
|||
settings.forcesetup = ForceSetup;
|
||||
settings.usemouse = UseMouse;
|
||||
settings.usejoy = UseJoystick;
|
||||
settings.game = namversion;
|
||||
strncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH);
|
||||
PopulateForm(-1);
|
||||
|
||||
|
@ -537,6 +544,7 @@ int startwin_run(void)
|
|||
UseMouse = settings.usemouse;
|
||||
UseJoystick = settings.usejoy;
|
||||
duke3dgrp = settings.selectedgrp;
|
||||
namversion = settings.game;
|
||||
}
|
||||
|
||||
if (wavedevs) {
|
||||
|
|
Loading…
Reference in a new issue