#include <C4DefGraphics.h>
Public Types | |
enum | GraphicsType { TYPE_None , TYPE_Bitmap , TYPE_Mesh } |
Public Member Functions | |
C4Surface * | GetBitmap (DWORD dwClr=0) |
C4DefGraphics (C4Def *pOwnDef=nullptr) | |
virtual | ~C4DefGraphics () |
bool | LoadBitmap (C4Group &hGroup, const char *szFilenamePNG, const char *szOverlayPNG, const char *szNormal, bool fColorByOwner) |
bool | LoadBitmaps (C4Group &hGroup, bool fColorByOwner) |
bool | LoadMesh (C4Group &hGroup, const char *szFilename, StdMeshSkeletonLoader &loader) |
bool | LoadSkeleton (C4Group &hGroup, const char *szFilename, StdMeshSkeletonLoader &loader) |
bool | Load (C4Group &hGroup, StdMeshSkeletonLoader &loader, bool fColorByOwner) |
C4DefGraphics * | Get (const char *szGrpName) |
void | Clear () |
bool | IsMesh () const |
bool | IsColorByOwner () |
void | Draw (C4Facet &cgo, DWORD iColor, C4Object *pObj, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *trans) |
virtual const char * | GetName () |
C4AdditionalDefGraphics * | GetNext () |
void | DrawClr (C4Facet &cgo, bool fAspect=true, DWORD dwClr=0) |
void | CompileFunc (StdCompiler *pComp) |
Public Attributes | |
C4Def * | pDef |
GraphicsType | Type |
union { | |
struct { | |
C4Surface * | Bitmap |
C4Surface * | BitmapClr |
C4Surface * | BitmapNormal |
} | Bmp |
StdMesh * | Mesh |
}; | |
bool | fColorBitmapAutoCreated |
Protected Member Functions | |
C4DefGraphics * | GetLast () |
Protected Attributes | |
C4AdditionalDefGraphics * | pNext |
Friends | |
class | C4DefGraphicsPtrBackup |
Definition at line 31 of file C4DefGraphics.h.
C4DefGraphics::C4DefGraphics | ( | C4Def * | pOwnDef = nullptr | ) |
Definition at line 73 of file stub-handle.cpp.
|
inlinevirtual |
Definition at line 64 of file C4DefGraphics.h.
References Clear().
void C4DefGraphics::Clear | ( | ) |
Definition at line 74 of file stub-handle.cpp.
Referenced by C4Def::Clear(), LoadBitmap(), and ~C4DefGraphics().
void C4DefGraphics::CompileFunc | ( | StdCompiler * | pComp | ) |
void C4DefGraphics::Draw | ( | C4Facet & | cgo, |
DWORD | iColor, | ||
C4Object * | pObj, | ||
int32_t | iPhaseX, | ||
int32_t | iPhaseY, | ||
C4DrawTransform * | trans | ||
) |
Definition at line 318 of file C4DefGraphics.cpp.
References C4ValueToMatrix(), C4Object::Color, C4Facet::DrawTUnscaled(), C4Object::FinishedDrawing(), GetBitmap(), C4GraphicsOverlay::GetNext(), C4PropList::GetProperty(), C4Facet::Hgt, C4Rect::Hgt, P_PictureTransformation, pDef, pDraw, C4Object::pGfxOverlay, C4Def::PictureRect, C4Object::PictureRect, C4Object::pMeshInstance, C4Object::PrepareDrawing(), C4Draw::RenderMesh(), C4Facet::Set(), C4Draw::SetMeshTransform(), C4Draw::SetPerspective(), C4Facet::Surface, Type, TYPE_Bitmap, TYPE_Mesh, TYPE_None, C4Facet::Wdt, C4Rect::Wdt, C4Facet::X, C4Rect::x, C4Facet::Y, and C4Rect::y.
Referenced by C4Def::Draw(), C4GraphicsOverlay::Draw(), C4MenuItem::DrawElement(), C4GraphicsOverlay::DrawPicture(), and C4Game::DrawPropListSpecImage().
Definition at line 378 of file C4DefGraphics.cpp.
References C4Facet::DrawClr(), C4Surface::Hgt, Type, TYPE_Bitmap, and C4Surface::Wdt.
C4DefGraphics * C4DefGraphics::Get | ( | const char * | szGrpName | ) |
Definition at line 307 of file C4DefGraphics.cpp.
References pNext, and SEqualNoCase().
Referenced by C4DefGraphicsPtrBackupEntry::AssignUpdate(), C4DefGraphicsAdapt::CompileFunc(), C4Def::Draw(), C4Game::DrawPropListSpecImage(), and C4Object::SetGraphics().
Definition at line 1185 of file C4DefGraphics.cpp.
References C4Surface::SetClr(), Type, and TYPE_Bitmap.
Referenced by Draw(), C4SolidMask::Draw(), C4Object::DrawFaceImpl(), C4Def::GetMainFace(), and C4GraphicsOverlay::UpdateFacet().
|
protected |
|
inlinevirtual |
Reimplemented in C4AdditionalDefGraphics.
Definition at line 79 of file C4DefGraphics.h.
Referenced by C4DefGraphicsPtrBackupEntry::C4DefGraphicsPtrBackupEntry(), and C4DefGraphicsAdapt::CompileFunc().
|
inline |
|
inline |
Definition at line 74 of file C4DefGraphics.h.
References Type, TYPE_Bitmap, and TYPE_Mesh.
Referenced by C4Object::UpdateGraphics().
|
inline |
bool C4DefGraphics::Load | ( | C4Group & | hGroup, |
StdMeshSkeletonLoader & | loader, | ||
bool | fColorByOwner | ||
) |
Definition at line 226 of file C4DefGraphics.cpp.
References _MAX_PATH, _MAX_PATH_LEN, C4CFN_ClrByOwner, C4CFN_ClrByOwnerEx, C4CFN_DefGraphics, C4CFN_DefGraphicsEx, C4CFN_DefGraphicsExMesh, C4CFN_DefGraphicsExMeshXml, C4CFN_DefGraphicsScaled, C4CFN_DefMesh, C4CFN_DefMeshXml, C4CFN_DefSkeleton, C4CFN_DefSkeletonXml, C4CFN_NormalMap, C4CFN_NormalMapEx, C4MaxName, EnforceExtension(), C4Group::FindNextEntry(), GetExtension(), LoadBitmap(), LoadMesh(), LoadSkeleton(), pDef, pNext, RemoveExtension(), C4Group::ResetSearch(), SAppend(), SCharLastPos(), SCharPos(), SCopy(), SEqualNoCase(), and WildcardMatch().
bool C4DefGraphics::LoadBitmap | ( | C4Group & | hGroup, |
const char * | szFilenamePNG, | ||
const char * | szOverlayPNG, | ||
const char * | szNormal, | ||
bool | fColorByOwner | ||
) |
Definition at line 84 of file C4DefGraphics.cpp.
References C4SF_MipMap, Clear(), DebugLogF(), fColorBitmapAutoCreated, StdStrBuf::getData(), C4Group::GetFullName(), Type, and TYPE_Bitmap.
Referenced by Load().
bool C4DefGraphics::LoadBitmaps | ( | C4Group & | hGroup, |
bool | fColorByOwner | ||
) |
bool C4DefGraphics::LoadMesh | ( | C4Group & | hGroup, |
const char * | szFilename, | ||
StdMeshSkeletonLoader & | loader | ||
) |
Definition at line 157 of file C4DefGraphics.cpp.
References DebugLogF(), GetExtension(), C4Group::GetName(), C4Def::id, C4Group::LoadEntry(), StdMeshLoader::LoadMeshBinary(), StdMeshLoader::LoadMeshXml(), MeshMaterialManager, pDef, SEqualNoCase(), C4ID::ToString(), Type, and TYPE_Mesh.
Referenced by Load().
bool C4DefGraphics::LoadSkeleton | ( | C4Group & | hGroup, |
const char * | szFilename, | ||
StdMeshSkeletonLoader & | loader | ||
) |
Definition at line 192 of file C4DefGraphics.cpp.
References DebugLogF(), GetExtension(), C4Group::GetName(), C4Group::LoadEntry(), StdMeshSkeletonLoader::LoadSkeletonBinary(), StdMeshSkeletonLoader::LoadSkeletonXml(), StdMeshSkeletonLoader::RemoveSkeleton(), and SEqualNoCase().
Referenced by Load().
|
friend |
Definition at line 87 of file C4DefGraphics.h.
union { ... } |
bool C4DefGraphics::fColorBitmapAutoCreated |
Definition at line 59 of file C4DefGraphics.h.
Referenced by LoadBitmap().
C4Def* C4DefGraphics::pDef |
Definition at line 34 of file C4DefGraphics.h.
Referenced by C4DefGraphicsPtrBackup::Add(), C4Def::C4Def(), C4DefGraphicsPtrBackupEntry::C4DefGraphicsPtrBackupEntry(), C4DefGraphicsAdapt::CompileFunc(), C4MeshDenumerator::CompileFunc(), Draw(), C4GraphicsOverlay::Draw(), Load(), LoadMesh(), and C4GraphicsOverlay::UpdateFacet().
|
protected |
Definition at line 37 of file C4DefGraphics.h.
Referenced by C4DefGraphicsPtrBackup::Add(), Get(), GetLast(), GetNext(), and Load().
GraphicsType C4DefGraphics::Type |
Definition at line 48 of file C4DefGraphics.h.
Referenced by C4DefGraphicsPtrBackupEntry::AssignUpdate(), C4DefGraphicsPtrBackupEntry::C4DefGraphicsPtrBackupEntry(), C4Object::CompileFunc(), C4MeshDenumerator::CompileFunc(), Draw(), C4MouseControl::Draw(), DrawClr(), C4Object::DrawFace(), GetBitmap(), C4Game::GetTextSpecImageAspect(), C4Object::Init(), IsColorByOwner(), IsMesh(), C4GraphicsOverlay::IsValid(), LoadBitmap(), LoadMesh(), C4GraphicsOverlay::UpdateFacet(), and C4Object::UpdateGraphics().