aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorChris Apers2004-01-20 14:22:42 +0000
committerChris Apers2004-01-20 14:22:42 +0000
commit2c60f5f3bc3625af7075296507518bd3bd0cf896 (patch)
tree211b75fffb0bab0601c85a71d1b700c0997d0366 /backends
parentcc123e7e28f977c336b0c6d73e291e84f5941e02 (diff)
downloadscummvm-rg350-2c60f5f3bc3625af7075296507518bd3bd0cf896.tar.gz
scummvm-rg350-2c60f5f3bc3625af7075296507518bd3bd0cf896.tar.bz2
scummvm-rg350-2c60f5f3bc3625af7075296507518bd3bd0cf896.zip
Fixed list positioning, tapwave related stuffs
svn-id: r12550
Diffstat (limited to 'backends')
-rw-r--r--backends/PalmOS/Src/skin.cpp49
1 files changed, 25 insertions, 24 deletions
diff --git a/backends/PalmOS/Src/skin.cpp b/backends/PalmOS/Src/skin.cpp
index 3e0af62646..5d05ea0c82 100644
--- a/backends/PalmOS/Src/skin.cpp
+++ b/backends/PalmOS/Src/skin.cpp
@@ -120,6 +120,7 @@ void SknApplySkin() {
RectangleType r;
FormPtr frmP = FrmGetActiveForm();
+ WinSetDrawWindow(WinGetDisplayWindow());
WinScreenLock(winLockDontCare);
//SknSetPalette();
RctSetRectangle(&r,0,0,160,160);
@@ -382,15 +383,18 @@ static void SknSetPalette() {
void SknUpdateList() {
MemHandle record;
- UInt16 index, maxIndex, maxView;
+ Int32 index, maxIndex, maxView;
GameInfoType *game;
RectangleType rArea, rField, rCopy, rArea2x;
DmOpenRef skinDBP;
UInt8 txtColor, norColor, selColor, bkgColor;
UInt16 x,y;
+
+ // prevent flashing screen on Zodiac ?
+ if (!OPTIONS_TST(kOptDeviceZodiac))
+ WinScreenLock(winLockCopy);
- WinScreenLock(winLockCopy);
SknGetListBounds(&rArea, &rArea2x);
skinDBP = SknOpenSkin();
// set default bg
@@ -419,10 +423,14 @@ void SknUpdateList() {
maxIndex = DmNumRecords(gameDB);
maxView = rArea.extent.y / sknInfoListItemSize;
- if (index > 0 && (index+maxView) > maxIndex) {
- index -= (index+maxView) - maxIndex;
- gPrefs->listPosition = index;
- }
+ if (index > 0 && (index + maxView) > maxIndex)
+ index -= (index + maxView) - maxIndex;
+
+ if (index < 0)
+ index = 0;
+
+ gPrefs->listPosition = index;
+
SknRedrawSlider(skinDBP, index, maxIndex, maxView);
SknRedrawTools(skinDBP);
SknGetListColors(skinDBP, skinColors, &norColor, &selColor, &bkgColor);
@@ -467,7 +475,9 @@ void SknUpdateList() {
RctSetRectangle(&rArea,0,0,160,160);
WinSetClip(&rArea);
- WinScreenUnlock();
+
+ if (!OPTIONS_TST(kOptDeviceZodiac))
+ WinScreenUnlock();
}
UInt16 SknCheckClick(DmOpenRef skinDBP, Coord mx, Coord my) {
@@ -508,30 +518,21 @@ void SknSelect(Coord x, Coord y) {
return;
if (index < DmNumRecords(gameDB)) {
- GameInfoType modGame;
-
+ Boolean newValue;
+
oldIndex = GamGetSelected();
+
+ if (oldIndex != index && oldIndex != dmMaxRecordIndex)
+ GamUnselect();
+
record = DmGetRecord(gameDB, index);
game = (GameInfoType *)MemHandleLock(record);
- MemMove(&modGame, game, sizeof(GameInfoType));
- modGame.selected = !modGame.selected;
- DmWrite(game, 0, &modGame, sizeof(GameInfoType));
+ newValue = !game->selected;
+ DmWrite(game, OffsetOf(GameInfoType,selected), &newValue, sizeof(Boolean));
MemHandleUnlock(record);
DmReleaseRecord (gameDB, index, 0);
-
- if (oldIndex != index && oldIndex != dmMaxRecordIndex) {
- record = DmGetRecord(gameDB, oldIndex);
- game = (GameInfoType *)MemHandleLock(record);
-
- MemMove(&modGame, game, sizeof(GameInfoType));
- modGame.selected = false;
- DmWrite(game, 0, &modGame, sizeof(GameInfoType));
-
- MemHandleUnlock(record);
- DmReleaseRecord (gameDB, oldIndex, 0);
- }
lastIndex = index;
SknUpdateList();