no longer uses vid_conwidth/height.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3435 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-11-11 20:09:33 +00:00
parent 7a166b89f7
commit 6b203a8eb4

View file

@ -3,57 +3,44 @@ float viewmodelindex;
.float lerptime; .float lerptime;
float scrwidth;
float scrheight;
void() Quick_Draw = void() Quick_Draw =
{ {
float width,height;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
drawstring('32 -80 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " q1 ", '8 8 8', '1 1 1', 1); drawstring('32 -80 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " q1 ", '8 8 8', '1 1 1', 1);
QuickImage('32 -72 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 5); QuickImage('32 -72 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 5);
drawstring('64 -80 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " q2 ", '8 8 8', '1 1 1', 1); drawstring('64 -80 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " q2 ", '8 8 8', '1 1 1', 1);
QuickImage('64 -72 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 6); QuickImage('64 -72 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 6);
}; };
void() DrawScreen = void() DrawScreen =
{ {
float width,height;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
ScreenImage(); ScreenImage();
}; };
void() Weapon_Draw = void() Weapon_Draw =
{ {
float width,height;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
local float hand; local float hand;
hand = getstati(61); hand = getstati(61);
if (hand == 1) if (hand == 1)
{ {
drawstring('0 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " HAND 1 ", '8 8 8', '1 1 1', 1); drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " HAND 1 ", '8 8 8', '1 1 1', 1);
SlotImage('0 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 1); SlotImage('0 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 1);
} }
if (hand == 2) if (hand == 2)
{ {
drawstring('0 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " HAND 2 ", '8 8 8', '1 1 1', 1); drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " HAND 2 ", '8 8 8', '1 1 1', 1);
SlotImage('0 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 2); SlotImage('0 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 2);
} }
}; };
void() Crosshair_Draw = void() Crosshair_Draw =
{ {
float width,height;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
local float x, a; local float x, a;
local vector y; local vector y;
@ -65,7 +52,7 @@ void() Crosshair_Draw =
else if (getstati(54) == 2) else if (getstati(54) == 2)
a = 8; a = 8;
y = '1 0 0'*width*0.50 + '0 1 0'*height*0.50; y = '1 0 0'*scrwidth*0.50 + '0 1 0'*scrheight*0.50;
x = a + (4 * getstati(99)); x = a + (4 * getstati(99));
Crosshair(y + '1 0 0'*x, "gui/xhair.jpg"); Crosshair(y + '1 0 0'*x, "gui/xhair.jpg");
@ -89,10 +76,6 @@ void() Crosshair_Draw =
void() Position_Draw = void() Position_Draw =
{ {
float width,height;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
float pos, s; float pos, s;
string sn; string sn;
@ -102,45 +85,41 @@ void() Position_Draw =
if (s > 0) if (s > 0)
{ {
drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "sneak", '8 8 8', '1 1 1', 1); drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "sneak", '8 8 8', '1 1 1', 1);
PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 1); PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1);
drawstring('0 8 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), strcat("%", sn), '8 8 8', '1 1 1', 1); drawstring('0 8 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), strcat("%", sn), '8 8 8', '1 1 1', 1);
} }
else if (pos == 1) else if (pos == 1)
{ {
drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "duck", '8 8 8', '1 1 1', 1); drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "duck", '8 8 8', '1 1 1', 1);
PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 1); PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1);
} }
else if (pos == 2) else if (pos == 2)
{ {
drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "prone", '8 8 8', '1 1 1', 1); drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "prone", '8 8 8', '1 1 1', 1);
PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 2); PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 2);
} }
}; };
void() Chem_Draw = void() Chem_Draw =
{ {
float width,height;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
local float rage, heal; local float rage, heal;
rage = getstati(55); rage = getstati(55);
heal = getstati(56); heal = getstati(56);
if (rage == 255) if (rage == 255)
ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 0); ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 0);
else if (rage == IID_CHEM_ADRENALINE) else if (rage == IID_CHEM_ADRENALINE)
ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 1); ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 1);
else if (rage == IID_CHEM_PSYCHO) else if (rage == IID_CHEM_PSYCHO)
ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 2); ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 2);
else if (rage == IID_CHEM_BESERK) else if (rage == IID_CHEM_BESERK)
ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 3); ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 3);
else if (heal > 0) else if (heal > 0)
ChemImage('32 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 4); ChemImage('32 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 4);
else if (rage == 777) else if (rage == 777)
ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 5); ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 5);
}; };
@ -148,9 +127,6 @@ void() Ammo_Draw =
{ {
local float hand, weap, ammo, amount; local float hand, weap, ammo, amount;
local string reveal; local string reveal;
float width,height;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
hand = getstati(61); hand = getstati(61);
@ -161,11 +137,11 @@ void() Ammo_Draw =
amount = ShadowSlotOfItem(self, ammo); amount = ShadowSlotOfItem(self, ammo);
//drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1); //drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1);
//SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount); //SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount);
drawstring('-64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); drawstring('-64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " AMMO ", '8 8 8', '1 1 1', 1);
if (amount > 0) if (amount > 0)
SlotImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), amount); SlotImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), amount);
else else
BlankImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 0); BlankImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 0);
} }
else if (hand == 2) else if (hand == 2)
{ {
@ -175,48 +151,40 @@ void() Ammo_Draw =
reveal = ftos(amount); reveal = ftos(amount);
//drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1); //drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1);
//SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount); //SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount);
drawstring('-64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); drawstring('-64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " AMMO ", '8 8 8', '1 1 1', 1);
if (amount > 0) if (amount > 0)
SlotImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), amount); SlotImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), amount);
else else
BlankImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 0); BlankImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 0);
} }
}; };
void() Money_Draw = void() Money_Draw =
{ {
float width,height;
string cash; string cash;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
cash = ftos(getstati(50)); cash = ftos(getstati(50));
drawstring('64 -32 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), cash, '8 8 8', '1 1 1', 1); drawstring('64 -32 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), cash, '8 8 8', '1 1 1', 1);
MoneyImage('64 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), "money.jpg"); MoneyImage('64 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "money.jpg");
}; };
void() Energy_Draw = void() Energy_Draw =
{ {
float width,height;
string cash; string cash;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
cash = ftos(getstati(51)); cash = ftos(getstati(51));
drawstring('34 -32 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), cash, '8 8 8', '1 1 1', 1); drawstring('34 -32 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), cash, '8 8 8', '1 1 1', 1);
MoneyImage('32 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), "energy.jpg"); MoneyImage('32 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "energy.jpg");
}; };
void() Weight_Draw = void() Weight_Draw =
{ {
float width,height,carry,max,enc; float carry,max,enc;
string image; string image;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
carry = getstati(52); carry = getstati(52);
max = getstati(53); max = getstati(53);
@ -240,27 +208,21 @@ void() Weight_Draw =
else else
image = "weight/weight_seven.jpg"; image = "weight/weight_seven.jpg";
MoneyImage('0 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), image); MoneyImage('0 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), image);
}; };
void() Armor_Draw = void() Armor_Draw =
{ {
float width,height;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
//drawstring('300 350 0'+('3 0 0'*IMGSIZEF), " ARMOR ", '8 8 8', '1 1 1', 1); //drawstring('300 350 0'+('3 0 0'*IMGSIZEF), " ARMOR ", '8 8 8', '1 1 1', 1);
//SlotImage('300 358 0'+('3 0 0'*IMGSIZEF), 3); //SlotImage('300 358 0'+('3 0 0'*IMGSIZEF), 3);
drawstring('64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " ARMOR ", '8 8 8', '1 1 1', 1); drawstring('64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " ARMOR ", '8 8 8', '1 1 1', 1);
SlotImage('64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 3); SlotImage('64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 3);
}; };
void() Health_Draw = void() Health_Draw =
{ {
float width,height;
height = cvar("vid_conheight");
float hp, maxhp, status, perc, hpos, tpos, opos, ostatus, ones; float hp, maxhp, status, perc, hpos, tpos, opos, ostatus, ones;
string string_hpos, string_tpos, string_opos; string string_hpos, string_tpos, string_opos;
@ -337,24 +299,24 @@ void() Health_Draw =
if (perc > 50) if (perc > 50)
{ {
HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 0, "percent.jpg"); HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 0, "percent.jpg");
HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 0, string_hpos); HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_hpos);
HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 0, string_tpos); HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_tpos);
HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 0, string_opos); HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_opos);
} }
else if (perc > 25) else if (perc > 25)
{ {
HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 1, "percent.jpg"); HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 1, "percent.jpg");
HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 1, string_hpos); HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_hpos);
HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 1, string_tpos); HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_tpos);
HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 1, string_opos); HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_opos);
} }
else else
{ {
HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 2, "percent.jpg"); HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 2, "percent.jpg");
HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 2, string_hpos); HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_hpos);
HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 2, string_tpos); HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_tpos);
HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 2, string_opos); HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_opos);
} }
}; };
@ -397,12 +359,12 @@ void() CSQC_Init =
void(float do2d) CSQC_UpdateView = void(float vwidth, float vheight, float do2d) CSQC_UpdateView =
{ {
float width,height;
float usehud; float usehud;
width = cvar("vid_conwidth");
height = cvar("vid_conheight"); scrwidth = vwidth;
scrheight = vheight;
clearscene(); clearscene();
@ -420,8 +382,8 @@ void(float do2d) CSQC_UpdateView =
//force fullscreen views. //force fullscreen views.
setviewprop(VF_MIN, '0 0 0'); setviewprop(VF_MIN, '0 0 0');
setviewprop(VF_SIZE_X, width); setviewprop(VF_SIZE_X, scrwidth);
setviewprop(VF_SIZE_Y, height); setviewprop(VF_SIZE_Y, scrheight);
addentities(MASK_ENGINE | MASK_NORMAL); addentities(MASK_ENGINE | MASK_NORMAL);