[Scummvm-cvs-logs] SF.net SVN: scummvm: [23863] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Sep 10 15:26:08 CEST 2006
Revision: 23863
http://svn.sourceforge.net/scummvm/?rev=23863&view=rev
Author: lordhoto
Date: 2006-09-10 06:26:00 -0700 (Sun, 10 Sep 2006)
Log Message:
-----------
Little bit cleanup.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra3.cpp
scummvm/trunk/engines/kyra/kyra3.h
scummvm/trunk/engines/kyra/screen.cpp
scummvm/trunk/engines/kyra/screen.h
Modified: scummvm/trunk/engines/kyra/kyra3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.cpp 2006-09-10 13:16:34 UTC (rev 23862)
+++ scummvm/trunk/engines/kyra/kyra3.cpp 2006-09-10 13:26:00 UTC (rev 23863)
@@ -456,13 +456,13 @@
_tableBuffer2 = _tableBuffer1 = buf;
}
-int KyraEngine_v3::addShapeToTable(uint8 *buf, int id, int shapeNum) {
+int KyraEngine_v3::addShapeToTable(const uint8 *buf, int id, int shapeNum) {
debugC(9, kDebugLevelMain, "KyraEngine::addShapeToTable(%p, %d, %d)", (void*)buf, id, shapeNum);
if (!buf)
return 0;
- uint8 *shapePtr = _screen->getPtrToShape(buf, shapeNum);
+ const uint8 *shapePtr = _screen->getPtrToShape(buf, shapeNum);
if (!shapePtr)
return 0;
@@ -636,13 +636,13 @@
_screen->loadBitmap("ITEMS.CSH", 3, 3, 0);
for (int i = 248; i <= 319; ++i) {
- addShapeToTable(_screen->getPagePtr(3), i, i-248);
+ addShapeToTable(_screen->getCPagePtr(3), i, i-248);
}
_screen->loadBitmap("ITEMS2.CSH", 3, 3, 0);
for (int i = 320; i <= 397; ++i) {
- addShapeToTable(_screen->getPagePtr(3), i, i-320);
+ addShapeToTable(_screen->getCPagePtr(3), i, i-320);
}
uint32 size = 0;
Modified: scummvm/trunk/engines/kyra/kyra3.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.h 2006-09-10 13:16:34 UTC (rev 23862)
+++ scummvm/trunk/engines/kyra/kyra3.h 2006-09-10 13:26:00 UTC (rev 23863)
@@ -129,7 +129,7 @@
uint8 *allocTableSpace(uint8 *buf, int size, int id);
uint8 *findIdInTable(uint8 *buf, int id);
- int addShapeToTable(uint8 *buf, int id, int shapeNum);
+ int addShapeToTable(const uint8 *buf, int id, int shapeNum);
uint8 *findShapeInTable(int id);
// resource specific
Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp 2006-09-10 13:16:34 UTC (rev 23862)
+++ scummvm/trunk/engines/kyra/screen.cpp 2006-09-10 13:26:00 UTC (rev 23863)
@@ -2242,6 +2242,18 @@
// kyra3 specific
+const uint8 *Screen::getPtrToShape(const uint8 *shpFile, int shape) {
+ debugC(9, kDebugLevelScreen, "KyraEngine::getPtrToShape(%p, %d)", (void *)shpFile, shape);
+ uint16 shapes = READ_LE_UINT16(shpFile);
+
+ if (shapes <= shape)
+ return 0;
+
+ uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2);
+
+ return shpFile + offset + 2;
+}
+
uint8 *Screen::getPtrToShape(uint8 *shpFile, int shape) {
debugC(9, kDebugLevelScreen, "KyraEngine::getPtrToShape(%p, %d)", (void *)shpFile, shape);
uint16 shapes = READ_LE_UINT16(shpFile);
@@ -2254,7 +2266,7 @@
return shpFile + offset + 2;
}
-uint16 Screen::getShapeSize(uint8 *shp) {
+uint16 Screen::getShapeSize(const uint8 *shp) {
debugC(9, kDebugLevelScreen, "KyraEngine::getShapeSize(%p)", (void *)shp);
return READ_LE_UINT16(shp+6);
Modified: scummvm/trunk/engines/kyra/screen.h
===================================================================
--- scummvm/trunk/engines/kyra/screen.h 2006-09-10 13:16:34 UTC (rev 23862)
+++ scummvm/trunk/engines/kyra/screen.h 2006-09-10 13:26:00 UTC (rev 23863)
@@ -192,12 +192,13 @@
static const int _screenDimTableCountK3;
uint8 *getPtrToShape(uint8 *shpFile, int shape);
+ const uint8 *getPtrToShape(const uint8 *shpFile, int shape);
- uint16 getShapeSize(uint8 *shp);
+ uint16 getShapeSize(const uint8 *shp);
- // only needed for Kyra3!
+private:
uint8 *getPagePtr(int pageNum);
-private:
+
int16 encodeShapeAndCalculateSize(uint8 *from, uint8 *to, int size);
void restoreMouseRect();
void copyMouseToScreen();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list