Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 4967 → Rev 4968

/polymer/eduke32/source/game.c
3377,6 → 3377,11
invalidatetile(CROSSHAIR, -1, -1);
}
 
static inline size_t G_LastMapInfoIndex(void)
{
return ud.volume_number*MAXLEVELS + ud.last_level - 1;
}
 
#define SCORESHEETOFFSET -20
static void G_ShowScores(void)
{
3385,7 → 3390,7
if (playerswhenstarted > 1 && (GametypeFlags[ud.coop]&GAMETYPE_SCORESHEET))
{
gametext(160,SCORESHEETOFFSET+58+2,"Multiplayer Totals",0,2+8+16);
gametext(160,SCORESHEETOFFSET+58+10,MapInfo[(ud.volume_number*MAXLEVELS)+ud.last_level-1].name,0,2+8+16);
gametext(160,SCORESHEETOFFSET+58+10,MapInfo[G_LastMapInfoIndex()].name,0,2+8+16);
 
t = 0;
minitext(70,SCORESHEETOFFSET+80,"Name",8,2+8+16+ROTATESPRITE_MAX);
12400,7 → 12405,7
if (PLUTOPAK) // JBF 20030804
rotatesprite_fs((260)<<16,36<<16,65536L,0,PLUTOPAKSPRITE+2,0,0,2+8);
gametext(160,58+2,"Multiplayer Totals",0,2+8+16);
gametext(160,58+10,MapInfo[(ud.volume_number*MAXLEVELS)+ud.last_level-1].name,0,2+8+16);
gametext(160,58+10,MapInfo[G_LastMapInfoIndex()].name,0,2+8+16);
 
gametext(160,165,"Press any key or button to continue",quotepulseshade,2+8+16);
 
12457,6 → 12462,57
minitext(45,96+(8*7),"Deaths",8,2+8+16+128);
}
 
static int32_t G_PrintTime_ClockPad(void)
{
int32_t clockpad = 2;
int32_t ii, ij;
 
for (ii=g_player[myconnectindex].ps->player_par/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij);
if (!(ud.volume_number == 0 && ud.last_level-1 == 7 && boardfilename[0]))
{
for (ii=MapInfo[G_LastMapInfoIndex()].partime/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij);
if (!NAM && MapInfo[G_LastMapInfoIndex()].designertime)
{
for (ii=MapInfo[G_LastMapInfoIndex()].designertime/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij);
}
}
if (ud.playerbest > 0) for (ii=ud.playerbest/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij);
 
return clockpad;
}
 
static const char* G_PrintTime2(int32_t time)
{
Bsprintf(tempbuf, "%0*d:%02d", G_PrintTime_ClockPad(), time/(REALGAMETICSPERSEC*60), (time/REALGAMETICSPERSEC)%60);
return tempbuf;
}
static const char* G_PrintTime3(int32_t time)
{
Bsprintf(tempbuf, "%0*d:%02d.%02d", G_PrintTime_ClockPad(), time/(REALGAMETICSPERSEC*60), (time/REALGAMETICSPERSEC)%60, ((time%REALGAMETICSPERSEC)*33)/10);
return tempbuf;
}
 
const char* G_PrintYourTime(void)
{
return G_PrintTime3(g_player[myconnectindex].ps->player_par);
}
const char* G_PrintParTime(void)
{
return G_PrintTime2(MapInfo[G_LastMapInfoIndex()].partime);
}
const char* G_PrintDesignerTime(void)
{
return G_PrintTime2(MapInfo[G_LastMapInfoIndex()].designertime);
}
const char* G_PrintBestTime(void)
{
return G_PrintTime3(ud.playerbest);
}
 
void G_BonusScreen(int32_t bonusonly)
{
int32_t gfx_offset;
12463,7 → 12519,6
int32_t bonuscnt;
int32_t clockpad = 2;
char *lastmapname;
int32_t playerbest = -1;
 
if (g_networkMode == NET_DEDICATED_SERVER)
return;
12478,9 → 12533,9
}
else
{
lastmapname = MapInfo[(ud.volume_number*MAXLEVELS)+ud.last_level-1].name;
lastmapname = MapInfo[G_LastMapInfoIndex()].name;
if (!lastmapname) // this isn't right but it's better than no name at all
lastmapname = MapInfo[(ud.m_volume_number*MAXLEVELS)+ud.last_level-1].name;
lastmapname = MapInfo[G_LastMapInfoIndex()].name;
}
 
 
12561,30 → 12616,9
bonuscnt = 0;
totalclock = 0;
 
playerbest = CONFIG_GetMapBestTime(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].filename);
if (g_player[myconnectindex].ps->player_par > 0 && (g_player[myconnectindex].ps->player_par < ud.playerbest || ud.playerbest < 0))
CONFIG_SetMapBestTime(MapInfo[G_LastMapInfoIndex()].filename, g_player[myconnectindex].ps->player_par);
 
