aboutsummaryrefslogtreecommitdiff
path: root/kyra/screen.h
diff options
context:
space:
mode:
authorGregory Montoir2005-08-19 22:12:09 +0000
committerGregory Montoir2005-08-19 22:12:09 +0000
commit24265fd3dd1681835f63e3c901158adef1ec5bc5 (patch)
tree36a28654b271ca5d8f12006f95f4990deaf371f8 /kyra/screen.h
parented2a18569a68d5be78d5a893d66979eef9fe06cd (diff)
downloadscummvm-rg350-24265fd3dd1681835f63e3c901158adef1ec5bc5.tar.gz
scummvm-rg350-24265fd3dd1681835f63e3c901158adef1ec5bc5.tar.bz2
scummvm-rg350-24265fd3dd1681835f63e3c901158adef1ec5bc5.zip
some WIP code to start introduction (with glitches) in Kyrandia 1 :
- the decoders have been rewritten due to crashes I encountered with the previous ones in Compression:: - the wsa code loader for v1 have been rewritten too, to handle the same flags as the original - some cleanup - this has only been tested with the floppy version svn-id: r18704
Diffstat (limited to 'kyra/screen.h')
-rw-r--r--kyra/screen.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/kyra/screen.h b/kyra/screen.h
new file mode 100644
index 0000000000..6ce4fa5569
--- /dev/null
+++ b/kyra/screen.h
@@ -0,0 +1,88 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2003-2005 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ *
+ */
+
+#ifndef KYRASCREEN_H
+#define KYRASCREEN_H
+
+#include "common/util.h"
+
+class OSystem;
+
+namespace Kyra {
+
+class CPSImage;
+class KyraEngine;
+
+class Screen {
+public:
+
+ Screen(KyraEngine *vm, OSystem *system);
+ ~Screen();
+
+ void updateScreen();
+ uint8 *getPagePtr(int pageNum);
+ void clearPage(int pageNum);
+ int setCurPage(int pageNum);
+ void clearCurPage();
+ void fadeFromBlack();
+ void fadeToBlack();
+ 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);
+ void copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint8 *src);
+ void fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum = -1);
+ void setAnimBlockPtr(uint8 *p, int size);
+ void setTextColorMap(const uint8 *cmap);
+ void setTextColor(const uint8 *cmap, int a, int b);
+ 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 drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int sd, int flags, int *flagsTable);
+ static void decodeFrame3(const uint8 *src, uint8 *dst, uint32 size);
+ static void decodeFrame4(const uint8 *src, uint8 *dst, uint32 dstSize);
+ static void decodeFrameDelta(uint8 *dst, const uint8 *src);
+ static void decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch);
+
+ int _charOffset;
+ int _charWidth;
+ int _curPage;
+ uint8 *_palette1;
+
+ enum {
+ SCREEN_W = 320,
+ SCREEN_H = 200,
+ PAGE_SIZE = 320 * 200 + 1024,
+ PAGE_NUM = 16
+ };
+
+private:
+
+ uint8 _textColorsMap[16];
+ uint8 *_animBlockPtr;
+ int _animBlockSize;
+ uint8 *_pagePtrs[16];
+ OSystem *_system;
+ KyraEngine *_vm;
+};
+
+} // End of namespace Kyra
+
+#endif