Apply DrawTransform to GFXOV_MODE_ObjectPicture overlays (#268)

stable-5.1
Armin Burgmeier 2010-06-28 22:34:34 +02:00
parent d0b4a73d18
commit deb21f7f82
5 changed files with 8 additions and 8 deletions

View File

@ -651,7 +651,7 @@ bool C4Def::Load(C4Group &hGroup,
return true;
}
void C4Def::Draw(C4Facet &cgo, bool fSelected, DWORD iColor, C4Object *pObj, int32_t iPhaseX, int32_t iPhaseY)
void C4Def::Draw(C4Facet &cgo, bool fSelected, DWORD iColor, C4Object *pObj, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform* trans)
{
// default: def picture rect
@ -673,7 +673,7 @@ void C4Def::Draw(C4Facet &cgo, bool fSelected, DWORD iColor, C4Object *pObj, int
{
case C4DefGraphics::TYPE_Bitmap:
fctPicture.Set(graphics->GetBitmap(iColor),fctPicRect.x,fctPicRect.y,fctPicRect.Wdt,fctPicRect.Hgt);
fctPicture.Draw(cgo,true,iPhaseX,iPhaseY,true);
fctPicture.DrawT(cgo,true,iPhaseX,iPhaseY,trans);
break;
case C4DefGraphics::TYPE_Mesh:
// TODO: Allow rendering of a mesh directly, without instance (to render pose; no animation)
@ -699,7 +699,7 @@ void C4Def::Draw(C4Facet &cgo, bool fSelected, DWORD iColor, C4Object *pObj, int
lpDDraw->SetMeshTransform(&matrix);
lpDDraw->SetPerspective(true);
lpDDraw->RenderMesh(*instance, cgo.Surface, cgo.X,cgo.Y, cgo.Wdt, cgo.Hgt, pObj ? pObj->Color : iColor, NULL);
lpDDraw->RenderMesh(*instance, cgo.Surface, cgo.X,cgo.Y, cgo.Wdt, cgo.Hgt, pObj ? pObj->Color : iColor, trans);
lpDDraw->SetPerspective(false);
lpDDraw->SetMeshTransform(NULL);

View File

@ -272,7 +272,7 @@ public:
bool Load(C4Group &hGroup,
DWORD dwLoadWhat, const char *szLanguage,
class C4SoundSystem *pSoundSystem = NULL);
void Draw(C4Facet &cgo, bool fSelected=false, DWORD iColor=0, C4Object *pObj=NULL, int32_t iPhaseX=0, int32_t iPhaseY=0);
void Draw(C4Facet &cgo, bool fSelected=false, DWORD iColor=0, C4Object *pObj=NULL, int32_t iPhaseX=0, int32_t iPhaseY=0,C4DrawTransform* trans=NULL);
inline C4Facet &GetMainFace(C4DefGraphics *pGraphics, DWORD dwClr=0) { MainFace.Surface=pGraphics->GetBitmap(dwClr); return MainFace; }
int32_t GetValue(C4Object *pInBase, int32_t iBuyPlayer); // get value of def; calling script functions if defined

View File

@ -1012,7 +1012,7 @@ void C4GraphicsOverlay::Draw(C4TargetFacet &cgo, C4Object *pForObj, int32_t iByP
C4Facet fctTarget;
fctTarget.Set(cgo.Surface, iTx+pForObj->Shape.x, iTy+pForObj->Shape.y, pForObj->Shape.Wdt, pForObj->Shape.Hgt);
OverlayObj->DrawPicture(fctTarget, false, NULL);
OverlayObj->DrawPicture(fctTarget, false, NULL, &C4DrawTransform(Transform, fctTarget.X+float(fctTarget.Wdt)/2, fctTarget.Y+float(fctTarget.Hgt)/2));
}
else
{

View File

@ -2923,10 +2923,10 @@ void C4Object::DenumeratePointers()
if (pMeshInstance) pMeshInstance->DenumeratePointers();
}
void C4Object::DrawPicture(C4Facet &cgo, bool fSelected, C4RegionList *pRegions)
void C4Object::DrawPicture(C4Facet &cgo, bool fSelected, C4RegionList *pRegions, C4DrawTransform* transform)
{
// Draw def picture with object color
Def->Draw(cgo,fSelected,Color,this);
Def->Draw(cgo,fSelected,Color,this,0,0,transform);
// Region
if (pRegions) pRegions->Add(cgo.X,cgo.Y,cgo.Wdt,cgo.Hgt,GetName(),COM_None,this);
}

View File

@ -242,7 +242,7 @@ public:
bool AssignInfo();
bool ValidateOwner();
bool AssignPlrViewRange();
void DrawPicture(C4Facet &cgo, bool fSelected=false, C4RegionList *pRegions=NULL);
void DrawPicture(C4Facet &cgo, bool fSelected=false, C4RegionList *pRegions=NULL,C4DrawTransform* transform=NULL);
void Picture2Facet(C4FacetSurface &cgo); // set picture to facet, or create facet in current size and draw if specific states are being needed
void DenumeratePointers();
void EnumeratePointers();