if (g_player[myconnectindex].ps->player_par > 0 && (g_player[myconnectindex].ps->player_par < playerbest || playerbest < 0))
CONFIG_SetMapBestTime(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].filename, g_player[myconnectindex].ps->player_par);
 
{
int32_t ii, ij;
 
for (ii=g_player[myconnectindex].ps->player_par/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij);
if (!(ud.volume_number == 0 && ud.last_level-1 == 7 && boardfilename[0]))
{
for (ii=MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij);
if (!NAM && MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime)
{
for (ii=MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij);
}
}
if (playerbest > 0) for (ii=playerbest/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij);
}
 
do
{
int32_t yy = 0, zz;
12665,12 → 12699,12
yy+=10;
if (!(ud.volume_number == 0 && ud.last_level-1 == 7 && boardfilename[0]))
{
if (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime)
if (MapInfo[G_LastMapInfoIndex()].partime)
{
gametext(10,yy+9,"Par Time:",0,2+8+16);
yy+=10;
}
if (!NAM && !DUKEBETA && MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime)
if (!NAM && !DUKEBETA && MapInfo[G_LastMapInfoIndex()].designertime)
{
gametext(10,yy+9,"3D Realms' Time:",0,2+8+16);
yy+=10;
12677,9 → 12711,9
}
 
}
if (playerbest > 0)
if (ud.playerbest > 0)
{
gametext(10,yy+9,(g_player[myconnectindex].ps->player_par > 0 && g_player[myconnectindex].ps->player_par < playerbest)?"Prev Best Time:":"Your Best Time:",0,2+8+16);
gametext(10,yy+9,(g_player[myconnectindex].ps->player_par > 0 && g_player[myconnectindex].ps->player_par < ud.playerbest)?"Prev Best Time:":"Your Best Time:",0,2+8+16);
yy += 10;
}
 
12697,13 → 12731,9
 
if (g_player[myconnectindex].ps->player_par > 0)
{
Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad,
(g_player[myconnectindex].ps->player_par/(REALGAMETICSPERSEC*60)),
(g_player[myconnectindex].ps->player_par/REALGAMETICSPERSEC)%60,
((g_player[myconnectindex].ps->player_par%REALGAMETICSPERSEC)*33)/10
);
G_PrintYourTime();
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
if (g_player[myconnectindex].ps->player_par < playerbest)
if (g_player[myconnectindex].ps->player_par < ud.playerbest)
gametext((320>>2)+89+(clockpad*24),yy+9,"New record!",0,2+8+16);
}
else
12712,31 → 12742,23
 
if (!(ud.volume_number == 0 && ud.last_level-1 == 7 && boardfilename[0]))
{
if (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime)
if (MapInfo[G_LastMapInfoIndex()].partime)
{
Bsprintf(tempbuf,"%0*d:%02d",clockpad,
(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/(REALGAMETICSPERSEC*60)),
(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/REALGAMETICSPERSEC)%60);
G_PrintParTime();
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
yy+=10;
}
if (!NAM && !DUKEBETA && MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime)
if (!NAM && !DUKEBETA && MapInfo[G_LastMapInfoIndex()].designertime)
{
Bsprintf(tempbuf,"%0*d:%02d",clockpad,
(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/(REALGAMETICSPERSEC*60)),
(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/REALGAMETICSPERSEC)%60);
G_PrintDesignerTime();
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
yy+=10;
}
}
 
