22 #ifndef HODJNPODJ_HNPLIBS_SPRITE_H 23 #define HODJNPODJ_HNPLIBS_SPRITE_H 25 #include "bagel/hodjnpodj/globals.h" 26 #include "bagel/hodjnpodj/hnplibs/dibdoc.h" 32 COLOR_WHITE = RGB(255, 255, 255)
35 #define SPRITE_TOPMOST 0 36 #define SPRITE_FOREGROUND 64 37 #define SPRITE_MIDDLE 128 38 #define SPRITE_BACKGROUND 192 39 #define SPRITE_HINDMOST 255 49 bool DuplicateSprite(
CDC *pDC,
CSprite *pSprite);
51 bool LoadSprite(
CDC *pDC,
const char* pszPathName);
53 bool LoadResourceSprite(
CDC *pDC,
const int resId);
54 bool LoadResourceSprite(
CDC *pDC,
const char* pszName);
56 bool LoadCels(
CDC *pDC,
const char* pszPathName,
const int nCels);
57 bool LoadCels(
CBitmap *pBitmap,
const int nCels,
CPalette *pPalette =
nullptr);
58 bool LoadResourceCels(
CDC *pDC,
const int resId,
const int nCels);
59 bool LoadResourceCels(
CDC *pDC,
const char* pszName,
const int nCels);
62 bool SharePalette(
CPalette *pPalette);
64 return (m_bSharedPalette);
67 bool PaintSprite(
CDC *pDC,
const int x,
const int y);
68 bool PaintSprite(
CDC *pDC,
CPoint point) {
69 return (PaintSprite(pDC, point.x, point.y));
72 bool SetupCels(
const int nCels);
73 void SetCel(
const int nCelID);
78 bool CropImage(
CDC *pDC,
CRect *pRect);
80 bool RefreshSprite(
CDC *pDC) {
81 return (PaintSprite(pDC, m_cPosition.x, m_cPosition.y));
83 bool RefreshBackground(
CDC *pDC);
85 bool EraseSprite(
CDC *pDC);
87 void ClearBackground();
90 return (Interception(pDC, m_pSpriteChain));
94 return (Interception(newRect, m_pSpriteChain));
97 bool TestInterception(
CDC *pDC,
CSprite * pSprite,
CPoint *pPoint =
nullptr);
103 void SetIntercepts(
bool bValue) {
104 m_bIntercepts = bValue;
106 bool GetIntercepts() {
107 return (m_bIntercepts);
110 void SetPosition(
int x,
int y);
111 void SetPosition(
CPoint point) {
112 SetPosition(point.x, point.y);
115 return (m_cPosition);
118 void SetDelta(
int x,
int y) {
119 m_cMovementDelta.x = x;
120 m_cMovementDelta.y = y;
123 return (m_cMovementDelta);
126 void SetHotspot(
int x,
int y) {
145 void SetMasked(
bool bValue) {
152 void SetMobile(
bool bValue) {
159 void SetOptimizeSpeed(
bool bValue) {
160 m_bRetainContexts =
false & bValue;
162 bool GetOptimizeSpeed() {
163 return (m_bRetainContexts);
166 void SetTypeCode(
int nValue) {
184 void SetZOrder(
int nValue) {
186 m_nZPosition = nValue;
192 return (m_nZPosition);
196 return (m_nCelCount);
202 void SetAnimated(
bool bAnimated) {
203 m_bAnimated = bAnimated;
206 return (m_bAnimated);
209 void SetRetainBackground(
bool bValue);
210 bool GetRetainBackground() {
211 return (m_bRetainBackground);
226 bool Touching(
CPoint myPoint);
229 return (Touched(myPoint, m_pSpriteChain));
232 static bool InterceptOccurred() {
233 return (m_bTouchedSprite);
235 static CSprite *GetInterception() {
236 return (m_pTouchedSprite);
239 static CSprite *GetSpriteChain() {
240 return (m_pSpriteChain);
242 static bool EraseSprites(
CDC *pDC);
243 static void ClearBackgrounds();
244 static void FlushSpriteChain();
246 static bool HaveBackdrop() {
247 return (m_bHaveBackdrop);
249 static CDC *GetBackdropDC(
CDC *pDC);
250 static void ReleaseBackdropDC();
252 static void ClearBackdrop();
253 static bool RefreshBackdrop(
CDC *pDC,
CPalette *pPalette);
256 bool UpdateSprite(
CDC *pDC);
258 bool SaveBackground(
CDC *pDC);
260 bool CreateBackground(
CDC *pDC);
261 bool CreateMask(
CDC *pDC);
263 bool SetupImage(
CDC *pDC);
264 bool SetupBackground(
CDC *pDC);
265 bool SetupMask(
CDC *pDC);
267 bool CreateImageContext(
CDC *pDC);
268 bool CreateBackgroundContext(
CDC *pDC);
269 bool CreateMaskContext(
CDC *pDC);
271 void ReleaseImageContext();
272 void ReleaseBackgroundContext();
273 void ReleaseMaskContext();
281 bool DoSpritePainting(
CDC *pDC,
CPoint cPoint);
282 bool DoOptimizedPainting(
CDC *pDC,
CRect *pDst);
283 bool DoOverlapPainting(
CDC *pDC,
CRect *myRect);
284 bool ReconstructBackground(
CDC *pDC,
CRect *myRect);
293 CDC *m_pBackgroundDC;
307 bool m_bSharedPalette;
311 bool m_bPaintOverlap;
312 bool m_bRetainBackground;
313 bool m_bRetainContexts;
332 static CSprite *m_pSpriteChain;
333 static bool m_bTouchedSprite;
334 static CSprite *m_pTouchedSprite;
335 static bool m_bHaveBackdrop;
336 static CDC *m_pBackdropDC;
338 static CBitmap *m_pBackdropOld;
339 static CPalette *m_pBackdropPalette;
Definition: atltypes.h:79
Definition: atltypes.h:40
Definition: atltypes.h:131