aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/wince/wince-sdl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/wince/wince-sdl.cpp')
-rw-r--r--backends/platform/wince/wince-sdl.cpp58
1 files changed, 38 insertions, 20 deletions
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 8b2e0848f8..5d75b76805 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -403,9 +403,8 @@ static Uint32 timer_handler_wrapper(Uint32 interval) {
void OSystem_WINCE3::initBackend()
{
// Instantiate our own sound mixer
- // mixer init is postponed until a game engine is selected.
- if (_mixer == 0)
- _mixer = new Audio::MixerImpl(this);
+ // mixer init is rerun when a game engine is selected.
+ setupMixer();
// Create the timer. CE SDL does not support multiple timers (SDL_AddTimer).
// We work around this by using the SetTimer function, since we only use
@@ -792,11 +791,15 @@ void OSystem_WINCE3::setupMixer() {
SDL_AudioSpec desired;
int thread_priority;
+ compute_sample_rate();
if (_sampleRate == 0)
warning("setSoundCallback called with 0 _sampleRate. Audio will not work.");
+ else if (_mixer && _mixer->getOutputRate() == _sampleRate) {
+ debug(1, "Skipping sound mixer re-init: samplerate is good");
+ return;
+ }
memset(&desired, 0, sizeof(desired));
-
desired.freq = _sampleRate;
desired.format = AUDIO_S16SYS;
desired.channels = 2;
@@ -913,7 +916,6 @@ void OSystem_WINCE3::engineInit() {
//update_game_settings();
// finalize mixer init
- compute_sample_rate();
setupMixer();
}
@@ -1080,13 +1082,6 @@ void OSystem_WINCE3::update_game_settings() {
if (ConfMan.hasKey("no_doubletap_rightclick"))
_noDoubleTapRMB = ConfMan.getBool("no_doubletap_rightclick");
- else if (gameid == "tinsel") {
- _noDoubleTapRMB = true;
- ConfMan.setBool("no_doubletap_rightclick", true);
- ConfMan.flushToDisk();
- }
-
- compute_sample_rate();
}
void OSystem_WINCE3::initSize(uint w, uint h) {
@@ -1147,13 +1142,13 @@ void OSystem_WINCE3::setGraphicsModeIntern() {
}
bool OSystem_WINCE3::update_scalers() {
- if (_videoMode.mode != GFX_NORMAL)
- return false;
-
_videoMode.aspectRatioCorrection = false;
if (CEDevice::hasPocketPCResolution()) {
- if ( (!_orientationLandscape && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth))
+ if (_videoMode.mode != GFX_NORMAL)
+ return false;
+
+ if ((!_orientationLandscape && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth))
|| CEDevice::hasSquareQVGAResolution() ) {
if (getScreenWidth() != 320) {
_scaleFactorXm = 3;
@@ -1204,9 +1199,32 @@ bool OSystem_WINCE3::update_scalers() {
}
return true;
- }
+ } else if (CEDevice::hasWideResolution()) {
+#ifdef USE_ARM_SCALER_ASM
+ if ( _videoMode.mode == GFX_DOUBLESIZE && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth) ) {
+ if ( !_panelVisible && !_overlayVisible && _canBeAspectScaled ) {
+ _scaleFactorXm = 2;
+ _scaleFactorXd = 1;
+ _scaleFactorYm = 12;
+ _scaleFactorYd = 5;
+ _scalerProc = Normal2xAspect;
+ _modeFlags = 0;
+ _videoMode.aspectRatioCorrection = true;
+ } else if ( (_panelVisible || _overlayVisible) && _canBeAspectScaled ) {
+ _scaleFactorXm = 2;
+ _scaleFactorXd = 1;
+ _scaleFactorYm = 2;
+ _scaleFactorYd = 1;
+ _scalerProc = Normal2x;
+ _modeFlags = 0;
+ }
+ return true;
+ }
+#endif
+ } else if (CEDevice::hasSmartphoneResolution()) {
+ if (_videoMode.mode != GFX_NORMAL)
+ return false;
- if (CEDevice::hasSmartphoneResolution()) {
if (_videoMode.screenWidth > 320)
error("Game resolution not supported on Smartphone");
#ifdef ARM
@@ -1373,8 +1391,8 @@ bool OSystem_WINCE3::loadGFXMode() {
displayWidth = _videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd;
displayHeight = _videoMode.screenHeight * _scaleFactorYm / _scaleFactorYd;
} else {
- displayWidth = _videoMode.screenWidth;
- displayHeight = _videoMode.screenHeight;
+ displayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+ displayHeight = _videoMode.screenHeight* _videoMode.scaleFactor;
}
switch (_orientationLandscape) {