From 6b203a8eb4ee104e1aa5e8610f8ac2d86808259c Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 11 Nov 2009 20:09:33 +0000 Subject: [PATCH] no longer uses vid_conwidth/height. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3435 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/main.qc | 152 +++++++++++++---------------------- 1 file changed, 57 insertions(+), 95 deletions(-) diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index bbbad3372..d20a26dfb 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -3,57 +3,44 @@ float viewmodelindex; .float lerptime; +float scrwidth; +float scrheight; 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); - QuickImage('32 -72 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 5); + 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'*(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); - QuickImage('64 -72 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 6); + 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'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 6); }; void() DrawScreen = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - ScreenImage(); }; void() Weapon_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - local float hand; hand = getstati(61); 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); - SlotImage('0 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 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'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 1); } 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); - SlotImage('0 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 2); + 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'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 2); } }; void() Crosshair_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - local float x, a; local vector y; @@ -65,7 +52,7 @@ void() Crosshair_Draw = else if (getstati(54) == 2) 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)); Crosshair(y + '1 0 0'*x, "gui/xhair.jpg"); @@ -89,10 +76,6 @@ void() Crosshair_Draw = void() Position_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - float pos, s; string sn; @@ -102,45 +85,41 @@ void() Position_Draw = 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); - PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*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 -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'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 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) { - drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*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); + 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'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1); } 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); - PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 2); + 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'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 2); } }; void() Chem_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - local float rage, heal; rage = getstati(55); heal = getstati(56); 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) - 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) - 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) - 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) - 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) - 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 string reveal; - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); hand = getstati(61); @@ -161,11 +137,11 @@ void() Ammo_Draw = amount = ShadowSlotOfItem(self, ammo); //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); - 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) - 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 - 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) { @@ -175,48 +151,40 @@ void() Ammo_Draw = reveal = ftos(amount); //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); - 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) - 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 - 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 = { - float width,height; string cash; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); 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); - MoneyImage('64 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), "money.jpg"); + 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'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "money.jpg"); }; void() Energy_Draw = { - float width,height; string cash; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); 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); - MoneyImage('32 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), "energy.jpg"); + 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'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "energy.jpg"); }; void() Weight_Draw = { - float width,height,carry,max,enc; + float carry,max,enc; string image; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); carry = getstati(52); max = getstati(53); @@ -240,27 +208,21 @@ void() Weight_Draw = else 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 = { - 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); //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); - SlotImage('64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 3); + 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'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 3); }; void() Health_Draw = { - float width,height; - height = cvar("vid_conheight"); float hp, maxhp, status, perc, hpos, tpos, opos, ostatus, ones; string string_hpos, string_tpos, string_opos; @@ -337,24 +299,24 @@ void() Health_Draw = if (perc > 50) { - HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 0, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 0, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 0, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 0, string_opos); + HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 0, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_tpos); + HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_opos); } else if (perc > 25) { - HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 1, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 1, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 1, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 1, string_opos); + HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 1, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_tpos); + HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_opos); } else { - HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 2, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 2, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 2, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 2, string_opos); + HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 2, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_tpos); + 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; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); + + scrwidth = vwidth; + scrheight = vheight; clearscene(); @@ -420,8 +382,8 @@ void(float do2d) CSQC_UpdateView = //force fullscreen views. setviewprop(VF_MIN, '0 0 0'); - setviewprop(VF_SIZE_X, width); - setviewprop(VF_SIZE_Y, height); + setviewprop(VF_SIZE_X, scrwidth); + setviewprop(VF_SIZE_Y, scrheight); addentities(MASK_ENGINE | MASK_NORMAL); @@ -462,4 +424,4 @@ void(float do2d) CSQC_UpdateView = Chem_Draw(); Crosshair_Draw(); } -}; \ No newline at end of file +};