Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 244 | chris | 1 | #ifndef __DDIMAGE_H__ |
| 2 | #define __DDIMAGE_H__ |
||
| 3 | |||
| 4 | #include "MemoryImage.h" |
||
| 5 | #include <ddraw.h> |
||
| 6 | |||
| 7 | namespace Sexy |
||
| 8 | { |
||
| 9 | |||
| 10 | class DDInterface; |
||
| 11 | class SysFont; |
||
| 12 | |||
| 13 | class DDImage : public MemoryImage |
||
| 14 | { |
||
| 15 | protected: |
||
| 16 | friend class SysFont; |
||
| 17 | void DeleteAllNonSurfaceData(); |
||
| 18 | |||
| 19 | public: |
||
| 20 | DDInterface* mDDInterface; |
||
| 21 | LPDIRECTDRAWSURFACE mSurface; |
||
| 22 | bool mSurfaceSet; |
||
| 23 | bool mNoLock; |
||
| 24 | bool mVideoMemory; |
||
| 25 | bool mFirstPixelTrans; |
||
| 26 | bool mWantDDSurface; |
||
| 27 | bool mDrawToBits; |
||
| 28 | |||
| 29 | int mLockCount; |
||
| 30 | DDSURFACEDESC mLockedSurfaceDesc; |
||
| 31 | |||
| 32 | private: |
||
| 33 | void Init(); |
||
| 34 | |||
| 35 | public: |
||
| 36 | bool GenerateDDSurface(); |
||
| 37 | void DeleteDDSurface(); |
||
| 38 | virtual void ReInit(); |
||
| 39 | virtual void SetVideoMemory(bool wantVideoMemory); |
||
| 40 | virtual void RehupFirstPixelTrans(); |
||
| 41 | |||
| 42 | LPDIRECTDRAWSURFACE GetSurface(); |
||
| 43 | virtual void BitsChanged(); |
||
| 44 | virtual void CommitBits(); |
||
| 45 | |||
| 46 | virtual void NormalFillRect(const Rect& theRect, const Color& theColor); |
||
| 47 | virtual void AdditiveFillRect(const Rect& theRect, const Color& theColor); |
||
| 48 | virtual void NormalBlt(Image* theImage, int theX, int theY, const Rect& theSrcRect, const Color& theColor); |
||
| 49 | virtual void AdditiveBlt(Image* theImage, int theX, int theY, const Rect& theSrcRect, const Color& theColor); |
||
| 50 | virtual void NormalDrawLine(double theStartX, double theStartY, double theEndX, double theEndY, const Color& theColor); |
||
| 51 | virtual void AdditiveDrawLine(double theStartX, double theStartY, double theEndX, double theEndY, const Color& theColor); |
||
| 52 | virtual void NormalDrawLineAA(double theStartX, double theStartY, double theEndX, double theEndY, const Color& theColor); |
||
| 53 | virtual void AdditiveDrawLineAA(double theStartX, double theStartY, double theEndX, double theEndY, const Color& theColor); |
||
| 54 | |||
| 55 | |||
| 56 | virtual void NormalBltMirror(Image* theImage, int theX, int theY, const Rect& theSrcRect, const Color& theColor); |
||
| 57 | virtual void AdditiveBltMirror(Image* theImage, int theX, int theY, const Rect& theSrcRect, const Color& theColor); |
||
| 58 | |||
| 59 | virtual void FillScanLinesWithCoverage(Span* theSpans, int theSpanCount, const Color& theColor, int theDrawMode, const BYTE* theCoverage, int theCoverX, int theCoverY, int theCoverWidth, int theCoverHeight); |
||
| 60 | |||
| 61 | static bool Check3D(DDImage *theImage); |
||
| 62 | static bool Check3D(Image *theImage); |
||
| 63 | |||
| 64 | public: |
||
| 65 | DDImage(); |
||
| 66 | DDImage(DDInterface* theDDInterface); |
||
| 67 | virtual ~DDImage(); |
||
| 68 | |||
| 69 | virtual bool LockSurface(); |
||
| 70 | virtual bool UnlockSurface(); |
||
| 71 | |||
| 72 | virtual void SetSurface(LPDIRECTDRAWSURFACE theSurface); |
||
| 73 | |||
| 74 | virtual void Create(int theWidth, int theHeight); |
||
| 75 | virtual ulong* GetBits(); |
||
| 76 | |||
| 77 | virtual bool PolyFill3D(const Point theVertices[], int theNumVertices, const Rect *theClipRect, const Color &theColor, int theDrawMode, int tx, int ty, bool comvex); |
||
| 78 | virtual void FillRect(const Rect& theRect, const Color& theColor, int theDrawMode); |
||
| 79 | virtual void DrawLine(double theStartX, double theStartY, double theEndX, double theEndY, const Color& theColor, int theDrawMode); |
||
| 80 | virtual void DrawLineAA(double theStartX, double theStartY, double theEndX, double theEndY, const Color& theColor, int theDrawMode); |
||
| 81 | virtual void Blt(Image* theImage, int theX, int theY, const Rect& theSrcRect, const Color& theColor, int theDrawMode); |
||
| 82 | virtual void BltF(Image* theImage, float theX, float theY, const Rect& theSrcRect, const Rect &theClipRect, const Color& theColor, int theDrawMode); |
||
| 83 | virtual void BltRotated(Image* theImage, float theX, float theY, const Rect &theSrcRect, const Rect& theClipRect, const Color& theColor, int theDrawMode, double theRot, float theRotCenterX, float theRotCenterY); |
||
| 84 | virtual void StretchBlt(Image* theImage, const Rect& theDestRect, const Rect& theSrcRect, const Rect& theClipRect, const Color& theColor, int theDrawMode, bool fastStretch); |
||
| 85 | virtual void BltMatrix(Image* theImage, float x, float y, const SexyMatrix3 &theMatrix, const Rect& theClipRect, const Color& theColor, int theDrawMode, const Rect &theSrcRect, bool blend); |
||
| 86 | virtual void BltTrianglesTex(Image *theTexture, const TriVertex theVertices[][3], int theNumTriangles, const Rect& theClipRect, const Color &theColor, int theDrawMode, float tx, float ty, bool blend); |
||
| 87 | |||
| 88 | virtual void BltMirror(Image* theImage, int theX, int theY, const Rect& theSrcRect, const Color& theColor, int theDrawMode); |
||
| 89 | virtual void StretchBltMirror(Image* theImage, const Rect& theDestRectOrig, const Rect& theSrcRect, const Rect& theClipRect, const Color& theColor, int theDrawMode, bool fastStretch); |
||
| 90 | |||
| 91 | virtual bool Palletize(); |
||
| 92 | virtual void PurgeBits(); |
||
| 93 | virtual void DeleteNativeData(); |
||
| 94 | virtual void DeleteExtraBuffers(); |
||
| 95 | }; |
||
| 96 | |||
| 97 | } |
||
| 98 | |||
| 99 | #endif //__DDIMAGE_H__ |