This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Thats right. second time i tinker with the HUD and it doesnt like me being here.
This time im trying to tile a scanline sprite across the screen for our mod's Thermal
vision. the scanline sprite is 256^2 but it only shows up as 20^2 in the HUD?
Here is the scanline.cpp file in case anyone knows what is going on :(
#include "STDIO.H"
#include "STDLIB.H"
#include "MATH.H"
#include "hud.h"
#include "cl_util.h"
#include "parsemsg.h"
#include <string.h>
int CHudScanlines::Init()
{
m_iFlags |= HUD_ACTIVE;
gHUD.AddHudElem(this);
return 1;
}
int CHudScanlines::VidInit()
{
m_hScanlines = SPR_Load("sprites/scanlines.spr");
return 1;
}
int CHudScanlines::Draw(float fTime)
{
int r,g,b,a;
wrect_t rect;
int iScanWidth,iScanHeight;
int x,y;
UnpackRGB(r,g,b,RGB_REDISH);
a = 128;
ScaleColors(r,g,b,a);
rect = gHUD.GetSpriteRect(m_hScanlines);
iScanWidth = rect.right - rect.left;
iScanHeight = rect.bottom - rect.top;
SPR_Set(m_hScanlines, r, g, b);
x = y = 128;
SPR_DrawAdditive(0,x,y,&rect);
char szPrint[10];
sprintf(szPrint,"Width: %i",iScanWidth);
gEngfuncs.pfnCenterPrint(szPrint);
return 1;
}
void CHudScanlines::Reset()
{
}
Right now im just drawing on sprite but its only showing up at 20^2. If anyone knows
how to solve this i will be happy happy happy :)
Regards,
Josh
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders