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 SPECPAL (MAXPALOOKUPS - 8)
#define STAT_NOCULL 99
#define CLIPMASK0 (((1L)<<16)+1L)
#define CLIPMASK1 (((256L)<<16)+64L)
@ -547,7 +549,7 @@ extern int r_animsmoothing;
extern int r_parallaxskyclamping;
extern int r_parallaxskypanning;
extern int r_cullobstructedmodels;
extern int r_fullbright;
extern int r_fullbrights;
extern int mdtims, omdtims;
#endif

View file

@ -179,7 +179,7 @@ int r_cullobstructedmodels = 0;
#define CULL_DELAY 5
// fullbright cvar
int r_fullbright = 1;
int r_fullbrights = 1;
static float fogresult, fogcol[4];
@ -582,7 +582,7 @@ void gltexapplyprops(void)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
if (glinfo.maxanisotropy > 1.0)
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);
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;
pth = gltexcache(globalpicnum,globalpal,method&(~3));
if (r_fullbright && pth->flags & 16)
if (r_fullbrights && pth->flags & 16)
if (indrawroomsandmasks)
{
if (!fullbrightdrawingpass)
@ -4514,7 +4514,7 @@ void polymost_drawsprite(int snum)
if (totalclock < lastcullcheck[tspr->owner])
break;
cullmodel[tspr->owner] = 1;
if (tspr->statnum == 99)
if (tspr->statnum == STAT_NOCULL)
{ cullmodel[tspr->owner] = 0; break; }
/* if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum,
tspr->x, tspr->y, tspr->z, tspr->sectnum))
@ -4525,9 +4525,9 @@ void polymost_drawsprite(int snum)
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x, tspr->y, tspr->z,tspr->sectnum))
{ cullmodel[tspr->owner] = 0; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
/* if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
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,
tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ cullmodel[tspr->owner] = 0; break; } */
@ -4535,7 +4535,7 @@ void polymost_drawsprite(int snum)
if (polymost_checkcoordinates(0, 0, tspr))
{ cullmodel[tspr->owner] = 0; break; }
i = 640;
i = 256;
if (polymost_checkcoordinates(-i, 0, tspr))
{ cullmodel[tspr->owner] = 0; break; }
if (polymost_checkcoordinates(-i, -i, tspr))
@ -5964,10 +5964,10 @@ static int osdcmd_polymostvars(const osdfuncparm_t *parm)
else r_cullobstructedmodels = (val != 0);
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); }
else r_fullbright = (val != 0);
if (showval) { OSD_Printf("r_fullbrights is %d\n", r_fullbrights); }
else r_fullbrights = (val != 0);
return OSDCMD_OK;
}
#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_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_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_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);

View file

@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "scriptfile.h"
#include "crc32.h"
#define VERSION " 1.2.0 svn"
#define VERSION " 1.2.0devel"
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", "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", "GLGlowMapping", &r_glowmapping);
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", "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", "GLGlowMapping", r_glowmapping,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 HEAD "EDuke32"VERSION" (shareware)"
#define VERSION " 1.5.0devel"
#define HEAD2 "EDuke32"VERSION
#ifdef __cplusplus

View file

