[Scummvm-devel] SamsungTV backend
Pawel Kolodziejski
aquadran at xtr.net.pl
Sat Nov 14 14:32:05 CET 2009
On 2009-11-13, at 00:18, Max Horn wrote:
> Hi Pawel,
>
> so I gather you are making some good progress, nice. One small
> request: Could you please rename samsungtv/sdl.* ? E.g. to
> samsungtv.cpp and samsungtv.h
>
> I also performed some cleanup on the code, but can't test it, so
> here it is as a patch. Finally, you might want to add a README with
> some instructions on how to compile this port (and we could set it
> up on the buildbot, too).
>
>
> Cheers,
> Max
> <samsungtv.patch>
I just ask that case would acceptable to apply ?
In this case samsungtv backend would eliminate to minimal gfs code
duplication.
In the future would be extend functionality of sdl backend to allow
support 32 bit video only supported devices.
This change is quite generic, but require add SDL_SetVideoMode in
subclass.
Index: backends/platform/sdl/graphics.cpp
===================================================================
--- backends/platform/sdl/graphics.cpp (revision 45888)
+++ backends/platform/sdl/graphics.cpp (working copy)
@@ -568,6 +568,11 @@
fixupResolutionForAspectRatio
(_videoMode.desiredAspectRatio, _videoMode.hardwareWidth,
_videoMode.hardwareHeight);
}
+#if defined(SAMSUNGTV)
+ _hwscreen = SDL_CreateRGBSurface(SDL_SWSURFACE,
_videoMode.hardwareWidth, _videoMode.hardwareHeight, 16, 0, 0, 0, 0);
+ if (_hwscreen == NULL)
+ error("allocating _hwscreen failed");
+#else
_hwscreen = SDL_SetVideoMode(_videoMode.hardwareWidth,
_videoMode.hardwareHeight, 16,
_videoMode.fullscreen ? (SDL_FULLSCREEN|
SDL_SWSURFACE) : SDL_SWSURFACE
);
@@ -582,6 +587,7 @@
return false;
}
}
+#endif
How it would like gfx part of samsungtv code:
void OSystem_SDL_SamsungTV::unloadGFXMode() {
if (_realhwscreen) {
SDL_FreeSurface(_realhwscreen);
_realhwscreen = NULL;
}
OSystem_SDL::unloadGFXMode();
}
bool OSystem_SDL_SamsungTV::hotswapGFXMode() {
if (!_screen)
return false;
SDL_FreeSurface(_realhwscreen); _realhwscreen = NULL;
return OSystem_SDL::hotswapGFXMode();
}
void OSystem_SDL_SamsungTV::internUpdateScreen() {
OSystem_SDL::internUpdateScreen();
SDL_BlitSurface(_hwscreen, 0, _realhwscreen, 0);
SDL_UpdateRect(_realhwscreen, 0, 0, 0, 0);
}
More information about the Scummvm-devel
mailing list