Game name in window title and some other shit

git-svn-id: https://svn.eduke32.com/eduke32@886 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-07-22 09:05:34 +00:00
parent de25cb4392
commit 11fc1203fa
14 changed files with 104 additions and 47 deletions

View file

@ -49,6 +49,8 @@ extern "C" {
#define GREENPAL (MAXPALOOKUPS - 7) #define GREENPAL (MAXPALOOKUPS - 7)
#define SPECPAL (MAXPALOOKUPS - 8) #define SPECPAL (MAXPALOOKUPS - 8)
#define STAT_NOCULL 99
#define CLIPMASK0 (((1L)<<16)+1L) #define CLIPMASK0 (((1L)<<16)+1L)
#define CLIPMASK1 (((256L)<<16)+64L) #define CLIPMASK1 (((256L)<<16)+64L)
@ -547,7 +549,7 @@ extern int r_animsmoothing;
extern int r_parallaxskyclamping; extern int r_parallaxskyclamping;
extern int r_parallaxskypanning; extern int r_parallaxskypanning;
extern int r_cullobstructedmodels; extern int r_cullobstructedmodels;
extern int r_fullbright; extern int r_fullbrights;
extern int mdtims, omdtims; extern int mdtims, omdtims;
#endif #endif

View file

@ -179,7 +179,7 @@ int r_cullobstructedmodels = 0;
#define CULL_DELAY 5 #define CULL_DELAY 5
// fullbright cvar // fullbright cvar
int r_fullbright = 1; int r_fullbrights = 1;
static float fogresult, fogcol[4]; static float fogresult, fogcol[4];
@ -582,7 +582,7 @@ void gltexapplyprops(void)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min); bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
if (glinfo.maxanisotropy > 1.0) if (glinfo.maxanisotropy > 1.0)
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy); bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
if (r_fullbright && pth->flags & 16) if (r_fullbrights && pth->flags & 16)
{ {
bglBindTexture(GL_TEXTURE_2D,pth->ofb->glpic); bglBindTexture(GL_TEXTURE_2D,pth->ofb->glpic);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag); bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
@ -1817,7 +1817,7 @@ void drawpoly(double *dpx, double *dpy, int n, int method)
if (skyclamphack) method |= 4; if (skyclamphack) method |= 4;
pth = gltexcache(globalpicnum,globalpal,method&(~3)); pth = gltexcache(globalpicnum,globalpal,method&(~3));
if (r_fullbright && pth->flags & 16) if (r_fullbrights && pth->flags & 16)
if (indrawroomsandmasks) if (indrawroomsandmasks)
{ {
if (!fullbrightdrawingpass) if (!fullbrightdrawingpass)
@ -4514,7 +4514,7 @@ void polymost_drawsprite(int snum)
if (totalclock < lastcullcheck[tspr->owner]) if (totalclock < lastcullcheck[tspr->owner])
break; break;
cullmodel[tspr->owner] = 1; cullmodel[tspr->owner] = 1;
if (tspr->statnum == 99) if (tspr->statnum == STAT_NOCULL)
{ cullmodel[tspr->owner] = 0; break; } { cullmodel[tspr->owner] = 0; break; }
/* if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum, /* if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum,
tspr->x, tspr->y, tspr->z, tspr->sectnum)) tspr->x, tspr->y, tspr->z, tspr->sectnum))
@ -4525,9 +4525,9 @@ void polymost_drawsprite(int snum)
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x, tspr->y, tspr->z,tspr->sectnum)) tspr->x, tspr->y, tspr->z,tspr->sectnum))
{ cullmodel[tspr->owner] = 0; break; } { cullmodel[tspr->owner] = 0; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, /* if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x, tspr->y, globalposz,tspr->sectnum)) tspr->x, tspr->y, globalposz,tspr->sectnum))
{ cullmodel[tspr->owner] = 0; break; } { cullmodel[tspr->owner] = 0; break; } */
/* if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz, globalcursectnum, /* if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz, globalcursectnum,
tspr->x, tspr->y, tspr->z, tspr->sectnum)) tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ cullmodel[tspr->owner] = 0; break; } */ { cullmodel[tspr->owner] = 0; break; } */
@ -4535,7 +4535,7 @@ void polymost_drawsprite(int snum)
if (polymost_checkcoordinates(0, 0, tspr)) if (polymost_checkcoordinates(0, 0, tspr))
{ cullmodel[tspr->owner] = 0; break; } { cullmodel[tspr->owner] = 0; break; }
i = 640; i = 256;
if (polymost_checkcoordinates(-i, 0, tspr)) if (polymost_checkcoordinates(-i, 0, tspr))
{ cullmodel[tspr->owner] = 0; break; } { cullmodel[tspr->owner] = 0; break; }
if (polymost_checkcoordinates(-i, -i, tspr)) if (polymost_checkcoordinates(-i, -i, tspr))
@ -5964,10 +5964,10 @@ static int osdcmd_polymostvars(const osdfuncparm_t *parm)
else r_cullobstructedmodels = (val != 0); else r_cullobstructedmodels = (val != 0);
return OSDCMD_OK; return OSDCMD_OK;
} }
else if (!Bstrcasecmp(parm->name, "r_fullbright")) else if (!Bstrcasecmp(parm->name, "r_fullbrights"))
{ {
if (showval) { OSD_Printf("r_fullbright is %d\n", r_fullbright); } if (showval) { OSD_Printf("r_fullbrights is %d\n", r_fullbrights); }
else r_fullbright = (val != 0); else r_fullbrights = (val != 0);
return OSDCMD_OK; return OSDCMD_OK;
} }
#endif #endif
@ -6012,7 +6012,7 @@ void polymost_initosdfuncs(void)
OSD_RegisterFunction("r_curpeel","r_curpeel: allows to display one depth layer at a time (for development purposes)",osdcmd_polymostvars); OSD_RegisterFunction("r_curpeel","r_curpeel: allows to display one depth layer at a time (for development purposes)",osdcmd_polymostvars);
OSD_RegisterFunction("r_depthpeeling","r_depthpeeling: enable/disable order-independant transparency",osdcmd_polymostvars); OSD_RegisterFunction("r_depthpeeling","r_depthpeeling: enable/disable order-independant transparency",osdcmd_polymostvars);
OSD_RegisterFunction("r_detailmapping","r_detailmapping: enable/disable detail mapping",osdcmd_polymostvars); OSD_RegisterFunction("r_detailmapping","r_detailmapping: enable/disable detail mapping",osdcmd_polymostvars);
OSD_RegisterFunction("r_fullbright","r_fullbright: enable/disable fullbright textures",osdcmd_polymostvars); OSD_RegisterFunction("r_fullbrights","r_fullbrights: enable/disable fullbright textures",osdcmd_polymostvars);
OSD_RegisterFunction("r_glowmapping","r_glowmapping: enable/disable glow mapping",osdcmd_polymostvars); OSD_RegisterFunction("r_glowmapping","r_glowmapping: enable/disable glow mapping",osdcmd_polymostvars);
OSD_RegisterFunction("r_multisample","r_multisample: sets the number of samples used for antialiasing (0 = off)",osdcmd_polymostvars); OSD_RegisterFunction("r_multisample","r_multisample: sets the number of samples used for antialiasing (0 = off)",osdcmd_polymostvars);
OSD_RegisterFunction("r_nvmultisamplehint","r_nvmultisamplehint: enable/disable Nvidia multisampling hinting",osdcmd_polymostvars); OSD_RegisterFunction("r_nvmultisamplehint","r_nvmultisamplehint: enable/disable Nvidia multisampling hinting",osdcmd_polymostvars);

View file

@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "scriptfile.h" #include "scriptfile.h"
#include "crc32.h" #include "crc32.h"
#define VERSION " 1.2.0 svn" #define VERSION " 1.2.0devel"
static int floor_over_floor; static int floor_over_floor;

View file

@ -685,7 +685,7 @@ int32 CONFIG_ReadSetup(void)
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling", &r_depthpeeling); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling", &r_depthpeeling);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount", &r_peelscount); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount", &r_peelscount);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", &r_fullbright); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", &r_fullbrights);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", &r_detailmapping); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", &r_detailmapping);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", &r_glowmapping); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", &r_glowmapping);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", &r_vertexarrays); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", &r_vertexarrays);
@ -895,7 +895,7 @@ void CONFIG_WriteSetup(void)
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling",r_depthpeeling,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling",r_depthpeeling,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLFullbright", r_fullbright,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", r_fullbrights,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", r_detailmapping,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", r_detailmapping,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", r_glowmapping,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", r_glowmapping,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", r_vertexarrays,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", r_vertexarrays,false,false);

