mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@909 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
8b9116d1a4
commit
9ebad22ac8
9 changed files with 62 additions and 39 deletions
|
@ -123,6 +123,7 @@ int OSD_RegisterFunction(const char *name, const char *help, int (*func)(const o
|
|||
#define OSDTEXT_YELLOW "^23"
|
||||
#define OSDTEXT_BRIGHT "^S0"
|
||||
|
||||
#define OSD_ERROR OSDTEXT_DARKRED OSDTEXT_BRIGHT
|
||||
#define TEXTSIZE 32768
|
||||
|
||||
#endif // __osd_h__
|
||||
|
|
|
@ -231,7 +231,7 @@ static int _internal_osdfunc_exec(const osdfuncparm_t *parm)
|
|||
|
||||
if (OSD_Exec(fn))
|
||||
{
|
||||
OSD_Printf("exec: file \"%s\" not found.\n", fn);
|
||||
OSD_Printf(OSD_ERROR "exec: file \"%s\" not found.\n", fn);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
|
|
|
@ -1030,6 +1030,7 @@ static void moveplayers(void) //Players
|
|||
otherx = 0;
|
||||
}
|
||||
|
||||
if (actorscrptr[sprite[i].picnum])
|
||||
execute(i,s->yvel,otherx);
|
||||
|
||||
if (ud.multimode > 1)
|
||||
|
@ -2261,10 +2262,12 @@ CLEAR_THE_BOLT:
|
|||
case STEAM__STATIC:
|
||||
case CEILINGSTEAM__STATIC:
|
||||
p = findplayer(s, &x);
|
||||
if (actorscrptr[sprite[i].picnum])
|
||||
execute(i,p,x);
|
||||
goto BOLT;
|
||||
case WATERBUBBLEMAKER__STATIC:
|
||||
p = findplayer(s, &x);
|
||||
if (actorscrptr[sprite[i].picnum])
|
||||
execute(i,p,x);
|
||||
goto BOLT;
|
||||
}
|
||||
|
@ -2729,9 +2732,12 @@ static void moveweapons(void)
|
|||
|
||||
|
||||
if (hittype[i].projectile.workslike & PROJECTILE_FLAG_HITSCAN)
|
||||
{
|
||||
if (actorscrptr[sprite[i].picnum])
|
||||
{
|
||||
p = findplayer(s,&x);
|
||||
execute(i,p,x);
|
||||
}
|
||||
goto BOLT;
|
||||
}
|
||||
|
||||
|
@ -3091,8 +3097,11 @@ static void moveweapons(void)
|
|||
goto BOLT;
|
||||
|
||||
case SHOTSPARK1__STATIC:
|
||||
if (actorscrptr[sprite[i].picnum])
|
||||
{
|
||||
p = findplayer(s,&x);
|
||||
execute(i,p,x);
|
||||
}
|
||||
goto BOLT;
|
||||
}
|
||||
}
|
||||
|
@ -4760,10 +4769,11 @@ DETONATEB:
|
|||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
if (actorscrptr[sprite[i].picnum])
|
||||
{
|
||||
p = findplayer(s,&x);
|
||||
|
||||
execute(i,p,x);
|
||||
}
|
||||
|
||||
BOLT:
|
||||
|
||||
|
@ -5204,8 +5214,11 @@ static void moveexplosions(void) // STATNUM 5
|
|||
case FORCERIPPLE__STATIC:
|
||||
case TRANSPORTERSTAR__STATIC:
|
||||
case TRANSPORTERBEAM__STATIC:
|
||||
if (actorscrptr[sprite[i].picnum])
|
||||
{
|
||||
p = findplayer(s,&x);
|
||||
execute(i,p,x);
|
||||
}
|
||||
goto BOLT;
|
||||
|
||||
case SHELL__STATIC:
|
||||
|
|
|
@ -511,7 +511,7 @@ void getpackets(void)
|
|||
{
|
||||
if (setgamemode(!ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP))
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "Failed setting fullscreen video mode.\n");
|
||||
OSD_Printf(OSD_ERROR "Failed setting fullscreen video mode.\n");
|
||||
if (setgamemode(ud.config.ScreenMode, ud.config.ScreenWidth, ud.config.ScreenHeight, ud.config.ScreenBPP))
|
||||
gameexit("Failed to recover from failure to set fullscreen video mode.\n");
|
||||
}
|
||||
|
@ -2446,7 +2446,7 @@ static void operatefta(void)
|
|||
|
||||
if (fta_quotes[g_player[screenpeek].ps->ftq] == NULL)
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "%s %d null quote %d\n",__FILE__,__LINE__,g_player[screenpeek].ps->ftq);
|
||||
OSD_Printf(OSD_ERROR "%s %d null quote %d\n",__FILE__,__LINE__,g_player[screenpeek].ps->ftq);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2489,7 +2489,7 @@ void FTA(int q, player_struct *p)
|
|||
|
||||
if (fta_quotes[q] == NULL)
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "%s %d null quote %d\n",__FILE__,__LINE__,q);
|
||||
OSD_Printf(OSD_ERROR "%s %d null quote %d\n",__FILE__,__LINE__,q);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5338,7 +5338,7 @@ int spawn(int j, int pn)
|
|||
if (sp->hitag && sp->picnum == WATERBUBBLEMAKER)
|
||||
{
|
||||
// JBF 20030913: Pisses off move(), eg. in bobsp2
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n",
|
||||
OSD_Printf(OSD_ERROR "WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n",
|
||||
i,sp->x,sp->y);
|
||||
sp->hitag = 0;
|
||||
}
|
||||
|
@ -9672,12 +9672,14 @@ void Shutdown(void)
|
|||
|
||||
static void compilecons(void)
|
||||
{
|
||||
int i;
|
||||
int i, psm = pathsearchmode;
|
||||
label = (char *)&sprite[0]; // V8: 16384*44/64 = 11264 V7: 4096*44/64 = 2816
|
||||
labelcode = (intptr_t *)§or[0]; // V8: 4096*40/4 = 40960 V7: 1024*40/4 = 10240
|
||||
labeltype = (intptr_t *)&wall[0]; // V8: 16384*32/4 = 131072 V7: 8192*32/4 = 65536
|
||||
// if we compile for a V7 engine wall[] should be used for label names since it's bigger
|
||||
|
||||
Bcorrectfilename(confilename,0);
|
||||
// if we compile for a V7 engine wall[] should be used for label names since it's bigger
|
||||
pathsearchmode = 1;
|
||||
if (userconfiles == 0)
|
||||
{
|
||||
i = kopen4load(confilename,0);
|
||||
|
@ -9728,6 +9730,7 @@ static void compilecons(void)
|
|||
clearbufbyte(&wall[0], sizeof(walltype) * MAXWALLS, 0);
|
||||
|
||||
OnEvent(EVENT_INIT, -1, -1, -1);
|
||||
pathsearchmode = psm;
|
||||
}
|
||||
|
||||
static void sanitizegametype()
|
||||
|
@ -10169,6 +10172,12 @@ void app_main(int argc,const char **argv)
|
|||
backgroundidle = 0;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
tempbuf[GetModuleFileName(NULL,tempbuf,BMAX_PATH)] = 0;
|
||||
Bcorrectfilename(tempbuf,1);
|
||||
chdir(tempbuf);
|
||||
#endif
|
||||
|
||||
OSD_SetLogFile("eduke32.log");
|
||||
OSD_SetParameters(6,0, 0,12, 2,12);
|
||||
OSD_SetFunctions(
|
||||
|
@ -10890,7 +10899,7 @@ static int opendemoread(int which_demo) // 0 = mine
|
|||
newgame(ud.volume_number,ud.level_number,ud.player_skill);
|
||||
return(1);
|
||||
corrupt:
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "Demo %d header is corrupt.\n",which_demo);
|
||||
OSD_Printf(OSD_ERROR "Demo %d header is corrupt.\n",which_demo);
|
||||
ud.reccnt = 0;
|
||||
kclose(recfilep);
|
||||
return 0;
|
||||
|
@ -11043,7 +11052,7 @@ RECHECK:
|
|||
l = min(ud.reccnt,RECSYNCBUFSIZ);
|
||||
if (kdfread(recsync,sizeof(input)*ud.multimode,l/ud.multimode,recfilep) != l/ud.multimode)
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "Demo %d is corrupt.\n", which_demo-1);
|
||||
OSD_Printf(OSD_ERROR "Demo %d is corrupt.\n", which_demo-1);
|
||||
foundemo = 0;
|
||||
ud.reccnt = 0;
|
||||
kclose(recfilep);
|
||||
|
|
|
@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
void restoremapstate(mapstate_t *save);
|
||||
void savemapstate(mapstate_t *save);
|
||||
#define CON_ERROR OSDTEXT_DARKRED OSDTEXT_BRIGHT "Line %d, "
|
||||
#define CON_ERROR OSD_ERROR "Line %d, "
|
||||
|
||||
int g_i,g_p;
|
||||
static int g_x;
|
||||
|
@ -7719,7 +7719,9 @@ void LoadActor(int iActor)
|
|||
|
||||
void execute(int iActor,int iPlayer,int lDist)
|
||||
{
|
||||
short temp, temp2;
|
||||
int temp, temp2;
|
||||
|
||||
// if (actorscrptr[sprite[iActor].picnum] == 0) return;
|
||||
|
||||
g_i = iActor; // Sprite ID
|
||||
g_p = iPlayer; // Player ID
|
||||
|
@ -7727,8 +7729,6 @@ void execute(int iActor,int iPlayer,int lDist)
|
|||
g_sp = &sprite[g_i]; // Pointer to sprite structure
|
||||
g_t = &hittype[g_i].temp_data[0]; // Sprite's 'extra' data
|
||||
|
||||
if (actorscrptr[g_sp->picnum] == 0) return;
|
||||
|
||||
insptr = 4 + (actorscrptr[g_sp->picnum]);
|
||||
|
||||
killit_flag = 0;
|
||||
|
@ -7946,8 +7946,8 @@ void restoremapstate(mapstate_t *save)
|
|||
if (save != NULL)
|
||||
{
|
||||
int i, k, x;
|
||||
char phealth[ud.multimode];
|
||||
intptr_t j;
|
||||
char phealth[MAXPLAYERS];
|
||||
|
||||
for (i=0;i<ud.multimode;i++)
|
||||
phealth[i] = sprite[g_player[i].ps->i].extra;
|
||||
|
|
|
@ -621,13 +621,13 @@ int GetGameVarID(int id, int iActor, int iPlayer)
|
|||
// OSD_Printf("GetGameVarID(): reading from array\n");
|
||||
if ((index < aGameArrays[id].size)&&(index>=0))
|
||||
return(m * aGameArrays[id].plValues[index]);
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "GetGameVarID(): invalid array index (%s[%d])\n",aGameArrays[id].szLabel,index);
|
||||
OSD_Printf(OSD_ERROR "GetGameVarID(): invalid array index (%s[%d])\n",aGameArrays[id].szLabel,index);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(id&(MAXGAMEVARS<<1)))
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "GetGameVarID(): invalid gamevar ID (%d)\n",id);
|
||||
OSD_Printf(OSD_ERROR "GetGameVarID(): invalid gamevar ID (%d)\n",id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -681,7 +681,7 @@ void SetGameArrayID(int id,int index, int lValue)
|
|||
{
|
||||
if (id<0 || id >= iGameArrayCount || !((index < aGameArrays[id].size)&&(index>=0)))
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "SetGameVarID(): tried to set invalid array ID (%d) or index out of bounds from sprite %d (%d), player %d\n",id,g_i,sprite[g_i].picnum,g_p);
|
||||
OSD_Printf(OSD_ERROR "SetGameVarID(): tried to set invalid array ID (%d) or index out of bounds from sprite %d (%d), player %d\n",id,g_i,sprite[g_i].picnum,g_p);
|
||||
return;
|
||||
}
|
||||
aGameArrays[id].plValues[index]=lValue;
|
||||
|
@ -691,7 +691,7 @@ void SetGameVarID(int id, int lValue, int iActor, int iPlayer)
|
|||
{
|
||||
if (id<0 || id >= iGameVarCount)
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "SetGameVarID(): tried to set invalid gamevar ID (%d) from sprite %d (%d), player %d\n",id,g_i,sprite[g_i].picnum,g_p);
|
||||
OSD_Printf(OSD_ERROR "SetGameVarID(): tried to set invalid gamevar ID (%d) from sprite %d (%d), player %d\n",id,g_i,sprite[g_i].picnum,g_p);
|
||||
return;
|
||||
}
|
||||
//Bsprintf(g_szBuf,"SGVI: %d ('%s') to %d for %d %d",id,aGameVars[id].szLabel,lValue,iActor,iPlayer);
|
||||
|
@ -700,7 +700,7 @@ void SetGameVarID(int id, int lValue, int iActor, int iPlayer)
|
|||
{
|
||||
if (iPlayer < 0 || iPlayer > MAXPLAYERS-1)
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "SetGameVarID(): invalid player (%d) for per-player gamevar %s from sprite %d (%d), player %d\n",iPlayer,aGameVars[id].szLabel,g_i,sprite[g_i].picnum,g_p);
|
||||
OSD_Printf(OSD_ERROR "SetGameVarID(): invalid player (%d) for per-player gamevar %s from sprite %d (%d), player %d\n",iPlayer,aGameVars[id].szLabel,g_i,sprite[g_i].picnum,g_p);
|
||||
return;
|
||||
}
|
||||
// for the current player
|
||||
|
@ -712,7 +712,7 @@ void SetGameVarID(int id, int lValue, int iActor, int iPlayer)
|
|||
{
|
||||
if (iActor < 0 || iActor > MAXSPRITES-1)
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "SetGameVarID(): invalid sprite (%d) for per-actor gamevar %s from sprite %d (%d), player %d\n",iActor,aGameVars[id].szLabel,g_i,sprite[g_i].picnum,g_p);
|
||||
OSD_Printf(OSD_ERROR "SetGameVarID(): invalid sprite (%d) for per-actor gamevar %s from sprite %d (%d), player %d\n",iActor,aGameVars[id].szLabel,g_i,sprite[g_i].picnum,g_p);
|
||||
return;
|
||||
}
|
||||
// for the current actor
|
||||
|
@ -774,7 +774,7 @@ static intptr_t *GetGameValuePtr(const char *szGameLabel)
|
|||
{
|
||||
if (!aGameVars[i].plValues)
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "GetGameValuePtr(): INTERNAL ERROR: NULL array !!!\n");
|
||||
OSD_Printf(OSD_ERROR "GetGameValuePtr(): INTERNAL ERROR: NULL array !!!\n");
|
||||
}
|
||||
return aGameVars[i].plValues;
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ static int osdcmd_map(const osdfuncparm_t *parm)
|
|||
|
||||
if ((i = kopen4load(filename,0)) < 0)
|
||||
{
|
||||
OSD_Printf("map: file \"%s\" not found.\n", filename);
|
||||
OSD_Printf(OSD_ERROR "map: file \"%s\" not found.\n", filename);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
kclose(i);
|
||||
|
|
|
@ -1686,7 +1686,7 @@ int enterlevel(int g)
|
|||
{
|
||||
if (loadboard(boardfilename,0,&g_player[0].ps->posx, &g_player[0].ps->posy, &g_player[0].ps->posz, &g_player[0].ps->ang,&g_player[0].ps->cursectnum) == -1)
|
||||
{
|
||||
initprintf("Map '%s' not found!\n",boardfilename);
|
||||
OSD_Printf(OSD_ERROR "Map '%s' not found!\n",boardfilename);
|
||||
//gameexit(tempbuf);
|
||||
return 1;
|
||||
}
|
||||
|
@ -1708,7 +1708,7 @@ int enterlevel(int g)
|
|||
}
|
||||
else if (loadboard(map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename,0,&g_player[0].ps->posx, &g_player[0].ps->posy, &g_player[0].ps->posz, &g_player[0].ps->ang,&g_player[0].ps->cursectnum) == -1)
|
||||
{
|
||||
initprintf("Map %s not found!\n",map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename);
|
||||
OSD_Printf(OSD_ERROR "Map %s not found!\n",map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename);
|
||||
//gameexit(tempbuf);
|
||||
return 1;
|
||||
}
|
||||
|
@ -1739,7 +1739,7 @@ int enterlevel(int g)
|
|||
|
||||
if (loadboard(levname,1,&g_player[0].ps->posx, &g_player[0].ps->posy, &g_player[0].ps->posz, &g_player[0].ps->ang,&g_player[0].ps->cursectnum) == -1)
|
||||
{
|
||||
initprintf("Map '%s' not found!\n",map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename);
|
||||
OSD_Printf(OSD_ERROR "Map '%s' not found!\n",map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename);
|
||||
//gameexit(tempbuf);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ int loadsound(unsigned int num)
|
|||
|
||||
if (g_sounds[num].filename == NULL)
|
||||
{
|
||||
OSD_Printf(OSDTEXT_DARKRED OSDTEXT_BRIGHT "Sound (#%d) not defined!\n",num);
|
||||
OSD_Printf(OSD_ERROR "Sound (#%d) not defined!\n",num);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue