aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/chewy/chewy.cpp16
-rw-r--r--engines/chewy/graphics.cpp42
-rw-r--r--engines/chewy/graphics.h42
-rw-r--r--engines/chewy/module.mk1
4 files changed, 91 insertions, 10 deletions
diff --git a/engines/chewy/chewy.cpp b/engines/chewy/chewy.cpp
index 8051c877db..a040e16315 100644
--- a/engines/chewy/chewy.cpp
+++ b/engines/chewy/chewy.cpp
@@ -24,11 +24,13 @@
#include "common/error.h"
#include "common/events.h"
#include "common/system.h"
+#include "graphics/palette.h"
#include "engines/engine.h"
#include "engines/util.h"
#include "chewy/chewy.h"
+#include "chewy/graphics.h"
#include "chewy/resource.h"
namespace Chewy {
@@ -56,19 +58,13 @@ ChewyEngine::~ChewyEngine() {
Common::Error ChewyEngine::run() {
// Initialize backend
- initGraphics(320, 200, false);
+ initGraphics(640, 480, true);
initialize();
- Resource *res = new Resource("comic.tgp");
- TBFChunk *cur = res->getChunk(1);
-
- debug("Chunk 1: packed %d, type %d, pos %d, mode %d, comp %d, unpacked %d, width %d, height %d",
- cur->packedSize, cur->type, cur->pos, cur->screenMode, cur->compressionFlag, cur->unpackedSize,
- cur->width, cur->height
- );
-
- delete res;
+ Graphics *g = new Graphics();
+ g->drawImage("comic.tgp", 0);
+ delete g;
// Run a dummy loop
Common::Event event;
diff --git a/engines/chewy/graphics.cpp b/engines/chewy/graphics.cpp
new file mode 100644
index 0000000000..5127607b01
--- /dev/null
+++ b/engines/chewy/graphics.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/system.h"
+#include "graphics/palette.h"
+
+#include "chewy/graphics.h"
+#include "chewy/resource.h"
+
+namespace Chewy {
+
+void Graphics::drawImage(Common::String filename, int imageNum) {
+ Resource *res = new Resource("comic.tgp");
+ TBFChunk *cur = res->getChunk(0);
+ byte *buf = res->getChunkData(0);
+
+ g_system->getPaletteManager()->setPalette(cur->palette, 0, 256);
+ g_system->copyRectToScreen(buf, cur->width, 0, 0, cur->width, cur->height);
+ g_system->updateScreen();
+ delete res;
+}
+
+} // End of namespace Chewy
diff --git a/engines/chewy/graphics.h b/engines/chewy/graphics.h
new file mode 100644
index 0000000000..601b419171
--- /dev/null
+++ b/engines/chewy/graphics.h
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef CHEWY_GRAPHICS_H
+#define CHEWY_GRAPHICS_H
+
+#include "chewy/chewy.h"
+
+namespace Chewy {
+
+class Graphics {
+public:
+ Graphics() {}
+ ~Graphics() {}
+
+ void drawImage(Common::String filename, int imageNum);
+private:
+
+};
+
+} // End of namespace Chewy
+
+#endif
diff --git a/engines/chewy/module.mk b/engines/chewy/module.mk
index 137a7fb97c..df932c7056 100644
--- a/engines/chewy/module.mk
+++ b/engines/chewy/module.mk
@@ -4,6 +4,7 @@ MODULE_OBJS = \
chewy.o \
console.o \
detection.o \
+ graphics.o \
resource.o