ew-progs/ew/ewdraw.qc
2011-09-06 00:00:00 +00:00

71 lines
1.3 KiB
C++

/*
=============================
ewdraw.qc
coded by
Michael Rogers a.k.a Xsniper
ssj_xsniper@yahoo.com
http://www.xsniper.net/
Description:
This file contains new image and text drawing functions derived from new engine code.
=============================
*/
//===================================================================================
//Drawing Code Below
void() QC_DrawOff =
{
stop_draw();
QC_DRAW_ON = 0;
};
void() QC_DrawOn =
{
init_draw();
QC_DRAW_ON = 1;
};
void() HUD_DrawOff =
{
stop_hud_draw();
HUD_DRAW_ON = 0;
};
void() HUD_DrawOn =
{
init_hud_draw();
HUD_DRAW_ON = 1;
};
void(float weaponmode) weapon_mode_draw =
{
local float wx, wy, vid_percent;
local string wpath;
//make sure any other images are unloaded first
HUD_DrawOff();
//now lets start fresh
HUD_DrawOn();
//setup weapon mode x and y coordinates
if (cvar("deathmatch") < 1)
{
vid_percent = (get_vid_width() * 0.3) - 10;
wx = get_vid_width() - vid_percent;
}
else
wx = 320 + 10;
wy = get_vid_height() - 24;
//draw icon based on weaponmode
if (weaponmode == 1)
wpath = "gfx/wprimary.lmp";
else if (weaponmode == 2)
wpath = "gfx/wsecondary.lmp";
//draw the image
HUD_draw_coord(0,wx,wy,wpath);
};