[Scummvm-cvs-logs] CVS: scummvm/backends/wince screen.cpp,1.6,1.7 screen.h,1.4,1.5
Nicolas Bacca
arisme at users.sourceforge.net
Sun Dec 1 15:28:08 CET 2002
Update of /cvsroot/scummvm/scummvm/backends/wince
In directory sc8-pr-cvs1:/tmp/cvs-serv20838
Modified Files:
screen.cpp screen.h
Log Message:
Fix display on HPC, update version
Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/screen.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- screen.cpp 19 Nov 2002 08:21:12 -0000 1.6
+++ screen.cpp 1 Dec 2002 23:26:49 -0000 1.7
@@ -21,7 +21,7 @@
#ifdef _WIN32_WCE
-#define POCKETSCUMM_VERSION "alpha build 11.17.02"
+#define POCKETSCUMM_VERSION "official build 0.3.0"
/* Original GFX code by Vasyl Tsvirkunov */
@@ -85,6 +85,7 @@
extern bool hide_toolbar;
bool toolbar_drawn;
bool draw_keyboard;
+bool wide_screen;
GXDisplayProperties gxdp;
int active;
@@ -494,6 +495,9 @@
maxMode = 0; // portrait only!
active = 1;
+
+ wide_screen = GetSystemMetrics(SM_CXSCREEN) >= 320;
+
return 0;
}
@@ -759,7 +763,7 @@
void drawAllToolbar() {
int x,y;
- if (currentScreenMode) {
+ if (currentScreenMode || wide_screen) {
if (draw_keyboard) {
pBlt_part(image_expand(item_keyboard), 0, 200, 320, 40, item_keyboard_colors, 0);
@@ -809,7 +813,7 @@
}
void redrawSoundItem() {
- drawSoundItem(10 + 40 + 40, (currentScreenMode ? 204 : 240));
+ drawSoundItem(10 + 40 + 40, (currentScreenMode || wide_screen ? 204 : 240));
}
bool isInBox(int x, int y, int x1, int y1, int x2, int y2) {
@@ -828,7 +832,7 @@
return ToolbarNone;
test_x = 10;
- test_y = (currentScreenMode ? 204 : 240);
+ test_y = (currentScreenMode || wide_screen ? 204 : 240);
if (isInBox(x, y, test_x, test_y, test_x + 32, test_y + 32))
return ToolbarSaveLoad;
test_x += 40;
@@ -859,13 +863,21 @@
void Blt_part(UBYTE * src_ptr, int x, int y, int width, int height, int pitch, bool check) {
+ if (check && (y > _geometry_h || (y + height) > _geometry_h))
+ return;
+
if (toolbar_available && !toolbar_drawn && !hide_toolbar)
drawAllToolbar();
pBlt_part(src_ptr, x, y, width, height, NULL, pitch);
- if (check && (y > _geometry_h || (y + height) > _geometry_h))
+ if (check && (y > _geometry_h || (y + height) > _geometry_h)) {
+ char message[100];
+ sprintf(message, "Override geometry : h %d y %d height %d", _geometry_h, y, height);
+ drawError(message);
+ exit(1);
toolbar_drawn = false;
+ }
}
@@ -2081,12 +2093,12 @@
GetWindowRect(hWndMain, &rc);
memset(noGAPI_video_buffer, 0x00, sizeof(noGAPI_video_buffer));
- if (currentScreenMode)
+ if (currentScreenMode || wide_screen)
hb = CreateBitmap(320, 240, 1, 16, noGAPI_video_buffer);
else
hb = CreateBitmap(240, 320, 1, 16, noGAPI_video_buffer);
old = (HBITMAP)SelectObject(noGAPI_compat, hb);
- if (currentScreenMode)
+ if (currentScreenMode || wide_screen)
BitBlt(hdc, 0, 0, 320, 240, noGAPI_compat, 0, 0, SRCCOPY);
else
BitBlt(hdc, 0, 0, 240, 320, noGAPI_compat, 0, 0, SRCCOPY);
@@ -2116,7 +2128,7 @@
work_buffer = noGAPI_video_buffer;
unsigned short *work_buffer_2 = (unsigned short*)work_buffer;
- if (currentScreenMode) {
+ if (currentScreenMode || wide_screen) {
for (i=0; i<width; i++) {
for (j=0; j<height; j++) {
@@ -2134,12 +2146,12 @@
}
}
- if (currentScreenMode)
+ if (currentScreenMode || wide_screen)
hb = CreateBitmap(height, width, 1, 16, noGAPI_video_buffer);
else
hb = CreateBitmap(width, height, 1, 16, noGAPI_video_buffer);
old = (HBITMAP)SelectObject(noGAPI_compat, hb);
- if (currentScreenMode)
+ if (currentScreenMode || wide_screen)
BitBlt(hdc, y , 320 - (x + width), height, width, noGAPI_compat, 0, 0, SRCCOPY);
else
BitBlt(hdc, x, y, width, height, noGAPI_compat, 0, 0, SRCCOPY);
@@ -2165,7 +2177,7 @@
GetWindowRect(hWndMain, &rc);
work_buffer = noGAPI_video_buffer;
- if (currentScreenMode) {
+ if (currentScreenMode || wide_screen) {
unsigned short *work_buffer_2 = (unsigned short*)work_buffer;
for (i=0; i<width; i++)
for (j=0; j<height; j++)
@@ -2195,12 +2207,12 @@
}
}
- if (currentScreenMode)
+ if (currentScreenMode || wide_screen)
hb = CreateBitmap(height, width, 1, 16, noGAPI_video_buffer);
else
hb = CreateBitmap(width, height, 1, 16, noGAPI_video_buffer);
old = (HBITMAP)SelectObject(noGAPI_compat, hb);
- if (currentScreenMode)
+ if (currentScreenMode || wide_screen)
BitBlt(hdc, y , 320 - (x + width), height, width, noGAPI_compat, 0, 0, SRCCOPY);
else
BitBlt(hdc, x, y, width, height, noGAPI_compat, 0, 0, SRCCOPY);
@@ -2217,11 +2229,12 @@
{
int x, y;
+ if (wide_screen)
+ return;
+
switch(currentScreenMode)
{
case 0: /* portrait */
- if (!_gfx_mode_switch)
- break;
*px = *px*4/3;
break;
case 1: /* landscape left */
Index: screen.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/screen.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- screen.h 7 Nov 2002 00:25:40 -0000 1.4
+++ screen.h 1 Dec 2002 23:26:49 -0000 1.5
@@ -47,7 +47,7 @@
void SetPalEntry(int ent, UBYTE r, UBYTE g, UBYTE b);
void Blt(UBYTE * scr_ptr);
-void Blt_part(UBYTE * src_ptr, int x, int y, int width, int height, int pitch);
+void Blt_part(UBYTE * src_ptr, int x, int y, int width, int height, int pitch, bool check = false);
void checkToolbar();
void Get_565(UBYTE *src, INT16 *buffer, int pitch, int x, int y, int width, int height);
@@ -59,6 +59,7 @@
void drawWait();
void drawVideoDevice();
+void setGameSelectionPalette();
void drawBlankGameSelection();
void reducePortraitGeometry();
void drawCommentString(char *);
More information about the Scummvm-git-logs
mailing list