Replace SURFACE with C4Surface *

Günther Brammer 2011-10-03 16:07:07 +02:00
parent 55f6bc8d0f
commit 68d6b34f72
22 changed files with 121 additions and 123 deletions

View File

@ -290,7 +290,7 @@ namespace
CGImageRef C4ToolsDlg::State::CreatePreviewImage()
{
SURFACE sfcPreview;
C4Surface * sfcPreview;
int32_t iPrvWdt,iPrvHgt;
iPrvWdt = [ctrler(&Console).previewView frame].size.width;

View File

@ -549,7 +549,7 @@ bool C4MaterialMap::CrossMapMaterials() // Called after load
Map[cnt].DefaultMatTex = ::TextureMap.GetIndex(Map[cnt].Name, szTextureOverlay, true,
FormatString("DefaultMatTex of mat %s", Map[cnt].Name).getData());
// init PXS facet
SURFACE sfcTexture;
C4Surface * sfcTexture;
C4Texture * Texture;
if (Map[cnt].sPXSGfx.getLength())
if ((Texture=::TextureMap.GetTexture(Map[cnt].sPXSGfx.getData())))

View File

@ -333,7 +333,7 @@ bool C4PathFinderRay::PathFree(int32_t &rX, int32_t &rY, int32_t iToX, int32_t i
return true;
}
/*void C4PathFinderRay::DrawLine(SURFACE sfcSurface, int32_t rX, int32_t rY, int32_t iToX, int32_t iToY, BYTE byCol)
/*void C4PathFinderRay::DrawLine(C4Surface * sfcSurface, int32_t rX, int32_t rY, int32_t iToX, int32_t iToY, BYTE byCol)
{
int32_t d,dx,dy,aincr,bincr,xincr,yincr,x,y;
// Y based

View File

@ -409,7 +409,7 @@ C4SolidMask::C4SolidMask(C4Object *pForObject) : pForObject(pForObject)
// copy solid mask from bitmap
int iNeededBufSize = pForObject->SolidMask.Wdt * pForObject->SolidMask.Hgt;
if (!(pSolidMask = new BYTE [iNeededBufSize])) return;
SURFACE sfcBitmap = pForObject->GetGraphics()->GetBitmap();
C4Surface * sfcBitmap = pForObject->GetGraphics()->GetBitmap();
if (!sfcBitmap->Lock()) return;
for (int ycnt=0; ycnt<pForObject->SolidMask.Hgt; ycnt++)
for (int xcnt=0; xcnt<pForObject->SolidMask.Wdt; xcnt++)

View File

@ -856,7 +856,7 @@ void C4Menu::DrawElement(C4TargetFacet &cgo)
//lpDDraw->SetPrimaryClipper(iX1,iY1,iX2,iY2);
}
void C4Menu::DrawFrame(SURFACE sfcSurface, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
void C4Menu::DrawFrame(C4Surface * sfcSurface, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
{
lpDDraw->DrawFrameDw(sfcSurface, iX+1, iY+1, iX+iWdt-1,iY+iHgt-1, C4RGB(0x44, 0, 0));
}

View File

@ -219,7 +219,7 @@ protected:
bool RefillInternal();
void DrawButton(C4Facet &cgo);
void DrawScrollbar(C4Facet &cgo, int32_t iTotal, int32_t iVisible, int32_t iPosition);
void DrawFrame(SURFACE sfcSurface, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt);
void DrawFrame(C4Surface * sfcSurface, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt);
void InitLocation(C4Facet &cgo);
void InitSize();
void UpdateScrollBar(); // call InitSize if a scroll bar is needed but not present or vice vera

View File

@ -38,7 +38,7 @@ void C4Facet::Default()
Set(NULL,0,0,0,0);
}
void C4Facet::Set(SURFACE nsfc, int32_t nx, int32_t ny, int32_t nwdt, int32_t nhgt)
void C4Facet::Set(C4Surface * nsfc, int32_t nx, int32_t ny, int32_t nwdt, int32_t nhgt)
{
Surface=nsfc; X=nx; Y=ny; Wdt=nwdt; Hgt=nhgt;
}
@ -68,7 +68,7 @@ C4Facet C4Facet::GetPhase(int iPhaseX, int iPhaseY)
return fctResult;
}
void C4Facet::Draw(SURFACE sfcTarget, float iX, float iY, int32_t iPhaseX, int32_t iPhaseY)
void C4Facet::Draw(C4Surface * sfcTarget, float iX, float iY, int32_t iPhaseX, int32_t iPhaseY)
{
if (!lpDDraw || !Surface || !sfcTarget || !Wdt || !Hgt) return;
@ -78,7 +78,7 @@ void C4Facet::Draw(SURFACE sfcTarget, float iX, float iY, int32_t iPhaseX, int32
iX,iY,Wdt,Hgt,true);
}
void C4Facet::DrawT(SURFACE sfcTarget, float iX, float iY, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform)
void C4Facet::DrawT(C4Surface * sfcTarget, float iX, float iY, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform)
{
if (!lpDDraw || !Surface || !sfcTarget || !Wdt || !Hgt) return;
@ -168,7 +168,7 @@ void C4Facet::DrawClr(C4Facet &cgo, bool fAspect, DWORD dwClr)
Draw(cgo, fAspect);
}
void C4Facet::DrawXClr(SURFACE sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, DWORD dwClr)
void C4Facet::DrawXClr(C4Surface * sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, DWORD dwClr)
{
// set ColorByOwner-color
Surface->SetClr(dwClr);
@ -184,7 +184,7 @@ void C4Facet::DrawValue2Clr(C4Facet &cgo, int32_t iValue1, int32_t iValue2, DWOR
DrawValue2(cgo, iValue1, iValue2);
}
void C4Facet::DrawXR(SURFACE sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iSectionX, int32_t iSectionY, int32_t r)
void C4Facet::DrawXR(C4Surface * sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iSectionX, int32_t iSectionY, int32_t r)
{
if (!lpDDraw || !Surface || !sfcTarget || !Wdt || !Hgt) return;
C4BltTransform rot;
@ -304,7 +304,7 @@ void C4Facet::DrawValue2(C4Facet &cgo, int32_t iValue1, int32_t iValue2, int32_t
}
}
void C4Facet::DrawX(SURFACE sfcTarget, float iX, float iY, float iWdt, float iHgt, int32_t iSectionX, int32_t iSectionY) const
void C4Facet::DrawX(C4Surface * sfcTarget, float iX, float iY, float iWdt, float iHgt, int32_t iSectionX, int32_t iSectionY) const
{
if (!lpDDraw || !Surface || !sfcTarget || !Wdt || !Hgt) return;
lpDDraw->Blit(Surface,
@ -314,7 +314,7 @@ void C4Facet::DrawX(SURFACE sfcTarget, float iX, float iY, float iWdt, float iHg
true);
}
void C4Facet::DrawXFloat(SURFACE sfcTarget, float fX, float fY, float fWdt, float fHgt) const
void C4Facet::DrawXFloat(C4Surface * sfcTarget, float fX, float fY, float fWdt, float fHgt) const
{
if (!lpDDraw || !Surface || !sfcTarget || !Wdt || !Hgt || fWdt<=0 || fHgt<=0) return;
// Since only source coordinates are available as floats for blitting, go inwards into this facet to match blit
@ -338,7 +338,7 @@ void C4Facet::DrawXFloat(SURFACE sfcTarget, float fX, float fY, float fWdt, floa
true);*/
}
void C4Facet::DrawXT(SURFACE sfcTarget, float iX, float iY, int32_t iWdt, int32_t iHgt, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform)
void C4Facet::DrawXT(C4Surface * sfcTarget, float iX, float iY, int32_t iWdt, int32_t iHgt, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform)
{
if (!lpDDraw || !Surface || !sfcTarget || !Wdt || !Hgt) return;
lpDDraw->Blit(Surface,
@ -410,7 +410,7 @@ void C4Facet::Set(C4Surface &rSfc)
Set(&rSfc,0,0,rSfc.Wdt,rSfc.Hgt);
}
void C4Facet::DrawTile(SURFACE sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
void C4Facet::DrawTile(C4Surface * sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
{
if (!lpDDraw || !Surface || !Wdt || !Hgt) return;
// Blits whole source surface, not surface facet area

View File

@ -120,34 +120,34 @@ public:
class C4Facet
{
public:
SURFACE Surface;
C4Surface * Surface;
int32_t X,Y,Wdt,Hgt;
public:
C4Facet();
C4Facet(SURFACE pSfc, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
C4Facet(C4Surface * pSfc, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
: Surface(pSfc), X(iX), Y(iY), Wdt(iWdt), Hgt(iHgt) { }
public:
void Default();
void Set(C4Surface &rSfc);
void Set(SURFACE nsfc, int32_t nx, int32_t ny, int32_t nwdt, int32_t nhgt);
void Set(C4Surface * nsfc, int32_t nx, int32_t ny, int32_t nwdt, int32_t nhgt);
void Set(const C4Facet &cpy) { *this=cpy; }
void Expand(int32_t iLeft=0, int32_t iRight=0, int32_t iTop=0, int32_t iBottom=0);
void DrawTile(SURFACE sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt);
void DrawTile(C4Surface * sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt);
void DrawEnergyLevelEx(int32_t iLevel, int32_t iRange, const C4Facet &gfx, int32_t bar_idx); // draw energy level using graphics
void DrawX(SURFACE sfcTarget, float iX, float iY, float iWdt, float iHgt, int32_t iPhaseX=0, int32_t iPhaseY=0) const;
void DrawXFloat(SURFACE sfcTarget, float fX, float fY, float fWdt, float fHgt) const;
void DrawX(C4Surface * sfcTarget, float iX, float iY, float iWdt, float iHgt, int32_t iPhaseX=0, int32_t iPhaseY=0) const;
void DrawXFloat(C4Surface * sfcTarget, float fX, float fY, float fWdt, float fHgt) const;
void DrawValue(C4Facet &cgo, int32_t iValue, int32_t iPhaseX=0, int32_t iPhaseY=0, int32_t iAlign=C4FCT_Center);
void DrawValue2(C4Facet &cgo, int32_t iValue1, int32_t iValue2, int32_t iPhaseX=0, int32_t iPhaseY=0, int32_t iAlign=C4FCT_Center, int32_t *piUsedWidth=NULL);
void Draw(C4Facet &cgo, bool fAspect=true, int32_t iPhaseX=0, int32_t iPhaseY=0, bool fTransparent=true);
void DrawFullScreen(C4Facet &cgo);
void DrawT(SURFACE sfcTarget, float iX, float iY, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform); // draw with transformation (if pTransform is assigned)
void DrawT(C4Surface * sfcTarget, float iX, float iY, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform); // draw with transformation (if pTransform is assigned)
void DrawT(C4Facet &cgo, bool fAspect, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform);
void DrawXT(SURFACE sfcTarget, float iX, float iY, int32_t iWdt, int32_t iHgt, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform);
void DrawXT(C4Surface * sfcTarget, float iX, float iY, int32_t iWdt, int32_t iHgt, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *pTransform);
void DrawClr(C4Facet &cgo, bool fAspect=true, DWORD dwClr=0); // set surface color and draw
void DrawXClr(SURFACE sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, DWORD dwClr); // set surface color and draw
void DrawXClr(C4Surface * sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, DWORD dwClr); // set surface color and draw
void DrawValue2Clr(C4Facet &cgo, int32_t iValue1, int32_t iValue2, DWORD dwClr); // set surface color and draw
void DrawXR(SURFACE sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iPhaseX=0, int32_t iPhaseY=0, int32_t r=0); // draw rotated
void Draw(SURFACE sfcTarget, float iX, float iY, int32_t iPhaseX=0, int32_t iPhaseY=0);
void DrawXR(C4Surface * sfcTarget, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iPhaseX=0, int32_t iPhaseY=0, int32_t r=0); // draw rotated
void Draw(C4Surface * sfcTarget, float iX, float iY, int32_t iPhaseX=0, int32_t iPhaseY=0);
bool GetPhaseNum(int32_t &rX, int32_t &rY); // return number of phases in this graphic
C4Facet GetSection(int32_t iSection);
C4Facet GetPhase(int iPhaseX=0, int iPhaseY=0);

View File

@ -29,13 +29,13 @@
#include <C4Group.h>
void C4TargetFacet::Set(SURFACE nsfc, int nx, int ny, int nwdt, int nhgt, float ntx, float nty, float Zoom)
void C4TargetFacet::Set(C4Surface * nsfc, int nx, int ny, int nwdt, int nhgt, float ntx, float nty, float Zoom)
{
C4Facet::Set(nsfc, nx, ny, nwdt, nhgt);
TargetX = ntx; TargetY = nty; this->Zoom = Zoom;
}
void C4TargetFacet::Set(SURFACE nsfc, const C4Rect & r, float ntx, float nty, float Zoom)
void C4TargetFacet::Set(C4Surface * nsfc, const C4Rect & r, float ntx, float nty, float Zoom)
{
Set(nsfc, r.x, r.y, r.Wdt, r.Hgt, ntx, nty, Zoom);
}

View File

@ -77,7 +77,7 @@ public:
void Clear() { Face.Clear(); }
void Set(const C4Facet &cpy) { Clear(); C4Facet::Set(cpy); }
void Set(SURFACE nsfc, int nx, int ny, int nwdt, int nhgt)
void Set(C4Surface * nsfc, int nx, int ny, int nwdt, int nhgt)
{ C4Facet::Set(nsfc, nx,ny,nwdt,nhgt); }
void Grayscale(int32_t iOffset = 0);

View File

@ -275,6 +275,4 @@ public:
extern CTexMgr *pTexMgr;
#define SURFACE C4Surface *
#endif

View File

@ -69,7 +69,7 @@ void C4Video::Clear()
Stop();
}
void C4Video::Init(SURFACE sfcSource, int iWidth, int iHeight)
void C4Video::Init(C4Surface * sfcSource, int iWidth, int iHeight)
{
// Activate
Active=true;

View File

@ -46,7 +46,7 @@ protected:
int BufferSize;
int InfoSize;
bool Recording;
SURFACE Surface;
C4Surface * Surface;
int ShowFlash;
public:
void Draw();
@ -54,7 +54,7 @@ public:
void Resize(int iChange);
bool Start(const char *szFilename);
void Default();
void Init(SURFACE sfcSource, int iWidth=768, int iHeight=576);
void Init(C4Surface * sfcSource, int iWidth=768, int iHeight=576);
void Clear();
bool Start();
bool Stop();

View File

@ -184,7 +184,7 @@ bool CStdD3D::PrepareMaterial(StdMeshMaterial &mat)
return false;
}
bool CStdD3D::PrepareRendering(SURFACE sfcToSurface)
bool CStdD3D::PrepareRendering(C4Surface * sfcToSurface)
{
// call from gfx thread only!
if (!pApp || !pApp->AssertMainThread()) return false;
@ -339,7 +339,7 @@ bool CStdD3D::BlitTex2Window(CTexRef *pTexRef, HDC hdcTarget, RECT &rtFrom, RECT
return true;
}
bool CStdD3D::BlitSurface2Window(SURFACE sfcSource,
bool CStdD3D::BlitSurface2Window(C4Surface * sfcSource,
int fX, int fY, int fWdt, int fHgt,
HWND hWnd,
int tX, int tY, int tWdt, int tHgt)
@ -655,7 +655,7 @@ bool CStdD3D::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigned int
return true;
}
void CStdD3D::PerformPix(SURFACE sfcDest, float tx, float ty, DWORD dwClr)
void CStdD3D::PerformPix(C4Surface * sfcDest, float tx, float ty, DWORD dwClr)
{
// is render target?
if (!sfcDest->IsRenderTarget())
@ -684,7 +684,7 @@ void CStdD3D::PerformPix(SURFACE sfcDest, float tx, float ty, DWORD dwClr)
DrawQuadDw(sfcDest, vtx, dwClr, dwClr, dwClr, dwClr);
}
void CStdD3D::DrawPixPrimary(SURFACE sfcDest, int iX, int iY, DWORD dwClr)
void CStdD3D::DrawPixPrimary(C4Surface * sfcDest, int iX, int iY, DWORD dwClr)
{
// Must be render target and locked
if (!sfcDest->IsRenderTarget() || !sfcDest->IsLocked()) return;
@ -719,7 +719,7 @@ void CStdD3D::DrawPixPrimary(SURFACE sfcDest, int iX, int iY, DWORD dwClr)
}
}
void CStdD3D::DrawQuadDw(SURFACE sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4)
void CStdD3D::DrawQuadDw(C4Surface * sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4)
{
// prepare rendering to target
if (!PrepareRendering(sfcTarget)) return;
@ -765,7 +765,7 @@ void CStdD3D::DrawQuadDw(SURFACE sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dw
lpDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, 2 );
}
void CStdD3D::PerformLine(SURFACE sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr)
void CStdD3D::PerformLine(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr)
{
// FIXME: zoom width
//dwClr |= 0xf0000000;

View File

@ -130,18 +130,18 @@ public:
bool UpdateClipper(); // set current clipper to render target
virtual bool PrepareMaterial(StdMeshMaterial &mat);
// Surface
bool PrepareRendering(SURFACE sfcToSurface); // check if/make rendering possible to given surface
bool PrepareRendering(C4Surface * sfcToSurface); // check if/make rendering possible to given surface
// Blit
virtual void PerformMesh(StdMeshInstance &instance, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform);
void PerformBlt(C4BltData &rBltData, CTexRef *pTex, DWORD dwModClr, bool fMod2, bool fExact);
bool BlitTex2Window(CTexRef *pTexRef, HDC hdcTarget, RECT &rtFrom, RECT &rtTo);
bool BlitSurface2Window(SURFACE sfcSource, int fX, int fY, int fWdt, int fHgt, HWND hWnd, int tX, int tY, int tWdt, int tHgt);
bool BlitSurface2Window(C4Surface * sfcSource, int fX, int fY, int fWdt, int fHgt, HWND hWnd, int tX, int tY, int tWdt, int tHgt);
void FillBG(DWORD dwClr=0);
// Drawing
void DrawQuadDw(SURFACE sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4);
void PerformLine(SURFACE sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr);
void PerformPix(SURFACE sfcDest, float tx, float ty, DWORD dwCol);
void DrawPixPrimary(SURFACE sfcDest, int tx, int ty, DWORD dwCol);
void DrawQuadDw(C4Surface * sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4);
void PerformLine(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr);
void PerformPix(C4Surface * sfcDest, float tx, float ty, DWORD dwCol);
void DrawPixPrimary(C4Surface * sfcDest, int tx, int ty, DWORD dwCol);
// Gamma
virtual bool ApplyGammaRamp(D3DGAMMARAMP &ramp, bool fForce);
virtual bool SaveDefaultGammaRamp(C4Window * pWindow);

View File

@ -122,7 +122,7 @@ C4Pattern& C4Pattern::operator=(const C4Pattern& nPattern)
return *this;
}
bool C4Pattern::Set(SURFACE sfcSource, int iZoom)
bool C4Pattern::Set(C4Surface * sfcSource, int iZoom)
{
// Safety
if (!sfcSource) return false;
@ -410,7 +410,7 @@ void CStdDDraw::Clear()
dwBlitMode = 0;
}
bool CStdDDraw::GetSurfaceSize(SURFACE sfcSurface, int &iWdt, int &iHgt)
bool CStdDDraw::GetSurfaceSize(C4Surface * sfcSurface, int &iWdt, int &iHgt)
{
return sfcSurface->GetSurfaceSize(iWdt, iHgt);
}
@ -446,13 +446,13 @@ bool CStdDDraw::SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
return true;
}
bool CStdDDraw::ApplyPrimaryClipper(SURFACE sfcSurface)
bool CStdDDraw::ApplyPrimaryClipper(C4Surface * sfcSurface)
{
//sfcSurface->SetClipper(lpClipper);
return true;
}
bool CStdDDraw::DetachPrimaryClipper(SURFACE sfcSurface)
bool CStdDDraw::DetachPrimaryClipper(C4Surface * sfcSurface)
{
//sfcSurface->SetClipper(NULL);
return true;
@ -466,14 +466,14 @@ bool CStdDDraw::NoPrimaryClipper()
return true;
}
void CStdDDraw::BlitLandscape(SURFACE sfcSource, float fx, float fy,
SURFACE sfcTarget, float tx, float ty, float wdt, float hgt, const SURFACE textures[])
void CStdDDraw::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,
SURFACE sfcTarget, int tx, int ty, int wdt, int hgt)
C4Surface * sfcTarget, int tx, int ty, int wdt, int hgt)
{
// blit 8bit-sfc
// lock surfaces
@ -719,7 +719,7 @@ bool CStdDDraw::Blit(C4Surface * sfcSource, float fx, float fy, float fwdt, floa
return true;
}
bool CStdDDraw::RenderMesh(StdMeshInstance &instance, SURFACE sfcTarget, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform)
bool CStdDDraw::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,8 +740,8 @@ bool CStdDDraw::RenderMesh(StdMeshInstance &instance, SURFACE sfcTarget, float t
return true;
}
bool CStdDDraw::Blit8(SURFACE sfcSource, int fx, int fy, int fwdt, int fhgt,
SURFACE sfcTarget, int tx, int ty, int twdt, int thgt,
bool CStdDDraw::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)
{
if (!pTransform) return BlitRotate(sfcSource, fx, fy, fwdt, fhgt, sfcTarget, tx, ty, twdt, thgt, 0, fSrcColKey!=false);
@ -785,8 +785,8 @@ bool CStdDDraw::Blit8(SURFACE sfcSource, int fx, int fy, int fwdt, int fhgt,
return true;
}
bool CStdDDraw::BlitRotate(SURFACE sfcSource, int fx, int fy, int fwdt, int fhgt,
SURFACE sfcTarget, int tx, int ty, int twdt, int thgt,
bool CStdDDraw::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)
{
// rendertarget?
@ -896,7 +896,7 @@ bool CStdDDraw::CreatePrimaryClipper(unsigned int iXRes, unsigned int iYRes)
return true;
}
bool CStdDDraw::BlitSurface(SURFACE sfcSurface, SURFACE sfcTarget, int tx, int ty, bool fBlitBase)
bool CStdDDraw::BlitSurface(C4Surface * sfcSurface, C4Surface * sfcTarget, int tx, int ty, bool fBlitBase)
{
if (fBlitBase)
{
@ -914,7 +914,7 @@ bool CStdDDraw::BlitSurface(SURFACE sfcSurface, SURFACE sfcTarget, int tx, int t
}
}
bool CStdDDraw::BlitSurfaceTile(SURFACE sfcSurface, SURFACE sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX, int iOffsetY, bool fSrcColKey)
bool CStdDDraw::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(SURFACE sfcSurface, SURFACE sfcTarget, int iToX,
return true;
}
bool CStdDDraw::BlitSurfaceTile2(SURFACE sfcSurface, SURFACE sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX, int iOffsetY, bool fSrcColKey)
bool CStdDDraw::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(SURFACE sfcSurface, SURFACE sfcTarget, int iToX
return true;
}
bool CStdDDraw::TextOut(const char *szText, CStdFont &rFont, float fZoom, SURFACE sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup)
bool CStdDDraw::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, SURFAC
return true;
}
bool CStdDDraw::StringOut(const char *szText, CStdFont &rFont, float fZoom, SURFACE sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup)
bool CStdDDraw::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, SURF
return StringOut(szText, sfcDest, iTx, iTy, dwFCol, byForm, fDoMarkup, Markup, &rFont, fZoom);
}
bool CStdDDraw::StringOut(const char *szText, SURFACE sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup, C4Markup &Markup, CStdFont *pFont, float 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)
{
// clip
if (ClipAll) return true;
@ -1022,7 +1022,7 @@ bool CStdDDraw::StringOut(const char *szText, SURFACE sfcDest, float iTx, float
return true;
}
void CStdDDraw::DrawPix(SURFACE sfcDest, float tx, float ty, DWORD dwClr)
void CStdDDraw::DrawPix(C4Surface * sfcDest, float tx, float ty, DWORD dwClr)
{
ApplyZoom(tx, ty);
// FIXME: zoom to a box
@ -1043,7 +1043,7 @@ void CStdDDraw::DrawPix(SURFACE sfcDest, float tx, float ty, DWORD dwClr)
PerformPix(sfcDest, tx, ty, dwClr);
}
void CStdDDraw::DrawLineDw(SURFACE sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr)
void CStdDDraw::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(SURFACE sfcTarget, float x1, float y1, float x2, floa
PerformLine(sfcTarget, x1, y1, x2, y2, dwClr);
}
void CStdDDraw::DrawFrameDw(SURFACE sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr) // make these parameters float...?
void CStdDDraw::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);
@ -1102,14 +1102,14 @@ void CStdDDraw::DrawFrameDw(SURFACE sfcDest, int x1, int y1, int x2, int y2, DWO
C4Surface *GLSBuffer=NULL;
bool LockSurfaceGlobal(SURFACE sfcTarget)
bool LockSurfaceGlobal(C4Surface * sfcTarget)
{
if (GLSBuffer) return false;
GLSBuffer=sfcTarget;
return !!sfcTarget->Lock();
}
bool UnLockSurfaceGlobal(SURFACE sfcTarget)
bool UnLockSurfaceGlobal(C4Surface * sfcTarget)
{
if (!GLSBuffer) return false;
sfcTarget->Unlock();
@ -1124,7 +1124,7 @@ bool DLineSPixDw(int32_t x, int32_t y, int32_t dwClr)
return true;
}
void CStdDDraw::DrawPatternedCircle(SURFACE sfcDest, int x, int y, int r, BYTE col, C4Pattern & Pattern, CStdPalette &rPal)
void CStdDDraw::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(SURFACE sfcDest, int x, int y, int r, BYTE c
sfcDest->Unlock();
}
void CStdDDraw::Grayscale(SURFACE sfcSfc, int32_t iOffset)
void CStdDDraw::Grayscale(C4Surface * sfcSfc, int32_t iOffset)
{
// safety
if (!sfcSfc) return;
@ -1295,7 +1295,7 @@ bool CStdDDraw::Init(C4AbstractApp * pApp, bool Editor, bool fUsePageLock, unsig
return true;
}
void CStdDDraw::DrawBoxFade(SURFACE sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, int iBoxOffX, int iBoxOffY)
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)
{
ApplyZoom(iX, iY);
iWdt *= Zoom;
@ -1347,7 +1347,7 @@ void CStdDDraw::DrawBoxFade(SURFACE sfcDest, float iX, float iY, float iWdt, flo
DrawQuadDw(sfcDest, vtx, dwClr1, dwClr3, dwClr4, dwClr2);
}
void CStdDDraw::DrawBoxDw(SURFACE sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
void CStdDDraw::DrawBoxDw(C4Surface * sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
{
// manual clipping?
if (Config.Graphics.ClipManuallyE)

View File

@ -242,49 +242,49 @@ public:
bool StorePrimaryClipper();
bool RestorePrimaryClipper();
bool NoPrimaryClipper();
bool ApplyPrimaryClipper(SURFACE sfcSurface);
bool DetachPrimaryClipper(SURFACE sfcSurface);
bool ApplyPrimaryClipper(C4Surface * sfcSurface);
bool DetachPrimaryClipper(C4Surface * sfcSurface);
virtual bool UpdateClipper() = 0; // set current clipper to render target
// Surface
bool GetSurfaceSize(SURFACE sfcSurface, int &iWdt, int &iHgt);
void Grayscale(SURFACE sfcSfc, int32_t iOffset = 0);
bool GetSurfaceSize(C4Surface * sfcSurface, int &iWdt, int &iHgt);
void Grayscale(C4Surface * sfcSfc, int32_t iOffset = 0);
void LockingPrimary() { PrimaryLocked=true; }
void PrimaryUnlocked() { PrimaryLocked=false; }
virtual bool PrepareMaterial(StdMeshMaterial &mat) = 0; // Find best technique, fail if there is none
virtual bool PrepareRendering(SURFACE sfcToSurface) = 0; // check if/make rendering possible to given surface
virtual bool PrepareRendering(C4Surface * sfcToSurface) = 0; // check if/make rendering possible to given surface
// Blit
virtual void BlitLandscape(SURFACE sfcSource, float fx, float fy,
SURFACE sfcTarget, float tx, float ty, float wdt, float hgt, const SURFACE textures[]);
virtual void BlitLandscape(C4Surface * sfcSource, float fx, float fy,
C4Surface * sfcTarget, float tx, float ty, float wdt, float hgt, const C4Surface * textures[]);
void Blit8Fast(CSurface8 * sfcSource, int fx, int fy,
SURFACE sfcTarget, int tx, int ty, int wdt, int hgt);
bool Blit(SURFACE sfcSource, float fx, float fy, float fwdt, float fhgt,
SURFACE sfcTarget, float tx, float ty, float twdt, float thgt,
C4Surface * sfcTarget, int tx, int ty, int wdt, int hgt);
bool Blit(C4Surface * sfcSource, float fx, float fy, float fwdt, float fhgt,
C4Surface * sfcTarget, float tx, float ty, float twdt, float thgt,
bool fSrcColKey=false, const C4BltTransform *pTransform=NULL);
bool RenderMesh(StdMeshInstance &instance, SURFACE sfcTarget, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform); // Call PrepareMaterial with Mesh's material before
bool RenderMesh(StdMeshInstance &instance, C4Surface * sfcTarget, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform); // Call PrepareMaterial with Mesh's material before
virtual void PerformBlt(C4BltData &rBltData, CTexRef *pTex, DWORD dwModClr, bool fMod2, bool fExact) = 0;
virtual void PerformMesh(StdMeshInstance &instance, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform) = 0;
bool Blit8(SURFACE sfcSource, int fx, int fy, int fwdt, int fhgt, // force 8bit-blit (inline)
SURFACE sfcTarget, int tx, int ty, int twdt, int thgt,
bool Blit8(C4Surface * sfcSource, int fx, int fy, int fwdt, int fhgt, // force 8bit-blit (inline)
C4Surface * sfcTarget, int tx, int ty, int twdt, int thgt,
bool fSrcColKey=false, const C4BltTransform *pTransform=NULL);
bool BlitRotate(SURFACE sfcSource, int fx, int fy, int fwdt, int fhgt,
SURFACE sfcTarget, int tx, int ty, int twdt, int thgt,
bool 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=true);
bool BlitSurface(SURFACE sfcSurface, SURFACE sfcTarget, int tx, int ty, bool fBlitBase);
bool BlitSurfaceTile(SURFACE sfcSurface, SURFACE sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX=0, int iOffsetY=0, bool fSrcColKey=false);
bool BlitSurfaceTile2(SURFACE sfcSurface, SURFACE sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX=0, int iOffsetY=0, bool fSrcColKey=false);
bool BlitSurface(C4Surface * sfcSurface, C4Surface * sfcTarget, int tx, int ty, bool fBlitBase);
bool BlitSurfaceTile(C4Surface * sfcSurface, C4Surface * sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX=0, int iOffsetY=0, bool fSrcColKey=false);
bool BlitSurfaceTile2(C4Surface * sfcSurface, C4Surface * sfcTarget, int iToX, int iToY, int iToWdt, int iToHgt, int iOffsetX=0, int iOffsetY=0, bool fSrcColKey=false);
virtual void FillBG(DWORD dwClr=0) = 0;
// Text
enum { DEFAULT_MESSAGE_COLOR = 0xffffffff };
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, SURFACE sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true);
bool StringOut(const char *szText, CStdFont &rFont, float fZoom, SURFACE sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true);
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true);
bool StringOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true);
// Drawing
virtual void DrawPix(SURFACE sfcDest, float tx, float ty, DWORD dwCol);
void DrawBoxDw(SURFACE sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr); // calls DrawBoxFade
void DrawBoxFade(SURFACE sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, int iBoxOffX, int iBoxOffY); // calls DrawQuadDw
void DrawPatternedCircle(SURFACE sfcDest, int x, int y, int r, BYTE col, C4Pattern & Pattern, CStdPalette &rPal);
void DrawFrameDw(SURFACE sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr);
virtual void DrawLineDw(SURFACE sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr);
virtual void DrawQuadDw(SURFACE sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4) = 0;
virtual void DrawPix(C4Surface * sfcDest, float tx, float ty, DWORD dwCol);
void DrawBoxDw(C4Surface * sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr); // calls DrawBoxFade
void DrawBoxFade(C4Surface * sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, int iBoxOffX, int iBoxOffY); // calls DrawQuadDw
void DrawPatternedCircle(C4Surface * sfcDest, int x, int y, int r, BYTE col, C4Pattern & Pattern, CStdPalette &rPal);
void DrawFrameDw(C4Surface * sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr);
virtual void DrawLineDw(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr);
virtual void DrawQuadDw(C4Surface * sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4) = 0;
// gamma
void SetGamma(DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, int32_t iRampIndex); // set gamma ramp
void ApplyGamma(); // apply gamma ramp to ddraw
@ -327,9 +327,9 @@ public:
int GetByteCnt() { return byByteCnt; } // return bytes per pixel
protected:
bool StringOut(const char *szText, SURFACE sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup, C4Markup &Markup, CStdFont *pFont, float fZoom);
virtual void PerformPix(SURFACE sfcDest, float tx, float ty, DWORD dwCol) = 0; // without ClrModMap
virtual void PerformLine(SURFACE sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr) = 0;
bool StringOut(const char *szText, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup, C4Markup &Markup, CStdFont *pFont, float fZoom);
virtual void PerformPix(C4Surface * sfcDest, float tx, float ty, DWORD dwCol) = 0; // without ClrModMap
virtual void PerformLine(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr) = 0;
bool CreatePrimaryClipper(unsigned int iXRes, unsigned int iYRes);
virtual bool CreatePrimarySurfaces(bool Editor, unsigned int iXRes, unsigned int iYRes, int iColorDepth, unsigned int iMonitor) = 0;
virtual bool Error(const char *szMsg);
@ -353,8 +353,8 @@ struct ZoomDataStackItem: public ZoomData
~ZoomDataStackItem() { lpDDraw->SetZoom(*this); }
};
bool LockSurfaceGlobal(SURFACE sfcTarget);
bool UnLockSurfaceGlobal(SURFACE sfcTarget);
bool LockSurfaceGlobal(C4Surface * sfcTarget);
bool UnLockSurfaceGlobal(C4Surface * sfcTarget);
bool DLineSPix(int32_t x, int32_t y, int32_t col);
bool DLineSPixDw(int32_t x, int32_t y, int32_t dwClr);

View File

@ -819,7 +819,7 @@ int CStdFont::GetMessageBreak(const char *szMsg, const char **ppNewPos, int iBre
/* Text drawing */
void CStdFont::DrawText(SURFACE sfcDest, float iX, float iY, DWORD dwColor, const char *szText, DWORD dwFlags, C4Markup &Markup, float fZoom)
void CStdFont::DrawText(C4Surface * sfcDest, float iX, float iY, DWORD dwColor, const char *szText, DWORD dwFlags, C4Markup &Markup, float fZoom)
{
assert(IsValidUtf8(szText));
C4BltTransform bt, *pbt=NULL;

View File

@ -108,7 +108,7 @@ protected:
public:
int iLineHgt; // height of one line of font (in pixels)
// draw ine line of text
void DrawText(SURFACE sfcDest, float iX, float iY, DWORD dwColor, const char *szText, DWORD dwFlags, C4Markup &Markup, float fZoom);
void DrawText(C4Surface * sfcDest, float iX, float iY, DWORD dwColor, const char *szText, DWORD dwFlags, C4Markup &Markup, float fZoom);
// get text size
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup = true);

View File

@ -307,7 +307,7 @@ bool CStdGL::PrepareMaterial(StdMeshMaterial& mat)
return mat.BestTechniqueIndex != -1;
}
bool CStdGL::PrepareRendering(SURFACE sfcToSurface)
bool CStdGL::PrepareRendering(C4Surface * sfcToSurface)
{
// call from gfx thread only!
if (!pApp || !pApp->AssertMainThread()) return false;
@ -1385,8 +1385,8 @@ void CStdGL::PerformMesh(StdMeshInstance &instance, float tx, float ty, float tw
glClear(GL_DEPTH_BUFFER_BIT);
}
void CStdGL::BlitLandscape(SURFACE sfcSource, float fx, float fy,
SURFACE sfcTarget, float tx, float ty, float wdt, float hgt, const SURFACE mattextures[])
void CStdGL::BlitLandscape(C4Surface * sfcSource, float fx, float fy,
C4Surface * sfcTarget, float tx, float ty, float wdt, float hgt, const C4Surface * mattextures[])
{
//Blit(sfcSource, fx, fy, wdt, hgt, sfcTarget, tx, ty, wdt, hgt);return;
// safety
@ -1658,7 +1658,7 @@ bool CStdGL::CreatePrimarySurfaces(bool, unsigned int, unsigned int, int iColorD
return RestoreDeviceObjects();
}
void CStdGL::DrawQuadDw(SURFACE sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4)
void CStdGL::DrawQuadDw(C4Surface * sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4)
{
// prepare rendering to target
if (!PrepareRendering(sfcTarget)) return;
@ -1713,7 +1713,7 @@ static inline long int lrintf(float f)
}
#endif
void CStdGL::PerformLine(SURFACE sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr)
void CStdGL::PerformLine(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr)
{
// render target?
if (sfcTarget->IsRenderTarget())
@ -1788,7 +1788,7 @@ void CStdGL::PerformLine(SURFACE sfcTarget, float x1, float y1, float x2, float
}
}
void CStdGL::PerformPix(SURFACE sfcTarget, float tx, float ty, DWORD dwClr)
void CStdGL::PerformPix(C4Surface * sfcTarget, float tx, float ty, DWORD dwClr)
{
// render target?
if (sfcTarget->IsRenderTarget())

View File

@ -116,7 +116,7 @@ public:
bool UpdateClipper(); // set current clipper to render target
bool PrepareMaterial(StdMeshMaterial& mat);
// Surface
bool PrepareRendering(SURFACE sfcToSurface); // check if/make rendering possible to given surface
bool PrepareRendering(C4Surface * sfcToSurface); // check if/make rendering possible to given surface
virtual CStdGLCtx *CreateContext(C4Window * pWindow, C4AbstractApp *pApp);
#ifdef _WIN32
virtual CStdGLCtx *CreateContext(HWND hWindow, C4AbstractApp *pApp);
@ -125,13 +125,13 @@ public:
void SetupTextureEnv(bool fMod2, bool landscape);
virtual void PerformBlt(C4BltData &rBltData, CTexRef *pTex, DWORD dwModClr, bool fMod2, bool fExact);
virtual void PerformMesh(StdMeshInstance &instance, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform);
virtual void BlitLandscape(SURFACE sfcSource, float fx, float fy,
SURFACE sfcTarget, float tx, float ty, float wdt, float hgt, const SURFACE textures[]);
virtual void BlitLandscape(C4Surface * sfcSource, float fx, float fy,
C4Surface * sfcTarget, float tx, float ty, float wdt, float hgt, const C4Surface * textures[]);
void FillBG(DWORD dwClr=0);
// Drawing
void DrawQuadDw(SURFACE sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4);
void PerformLine(SURFACE sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr);
void PerformPix(SURFACE sfcDest, float tx, float ty, DWORD dwCol);
void DrawQuadDw(C4Surface * sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4);
void PerformLine(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr);
void PerformPix(C4Surface * sfcDest, float tx, float ty, DWORD dwCol);
// Gamma
virtual bool ApplyGammaRamp(D3DGAMMARAMP &ramp, bool fForce);
virtual bool SaveDefaultGammaRamp(C4Window * pWindow);

View File

@ -37,13 +37,13 @@ public:
virtual bool UpdateClipper() { return true; }
virtual bool OnResolutionChanged(unsigned int, unsigned int) { return true; }
virtual bool PrepareMaterial(StdMeshMaterial& mesh);
virtual bool PrepareRendering(SURFACE) { return true; }
virtual bool PrepareRendering(C4Surface *) { return true; }
virtual void FillBG(DWORD dwClr=0) { }
virtual void PerformBlt(C4BltData &, CTexRef *, DWORD, bool, bool) { }
virtual void PerformMesh(StdMeshInstance &, float, float, float, float, DWORD, C4BltTransform* pTransform) { }
virtual void PerformLine(SURFACE, float, float, float, float, DWORD) { }
virtual void DrawQuadDw(SURFACE, float *, DWORD, DWORD, DWORD, DWORD) { }
virtual void PerformPix(SURFACE, float, float, DWORD) { }
virtual void PerformLine(C4Surface *, float, float, float, float, DWORD) { }
virtual void DrawQuadDw(C4Surface *, float *, DWORD, DWORD, DWORD, DWORD) { }
virtual void PerformPix(C4Surface *, float, float, DWORD) { }
virtual bool ApplyGammaRamp(D3DGAMMARAMP &, bool ) { return true; }
virtual bool SaveDefaultGammaRamp(C4Window *) { return true; }
virtual void SetTexture() { }