@ -54,7 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <windows.h>
#include <shellapi.h>
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
#endif
@ -114,6 +114,7 @@ static int sendmessagecommand = -1;
char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp";
char *duke3dgrp = defaultduke3dgrp;
char *duke3dgrpstring = NULL;
static char defaultconfilename[BMAX_PATH] = {"EDUKE.CON"};
static char *confilename = defaultconfilename;
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)
{
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));
tsprite[spritesortcnt].statnum = 99;
tsprite[spritesortcnt].statnum = STAT_NOCULL;
/* tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
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));
tsprite[spritesortcnt].statnum = 99;
tsprite[spritesortcnt].statnum = STAT_NOCULL;
tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4;
@ -6939,7 +6940,7 @@ PALONLY:
{
memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
tsprite[spritesortcnt].statnum = 99;
tsprite[spritesortcnt].statnum = STAT_NOCULL;
tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4;
@ -7107,7 +7108,7 @@ PALONLY:
}
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)
{
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
@ -9394,8 +9395,8 @@ static void Logo(void)
flushperms();
nextpage();
if (VOLUMEALL) wm_setapptitle(HEAD2);
else wm_setapptitle(HEAD);
Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
wm_setapptitle(tempbuf);
MUSIC_StopSong();
FX_StopAllSounds(); // JBF 20031228
@ -10139,8 +10140,8 @@ void backtomenu(void)
g_player[myconnectindex].ps->gm = MODE_MENU;
cmenu(0);
KB_FlushKeyboardQueue();
if (VOLUMEALL) wm_setapptitle(HEAD2);
else wm_setapptitle(HEAD);
Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
wm_setapptitle(tempbuf);
}
#ifdef RENDERTYPEWIN
@ -10341,6 +10342,7 @@ void app_main(int argc,const char **argv)
if (!Bstrcasecmp(fg->name, defaultduke3dgrp))
{
g_GameType = grpfiles[i].game;
duke3dgrpstring = (char *)grpfiles[i].name;
break;
}
}
@ -10348,6 +10350,7 @@ void app_main(int argc,const char **argv)
{
Bstrcpy(defaultduke3dgrp, first->name);
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
if (VOLUMEALL) wm_setapptitle(HEAD2);
else wm_setapptitle(HEAD);
Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
wm_setapptitle(tempbuf);
// initprintf("\n");
@ -11974,8 +11978,8 @@ void dobonus(int bonusonly)
350, 380,VICTORY1+8,86,59
};
if (VOLUMEALL) wm_setapptitle(HEAD2);
else wm_setapptitle(HEAD);
Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
wm_setapptitle(tempbuf);
if (ud.volume_number == 0 && ud.last_level == 8 && boardfilename[0])
{

View file

@ -91,6 +91,8 @@ extern int qsetmode;
char *textptr;
int error,warning;
extern char *duke3dgrpstring;
enum labeltypes
{
LABEL_ANY = -1,
@ -461,6 +463,7 @@ static const char *keyw[] =
"loadmapstate", // 327
"clearmapstate", // 328
"scriptsize", // 329
"definegamename", // 330
"<null>"
};
@ -4448,6 +4451,33 @@ repeatcase:
skill_names[j][i] = '\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:
scriptptr--; //remove opcode from compiled code
transnum(LABEL_DEFINE); //translate number

View file

@ -838,4 +838,5 @@ enum keywords
CON_LOADMAPSTATE, // 327
CON_CLEARMAPSTATE, // 328
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 Shareware", 0x983AD923, 11035779, 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 },
{ "Napalm", 0x3DE1589A, 44365728, GAMENAM, NULL },
{ "WW2GI", 0x907B82BF, 77939508, GAMEWW2, NULL },

View file

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

View file

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

View file

@ -40,6 +40,8 @@ short spritecache[MAXTILES][3];
static char precachehightile[2][MAXTILES>>3];
static int precachecount;
extern char *duke3dgrpstring;
static void tloadtile(int tilenume, int type)
{
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)
{
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);
else Bsprintf(tempbuf,HEAD);
Bstrcat(tempbuf,apptitle);
Bstrcpy(tempbuf,apptitle);
wm_setapptitle(tempbuf);
if (!VOLUMEONE)

View file

@ -31,6 +31,7 @@ static struct
int usemouse, usejoy;
char selectedgrp[BMAX_PATH+1];
int game;
int crcval;
} settings;
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);
strcpy(settings.selectedgrp, fg->name);
settings.game = fg->game;
settings.crcval = fg->crcval;
}
}
@ -741,7 +743,7 @@ int startwin_idle(void *s)
return 0;
}
extern char *duke3dgrp;
extern char *duke3dgrp, *duke3dgrpstring;
int startwin_run(void)
{
@ -766,6 +768,8 @@ int startwin_run(void)
SetPage(TAB_MESSAGES);
if (retval)
{
int i;
ud.config.ScreenMode = settings.fullscreen;
ud.config.ScreenWidth = settings.xdim3d;
ud.config.ScreenHeight = settings.ydim3d;
@ -775,6 +779,10 @@ int startwin_run(void)
ud.config.UseJoystick = settings.usejoy;
duke3dgrp = settings.selectedgrp;
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;

View file

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