diff options
author | Gregory Montoir | 2005-09-08 19:09:52 +0000 |
---|---|---|
committer | Gregory Montoir | 2005-09-08 19:09:52 +0000 |
commit | 53a884dc17ed6ef4b5f827629f735fa21544bbf5 (patch) | |
tree | 22ce8f134d3b178a964233c2c92bc5a3722a7789 /kyra/screen.h | |
parent | b17c47f74a04865a2e88acd2585a43717ab372d4 (diff) | |
download | scummvm-rg350-53a884dc17ed6ef4b5f827629f735fa21544bbf5.tar.gz scummvm-rg350-53a884dc17ed6ef4b5f827629f735fa21544bbf5.tar.bz2 scummvm-rg350-53a884dc17ed6ef4b5f827629f735fa21544bbf5.zip |
some WIP code, moved Font stuff to Screen class
svn-id: r18790
Diffstat (limited to 'kyra/screen.h')
-rw-r--r-- | kyra/screen.h | 68 |
1 files changed, 44 insertions, 24 deletions
diff --git a/kyra/screen.h b/kyra/screen.h index 97f18cc57f..712aa39a38 100644 --- a/kyra/screen.h +++ b/kyra/screen.h @@ -28,7 +28,6 @@ class OSystem; namespace Kyra { -class CPSImage; class KyraEngine; struct ScreenDim { @@ -42,9 +41,39 @@ struct ScreenDim { uint16 unkE; }; +struct Font { + uint8 *fontData; + uint8 *charWidthTable; + uint16 charBoxHeight; + uint16 charBitmapOffset; + uint16 charWidthTableOffset; + uint16 charHeightTableOffset; +}; + class Screen { public: + enum { + SCREEN_W = 320, + SCREEN_H = 200, + SCREEN_PAGE_SIZE = 320 * 200 + 1024, + SCREEN_PAGE_NUM = 16 + }; + + enum DrawShapeFlags { + DSF_X_FLIPPED = 0x01, + DSF_Y_FLIPPED = 0x02, + DSF_SCALE = 0x04, + DSF_WND_COORDS = 0x10, + DSF_CENTER = 0x20 + }; + + enum FontId { + FID_6_FNT = 0, + FID_8_FNT, + FID_NUM + }; + Screen(KyraEngine *vm, OSystem *system); ~Screen(); @@ -57,6 +86,7 @@ public: void setPagePixel(int pageNum, int x, int y, uint8 color); void fadeFromBlack(); void fadeToBlack(); + void fadePalette(const uint8 *palData, int delay); void setScreenPalette(const uint8 *palData); void copyToPage0(int y, int h, uint8 page, uint8 *seqBuf); void copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage); @@ -67,9 +97,12 @@ public: void setAnimBlockPtr(uint8 *p, int size); void setTextColorMap(const uint8 *cmap); void setTextColor(const uint8 *cmap, int a, int b); + void loadFont(FontId fontId, uint8 *fontData); + FontId setFont(FontId fontId); int getCharWidth(uint8 c) const; int getTextWidth(const char *str) const; void printText(const char *str, int x, int y, uint8 color1, uint8 color2); + void drawChar(char c, int x, int y); void setScreenDim(int dim); void drawShapePlotPixelCallback1(uint8 *dst, uint8 color); void drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int sd, int flags, int *flagsTable); @@ -78,44 +111,31 @@ public: static void decodeFrameDelta(uint8 *dst, const uint8 *src); static void decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch); - int _charOffset; int _charWidth; + int _charOffset; int _curPage; - uint8 *_palette1; - - enum { - SCREEN_W = 320, - SCREEN_H = 200, - SCREEN_PAGE_SIZE = 320 * 200 + 1024, - SCREEN_PAGE_NUM = 16 - }; - - enum DrawShapeFlags { - DSF_X_FLIPPED = 0x01, - DSF_Y_FLIPPED = 0x02, - DSF_SCALE = 0x04, - DSF_WND_COORDS = 0x10, - DSF_CENTER = 0x20 - }; + uint8 *_currentPalette; typedef void (Screen::*DrawShapePlotPixelCallback)(uint8 *dst, uint8 c); private: - uint8 _textColorsMap[16]; - uint8 *_animBlockPtr; - int _animBlockSize; uint8 *_pagePtrs[16]; - uint8 *_palette3; - uint8 *_fadePalette; + uint8 *_screenPalette; const ScreenDim *_curDim; + FontId _currentFont; + Font _fonts[FID_NUM]; + uint8 _textColorsMap[16]; uint8 *_decodeShapeBuffer; int _decodeShapeBufferSize; - + uint8 *_animBlockPtr; + int _animBlockSize; + OSystem *_system; KyraEngine *_vm; static const ScreenDim _screenDimTable[]; + static const int _screenDimTableCount; static const DrawShapePlotPixelCallback _drawShapePlotPixelTable[]; static const int _drawShapePlotPixelCount; }; |