View file

@ -22,9 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#define VERSION " 1.4.0 svn" #define VERSION " 1.5.0devel"
#define HEAD "EDuke32"VERSION" (shareware)"
#define HEAD2 "EDuke32"VERSION #define HEAD2 "EDuke32"VERSION
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -54,7 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <windows.h> #include <windows.h>
#include <shellapi.h> #include <shellapi.h>
extern int getversionfromwebsite(char *buffer); extern int getversionfromwebsite(char *buffer);
#define BUILDDATE 20080720 // this is checked against http://eduke32.com/VERSION #define BUILDDATE 20080722 // this is checked against http://eduke32.com/VERSION
#define UPDATEINTERVAL 604800 // 1w #define UPDATEINTERVAL 604800 // 1w
#endif #endif
@ -114,6 +114,7 @@ static int sendmessagecommand = -1;
char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp"; char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp";
char *duke3dgrp = defaultduke3dgrp; char *duke3dgrp = defaultduke3dgrp;
char *duke3dgrpstring = NULL;
static char defaultconfilename[BMAX_PATH] = {"EDUKE.CON"}; static char defaultconfilename[BMAX_PATH] = {"EDUKE.CON"};
static char *confilename = defaultconfilename; static char *confilename = defaultconfilename;
static char *duke3ddef = "duke3d.def"; static char *duke3ddef = "duke3d.def";
@ -6475,7 +6476,7 @@ void animatesprites(int x,int y,int a,int smoothratio)
} }
} }
if (t->statnum == 99) continue; if (t->statnum == STAT_NOCULL) continue;
if (s->statnum != 1 && s->picnum == APLAYER && g_player[s->yvel].ps->newowner == -1 && s->owner >= 0) if (s->statnum != 1 && s->picnum == APLAYER && g_player[s->yvel].ps->newowner == -1 && s->owner >= 0)
{ {
t->x -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posx-g_player[s->yvel].ps->oposx); t->x -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posx-g_player[s->yvel].ps->oposx);
@ -6666,7 +6667,7 @@ void animatesprites(int x,int y,int a,int smoothratio)
{ {
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
tsprite[spritesortcnt].statnum = 99; tsprite[spritesortcnt].statnum = STAT_NOCULL;
/* tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); /* tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4; */ if (t->yrepeat < 4) t->yrepeat = 4; */
@ -6698,7 +6699,7 @@ void animatesprites(int x,int y,int a,int smoothratio)
{ {
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
tsprite[spritesortcnt].statnum = 99; tsprite[spritesortcnt].statnum = STAT_NOCULL;
tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4; if (t->yrepeat < 4) t->yrepeat = 4;
@ -6939,7 +6940,7 @@ PALONLY:
{ {
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
tsprite[spritesortcnt].statnum = 99; tsprite[spritesortcnt].statnum = STAT_NOCULL;
tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4; if (t->yrepeat < 4) t->yrepeat = 4;
@ -7107,7 +7108,7 @@ PALONLY:
} }
for (j=0;j < spritesortcnt; j++) for (j=0;j < spritesortcnt; j++)
{ {
if (display_mirror) tsprite[j].statnum = 99; if (display_mirror) tsprite[j].statnum = STAT_NOCULL;
if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS) if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
{ {
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
@ -9394,8 +9395,8 @@ static void Logo(void)
flushperms(); flushperms();
nextpage(); nextpage();
if (VOLUMEALL) wm_setapptitle(HEAD2); Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
else wm_setapptitle(HEAD); wm_setapptitle(tempbuf);
MUSIC_StopSong(); MUSIC_StopSong();
FX_StopAllSounds(); // JBF 20031228 FX_StopAllSounds(); // JBF 20031228
@ -10139,8 +10140,8 @@ void backtomenu(void)
g_player[myconnectindex].ps->gm = MODE_MENU; g_player[myconnectindex].ps->gm = MODE_MENU;
cmenu(0); cmenu(0);
KB_FlushKeyboardQueue(); KB_FlushKeyboardQueue();
if (VOLUMEALL) wm_setapptitle(HEAD2); Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
else wm_setapptitle(HEAD); wm_setapptitle(tempbuf);
} }
#ifdef RENDERTYPEWIN #ifdef RENDERTYPEWIN
@ -10341,6 +10342,7 @@ void app_main(int argc,const char **argv)
if (!Bstrcasecmp(fg->name, defaultduke3dgrp)) if (!Bstrcasecmp(fg->name, defaultduke3dgrp))
{ {
g_GameType = grpfiles[i].game; g_GameType = grpfiles[i].game;
duke3dgrpstring = (char *)grpfiles[i].name;
break; break;
} }
} }
@ -10348,6 +10350,7 @@ void app_main(int argc,const char **argv)
{ {
Bstrcpy(defaultduke3dgrp, first->name); Bstrcpy(defaultduke3dgrp, first->name);
g_GameType = first->game; g_GameType = first->game;
duke3dgrpstring = (char *)grpfiles[0].name;
} }
} }
@ -10445,8 +10448,9 @@ void app_main(int argc,const char **argv)
// gotta set the proper title after we compile the CONs if this is the full version // gotta set the proper title after we compile the CONs if this is the full version
if (VOLUMEALL) wm_setapptitle(HEAD2); Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
else wm_setapptitle(HEAD); wm_setapptitle(tempbuf);
// initprintf("\n"); // initprintf("\n");
@ -11974,8 +11978,8 @@ void dobonus(int bonusonly)
350, 380,VICTORY1+8,86,59 350, 380,VICTORY1+8,86,59
}; };
if (VOLUMEALL) wm_setapptitle(HEAD2); Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
else wm_setapptitle(HEAD); wm_setapptitle(tempbuf);
if (ud.volume_number == 0 && ud.last_level == 8 && boardfilename[0]) if (ud.volume_number == 0 && ud.last_level == 8 && boardfilename[0])
{ {

View file

@ -91,6 +91,8 @@ extern int qsetmode;
char *textptr; char *textptr;
int error,warning; int error,warning;
extern char *duke3dgrpstring;
enum labeltypes enum labeltypes
{ {
LABEL_ANY = -1, LABEL_ANY = -1,
@ -461,6 +463,7 @@ static const char *keyw[] =
"loadmapstate", // 327 "loadmapstate", // 327
"clearmapstate", // 328 "clearmapstate", // 328
"scriptsize", // 329 "scriptsize", // 329
"definegamename", // 330
"<null>" "<null>"
}; };
@ -4448,6 +4451,33 @@ repeatcase:
skill_names[j][i] = '\0'; skill_names[j][i] = '\0';
return 0; return 0;
case CON_DEFINEGAMENAME:
{
char gamename[32];
scriptptr--;
while (*textptr == ' ' || *textptr == '\t') textptr++;
i = 0;
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
{
gamename[i] = *textptr;
textptr++,i++;
if (i >= (signed)sizeof(gamename)-1)
{
initprintf("%s:%d: error: game name exceeds limit of %d characters.\n",compilefile,line_number,sizeof(gamename)-1);
error++;
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++;
break;
}
}
gamename[i] = '\0';
duke3dgrpstring = Bstrdup(gamename);
Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
wm_setapptitle(tempbuf);
}
return 0;
case CON_DEFINEGAMETYPE: case CON_DEFINEGAMETYPE:
scriptptr--; //remove opcode from compiled code scriptptr--; //remove opcode from compiled code
transnum(LABEL_DEFINE); //translate number transnum(LABEL_DEFINE); //translate number

View file

@ -838,4 +838,5 @@ enum keywords
CON_LOADMAPSTATE, // 327 CON_LOADMAPSTATE, // 327
CON_CLEARMAPSTATE, // 328 CON_CLEARMAPSTATE, // 328
CON_SCRIPTSIZE, // 329 CON_SCRIPTSIZE, // 329
CON_DEFINEGAMENAME, // 330
}; };

