//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;