forked from Mirrors/openclonk
Rename CStdDDraw to C4Draw
parent
2b6f4432de
commit
c2908d5bd5
|
@ -30,7 +30,6 @@
|
|||
#include <C4InteractiveThread.h>
|
||||
#include <StdApp.h>
|
||||
|
||||
class CStdDDraw;
|
||||
class C4ApplicationGameTimer;
|
||||
class C4GamePadControl;
|
||||
|
||||
|
|
|
@ -320,7 +320,7 @@ void C4GraphicsSystem::DrawHoldMessages()
|
|||
pDraw->TextOut("Pause", ::GraphicsResource.FontRegular,1.0,
|
||||
FullScreen.pSurface, C4GUI::GetScreenWdt()/2,
|
||||
C4GUI::GetScreenHgt()/2 - ::GraphicsResource.FontRegular.iLineHgt*2,
|
||||
CStdDDraw::DEFAULT_MESSAGE_COLOR, ACenter);
|
||||
C4Draw::DEFAULT_MESSAGE_COLOR, ACenter);
|
||||
::GraphicsSystem.OverwriteBg();
|
||||
}
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ void C4GraphicsSystem::DrawFlashMessage()
|
|||
pDraw->TextOut(FlashMessageText, ::GraphicsResource.FontRegular, 1.0, FullScreen.pSurface,
|
||||
(FlashMessageX==-1) ? C4GUI::GetScreenWdt()/2 : FlashMessageX,
|
||||
(FlashMessageY==-1) ? C4GUI::GetScreenHgt()/2 : FlashMessageY,
|
||||
CStdDDraw::DEFAULT_MESSAGE_COLOR,
|
||||
C4Draw::DEFAULT_MESSAGE_COLOR,
|
||||
(FlashMessageX==-1) ? ACenter : ALeft);
|
||||
FlashMessageTime--;
|
||||
// Flash message timed out: redraw background
|
||||
|
@ -392,7 +392,7 @@ void C4GraphicsSystem::DrawHelp()
|
|||
strText.AppendFormat("<c ffff00>%s</c> - %s\n", GetKeyboardInputName("ScreenshotEx").getData(), LoadResStr("IDS_CTL_SCREENSHOTEX"));
|
||||
|
||||
pDraw->TextOut(strText.getData(), ::GraphicsResource.FontRegular, 1.0, FullScreen.pSurface,
|
||||
iX + 128, iY + 64, CStdDDraw::DEFAULT_MESSAGE_COLOR, ALeft);
|
||||
iX + 128, iY + 64, C4Draw::DEFAULT_MESSAGE_COLOR, ALeft);
|
||||
|
||||
// right coloumn
|
||||
strText.Clear();
|
||||
|
@ -406,7 +406,7 @@ void C4GraphicsSystem::DrawHelp()
|
|||
strText.AppendFormat("<c ffff00>%s</c> - %s\n", GetKeyboardInputName("DbgShowActionToggle").getData(), "Actions/Commands/Pathfinder");
|
||||
strText.AppendFormat("<c ffff00>%s</c> - %s\n", GetKeyboardInputName("DbgShowSolidMaskToggle").getData(), "SolidMasks");
|
||||
pDraw->TextOut(strText.getData(), ::GraphicsResource.FontRegular, 1.0, FullScreen.pSurface,
|
||||
iX + iWdt/2 + 64, iY + 64, CStdDDraw::DEFAULT_MESSAGE_COLOR, ALeft);
|
||||
iX + iWdt/2 + 64, iY + 64, C4Draw::DEFAULT_MESSAGE_COLOR, ALeft);
|
||||
}
|
||||
|
||||
bool C4GraphicsSystem::ToggleShowNetStatus()
|
||||
|
|
|
@ -137,7 +137,7 @@ class StdMeshBone;
|
|||
class StdMeshInstance;
|
||||
class StdMeshMaterial;
|
||||
class StdMeshSkeletonLoader;
|
||||
class CStdDDraw;
|
||||
class C4Draw;
|
||||
class C4AbstractApp;
|
||||
class C4Window;
|
||||
class C4Surface;
|
||||
|
|
|
@ -411,7 +411,7 @@ void C4IDList::Draw(C4Facet &cgo, int32_t iSelection,
|
|||
cgo2 = cgo.TruncateSection(iAlign);
|
||||
rDefs.Draw(c_id,cgo2,(firstid+cnt==iSelection),0);
|
||||
sprintf(buf,"%dx",idcount);
|
||||
if (fCounts) pDraw->TextOut(buf, ::GraphicsResource.FontRegular, 1.0, cgo2.Surface,cgo2.X+cgo2.Wdt-1, cgo2.Y + cgo2.Hgt - 1 - ::GraphicsResource.FontRegular.iLineHgt,CStdDDraw::DEFAULT_MESSAGE_COLOR,ARight);
|
||||
if (fCounts) pDraw->TextOut(buf, ::GraphicsResource.FontRegular, 1.0, cgo2.Surface,cgo2.X+cgo2.Wdt-1, cgo2.Y + cgo2.Hgt - 1 - ::GraphicsResource.FontRegular.iLineHgt,C4Draw::DEFAULT_MESSAGE_COLOR,ARight);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2034,7 +2034,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode, f
|
|||
if (iMoveTos) { Cmds.AppendChar('|'); Cmds.AppendFormat("%dx MoveTo",iMoveTos); iMoveTos=0; }
|
||||
// Draw message
|
||||
int32_t cmwdt,cmhgt; ::GraphicsResource.FontRegular.GetTextExtent(Cmds.getData(),cmwdt,cmhgt,true);
|
||||
pDraw->TextOut(Cmds.getData(), ::GraphicsResource.FontRegular, 1.0, cgo.Surface,offX,offY+Shape.GetY()-10-cmhgt,CStdDDraw::DEFAULT_MESSAGE_COLOR,ACenter);
|
||||
pDraw->TextOut(Cmds.getData(), ::GraphicsResource.FontRegular, 1.0, cgo.Surface,offX,offY+Shape.GetY()-10-cmhgt,C4Draw::DEFAULT_MESSAGE_COLOR,ACenter);
|
||||
}
|
||||
// Debug Display ///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -2163,7 +2163,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode, f
|
|||
int32_t cmwdt,cmhgt; ::GraphicsResource.FontRegular.GetTextExtent(str.getData(),cmwdt,cmhgt,true);
|
||||
pDraw->TextOut(str.getData(), ::GraphicsResource.FontRegular,
|
||||
1.0, cgo.Surface, offX, offY + Shape.GetY() - cmhgt,
|
||||
InLiquid ? 0xfa0000FF : CStdDDraw::DEFAULT_MESSAGE_COLOR, ACenter);
|
||||
InLiquid ? 0xfa0000FF : C4Draw::DEFAULT_MESSAGE_COLOR, ACenter);
|
||||
}
|
||||
}
|
||||
// Debug Display ///////////////////////////////////////////////////////////////////////
|
||||
|
@ -2675,7 +2675,7 @@ bool C4Object::CheckSolidMaskRect()
|
|||
if (GetGraphics()->Type != C4DefGraphics::TYPE_Bitmap) return false;
|
||||
|
||||
// check NewGfx only, because invalid SolidMask-rects are OK in OldGfx
|
||||
// the bounds-check is done in CStdDDraw::GetPixel()
|
||||
// the bounds-check is done in C4Draw::GetPixel()
|
||||
C4Surface *sfcGraphics = GetGraphics()->GetBitmap();
|
||||
SolidMask.Set(Max<int32_t>(SolidMask.x,0), Max<int32_t>(SolidMask.y,0),
|
||||
Min<int32_t>(SolidMask.Wdt,sfcGraphics->Wdt-SolidMask.x), Min<int32_t>(SolidMask.Hgt, sfcGraphics->Hgt-SolidMask.y),
|
||||
|
|
|
@ -377,7 +377,7 @@ void C4ObjectList::DrawIDList(C4Facet &cgo, int iSelection,
|
|||
// Draw count
|
||||
sprintf(szCount,"%dx",iCount);
|
||||
if ((iCount!=1) || fDrawOneCounts)
|
||||
pDraw->TextOut(szCount, ::GraphicsResource.FontRegular, 1.0, cgo2.Surface,cgo2.X+cgo2.Wdt-1,cgo2.Y+cgo2.Hgt-1-::GraphicsResource.FontRegular.iLineHgt,CStdDDraw::DEFAULT_MESSAGE_COLOR,ARight);
|
||||
pDraw->TextOut(szCount, ::GraphicsResource.FontRegular, 1.0, cgo2.Surface,cgo2.X+cgo2.Wdt-1,cgo2.Y+cgo2.Hgt-1-::GraphicsResource.FontRegular.iLineHgt,C4Draw::DEFAULT_MESSAGE_COLOR,ARight);
|
||||
// Region
|
||||
if (pRegions) pRegions->Add(cgo2.X,cgo2.Y,cgo2.Wdt,cgo2.Hgt,pFirstObj->GetName(),iRegionCom,pFirstObj,COM_None,COM_None,pFirstObj->Number);
|
||||
// Next section
|
||||
|
|
|
@ -147,7 +147,7 @@ void C4MenuItem::DrawElement(C4TargetFacet &cgo)
|
|||
switch (iStyle)
|
||||
{
|
||||
case C4MN_Style_Context:
|
||||
pDraw->TextOut(Caption,::GraphicsResource.FontRegular, 1.0, cgoItemText.Surface,cgoItemText.X,cgoItemText.Y,CStdDDraw::DEFAULT_MESSAGE_COLOR,ALeft);
|
||||
pDraw->TextOut(Caption,::GraphicsResource.FontRegular, 1.0, cgoItemText.Surface,cgoItemText.X,cgoItemText.Y,C4Draw::DEFAULT_MESSAGE_COLOR,ALeft);
|
||||
break;
|
||||
case C4MN_Style_Info:
|
||||
{
|
||||
|
@ -181,7 +181,7 @@ void C4MenuItem::DrawElement(C4TargetFacet &cgo)
|
|||
{
|
||||
char szCount[10+1];
|
||||
sprintf(szCount,"%ix",Count);
|
||||
pDraw->TextOut(szCount,::GraphicsResource.FontRegular, 1.0, cgoItemText.Surface,cgoItemText.X+cgoItemText.Wdt-1,cgoItemText.Y+cgoItemText.Hgt-1-::GraphicsResource.FontRegular.iLineHgt,CStdDDraw::DEFAULT_MESSAGE_COLOR,ARight);
|
||||
pDraw->TextOut(szCount,::GraphicsResource.FontRegular, 1.0, cgoItemText.Surface,cgoItemText.X+cgoItemText.Wdt-1,cgoItemText.Y+cgoItemText.Hgt-1-::GraphicsResource.FontRegular.iLineHgt,C4Draw::DEFAULT_MESSAGE_COLOR,ARight);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -263,14 +263,14 @@ void C4Facet::DrawValue(C4Facet &cgo, int32_t iValue, int32_t iSectionX, int32_t
|
|||
case C4FCT_Center:
|
||||
Draw(cgo, true, iSectionX, iSectionY);
|
||||
pDraw->TextOut(ostr, ::GraphicsResource.FontRegular, 1.0, cgo.Surface,
|
||||
cgo.X + cgo.Wdt - 1, cgo.Y + cgo.Hgt - 1, CStdDDraw::DEFAULT_MESSAGE_COLOR, ARight);
|
||||
cgo.X + cgo.Wdt - 1, cgo.Y + cgo.Hgt - 1, C4Draw::DEFAULT_MESSAGE_COLOR, ARight);
|
||||
break;
|
||||
case C4FCT_Right:
|
||||
{
|
||||
int32_t textwdt, texthgt;
|
||||
::GraphicsResource.FontRegular.GetTextExtent(ostr, textwdt, texthgt, false);
|
||||
pDraw->TextOut(ostr, ::GraphicsResource.FontRegular, 1.0, cgo.Surface,
|
||||
cgo.X + cgo.Wdt - 1, cgo.Y, CStdDDraw::DEFAULT_MESSAGE_COLOR, ARight);
|
||||
cgo.X + cgo.Wdt - 1, cgo.Y, C4Draw::DEFAULT_MESSAGE_COLOR, ARight);
|
||||
cgo.Set(cgo.Surface, cgo.X + cgo.Wdt - 1 - textwdt - 2 * cgo.Hgt, cgo.Y, 2 * cgo.Hgt, cgo.Hgt);
|
||||
Draw(cgo, true, iSectionX, iSectionY);
|
||||
break;
|
||||
|
@ -287,7 +287,7 @@ void C4Facet::DrawValue2(C4Facet &cgo, int32_t iValue1, int32_t iValue2, int32_t
|
|||
case C4FCT_Center:
|
||||
Draw(cgo, true, iSectionX, iSectionY);
|
||||
pDraw->TextOut(ostr, ::GraphicsResource.FontRegular, 1.0, cgo.Surface,
|
||||
cgo.X + cgo.Wdt - 1, cgo.Y + cgo.Hgt - 1, CStdDDraw::DEFAULT_MESSAGE_COLOR, ARight);
|
||||
cgo.X + cgo.Wdt - 1, cgo.Y + cgo.Hgt - 1, C4Draw::DEFAULT_MESSAGE_COLOR, ARight);
|
||||
break;
|
||||
case C4FCT_Right:
|
||||
{
|
||||
|
@ -295,7 +295,7 @@ void C4Facet::DrawValue2(C4Facet &cgo, int32_t iValue1, int32_t iValue2, int32_t
|
|||
::GraphicsResource.FontRegular.GetTextExtent(ostr, textwdt, texthgt, false);
|
||||
textwdt += Wdt + 3;
|
||||
pDraw->TextOut(ostr, ::GraphicsResource.FontRegular, 1.0, cgo.Surface,
|
||||
cgo.X + cgo.Wdt - 1, cgo.Y, CStdDDraw::DEFAULT_MESSAGE_COLOR, ARight);
|
||||
cgo.X + cgo.Wdt - 1, cgo.Y, C4Draw::DEFAULT_MESSAGE_COLOR, ARight);
|
||||
cgo.Set(cgo.Surface, cgo.X + cgo.Wdt - textwdt, cgo.Y, 2 * cgo.Hgt, cgo.Hgt);
|
||||
Draw(cgo, true, iSectionX, iSectionY);
|
||||
if (piUsedWidth) *piUsedWidth = textwdt;
|
||||
|
|
|
@ -190,7 +190,7 @@ protected:
|
|||
void FreeTextures(); // free ppTex-array if existant
|
||||
// C4Surface *Duplicate(); // create identical copy
|
||||
|
||||
friend class CStdDDraw;
|
||||
friend class C4Draw;
|
||||
friend class C4Pattern;
|
||||
friend class CStdD3D;
|
||||
friend class CStdGL;
|
||||
|
|
|
@ -55,7 +55,7 @@ CStdD3D::~CStdD3D()
|
|||
|
||||
void CStdD3D::Default()
|
||||
{
|
||||
CStdDDraw::Default();
|
||||
C4Draw::Default();
|
||||
SceneOpen=false;
|
||||
lpD3D=NULL;
|
||||
lpDevice=NULL;
|
||||
|
@ -83,7 +83,7 @@ void CStdD3D::Clear()
|
|||
lpD3D->Release(); lpD3D=NULL;
|
||||
}
|
||||
SceneOpen=false;
|
||||
CStdDDraw::Clear();
|
||||
C4Draw::Clear();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ typedef C4CTVERTEX C4CTVERTEXQUAD[4];
|
|||
class CStdD3DShader;
|
||||
|
||||
// direct draw encapsulation
|
||||
class CStdD3D : public CStdDDraw
|
||||
class CStdD3D : public C4Draw
|
||||
{
|
||||
public:
|
||||
CStdD3D(bool fSoftware);
|
||||
|
|
|
@ -41,11 +41,11 @@
|
|||
#include <limits.h>
|
||||
|
||||
// Global access pointer
|
||||
CStdDDraw *pDraw=NULL;
|
||||
C4Draw *pDraw=NULL;
|
||||
int iGfxEngine=-1;
|
||||
|
||||
// Transformation matrix to convert meshes from Ogre to Clonk coordinate system
|
||||
const StdMeshMatrix CStdDDraw::OgreToClonk = StdMeshMatrix::Scale(-1.0f, 1.0f, 1.0f) * StdMeshMatrix::Rotate(float(M_PI)/2.0f, 1.0f, 0.0f, 0.0f) * StdMeshMatrix::Rotate(float(M_PI)/2.0f, 0.0f, 0.0f, 1.0f);
|
||||
const StdMeshMatrix C4Draw::OgreToClonk = StdMeshMatrix::Scale(-1.0f, 1.0f, 1.0f) * StdMeshMatrix::Rotate(float(M_PI)/2.0f, 1.0f, 0.0f, 0.0f) * StdMeshMatrix::Rotate(float(M_PI)/2.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
inline DWORD GetTextShadowClr(DWORD dwTxtClr)
|
||||
{
|
||||
|
@ -383,7 +383,7 @@ uint32_t CColorFadeMatrix::GetColorAt(int iX, int iY)
|
|||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
void CStdDDraw::Default()
|
||||
void C4Draw::Default()
|
||||
{
|
||||
Editor=true;
|
||||
RenderTarget=NULL;
|
||||
|
@ -403,40 +403,40 @@ void CStdDDraw::Default()
|
|||
fSetGamma=false;
|
||||
}
|
||||
|
||||
void CStdDDraw::Clear()
|
||||
void C4Draw::Clear()
|
||||
{
|
||||
DisableGamma();
|
||||
Active=BlitModulated=fUseClrModMap=false;
|
||||
dwBlitMode = 0;
|
||||
}
|
||||
|
||||
bool CStdDDraw::GetSurfaceSize(C4Surface * sfcSurface, int &iWdt, int &iHgt)
|
||||
bool C4Draw::GetSurfaceSize(C4Surface * sfcSurface, int &iWdt, int &iHgt)
|
||||
{
|
||||
return sfcSurface->GetSurfaceSize(iWdt, iHgt);
|
||||
}
|
||||
|
||||
bool CStdDDraw::SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
|
||||
bool C4Draw::SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
|
||||
{
|
||||
// Set sub primary clipper
|
||||
SetPrimaryClipper(Max(iX1,iClipX1),Max(iY1,iClipY1),Min(iX2,iClipX2),Min(iY2,iClipY2));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::StorePrimaryClipper()
|
||||
bool C4Draw::StorePrimaryClipper()
|
||||
{
|
||||
// Store current primary clipper
|
||||
fStClipX1=fClipX1; fStClipY1=fClipY1; fStClipX2=fClipX2; fStClipY2=fClipY2;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::RestorePrimaryClipper()
|
||||
bool C4Draw::RestorePrimaryClipper()
|
||||
{
|
||||
// Restore primary clipper
|
||||
SetPrimaryClipper(fStClipX1, fStClipY1, fStClipX2, fStClipY2);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
|
||||
bool C4Draw::SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
|
||||
{
|
||||
// set clipper
|
||||
fClipX1=iX1; fClipY1=iY1; fClipX2=iX2; fClipY2=iY2;
|
||||
|
@ -446,19 +446,19 @@ bool CStdDDraw::SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::ApplyPrimaryClipper(C4Surface * sfcSurface)
|
||||
bool C4Draw::ApplyPrimaryClipper(C4Surface * sfcSurface)
|
||||
{
|
||||
//sfcSurface->SetClipper(lpClipper);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::DetachPrimaryClipper(C4Surface * sfcSurface)
|
||||
bool C4Draw::DetachPrimaryClipper(C4Surface * sfcSurface)
|
||||
{
|
||||
//sfcSurface->SetClipper(NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::NoPrimaryClipper()
|
||||
bool C4Draw::NoPrimaryClipper()
|
||||
{
|
||||
// apply maximum clipper
|
||||
SetPrimaryClipper(0,0,439832,439832);
|
||||
|
@ -466,13 +466,13 @@ bool CStdDDraw::NoPrimaryClipper()
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdDDraw::BlitLandscape(C4Surface * sfcSource, float fx, float fy,
|
||||
void C4Draw::BlitLandscape(C4Surface * sfcSource, float fx, float fy,
|
||||
C4Surface * sfcTarget, float tx, float ty, float wdt, float hgt, const C4Surface * textures[])
|
||||
{
|
||||
Blit(sfcSource, fx, fy, wdt, hgt, sfcTarget, tx, ty, wdt, hgt, false);
|
||||
}
|
||||
|
||||
void CStdDDraw::Blit8Fast(CSurface8 * sfcSource, int fx, int fy,
|
||||
void C4Draw::Blit8Fast(CSurface8 * sfcSource, int fx, int fy,
|
||||
C4Surface * sfcTarget, int tx, int ty, int wdt, int hgt)
|
||||
{
|
||||
// blit 8bit-sfc
|
||||
|
@ -501,7 +501,7 @@ void CStdDDraw::Blit8Fast(CSurface8 * sfcSource, int fx, int fy,
|
|||
if (!fRender) sfcTarget->Unlock();
|
||||
}
|
||||
|
||||
bool CStdDDraw::Blit(C4Surface * sfcSource, float fx, float fy, float fwdt, float fhgt,
|
||||
bool C4Draw::Blit(C4Surface * sfcSource, float fx, float fy, float fwdt, float fhgt,
|
||||
C4Surface * sfcTarget, float tx, float ty, float twdt, float thgt,
|
||||
bool fSrcColKey, const C4BltTransform *pTransform)
|
||||
{
|
||||
|
@ -719,7 +719,7 @@ bool CStdDDraw::Blit(C4Surface * sfcSource, float fx, float fy, float fwdt, floa
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::RenderMesh(StdMeshInstance &instance, C4Surface * sfcTarget, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform)
|
||||
bool C4Draw::RenderMesh(StdMeshInstance &instance, C4Surface * sfcTarget, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform)
|
||||
{
|
||||
// TODO: Emulate rendering
|
||||
if (!sfcTarget->IsRenderTarget()) return false;
|
||||
|
@ -740,7 +740,7 @@ bool CStdDDraw::RenderMesh(StdMeshInstance &instance, C4Surface * sfcTarget, flo
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::Blit8(C4Surface * sfcSource, int fx, int fy, int fwdt, int fhgt,
|
||||
bool C4Draw::Blit8(C4Surface * sfcSource, int fx, int fy, int fwdt, int fhgt,
|
||||
C4Surface * sfcTarget, int tx, int ty, int twdt, int thgt,
|
||||
bool fSrcColKey, const C4BltTransform *pTransform)
|
||||
{
|
||||
|
@ -785,7 +785,7 @@ bool CStdDDraw::Blit8(C4Surface * sfcSource, int fx, int fy, int fwdt, int fhgt,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::BlitRotate(C4Surface * sfcSource, int fx, int fy, int fwdt, int fhgt,
|
||||
bool C4Draw::BlitRotate(C4Surface * sfcSource, int fx, int fy, int fwdt, int fhgt,
|
||||
C4Surface * sfcTarget, int tx, int ty, int twdt, int thgt,
|
||||
int iAngle, bool fTransparency)
|
||||
{
|
||||
|
@ -879,14 +879,14 @@ bool CStdDDraw::BlitRotate(C4Surface * sfcSource, int fx, int fy, int fwdt, int
|
|||
}
|
||||
|
||||
|
||||
bool CStdDDraw::Error(const char *szMsg)
|
||||
bool C4Draw::Error(const char *szMsg)
|
||||
{
|
||||
if (pApp) pApp->Error(szMsg);
|
||||
Log(szMsg); return false;
|
||||
}
|
||||
|
||||
|
||||
bool CStdDDraw::CreatePrimaryClipper(unsigned int iXRes, unsigned int iYRes)
|
||||
bool C4Draw::CreatePrimaryClipper(unsigned int iXRes, unsigned int iYRes)
|
||||
{
|
||||
// simply setup primary viewport
|
||||
// assume no zoom has been set yet
|
||||
|
@ -896,7 +896,7 @@ bool CStdDDraw::CreatePrimaryClipper(unsigned int iXRes, unsigned int iYRes)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::BlitSurface(C4Surface * sfcSurface, C4Surface * sfcTarget, int tx, int ty, bool fBlitBase)
|
||||
bool C4Draw::BlitSurface(C4Surface * sfcSurface, C4Surface * sfcTarget, int tx, int ty, bool fBlitBase)
|
||||
{
|
||||
if (fBlitBase)
|
||||
{
|
||||
|
@ -914,7 +914,7 @@ bool CStdDDraw::BlitSurface(C4Surface * sfcSurface, C4Surface * sfcTarget, int t
|
|||
}
|
||||
}
|
||||
|
||||
bool CStdDDraw::BlitSurfaceTile(C4Surface * sfcSurface, C4Surface * sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX, int iOffsetY, bool fSrcColKey)
|
||||
bool C4Draw::BlitSurfaceTile(C4Surface * sfcSurface, C4Surface * sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX, int iOffsetY, bool fSrcColKey)
|
||||
{
|
||||
int iSourceWdt,iSourceHgt,iX,iY,iBlitX,iBlitY,iBlitWdt,iBlitHgt;
|
||||
// Get source surface size
|
||||
|
@ -939,7 +939,7 @@ bool CStdDDraw::BlitSurfaceTile(C4Surface * sfcSurface, C4Surface * sfcTarget, i
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::BlitSurfaceTile2(C4Surface * sfcSurface, C4Surface * sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX, int iOffsetY, bool fSrcColKey)
|
||||
bool C4Draw::BlitSurfaceTile2(C4Surface * sfcSurface, C4Surface * sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX, int iOffsetY, bool fSrcColKey)
|
||||
{
|
||||
// if it's a render target, simply blit with repeating texture
|
||||
// repeating textures, however, aren't currently supported
|
||||
|
@ -985,7 +985,7 @@ bool CStdDDraw::BlitSurfaceTile2(C4Surface * sfcSurface, C4Surface * sfcTarget,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup)
|
||||
bool C4Draw::TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup)
|
||||
{
|
||||
C4Markup Markup(true);
|
||||
static char szLinebuf[2500+1];
|
||||
|
@ -994,7 +994,7 @@ bool CStdDDraw::TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surf
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::StringOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup)
|
||||
bool C4Draw::StringOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup)
|
||||
{
|
||||
// init markup
|
||||
C4Markup Markup(true);
|
||||
|
@ -1002,7 +1002,7 @@ bool CStdDDraw::StringOut(const char *szText, CStdFont &rFont, float fZoom, C4Su
|
|||
return StringOut(szText, sfcDest, iTx, iTy, dwFCol, byForm, fDoMarkup, Markup, &rFont, fZoom);
|
||||
}
|
||||
|
||||
bool CStdDDraw::StringOut(const char *szText, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup, C4Markup &Markup, CStdFont *pFont, float fZoom)
|
||||
bool C4Draw::StringOut(const char *szText, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup, C4Markup &Markup, CStdFont *pFont, float fZoom)
|
||||
{
|
||||
// clip
|
||||
if (ClipAll) return true;
|
||||
|
@ -1022,7 +1022,7 @@ bool CStdDDraw::StringOut(const char *szText, C4Surface * sfcDest, float iTx, fl
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdDDraw::DrawPix(C4Surface * sfcDest, float tx, float ty, DWORD dwClr)
|
||||
void C4Draw::DrawPix(C4Surface * sfcDest, float tx, float ty, DWORD dwClr)
|
||||
{
|
||||
ApplyZoom(tx, ty);
|
||||
// FIXME: zoom to a box
|
||||
|
@ -1043,7 +1043,7 @@ void CStdDDraw::DrawPix(C4Surface * sfcDest, float tx, float ty, DWORD dwClr)
|
|||
PerformPix(sfcDest, tx, ty, dwClr);
|
||||
}
|
||||
|
||||
void CStdDDraw::DrawLineDw(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr)
|
||||
void C4Draw::DrawLineDw(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr)
|
||||
{
|
||||
ApplyZoom(x1, y1);
|
||||
ApplyZoom(x2, y2);
|
||||
|
@ -1090,7 +1090,7 @@ void CStdDDraw::DrawLineDw(C4Surface * sfcTarget, float x1, float y1, float x2,
|
|||
PerformLine(sfcTarget, x1, y1, x2, y2, dwClr);
|
||||
}
|
||||
|
||||
void CStdDDraw::DrawFrameDw(C4Surface * sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr) // make these parameters float...?
|
||||
void C4Draw::DrawFrameDw(C4Surface * sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr) // make these parameters float...?
|
||||
{
|
||||
DrawLineDw(sfcDest,(float)x1,(float)y1,(float)x2,(float)y1, dwClr);
|
||||
DrawLineDw(sfcDest,(float)x2,(float)y1,(float)x2,(float)y2, dwClr);
|
||||
|
@ -1124,7 +1124,7 @@ bool DLineSPixDw(int32_t x, int32_t y, int32_t dwClr)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdDDraw::DrawPatternedCircle(C4Surface * sfcDest, int x, int y, int r, BYTE col, C4Pattern & Pattern, CStdPalette &rPal)
|
||||
void C4Draw::DrawPatternedCircle(C4Surface * sfcDest, int x, int y, int r, BYTE col, C4Pattern & Pattern, CStdPalette &rPal)
|
||||
{
|
||||
if (!sfcDest->Lock()) return;
|
||||
for (int ycnt = -r; ycnt < r; ycnt++)
|
||||
|
@ -1139,7 +1139,7 @@ void CStdDDraw::DrawPatternedCircle(C4Surface * sfcDest, int x, int y, int r, BY
|
|||
sfcDest->Unlock();
|
||||
}
|
||||
|
||||
void CStdDDraw::Grayscale(C4Surface * sfcSfc, int32_t iOffset)
|
||||
void C4Draw::Grayscale(C4Surface * sfcSfc, int32_t iOffset)
|
||||
{
|
||||
// safety
|
||||
if (!sfcSfc) return;
|
||||
|
@ -1160,7 +1160,7 @@ void CStdDDraw::Grayscale(C4Surface * sfcSfc, int32_t iOffset)
|
|||
sfcSfc->Unlock();
|
||||
}
|
||||
|
||||
bool CStdDDraw::GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2)
|
||||
bool C4Draw::GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2)
|
||||
{
|
||||
// Store drawing clip values
|
||||
rX1=fClipX1; rY1=fClipY1; rX2=fClipX2; rY2=fClipY2;
|
||||
|
@ -1168,7 +1168,7 @@ bool CStdDDraw::GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdDDraw::SetGamma(DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, int32_t iRampIndex)
|
||||
void C4Draw::SetGamma(DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, int32_t iRampIndex)
|
||||
{
|
||||
// No gamma effects
|
||||
if (Config.Graphics.DisableGamma) return;
|
||||
|
@ -1183,7 +1183,7 @@ void CStdDDraw::SetGamma(DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, int32_t iRamp
|
|||
fSetGamma=true;
|
||||
}
|
||||
|
||||
void CStdDDraw::ApplyGamma()
|
||||
void C4Draw::ApplyGamma()
|
||||
{
|
||||
// No gamma effects
|
||||
if (Config.Graphics.DisableGamma) return;
|
||||
|
@ -1213,35 +1213,35 @@ void CStdDDraw::ApplyGamma()
|
|||
fSetGamma=false;
|
||||
}
|
||||
|
||||
void CStdDDraw::DisableGamma()
|
||||
void C4Draw::DisableGamma()
|
||||
{
|
||||
// set it
|
||||
ApplyGammaRamp(DefRamp.ramp, true);
|
||||
}
|
||||
|
||||
void CStdDDraw::EnableGamma()
|
||||
void C4Draw::EnableGamma()
|
||||
{
|
||||
// set it
|
||||
ApplyGammaRamp(Gamma.ramp, false);
|
||||
}
|
||||
|
||||
DWORD CStdDDraw::ApplyGammaTo(DWORD dwClr)
|
||||
DWORD C4Draw::ApplyGammaTo(DWORD dwClr)
|
||||
{
|
||||
return Gamma.ApplyTo(dwClr);
|
||||
}
|
||||
|
||||
void CStdDDraw::SetZoom(int X, int Y, float Zoom)
|
||||
void C4Draw::SetZoom(int X, int Y, float Zoom)
|
||||
{
|
||||
this->ZoomX = X; this->ZoomY = Y; this->Zoom = Zoom;
|
||||
}
|
||||
|
||||
void CStdDDraw::ApplyZoom(float & X, float & Y)
|
||||
void C4Draw::ApplyZoom(float & X, float & Y)
|
||||
{
|
||||
X = (X - ZoomX) * Zoom + ZoomX;
|
||||
Y = (Y - ZoomY) * Zoom + ZoomY;
|
||||
}
|
||||
|
||||
void CStdDDraw::RemoveZoom(float & X, float & Y)
|
||||
void C4Draw::RemoveZoom(float & X, float & Y)
|
||||
{
|
||||
X = (X - ZoomX) / Zoom + ZoomX;
|
||||
Y = (Y - ZoomY) / Zoom + ZoomY;
|
||||
|
@ -1273,7 +1273,7 @@ bool DDrawInit(C4AbstractApp * pApp, bool Editor, bool fUsePageLock, unsigned in
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdDDraw::Init(C4AbstractApp * pApp, bool Editor, bool fUsePageLock, unsigned int iXRes, unsigned int iYRes, int iBitDepth, unsigned int iMonitor)
|
||||
bool C4Draw::Init(C4AbstractApp * pApp, bool Editor, bool fUsePageLock, unsigned int iXRes, unsigned int iYRes, int iBitDepth, unsigned int iMonitor)
|
||||
{
|
||||
this->pApp = pApp;
|
||||
|
||||
|
@ -1295,7 +1295,7 @@ bool CStdDDraw::Init(C4AbstractApp * pApp, bool Editor, bool fUsePageLock, unsig
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdDDraw::DrawBoxFade(C4Surface * sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, int iBoxOffX, int iBoxOffY)
|
||||
void C4Draw::DrawBoxFade(C4Surface * sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, int iBoxOffX, int iBoxOffY)
|
||||
{
|
||||
ApplyZoom(iX, iY);
|
||||
iWdt *= Zoom;
|
||||
|
@ -1347,7 +1347,7 @@ void CStdDDraw::DrawBoxFade(C4Surface * sfcDest, float iX, float iY, float iWdt,
|
|||
DrawQuadDw(sfcDest, vtx, dwClr1, dwClr3, dwClr4, dwClr2);
|
||||
}
|
||||
|
||||
void CStdDDraw::DrawBoxDw(C4Surface * sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
|
||||
void C4Draw::DrawBoxDw(C4Surface * sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
|
||||
{
|
||||
// manual clipping?
|
||||
if (Config.Graphics.ClipManuallyE)
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#endif
|
||||
|
||||
// texref-predef
|
||||
class CStdDDraw;
|
||||
class C4Draw;
|
||||
class C4TexRef;
|
||||
class C4Surface;
|
||||
struct CStdPalette;
|
||||
|
@ -50,7 +50,7 @@ class StdMeshInstance;
|
|||
#define GFXENGN_NOGFX 3
|
||||
|
||||
// Global DDraw access pointer
|
||||
extern CStdDDraw *pDraw;
|
||||
extern C4Draw *pDraw;
|
||||
|
||||
extern int iGfxEngine;
|
||||
|
||||
|
@ -173,7 +173,7 @@ public:
|
|||
|
||||
DWORD ApplyTo(DWORD dwClr); // apply gamma to color value
|
||||
|
||||
friend class CStdDDraw;
|
||||
friend class C4Draw;
|
||||
friend class CStdD3D;
|
||||
friend class CStdGL;
|
||||
};
|
||||
|
@ -186,13 +186,13 @@ struct ZoomData
|
|||
};
|
||||
|
||||
// direct draw encapsulation
|
||||
class CStdDDraw
|
||||
class C4Draw
|
||||
{
|
||||
public:
|
||||
static const StdMeshMatrix OgreToClonk;
|
||||
|
||||
CStdDDraw(): MaxTexSize(0), Saturation(255) { }
|
||||
virtual ~CStdDDraw() { pDraw=NULL; }
|
||||
C4Draw(): MaxTexSize(0), Saturation(255) { }
|
||||
virtual ~C4Draw() { pDraw=NULL; }
|
||||
public:
|
||||
C4AbstractApp * pApp; // the application
|
||||
bool Active; // set if device is ready to render, etc.
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* See clonk_trademark_license.txt for full license.
|
||||
*/
|
||||
|
||||
// text drawing facility for CStdDDraw
|
||||
// text drawing facility for C4Draw
|
||||
|
||||
#include "C4Include.h"
|
||||
#include <StdFont.h>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* "Clonk" is a registered trademark of Matthes Bender.
|
||||
* See clonk_trademark_license.txt for full license.
|
||||
*/
|
||||
// text drawing facility for CStdDDraw
|
||||
// text drawing facility for C4Draw
|
||||
|
||||
#ifndef INC_STDFONT
|
||||
#define INC_STDFONT
|
||||
|
|
|
@ -88,7 +88,7 @@ void CStdGL::Clear()
|
|||
// clear context
|
||||
if (pCurrCtx) pCurrCtx->Deselect();
|
||||
pMainCtx=0;
|
||||
CStdDDraw::Clear();
|
||||
C4Draw::Clear();
|
||||
}
|
||||
|
||||
void CStdGL::FillBG(DWORD dwClr)
|
||||
|
@ -1142,17 +1142,17 @@ void CStdGL::PerformMesh(StdMeshInstance &instance, float tx, float ty, float tw
|
|||
static const float TAN_FOV = tan(FOV / 2.0f / 180.0f * M_PI);
|
||||
|
||||
// Convert OgreToClonk matrix to column-major order
|
||||
// TODO: This must be executed after CStdDDraw::OgreToClonk was
|
||||
// TODO: This must be executed after C4Draw::OgreToClonk was
|
||||
// initialized - is this guaranteed at this position?
|
||||
static const float OgreToClonkGL[16] =
|
||||
{
|
||||
CStdDDraw::OgreToClonk(0,0), CStdDDraw::OgreToClonk(1,0), CStdDDraw::OgreToClonk(2,0), 0,
|
||||
CStdDDraw::OgreToClonk(0,1), CStdDDraw::OgreToClonk(1,1), CStdDDraw::OgreToClonk(2,1), 0,
|
||||
CStdDDraw::OgreToClonk(0,2), CStdDDraw::OgreToClonk(1,2), CStdDDraw::OgreToClonk(2,2), 0,
|
||||
CStdDDraw::OgreToClonk(0,3), CStdDDraw::OgreToClonk(1,3), CStdDDraw::OgreToClonk(2,3), 1
|
||||
C4Draw::OgreToClonk(0,0), C4Draw::OgreToClonk(1,0), C4Draw::OgreToClonk(2,0), 0,
|
||||
C4Draw::OgreToClonk(0,1), C4Draw::OgreToClonk(1,1), C4Draw::OgreToClonk(2,1), 0,
|
||||
C4Draw::OgreToClonk(0,2), C4Draw::OgreToClonk(1,2), C4Draw::OgreToClonk(2,2), 0,
|
||||
C4Draw::OgreToClonk(0,3), C4Draw::OgreToClonk(1,3), C4Draw::OgreToClonk(2,3), 1
|
||||
};
|
||||
|
||||
static const bool OgreToClonkParity = CStdDDraw::OgreToClonk.Determinant() > 0.0f;
|
||||
static const bool OgreToClonkParity = C4Draw::OgreToClonk.Determinant() > 0.0f;
|
||||
|
||||
const StdMesh& mesh = instance.GetMesh();
|
||||
|
||||
|
@ -1998,7 +1998,7 @@ bool CStdGL::Error(const char *szMsg)
|
|||
LogF(" gl: %s", glGetString(GL_RENDERER));
|
||||
LogF(" gl: %s", glGetString(GL_VERSION));
|
||||
LogF(" gl: %s", glGetString(GL_EXTENSIONS));
|
||||
return CStdDDraw::Error(szMsg);
|
||||
return C4Draw::Error(szMsg);
|
||||
}
|
||||
|
||||
bool CStdGL::CheckGLError(const char *szAtOp)
|
||||
|
@ -2063,7 +2063,7 @@ bool CStdGL::OnResolutionChanged(unsigned int iXRes, unsigned int iYRes)
|
|||
|
||||
void CStdGL::Default()
|
||||
{
|
||||
CStdDDraw::Default();
|
||||
C4Draw::Default();
|
||||
pCurrCtx = NULL;
|
||||
iPixelFormat=0;
|
||||
sfcFmt=0;
|
||||
|
|
|
@ -83,7 +83,7 @@ protected:
|
|||
};
|
||||
|
||||
// OpenGL encapsulation
|
||||
class CStdGL : public CStdDDraw
|
||||
class CStdGL : public C4Draw
|
||||
{
|
||||
public:
|
||||
CStdGL();
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <StdDDraw2.h>
|
||||
|
||||
class CStdNoGfx : public CStdDDraw
|
||||
class CStdNoGfx : public C4Draw
|
||||
{
|
||||
public:
|
||||
CStdNoGfx();
|
||||
|
|
|
@ -204,7 +204,7 @@ static void readline_callback (char * line)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool CStdDDraw::SaveDefaultGammaRamp(C4Window * pWindow)
|
||||
bool C4Draw::SaveDefaultGammaRamp(C4Window * pWindow)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -330,7 +330,7 @@ public:
|
|||
// Invokes actual drawing code - should not be called directly
|
||||
virtual void PerformUpdate();
|
||||
public:
|
||||
friend class CStdDDraw;
|
||||
friend class C4Draw;
|
||||
friend class CStdGL;
|
||||
friend class CStdGLCtx;
|
||||
friend class C4AbstractApp;
|
||||
|
|
Loading…
Reference in New Issue