diff --git a/source/src/protos.h b/source/src/protos.h index 63b7ad9e..4d225011 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -674,6 +674,7 @@ extern int isoccluded(float vx, float vy, float cx, float cy, float csize); // main extern char *lang; extern SDL_Window *screen; +extern int screenw, screenh; extern int stencilbits; enum { KR_CONSOLE = 1<<0, KR_MENU = 1<<1, KR_EDITMODE = 1<<2 }; diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 3555db73..76a3c38d 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -333,7 +333,7 @@ void drawequipicons(playerent *p) // health & armor if(p->armour) drawequipicon(HUDPOS_ARMOUR*2, 1650, (p->armour-1)/25, 2); - if(p->mag[GUN_GRENADE]) drawequipicon(oldfashionedgunstats ? (HUDPOS_GRENADE + (((float)screen->w / (float)screen->h > 1.5f) ? 75 : 25)) * 2 : HUDPOS_GRENADE*2, 1650, 3, 1); + if(p->mag[GUN_GRENADE]) drawequipicon(oldfashionedgunstats ? (HUDPOS_GRENADE + (((float)screenw / (float)screenh > 1.5f) ? 75 : 25)) * 2 : HUDPOS_GRENADE*2, 1650, 3, 1); drawequipicon(HUDPOS_HEALTH*2, 1650, 2, 3); if(p->mag[GUN_GRENADE]) drawequipicon(oldfashionedgunstats ? (HUDPOS_GRENADE + 25)*2 : HUDPOS_GRENADE*2, 1650, 3, 1); diff --git a/source/src/vertmodel.h b/source/src/vertmodel.h index 8b0464d8..699c7f90 100644 --- a/source/src/vertmodel.h +++ b/source/src/vertmodel.h @@ -1058,7 +1058,6 @@ struct vertmodel : model shadows = new GLuint[numframes]; glGenTextures(numframes, shadows); - extern int screenw, screenh; int aasize = 1<<(dynshadowsize + aadynshadow); while(aasize > screenw || aasize > screenh) aasize /= 2; diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index bf6b64f2..f7ae842c 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -1340,7 +1340,7 @@ void grenades::renderstats() { char gunstats[64]; sprintf(gunstats, "%d", mag); - draw_text(gunstats, oldfashionedgunstats ? HUDPOS_GRENADE + HUDPOS_NUMBERSPACING + (((float)screen->w / (float)screen->h > 1.5f) ? 75 : 25) : HUDPOS_GRENADE + HUDPOS_NUMBERSPACING, 823); + draw_text(gunstats, oldfashionedgunstats ? HUDPOS_GRENADE + HUDPOS_NUMBERSPACING + (((float)screenw / (float)screenh > 1.5f) ? 75 : 25) : HUDPOS_GRENADE + HUDPOS_NUMBERSPACING, 823); } bool grenades::selectable() { return weapon::selectable() && state != GST_INHAND && mag; }