[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src skin.cpp,1.11,1.12
Chris Apers
chrilith at users.sourceforge.net
Sat Nov 5 03:45:16 CET 2005
Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25660
Modified Files:
skin.cpp
Log Message:
Cleanup
Index: skin.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/skin.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- skin.cpp 5 Nov 2005 11:35:42 -0000 1.11
+++ skin.cpp 5 Nov 2005 11:44:04 -0000 1.12
@@ -34,12 +34,6 @@
static WinHandle winLockH = NULL;
MemPtr SknScreenLock(WinLockInitType initMode) {
-/* if (!OPTIONS_TST(kOptDeviceZodiac)) {
- WinSetDrawWindow(WinGetDisplayWindow());
- // WARNING : this doesn't work on < OS5 with 16bit mode
- return WinScreenLock(initMode);
- }
-*/
Err e;
RectangleType r;
@@ -54,12 +48,6 @@
}
void SknScreenUnlock() {
-/* if (!OPTIONS_TST(kOptDeviceZodiac)) {
- WinSetDrawWindow(WinGetDisplayWindow());
- WinScreenUnlock();
- return;
- }
-*/
RectangleType r;
WinGetBounds(winLockH, &r);
@@ -81,13 +69,13 @@
if (skinDBP) {
colIndex = DmFindResource (skinDBP, sknColorsRsc, skinColors, NULL);
-
+
if (colIndex != (UInt16)-1) {
colH = DmGetResourceIndex(skinDBP, colIndex);
-
+
if (colH) {
colTemp = (UInt8 *)MemHandleLock(colH);
-
+
*text = colTemp[0];
*selected = colTemp[1];
*background = colTemp[2];
@@ -113,7 +101,7 @@
if (index != (UInt16)-1) {
hTemp = DmGetResourceIndex(skinDBP,index);
-
+
if (hTemp) {
bmpTemp = (BitmapType *)MemHandleLock(hTemp);
BmpGlueGetDimensions(bmpTemp, &bw, &bh, 0);
@@ -129,20 +117,20 @@
cw = srcRect->extent.x;
ch = srcRect->extent.y;
}
-
+
if (ch) {
WinGetClip(&old);
if (OPTIONS_TST(kOptModeHiDensity)) {
Err e;
BitmapTypeV3 *bmp2P;
-
+
// create an uncompressed version of the bitmap
WinHandle win = WinCreateOffscreenWindow(bw, bh, screenFormat, &e);
WinHandle old = WinGetDrawWindow();
WinSetDrawWindow(win);
WinDrawBitmap(bmpTemp, 0, 0);
WinSetDrawWindow(old);
-
+
bmp2P = BmpCreateBitmapV3(WinGetBitmap(win), kDensityDouble, BmpGetBits(WinGetBitmap(win)), NULL);
copy.topLeft.x = destX / 2;
@@ -184,7 +172,7 @@
SknScreenLock(winLockCopy);
skinDBP = SknOpenSkin();
-
+
if (gPrefs->card.volRefNum != sysInvalidRefNum)
FrmShowObject(frmP, FrmGetObjectIndex (frmP, MainMSBitMap));
else
@@ -199,7 +187,7 @@
SknCopyBits(skinDBP, skinBackgroundImageTop, 0, r.topLeft.x, r.topLeft.y);
SknGetObjectBounds(skinDBP, skinBackgroundImageBottom, &r);
SknCopyBits(skinDBP, skinBackgroundImageBottom, 0, r.topLeft.x, r.topLeft.y);
-
+
for (UInt16 resID = 1100; resID <= 7000; resID += 100) {
SknSetState(skinDBP, resID, sknStateNormal);
SknShowObject(skinDBP, resID);
@@ -218,29 +206,29 @@
UInt8 *strTemp;
RctSetRectangle(rP, 0, 0, 0, 0);
-
+
if (skinDBP) {
bmpIndex = DmFindResource (skinDBP, bitmapRsc, resID, NULL);
-
+
if (bmpIndex != (UInt16)-1) { // if bmp exists
strIndex = DmFindResource (skinDBP, sknPosRsc, resID, NULL);
-
+
if (strIndex != (UInt16)-1) { // if params exist
hBmp = DmGetResourceIndex(skinDBP,bmpIndex);
if (hBmp) {
hStr = DmGetResourceIndex(skinDBP,strIndex);
-
+
if (hStr) {
// buttons : state|x|y|w/h slider|draw mode|x1/y1 keep|x2/y2 keep slider
// list (160mode) : state|x|y|w|h|
bmpTemp = (BitmapType *)MemHandleLock(hBmp);
strTemp = (UInt8 *)MemHandleLock(hStr);
-
+
BmpGlueGetDimensions(bmpTemp, &(rP->extent.x), &(rP->extent.y), 0);
rP->topLeft.x = strTemp[sknInfoPosX] * 2;
rP->topLeft.y = strTemp[sknInfoPosY] * 2;
-
+
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
}
@@ -271,18 +259,18 @@
if (skinDBP) {
index = DmFindResource (skinDBP, sknPosRsc, resID, NULL);
-
+
if (index != (UInt16)-1) {
hStr = DmGetResourceIndex(skinDBP, index);
-
+
if (hStr) {
strTemp = (UInt8 *)MemHandleLock(hStr);
oldState = strTemp[sknInfoState];
-
+
if (oldState != newState) {
DmWrite(strTemp, 0, &newState, 1);
}
-
+
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
}
@@ -300,10 +288,10 @@
if (skinDBP) {
index = DmFindResource (skinDBP, sknDepthRsc, skinDepth, NULL);
-
+
if (index != (UInt16)-1) {
hStr = DmGetResourceIndex(skinDBP, index);
-
+
if (hStr) {
strTemp = (UInt8 *)MemHandleLock(hStr);
depth = *strTemp;
@@ -312,12 +300,11 @@
}
}
}
-
+
return depth;
}
UInt8 SknGetState(DmOpenRef skinDBP, DmResID resID) {
-
UInt16 index;
MemHandle hStr;
UInt8 *strTemp;
@@ -325,10 +312,10 @@
if (skinDBP) {
index = DmFindResource (skinDBP, sknPosRsc, resID, NULL);
-
+
if (index != (UInt16)-1) {
hStr = DmGetResourceIndex(skinDBP, index);
-
+
if (hStr) {
strTemp = (UInt8 *)MemHandleLock(hStr);
oldState = strTemp[sknInfoState];
@@ -342,7 +329,6 @@
}
void SknShowObject(DmOpenRef skinDBP, DmResID resID) {
-
RectangleType r;
UInt8 state = SknGetState(skinDBP, resID);
SknGetObjectBounds(skinDBP, resID, &r);
@@ -359,7 +345,7 @@
skinDBP = DmOpenDatabase(gPrefs->skin.cardNo, gPrefs->skin.dbID, dmModeReadOnly);
if (skinDBP) {
strIndex = DmFindResource (skinDBP, sknPosRsc, skinList, NULL);
-
+
if (strIndex != 0xFFFF) { // if params exist
hStr = DmGetResourceIndex(skinDBP,strIndex);
if (hStr) {
@@ -369,7 +355,7 @@
y = strTemp[sknInfoPosY];
w = strTemp[sknInfoListWidth];
h = strTemp[sknInfoListSize] * sknInfoListItemSize;
-
+
if (rAreaP)
RctSetRectangle(rAreaP ,x, y, w, h);
if (rArea2xP)
@@ -377,7 +363,6 @@
MemHandleUnlock(hStr);
DmReleaseResource(hStr);
-
}
}
@@ -448,7 +433,7 @@
UInt8 txtColor, norColor, selColor, bkgColor;
UInt16 x,y;
-
+
SknScreenLock(winLockCopy);
SknGetListBounds(&rArea, &rArea2x);
@@ -550,9 +535,8 @@
}
}
}
-
}
-
+
return 0;
}
@@ -573,7 +557,7 @@
if (index < DmNumRecords(gameDB)) {
Boolean newValue;
-
+
oldIndex = GamGetSelected();
if (oldIndex != index && oldIndex != dmMaxRecordIndex)
@@ -587,7 +571,7 @@
MemHandleUnlock(record);
DmReleaseRecord (gameDB, index, 0);
-
+
lastIndex = index;
SknUpdateList();
}
More information about the Scummvm-git-logs
mailing list