Files
firestorm/_UNUSED/Gameleap/Drivers/render.hpp
T
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

164 lines
5.6 KiB
C++

//D3DCOLOR_XXXX정위한다.(d3d8types.h에 정의되어 있으므로. 정의되어있지 않을것이다.
#ifndef D3DCOLOR_ARGB
#define D3DCOLOR_ARGB(a,r,g,b) (D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
#define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b)
#define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
#endif
#define TEXTALIGN_HORZ 0x0F
#define TEXTALIGN_LEFT 0x00
#define TEXTALIGN_RIGHT 0x01
#define TEXTALIGN_CENTER 0x02
#define TEXTALIGN_HCENTER 0x02
#define TEXTALIGN_VERT 0xF0
#define TEXTALIGN_TOP 0x00
#define TEXTALIGN_BOTTOM 0x10
#define TEXTALIGN_VCENTER 0x20
#define TEXTALIGN_ORG (TEXTALIGN_VCENTER|TEXTALIGN_CENTER)
#define MAX_NUM_VERTICES 50*6
bool IsMultimonitorAvailable();
bool __cdecl DrawBitmapToSurface(LPDIRECTDRAWSURFACE7 pddsTexture,int x,int y,const char* strName );
int __cdecl CopyTargetImage(int stage,LPDIRECTDRAWSURFACE7 tex=NULL,int step=0);
LPVOID GetSurfacePointer(LPDIRECTDRAWSURFACE7 psurf);
void ReleaseSurfacePointer(LPDIRECTDRAWSURFACE7 psurf);
/*
enum AUX1STATE
{
AUX1_TEAM,
AUX1_FREE,
AUX1_TEAM_MESSAGE,
AUX1_FREE_MESSAGE
};
*/
#define AUX1_TEAM 0
#define AUX1_FREE 1
#define AUX1_TEAM_MESSAGE 2
#define AUX1_FREE_MESSAGE 3
//각 디바이스마다.., 각 폰트 종류(typeface,크기,굴기,기울기)가 달라질때 마다 하나씩 생성시켜 사용하면 된다.
class CHSHFont
{
//일시적으로 사용되고.. 각 instance마다 사용되어질 필요가 없으므로 static으로 하였다.
static D3DTLVERTEX m_pVB[300];
LPDIRECT3DDEVICE7 m_pd3dDevice;
LPDIRECTDRAWSURFACE7 m_pTexture;
DWORD m_dwTexWidth;
DWORD m_dwTexHeight;
float m_fTexCoords[128-32][4];
DWORD m_dwSavedStateBlock;
DWORD m_dwDrawTextStateBlock;
DWORD m_dwMaxWidth;//문자 하나중 가장 큰것..
public:
CHSHFont();
~CHSHFont();
void Init(LPDIRECTDRAW7 pDD, LPDIRECT3DDEVICE7 pd3dDevice ,const char* strFontName, DWORD dwHeight, bool fBold,bool fItalic);
void Cleanup();
HRESULT GetTextExtent(const char* strText, SIZE* pSize );
HRESULT DrawText( float x, float y, DWORD dwColor,const char* strText);
HRESULT DrawText( float x, float y, DWORD dwColor,const char* strText, DWORD dwFlags);
HRESULT DrawTextMultiLine( float sx, float sy, DWORD dwColor,const char* strText,DWORD dwFlags);
HRESULT DrawTextVerticalOrg( float sx, float sy, DWORD dwColor,const char* strText);
};
class CHSH_Device
{
public:
LPDIRECTDRAW7 pDD;
LPDIRECTDRAWSURFACE7 pDDSFront; //Flip을 하기위해서 필요..
LPDIRECTDRAWSURFACE7 pDDSBack; //Drawing하기 위해서 필요.
LPDIRECTDRAWSURFACE7 pDDSTarget; //실제 그리는 텍스쳐 이다.
LPDIRECTDRAWSURFACE7 pDDSTexture; //실제 그리는 텍스쳐 이다.
LPDIRECT3DDEVICE7 pD3DDevice;
CHSHFont pFont[4];
SIZE size_back;
SIZE size_target;
float tw,th;//texture width,height
CHSH_Device();
bool InitFirst(int devicenum,DWORD resx,DWORD resy);
bool InitSecond(DWORD tresx,DWORD tresy);
virtual bool Release();
virtual bool BeginScene()=0;
virtual bool EndScene()=0;
//DrawingRoutines..
void DrawQuad(int x1,int y1,int x2,int y2,DWORD dwColor);
void DrawQuadList(int quadcount,RECT * prc,DWORD dwColor);
void DrawLine(int x1,int y1,int x2,int y2,DWORD dwColor);
void DrawLineStrip(int point_count,POINT* pts,DWORD dwColor);
void DrawLineList(int line_count,POINT* pts,DWORD dwColor);
void DrawFrame(int x1,int y1,int x2,int y2,DWORD dwColor);
void DrawFrameList(int framecount,RECT * prc,DWORD dwColor);
void DrawThickFrame(int x1,int y1,int x2,int y2,int t,DWORD dwColor);
void DrawThickFrameList(int framecount,RECT* prc,int t,DWORD dwColor);
void DrawTextureRotate(float u1,float v1,float u2,float v2,float tx,float ty,float x,float y,float e,DWORD color);
void DrawTexture(float x1,float y1,float x2,float y2,DWORD dwColor, float u1,float v1,float u2,float v2);
void DrawTexture2(float x,float y,float w,float h,DWORD dwColor, float u1,float v1,float u2,float v2);
void DrawTexture(float x,float y,DWORD dwColor, float u1,float v1,float u2,float v2);
void DrawTexture(float pt[4][2],DWORD dwColor,float tx1,float tx2,float ty1,float ty2);
void SetRenderTargetBackbuffer();
void SetRenderTargetTexture();
};
class CRadar_Device:public CHSH_Device
{
public:
bool InitFirst();
bool InitSecond();
LPDIRECTDRAWSURFACE7 pDDSBackground; //one attatched image sruface
virtual bool BeginScene(); //texture를 ratate시켜서 출력하기 위한 루틴이 포함된다.. background이미지를.. 미리 출력한다...
virtual bool EndScene();
virtual bool Release();
bool DrawBackText(int state[12]);
bool MapDrawn;
};
class CMFD_Device:public CHSH_Device
{
public:
LPDIRECTDRAWSURFACE7 pDDSMechTexture;//3D메크 이미지 저장하기 위한 텍스쳐...
LPDIRECTDRAWSURFACE7 pDDSDamageTexture;//메크 데미지 텍스쳐..
DWORD ch; //current channel....
bool InitFirst();
bool InitSecond();
bool BeginChannel(DWORD channel);// 0~4번의 채널을 정할 수 있게된다.
bool EndChannel();
virtual bool BeginScene(); //normal한 beginscene/endscene를 한다.
virtual bool EndScene(); //flip을 한다.
virtual bool Release();
bool LoadDamageTexture(const char *mechtexturename);
bool DrawMFDBackText(char text[8][32]);
//bool DrawMFDBackText(char text[8][32],RIOBUTTON * state);
bool DrawMFDBackTextAux3(int state);
bool DrawMFDBackGrid();
bool DrawMFDDefaultBackAux1(int state);
};
void HSH_EnterFullScreen2();
void HSH_DirectDrawRelease2();
extern CRadar_Device radar_device;
extern CMFD_Device mfd_device;
extern bool use_shgui;
extern int sh_step;
extern bool hsh_initialized;
extern bool sh_isdeathmode;