diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index c729735d3..569dc0bc8 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -220,6 +220,7 @@ void CONFIG_SetDefaults(void) ud.config.ShowOpponentWeapons = 0; ud.config.SmoothInput = 1; ud.config.SoundToggle = 1; + ud.althud = 1; ud.automsg = 0; ud.autovote = 0; ud.brightness = 8; @@ -749,6 +750,7 @@ int32 CONFIG_ReadSetup(void) SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "IDPlayers",&ud.automsg); SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ViewBobbing",&ud.viewbob); SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "WeaponSway",&ud.weaponsway); + SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "AltHud",&ud.althud); dummy = ud.config.useprecache; SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "UsePrecache",&dummy); @@ -899,6 +901,7 @@ void CONFIG_WriteSetup(void) SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "UsePrecache",ud.config.useprecache,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ViewBobbing",ud.viewbob,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "WeaponSway",ud.weaponsway,false,false); + SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AltHud",ud.althud,false,false); // SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AngleInterpolation",ud.angleinterpolation,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Detail",ud.detail,false,false); diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 16fcab309..52ead13c0 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -405,7 +405,7 @@ typedef struct { int runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125 int democams,color,msgdisptime,statusbarmode; int m_noexits,noexits,autovote,automsg,idplayers; - int team, viewbob, weaponsway; + int team, viewbob, weaponsway, althud; int entered_name,screen_tilting,shadows,fta_on,executions,auto_run; int coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 837d4a050..5389900ee 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -200,6 +200,12 @@ static inline int sbarx(int x) return (((320l<<16) - scale(320l<<16,ud.statusbarscale,100)) >> 1) + scale(x<<16,ud.statusbarscale,100); } +static inline int sbarxr(int x) +{ + if (ud.screen_size == 4 /*|| ud.statusbarmode == 1*/) return (320l<<16) - scale(x<<16,ud.statusbarscale,100); + return (((320l<<16) - scale(320l<<16,ud.statusbarscale,100)) >> 1) + scale(x<<16,ud.statusbarscale,100); +} + static inline int sbary(int y) { return ((200l<<16) - scale(200l<<16,ud.statusbarscale,100) + scale(y<<16,ud.statusbarscale,100)); @@ -1565,9 +1571,19 @@ void myospalx(int x, int y, int tilenum, int shade, int orientation, int p) static void invennum(int x,int y,char num1,char ha,char sbits) { char dabuf[80] = {0}; + int shd = (x < 0); + + if (shd) x = -x; + Bsprintf(dabuf,"%d",num1); if (num1 > 99) { + if (shd) + { + rotatesprite(sbarx(x-4+1),sbary(y+1),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,4,1|32|sbits,0,0,xdim-1,ydim-1); + rotatesprite(sbarx(x+1),sbary(y+1),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,4,1|32|sbits,0,0,xdim-1,ydim-1); + rotatesprite(sbarx(x+4+1),sbary(y+1),sbarsc(65536L),0,THREEBYFIVE+dabuf[2]-'0',ha,4,1|32|sbits,0,0,xdim-1,ydim-1); + } rotatesprite(sbarx(x-4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[2]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); @@ -1575,6 +1591,12 @@ static void invennum(int x,int y,char num1,char ha,char sbits) } if (num1 > 9) { + if (shd) + { + rotatesprite(sbarx(x+1),sbary(y+1),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,4,1|32|sbits,0,0,xdim-1,ydim-1); + rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,1|32|sbits,0,0,xdim-1,ydim-1); + } + rotatesprite(sbarx(x),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); rotatesprite(sbarx(x+4),sbary(y),sbarsc(65536L),0,THREEBYFIVE+dabuf[1]-'0',ha,0,sbits,0,0,xdim-1,ydim-1); return; @@ -1796,6 +1818,50 @@ void txdigitalnumberz(int starttile, int x,int y,int n,int s,int pal,int cs,int } } +static void altdigitalnumber(int x,int y,int n,char s,char cs) +{ + int i, j = 0, k, p, c; + char b[10]; + int rev = (x < 0); + int shd = (y < 0); + + if (rev) x = -x; + if (shd) y = -y; + + Bsnprintf(b,10,"%d",n); + i = Bstrlen(b); + + for (k=0;k>1); + + if (rev) + { +// j = 0; + for (k=0;k 4) - y = 154; - else y = (ud.drawweapon == 2?150:172); - - if (ud.screen_size == 4 && ud.drawweapon != 2) - { - xoff += 65; - if (ud.multimode > 1) - xoff -= 9; - } +// if (ud.screen_size > 4) + y = 154; +// else y = (ud.drawweapon == 2?150:172); + /* if (ud.screen_size == 4 && ud.drawweapon != 2) + { + xoff += 65; + if (ud.multimode > 1) + xoff -= 9; + } + */ while (j <= 9) { if (n&(1<i].pal == 1 && p->last_extra < 2) + altdigitalnumber(40,-(200-22),1,-16,10+16); + else altdigitalnumber(40,-(200-22),p->last_extra,-16,10+16); + + rotatesprite(sbarx(62+1),sbary(200-25+1),sbarsc(49152L),0,SHIELD,0,4,10+16+1+32,0,0,xdim-1,ydim-1); + rotatesprite(sbarx(62),sbary(200-25),sbarsc(49152L),0,SHIELD,0,0,10+16,0,0,xdim-1,ydim-1); + + altdigitalnumber(105,-(200-22),p->shield_amount,-16,10+16); + + i = 32768; + if (p->curr_weapon == PISTOL_WEAPON) i = 16384; + rotatesprite(sbarxr(57-1),sbary(200-14+1),sbarsc(i),0,ammo_sprites[p->curr_weapon],0,4,2+1+32,0,0,xdim-1,ydim-1); + rotatesprite(sbarxr(57),sbary(200-14),sbarsc(i),0,ammo_sprites[p->curr_weapon],0,0,2,0,0,xdim-1,ydim-1); + + if (p->curr_weapon == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON; + else i = p->curr_weapon; + altdigitalnumber(-20,-(200-22),p->ammo_amount[i],-16,10+16); + + o = 100; + permbit = 0; + + if (p->inven_icon) + { + switch (p->inven_icon) + { + case 1: + i = FIRSTAID_ICON; + break; + case 2: + i = STEROIDS_ICON; + break; + case 3: + i = HOLODUKE_ICON; + break; + case 4: + i = JETPACK_ICON; + break; + case 5: + i = HEAT_ICON; + break; + case 6: + i = AIRTANK_ICON; + break; + case 7: + i = BOOT_ICON; + break; + default: + i = -1; + } + if (i >= 0) + { + rotatesprite(sbarx(231-o+1),sbary(200-21-2+1),sbarsc(65536L),0,i,0,4,10+16+permbit+1+32,0,0,xdim-1,ydim-1); + rotatesprite(sbarx(231-o),sbary(200-21-2),sbarsc(65536L),0,i,0,0,10+16+permbit,0,0,xdim-1,ydim-1); + } + + minitext(292-30-o+1,190-3+1,"%",4,32+1+10+16+permbit + 256); + minitext(292-30-o,190-3,"%",6,10+16+permbit + 256); + + j = 0x80000000; + switch (p->inven_icon) + { + case 1: + i = p->firstaid_amount; + break; + case 2: + i = ((p->steroids_amount+3)>>2); + break; + case 3: + i = ((p->holoduke_amount+15)/24); + j = p->holoduke_on; + break; + case 4: + i = ((p->jetpack_amount+15)>>4); + j = p->jetpack_on; + break; + case 5: + i = p->heat_amount/12; + j = p->heat_on; + break; + case 6: + i = ((p->scuba_amount+63)>>6); + break; + case 7: + i = (p->boot_amount>>1); + break; + } + invennum(-(284-30-o),200-6-3,(char)i,0,10+permbit); + if (j > 0) + { + minitext(288-30-o+1,180-3+1,"ON",4,32+1+10+16+permbit + 256); + minitext(288-30-o,180-3,"ON",0,10+16+permbit + 256); + } + else if ((unsigned int)j != 0x80000000) + { + minitext(284-30-o+1,180-3+1,"OFF",4,32+1+10+16+permbit + 256); + minitext(284-30-o,180-3,"OFF",2,10+16+permbit + 256); + } + if (p->inven_icon >= 6) + { + minitext(284-35-o+1,180-3+1,"AUTO",4,32+1+10+16+permbit + 256); + minitext(284-35-o,180-3,"AUTO",2,10+16+permbit + 256); + } + + } + if (p->got_access&1) rotatesprite(sbarxr(39-1),sbary(200-43+1),sbarsc(32768),0,ACCESSCARD,0,4,10+16+32+1,0,0,xdim-1,ydim-1); + if (p->got_access&2) rotatesprite(sbarxr(34-1),sbary(200-41+1),sbarsc(32768),0,ACCESSCARD,0,4,10+16+32+1,0,0,xdim-1,ydim-1); + if (p->got_access&4) rotatesprite(sbarxr(29-1),sbary(200-39+1),sbarsc(32768),0,ACCESSCARD,0,4,10+16+32+1,0,0,xdim-1,ydim-1); + + if (p->got_access&1) rotatesprite(sbarxr(39),sbary(200-43),sbarsc(32768),0,ACCESSCARD,0,0,10+16,0,0,xdim-1,ydim-1); + if (p->got_access&2) rotatesprite(sbarxr(34),sbary(200-41),sbarsc(32768),0,ACCESSCARD,0,21,10+16,0,0,xdim-1,ydim-1); + if (p->got_access&4) rotatesprite(sbarxr(29),sbary(200-39),sbarsc(32768),0,ACCESSCARD,0,23,10+16,0,0,xdim-1,ydim-1); + + return; + } rotatesprite(sbarx(5),sbary(200-28),sbarsc(65536L),0,HEALTHBOX,0,21,10+16,0,0,xdim-1,ydim-1); if (p->inven_icon) rotatesprite(sbarx(69),sbary(200-30),sbarsc(65536L),0,INVENTORYBOX,0,21,10+16,0,0,xdim-1,ydim-1); diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index b2fdd5abd..6a59384b7 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -879,6 +879,7 @@ const memberlabel_t userdefslabels[]= { "obituaries", USERDEFS_OBITUARIES, 0, 0 }, { "levelstats", USERDEFS_LEVELSTATS, 0, 0 }, { "crosshairscale", USERDEFS_CROSSHAIRSCALE, 0, 0 }, + { "althud", USERDEFS_ALTHUD, 0, 0 }, { "", -1, 0, 0 } // END OF LIST }; diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 1703aeff7..bddcf0b82 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -342,7 +342,8 @@ enum userdefslabels USERDEFS_ANGLEINTERPOLATION, USERDEFS_OBITUARIES, USERDEFS_LEVELSTATS, - USERDEFS_CROSSHAIRSCALE + USERDEFS_CROSSHAIRSCALE, + USERDEFS_ALTHUD }; enum sectorlabels diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index c53852759..d40c67e7b 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -874,6 +874,15 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2) SetGameVarID(lVar2, ud.crosshairscale, g_i, g_p); return; + case USERDEFS_ALTHUD: + if (iSet) + { + ud.althud = lValue; + return; + } + SetGameVarID(lVar2, ud.althud, g_i, g_p); + return; + default: return; } diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 3120d75e1..5be75e551 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2884,6 +2884,7 @@ cheat_for_port_credits: "-", "Show inv & pickup messages", "HUD weapon display", + "Use alternate HUD", "Demo playback cameras", "-", "DM: Ignore map votes", @@ -2900,8 +2901,6 @@ cheat_for_port_credits: "-", "-", #endif - "-", - "-", "-", "Previous page", NULL @@ -2964,11 +2963,16 @@ cheat_for_port_credits: break; } case 3: + if (x==io) ud.althud = 1-ud.althud; + modval(0,1,(int *)&ud.althud,1,probey==io); + mgametextpal(d,yy, ud.althud ? "Yes" : "No", MENUHIGHLIGHT(io), 0); + break; + case 4: if (x==io) ud.democams = 1-ud.democams; modval(0,1,(int *)&ud.democams,1,probey==io); mgametextpal(d,yy, ud.democams ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; - case 4: + case 5: if (x==io) { ud.autovote = (ud.autovote == 2) ? 0 : ud.autovote+1; @@ -2979,28 +2983,28 @@ cheat_for_port_credits: mgametextpal(d,yy, s[ud.autovote], MENUHIGHLIGHT(io), 0); break; } - case 5: + case 6: if (x==io) ud.automsg = 1-ud.automsg; modval(0,1,(int *)&ud.automsg,1,probey==io); mgametextpal(d,yy, ud.automsg ? "Off" : "On", MENUHIGHLIGHT(io), 0); break; - case 6: + case 7: if (x==io) ud.idplayers = 1-ud.idplayers; modval(0,1,(int *)&ud.idplayers,1,probey==io); mgametextpal(d,yy, ud.idplayers ? "Yes" : "No", MENUHIGHLIGHT(io), 0); break; - case 7: + case 8: if (x==io) ud.showweapons = 1-ud.showweapons; modval(0,1,(int *)&ud.showweapons,1,probey==io); ud.config.ShowOpponentWeapons = ud.showweapons; mgametextpal(d,yy, ud.config.ShowOpponentWeapons ? "Yes" : "No", MENUHIGHLIGHT(io), 0); break; - case 8: + case 9: if (x==io) ud.obituaries = 1-ud.obituaries; modval(0,1,(int *)&ud.obituaries,1,probey==io); mgametextpal(d,yy, ud.obituaries ? "Yes" : "No", MENUHIGHLIGHT(io), 0); break; - case 9: + case 10: { int osdmode = OSD_GetTextMode(); if (x==io) osdmode = !osdmode; @@ -3011,7 +3015,7 @@ cheat_for_port_credits: break; } #ifdef _WIN32 - case 10: + case 11: i = ud.config.CheckForUpdates; if (x==io) ud.config.CheckForUpdates = 1-ud.config.CheckForUpdates; modval(0,1,(int *)&ud.config.CheckForUpdates,1,probey==io); @@ -3019,9 +3023,9 @@ cheat_for_port_credits: ud.config.LastUpdateCheck = 0; mgametextpal(d,yy, ud.config.CheckForUpdates ? "Yes" : "No", MENUHIGHLIGHT(io), 0); break; - case 11: + case 12: #else - case 10: + case 11: #endif if (x==io) cmenu(200); break; diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index b7911260b..44fd7e689 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -656,6 +656,7 @@ cvarmappings cvar[] = { { "crosshair", "crosshair: enable/disable crosshair", (void*)&ud.crosshair, CVAR_BOOL, 0, 0, 1 }, + { "cl_althud", "cl_althud: enable/disable alternate mini-hud", (void*)&ud.althud, CVAR_BOOL, 0, 0, 1 }, { "cl_autoaim", "cl_autoaim: enable/disable weapon autoaim", (void*)&ud.config.AutoAim, CVAR_INT|CVAR_MULTI, 0, 0, 2 }, { "cl_automsg", "cl_automsg: enable/disable automatically sending messages to all players", (void*)&ud.automsg, CVAR_BOOL, 0, 0, 1 }, { "cl_autovote", "cl_autovote: enable/disable automatic voting", (void*)&ud.autovote, CVAR_INT|CVAR_MULTI, 0, 0, 2 }, diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 69ef2fb05..6a93ed795 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -3561,41 +3561,41 @@ void processinput(int snum) if (hittype[p->i].temp_data[1] == 1) i = 7; else switch (dynamictostatic[hittype[p->i].picnum]) - { - case KNEE__STATIC: - i = 0; - break; - case SHOTSPARK1__STATIC: - switch (g_player[p->frag_ps].ps->curr_weapon) { + case KNEE__STATIC: + i = 0; + break; + case SHOTSPARK1__STATIC: + switch (g_player[p->frag_ps].ps->curr_weapon) + { + default: + case PISTOL_WEAPON: + i = 1; + break; + case SHOTGUN_WEAPON: + i = 2; + break; + case CHAINGUN_WEAPON: + i = 3; + break; + } + break; + case RPG__STATIC: + i = 4; + break; + case RADIUSEXPLOSION__STATIC: + i = 5; + break; + case SHRINKSPARK__STATIC: + i = 6; + break; + case GROWSPARK__STATIC: + i = 8; + break; default: - case PISTOL_WEAPON: - i = 1; - break; - case SHOTGUN_WEAPON: - i = 2; - break; - case CHAINGUN_WEAPON: - i = 3; + i = 0; break; } - break; - case RPG__STATIC: - i = 4; - break; - case RADIUSEXPLOSION__STATIC: - i = 5; - break; - case SHRINKSPARK__STATIC: - i = 6; - break; - case GROWSPARK__STATIC: - i = 8; - break; - default: - i = 0; - break; - } } Bstrcpy(name1,&g_player[snum].user_name[0]); Bstrcpy(name2,&g_player[p->frag_ps].user_name[0]);