View file

@ -15,7 +15,7 @@ struct grpfile grpfiles[numgrpfiles] =
{ "Duke Nukem 3D: Atomic Edition", 0xFD3DCFF1, 44356548, GAMEDUKE, NULL }, { "Duke Nukem 3D: Atomic Edition", 0xFD3DCFF1, 44356548, GAMEDUKE, NULL },
{ "Duke Nukem 3D Shareware", 0x983AD923, 11035779, GAMEDUKE, NULL }, { "Duke Nukem 3D Shareware", 0x983AD923, 11035779, GAMEDUKE, NULL },
{ "Duke Nukem 3D Mac Shareware", 0xC5F71561, 10444391, GAMEDUKE, NULL }, { "Duke Nukem 3D Mac Shareware", 0xC5F71561, 10444391, GAMEDUKE, NULL },
{ "Duke Nukem 3D Mac", 0x00000000, 0, GAMEDUKE, NULL }, // { "Duke Nukem 3D Mac", 0x00000000, 0, GAMEDUKE, NULL },
{ "NAM", 0x75C1F07B, 43448927, GAMENAM, NULL }, { "NAM", 0x75C1F07B, 43448927, GAMENAM, NULL },
{ "Napalm", 0x3DE1589A, 44365728, GAMENAM, NULL }, { "Napalm", 0x3DE1589A, 44365728, GAMENAM, NULL },
{ "WW2GI", 0x907B82BF, 77939508, GAMEWW2, NULL }, { "WW2GI", 0x907B82BF, 77939508, GAMEWW2, NULL },

