[Scummvm-cvs-logs] SF.net SVN: scummvm: [26979] scummvm/trunk/backends/platform/wince/ wince-sdl.cpp
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Sun May 27 21:05:52 CEST 2007
Revision: 26979
http://scummvm.svn.sourceforge.net/scummvm/?rev=26979&view=rev
Author: knakos
Date: 2007-05-27 12:05:51 -0700 (Sun, 27 May 2007)
Log Message:
-----------
getting screen extents from the sdl backend. Builders must use the newer sdl port lib
Modified Paths:
--------------
scummvm/trunk/backends/platform/wince/wince-sdl.cpp
Modified: scummvm/trunk/backends/platform/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.cpp 2007-05-27 19:00:28 UTC (rev 26978)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.cpp 2007-05-27 19:05:51 UTC (rev 26979)
@@ -176,7 +176,6 @@
#endif
CEDevice::init();
- OSystem_WINCE3::initScreenInfos();
/* Redirect standard input and standard output */
strcpy(stdout_fname, getcwd(NULL, MAX_PATH));
@@ -265,16 +264,6 @@
void OSystem_WINCE3::initBackend()
{
- // Initialize global key mapping
- GUI::Actions::init();
- GUI_Actions::Instance()->initInstanceMain(this);
- if (!GUI_Actions::Instance()->loadMapping()) { // error during loading means not present/wrong version
- warning("Setting default action mappings.");
- GUI_Actions::Instance()->saveMapping(); // write defaults
- }
-
- loadDeviceConfiguration();
-
// Instantiate our own sound mixer
// mixer init is postponed until a game engine is selected.
if (_mixer == 0) {
@@ -290,6 +279,23 @@
// Chain init
OSystem_SDL::initBackend();
+
+ // Query SDL for screen size and init screen dependent stuff
+ OSystem_WINCE3::initScreenInfos();
+ _isSmartphone = CEDevice::isSmartphone();
+ create_toolbar();
+ _hasSmartphoneResolution = CEDevice::hasSmartphoneResolution() || CEDevice::isSmartphone();
+ if (_hasSmartphoneResolution) _panelVisible = false; // init correctly in smartphones
+
+ // Initialize global key mapping
+ GUI::Actions::init();
+ GUI_Actions::Instance()->initInstanceMain(this);
+ if (!GUI_Actions::Instance()->loadMapping()) { // error during loading means not present/wrong version
+ warning("Setting default action mappings.");
+ GUI_Actions::Instance()->saveMapping(); // write defaults
+ }
+
+ loadDeviceConfiguration();
}
int OSystem_WINCE3::getScreenWidth() {
@@ -303,8 +309,13 @@
void OSystem_WINCE3::initScreenInfos() {
// sdl port ensures that we use correctly full screen
_isOzone = 0;
- _platformScreenWidth = GetSystemMetrics(SM_CXSCREEN);
- _platformScreenHeight = GetSystemMetrics(SM_CYSCREEN);
+ SDL_Rect **r;
+ r = SDL_ListModes(NULL, 0);
+ printf("listmodes: %dx%d\n", r[0]->w, r[0]->h);
+ //_platformScreenWidth = GetSystemMetrics(SM_CXSCREEN);
+ //_platformScreenHeight = GetSystemMetrics(SM_CYSCREEN);
+ _platformScreenWidth = r[0]->w;
+ _platformScreenHeight = r[0]->h;
}
bool OSystem_WINCE3::isOzone() {
@@ -322,15 +333,11 @@
_saveToolbarState(false), _saveActiveToolbar(NAME_MAIN_PANEL), _rbutton(false), _hasfocus(true),
_usesEmulatedMouse(false), _mouseBackupOld(NULL), _mouseBackupToolbar(NULL), _mouseBackupDim(0)
{
- _isSmartphone = CEDevice::isSmartphone();
- _hasSmartphoneResolution = CEDevice::hasSmartphoneResolution() || CEDevice::isSmartphone();
memset(&_mouseCurState, 0, sizeof(_mouseCurState));
if (_isSmartphone) {
_mouseCurState.x = 20;
_mouseCurState.y = 20;
}
- if (_hasSmartphoneResolution) _panelVisible = false; // init correctly in smartphones
- create_toolbar();
_mixer = 0;
_screen = NULL;
@@ -912,7 +919,6 @@
}
void OSystem_WINCE3::initSize(uint w, uint h) {
-
if (_hasSmartphoneResolution && h == 240)
h = 200; // mainly for the launcher
@@ -975,7 +981,6 @@
}
bool OSystem_WINCE3::update_scalers() {
-
if (_mode != GFX_NORMAL)
return false;
@@ -984,12 +989,21 @@
if (CEDevice::hasPocketPCResolution()) {
if ( (!_orientationLandscape && (_screenWidth == 320 || !_screenWidth))
|| CEDevice::hasSquareQVGAResolution() ) {
- _scaleFactorXm = 3;
- _scaleFactorXd = 4;
- _scaleFactorYm = 1;
- _scaleFactorYd = 1;
- _scalerProc = PocketPCPortrait;
- _modeFlags = 0;
+ if (getScreenWidth() != 320) {
+ _scaleFactorXm = 3;
+ _scaleFactorXd = 4;
+ _scaleFactorYm = 1;
+ _scaleFactorYd = 1;
+ _scalerProc = PocketPCPortrait;
+ _modeFlags = 0;
+ } else {
+ _scaleFactorXm = 1;
+ _scaleFactorXd = 1;
+ _scaleFactorYm = 1;
+ _scaleFactorYd = 1;
+ _scalerProc = Normal1x;
+ _modeFlags = 0;
+ }
} else if ( _orientationLandscape && (_screenWidth == 320 || !_screenWidth)) {
Common::String gameid(ConfMan.get("gameid")); // consider removing this check and start honoring the _adjustAspectRatio flag
if (!_panelVisible && !_hasSmartphoneResolution && !_overlayVisible && !(strncmp(gameid.c_str(), "zak", 3) == 0)) {
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