if (playerbest > 0)
if (ud.playerbest > 0)
{
Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad,
(playerbest/(REALGAMETICSPERSEC*60)),
(playerbest/REALGAMETICSPERSEC)%60,
((playerbest%REALGAMETICSPERSEC)*33)/10
);
G_PrintBestTime();
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
yy+=10;
}
/polymer/eduke32/source/game.h
167,6 → 167,7
int32_t player_skill,level_number,volume_number,m_marker,marker,mouseflip;
 
vec2_t m_origin;
int32_t playerbest;
 
int32_t configversion;
#if !defined LUNATIC
335,6 → 336,11
void A_SpawnWallGlass(int32_t i,int32_t wallnum,int32_t n);
void G_AddUserQuote(const char *daquote);
void G_BackToMenu(void);
 
const char* G_PrintYourTime(void);
const char* G_PrintParTime(void);
const char* G_PrintDesignerTime(void);
const char* G_PrintBestTime(void);
void G_BonusScreen(int32_t bonusonly);
//void G_CheatGetInv(void);
void G_DisplayRest(int32_t smoothratio);
/polymer/eduke32/source/gamedef.c
1045,6 → 1045,7
{ "last_camsprite", USERDEFS_LAST_CAMSPRITE, 0, 0 },
{ "last_level", USERDEFS_LAST_LEVEL, 0, 0 },
{ "secretlevel", USERDEFS_SECRETLEVEL, 0, 0 },
{ "playerbest", USERDEFS_PLAYERBEST, 0, 0 },
 
{ "const_visibility", USERDEFS_CONST_VISIBILITY, 0, 0 },
{ "uw_framerate", USERDEFS_UW_FRAMERATE, 0, 0 },
/polymer/eduke32/source/gamedef.h
425,6 → 425,7
USERDEFS_RUNKEY_MODE,
USERDEFS_M_ORIGIN_X,
USERDEFS_M_ORIGIN_Y,
USERDEFS_PLAYERBEST,
USERDEFS_END
};
 
/polymer/eduke32/source/gamestructures.c
251,6 → 251,7
case USERDEFS_RUNKEY_MODE: lLabelID = ud.runkey_mode; break;
case USERDEFS_M_ORIGIN_X: lLabelID = ud.m_origin.x; break;
case USERDEFS_M_ORIGIN_Y: lLabelID = ud.m_origin.y; break;
case USERDEFS_PLAYERBEST: lLabelID = ud.playerbest; break;
default: lLabelID = -1; break;
}
Gv_SetVarX(lVar2, lLabelID);
/polymer/eduke32/source/lunatic/con_lang.lua
868,6 → 868,7
mouseaiming = UD".mouseaiming",
pause_on = UDRO".pause_on",
player_skill = UD".player_skill",
playerbest = UDRO".playerbest",
mouseflip = UDRO".mouseflip",
multimode = { "1" },
noexits = UDRO".noexits",
/polymer/eduke32/source/lunatic/defs.ilua
513,6 → 513,7
int32_t player_skill,level_number,volume_number,m_marker,marker,mouseflip;
 
vec2_t m_origin;
int32_t playerbest;
 
int32_t configversion;
 
/polymer/eduke32/source/premap.c
1905,6 → 1905,8
G_AlignWarpElevators();
resetpspritevars(g);
 
ud.playerbest = CONFIG_GetMapBestTime(MapInfo[mii].filename);
 
G_FadeLoad(0,0,0, 63,0, -7, 4);
G_CacheMapData();
G_FadeLoad(0,0,0, 0,63, 7, 4);