View file

@ -2,7 +2,7 @@
#define __grpscan_h__ #define __grpscan_h__
// List of internally-known GRP files // List of internally-known GRP files
#define numgrpfiles 9 #define numgrpfiles 8
struct grpfile { struct grpfile {
const char *name; const char *name;
int crcval; int crcval;

View file

@ -2426,7 +2426,7 @@ cheat_for_port_credits:
int io, ii, yy, d=c+160+40, enabled; int io, ii, yy, d=c+160+40, enabled;
char *opts[] = char *opts[] =
{ {
"Widescreen", "Use widescreen hack",
"-", "-",
"Anisotropic filtering", "Anisotropic filtering",
"-", "-",
@ -2439,7 +2439,7 @@ cheat_for_port_credits:
"Use glow textures", "Use glow textures",
"-", "-",
"Use models", "Use models",
"-", "Blend model animations",
"-", "-",
"-", "-",
NULL NULL
@ -2481,7 +2481,7 @@ cheat_for_port_credits:
case 0: case 0:
if (x==io) glwidescreen = 1-glwidescreen; if (x==io) glwidescreen = 1-glwidescreen;
modval(0,1,(int *)&glwidescreen,1,probey==io); modval(0,1,(int *)&glwidescreen,1,probey==io);
gametextpal(d,yy, glwidescreen ? "On" : "Off", MENUHIGHLIGHT(io), 0); gametextpal(d,yy, glwidescreen ? "Yes" : "No", MENUHIGHLIGHT(io), 0);
break; break;
case 1: case 1:
{ {
@ -2517,13 +2517,13 @@ cheat_for_port_credits:
gametextpal(d,yy, glusetexcompr && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); gametextpal(d,yy, glusetexcompr && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
break; break;
case 5: case 5:
enabled = (glusetexcompr && usehightile && ud.config.useprecache); enabled = (glusetexcompr && usehightile);
if (enabled && x==io) glusetexcache = !glusetexcache; if (enabled && x==io) glusetexcache = !glusetexcache;
if (enabled) modval(0,1,(int *)&glusetexcache,1,probey==io); if (enabled) modval(0,1,(int *)&glusetexcache,1,probey==io);
gametextpal(d,yy, glusetexcache && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); gametextpal(d,yy, glusetexcache && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
break; break;
case 6: case 6:
enabled = (glusetexcompr && usehightile && ud.config.useprecache && glusetexcache); enabled = (glusetexcompr && usehightile && glusetexcache);
if (enabled && x==io) glusetexcachecompression = !glusetexcachecompression; if (enabled && x==io) glusetexcachecompression = !glusetexcachecompression;
if (enabled) modval(0,1,(int *)&glusetexcachecompression,1,probey==io); if (enabled) modval(0,1,(int *)&glusetexcachecompression,1,probey==io);
gametextpal(d,yy, glusetexcachecompression && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); gametextpal(d,yy, glusetexcachecompression && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
@ -2545,6 +2545,12 @@ cheat_for_port_credits:
modval(0,1,(int *)&usemodels,1,probey==io); modval(0,1,(int *)&usemodels,1,probey==io);
gametextpal(d,yy, usemodels ? "Yes" : "No", MENUHIGHLIGHT(io), 0); gametextpal(d,yy, usemodels ? "Yes" : "No", MENUHIGHLIGHT(io), 0);
break; break;
case 10:
enabled = usemodels;
if (enabled && x==io) r_animsmoothing = !r_animsmoothing;
if (enabled) modval(0,1,(int *)&r_animsmoothing,1,probey==io);
gametextpal(d,yy, r_animsmoothing && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0);
break;
default: default:
break; break;
} }

View file

@ -40,6 +40,8 @@ short spritecache[MAXTILES][3];
static char precachehightile[2][MAXTILES>>3]; static char precachehightile[2][MAXTILES>>3];
static int precachecount; static int precachecount;
extern char *duke3dgrpstring;
static void tloadtile(int tilenume, int type) static void tloadtile(int tilenume, int type)
{ {
if ((picanm[tilenume]&63) < 1) if ((picanm[tilenume]&63) < 1)
@ -1671,14 +1673,11 @@ int enterlevel(int g)
if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0) if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0)
{ {
Bstrcpy(levname, boardfilename); Bstrcpy(levname, boardfilename);
Bsprintf(apptitle," - %s",levname); Bsprintf(apptitle,HEAD2 " - %s - %s",levname,duke3dgrpstring);
} }
else Bsprintf(apptitle," - %s",map[(ud.volume_number*MAXLEVELS)+ud.level_number].name); else Bsprintf(apptitle,HEAD2 " - %s - %s",map[(ud.volume_number*MAXLEVELS)+ud.level_number].name,duke3dgrpstring);
if (VOLUMEALL) Bsprintf(tempbuf,HEAD2); Bstrcpy(tempbuf,apptitle);
else Bsprintf(tempbuf,HEAD);
Bstrcat(tempbuf,apptitle);
wm_setapptitle(tempbuf); wm_setapptitle(tempbuf);
if (!VOLUMEONE) if (!VOLUMEONE)

View file

@ -31,6 +31,7 @@ static struct
int usemouse, usejoy; int usemouse, usejoy;
char selectedgrp[BMAX_PATH+1]; char selectedgrp[BMAX_PATH+1];
int game; int game;
int crcval;
} settings; } settings;
extern int gtkenabled; extern int gtkenabled;
@ -224,6 +225,7 @@ static void on_gamelist_selection_changed(GtkTreeSelection *selection, gpointer
gtk_tree_model_get(model, &iter, 2, (gpointer)&fg, -1); gtk_tree_model_get(model, &iter, 2, (gpointer)&fg, -1);
strcpy(settings.selectedgrp, fg->name); strcpy(settings.selectedgrp, fg->name);
settings.game = fg->game; settings.game = fg->game;
settings.crcval = fg->crcval;
} }
} }
@ -741,7 +743,7 @@ int startwin_idle(void *s)
return 0; return 0;
} }
extern char *duke3dgrp; extern char *duke3dgrp, *duke3dgrpstring;
int startwin_run(void) int startwin_run(void)
{ {
@ -766,6 +768,8 @@ int startwin_run(void)
SetPage(TAB_MESSAGES); SetPage(TAB_MESSAGES);
if (retval) if (retval)
{ {
int i;
ud.config.ScreenMode = settings.fullscreen; ud.config.ScreenMode = settings.fullscreen;
ud.config.ScreenWidth = settings.xdim3d; ud.config.ScreenWidth = settings.xdim3d;
ud.config.ScreenHeight = settings.ydim3d; ud.config.ScreenHeight = settings.ydim3d;
@ -775,6 +779,10 @@ int startwin_run(void)
ud.config.UseJoystick = settings.usejoy; ud.config.UseJoystick = settings.usejoy;
duke3dgrp = settings.selectedgrp; duke3dgrp = settings.selectedgrp;
g_GameType = settings.game; g_GameType = settings.game;
for (i = 0; i<numgrpfiles; i++) if (settings.crcval == grpfiles[i].crcval) break;
if (i != numgrpfiles)
duke3dgrpstring = (char *)grpfiles[i].name;
} }
return retval; return retval;

View file

@ -34,6 +34,7 @@ static struct
int usemouse, usejoy; int usemouse, usejoy;
char selectedgrp[BMAX_PATH+1]; char selectedgrp[BMAX_PATH+1];
int game; int game;
int crcval; // for finding the grp in the list again
} }
settings; settings;
@ -211,6 +212,7 @@ static INT_PTR CALLBACK GamePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
{ {
strcpy(settings.selectedgrp, ((struct grpfile*)i)->name); strcpy(settings.selectedgrp, ((struct grpfile*)i)->name);
settings.game = ((struct grpfile*)i)->game; settings.game = ((struct grpfile*)i)->game;
settings.crcval = ((struct grpfile*)i)->crcval;
} }
return TRUE; return TRUE;
} }
@ -564,7 +566,7 @@ int startwin_idle(void *v)
return 0; return 0;
} }
extern char *duke3dgrp; extern char *duke3dgrp, *duke3dgrpstring;
int startwin_run(void) int startwin_run(void)
{ {
@ -587,6 +589,7 @@ int startwin_run(void)
settings.usemouse = ud.config.UseMouse; settings.usemouse = ud.config.UseMouse;
settings.usejoy = ud.config.UseJoystick; settings.usejoy = ud.config.UseJoystick;
settings.game = g_GameType; settings.game = g_GameType;
// settings.crcval = 0;
strncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH); strncpy(settings.selectedgrp, duke3dgrp, BMAX_PATH);
PopulateForm(-1); PopulateForm(-1);
@ -611,6 +614,8 @@ int startwin_run(void)
EnableConfig(0); EnableConfig(0);
if (done) if (done)
{ {
int i;
ud.config.ScreenMode = settings.fullscreen; ud.config.ScreenMode = settings.fullscreen;
ud.config.ScreenWidth = settings.xdim; ud.config.ScreenWidth = settings.xdim;
ud.config.ScreenHeight = settings.ydim; ud.config.ScreenHeight = settings.ydim;
@ -620,6 +625,10 @@ int startwin_run(void)
ud.config.UseJoystick = settings.usejoy; ud.config.UseJoystick = settings.usejoy;
duke3dgrp = settings.selectedgrp; duke3dgrp = settings.selectedgrp;
g_GameType = settings.game; g_GameType = settings.game;
for (i = 0; i<numgrpfiles; i++) if (settings.crcval == grpfiles[i].crcval) break;
if (i != numgrpfiles)
duke3dgrpstring = (char *)grpfiles[i].name;
} }
if (wavedevs) if (wavedevs)