75 Commits

Author SHA1 Message Date
Johannes Schickel
325addff0c OPENGLSDL: Make fullscreen mode switching work again. 2011-09-23 19:45:44 +02:00
Johannes Schickel
b8dcd9a25e OPENGL: Fix aspect ratio correction behavior.
Now only 320x200 and 640x400 will result in aspect ratio correction to be used
if the user requested it. This should fix some strechting in Myst/Riven.
2011-08-12 04:06:54 +02:00
Johannes Schickel
a77c29327e OPENGLSDL: Do not change requested window size on resize.
This should help fix a lock up on window managers, which will try to force the
ScummVM window to a certain size, by just requesting the same size over and
over again.

Now we get black borders even in windowed mode when the aspect of the window
does not match the aspect of the game screen (and we are not in "normal" mode),
but that is usually the same in video players too, so shouldn't be too bad.
2011-08-12 03:46:32 +02:00
Johannes Schickel
04ab0e58b4 SDL: Take advantage of SdlGraphicsManager.
This gets rid of the hacks, where SdlEventSource added events with custom type
numbers to pass SDL_VIDEOEXPOSE and SDL_VIDEORESIZE to the graphics manager.

Furthermore it get rids of the uninituitive and hard to trace way of assigning
the proper mouse coordinates to mouse related events. Formerly it passed the
real screen coordinates through the even dispatching api to the graphics
manager (at least hopefully ;-) and let that handle creating a new event with
the proper coordinates. Now instead SdlEventSource handles the proper
coordinate setup itself.

Since this is a behavior change and I can not test all the SDL based small
devices ports this commit might break compilation for them and more serve it
might also break mouse position behavior. If any of that occurs I am sorry
about it.
2011-08-09 00:03:11 +02:00
Johannes Schickel
0630a88a04 SDL: Let SDL based graphics managers inherit from SdlGraphicsManager.
This also adapts port I can not test (not even the compilation). So if this
breaks anything I am sorry about it.
2011-08-09 00:03:11 +02:00
Max Horn
88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
Johannes Schickel
f9f16ee358 OPENGLSDL: Add FIXME about desktop resolution retrieving. 2011-06-19 19:12:34 +02:00
Johannes Schickel
735604c2fd OPENGLSDL: Use String::format instead of sprintf. 2011-06-19 18:31:34 +02:00
Johannes Schickel
d316099f35 OPENGLSDL: Formatting fixes. 2011-06-19 18:27:18 +02:00
Thierry Crozat
014145f240 I18N: Make some OSD messages translatable 2011-06-06 23:20:11 +01:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Max Horn
59e77ed667 ALL: Mark printf and various other symbols as forbidden
Right now, a few places in the frontend code still use printf and
consorts. We mark the affected files with a FIXME for now, and
add a dedicated exception for each. To be fixed!

Also tweak FORBIDDEN_SYMBOL_REPLACEMENT to hopefully really always
enforce a compiler error
2011-05-02 16:31:31 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Johannes Schickel
6502e191b9 OPENGL: Handle aspect ratio correction as flag instead of having a special mode for it.
This partly fixes the OpenGL mode mess, but now OpenGL Normal and OpenGL
Conserve will feature the same semantics when aspect ratio correction is
enabled... That is still something to solve.
2011-03-20 17:29:08 +01:00
Johannes Schickel
f490e6f361 OPENGLSDL: More refactoring to avoid direct access of OpenGlGraphicsManager's members. 2011-03-17 21:20:20 +01:00
Johannes Schickel
83b199e921 OPENGL: Move setFullscreenMode to OpenGLGraphicsManager. 2011-03-17 21:20:20 +01:00
Johannes Schickel
8d87a460b0 OPENGLSDL: Handle active fullscreen mode OPENGLSDL internal. 2011-03-17 21:20:20 +01:00
Johannes Schickel
c9f6136110 OPENGLSDL: Cleanup. 2011-03-17 21:20:20 +01:00
Johannes Schickel
96979f73fc OPENGL: Slight refactoring.
First step into making all state variables of the OpenGL backend private, to
help making the backend more maintainable, by disallowing subclasses to just
mess with everything...
2011-03-17 19:55:06 +01:00
Johannes Schickel
42d3b8fcbd OPENGL: Fix compilation when USE_OSD is not defined. 2011-03-17 18:35:32 +01:00
Johannes Schickel
3c656916f1 OPENGL: Always properly set the overlay dimensions in loadGFXMode. 2011-03-17 18:35:32 +01:00
Johannes Schickel
e08683d939 OPENGL: Refactor warpMouse.
Now subclasses will not need to worry about the scaling logic themselves, but
just need to implement setInternalMousePosition, which should handles setting
the system's mouse coordinates.
2011-03-17 17:37:42 +01:00
Johannes Schickel
4841079075 OPENGL(SDL): Use the whole window/screen size for the overlay.
This makes the overlay looking nicer in fullscreen mode.
2011-03-01 05:32:14 +01:00
Johannes Schickel
4f3a244f16 OPENGLSDL: Add RGB555 to the supported format list. 2011-02-25 03:36:45 +01:00
Johannes Schickel
32d0e4c15f OPENGLSDL: Avoid warping in warpMouse when the logical coordinates did not change.
This fixes a slight move of the mouse cursor when the hardware mouse position
is at a subpixel from the logical coordinates.
2011-02-19 20:46:47 +01:00
Jordi Vilalta Prat
5884f5a7ac OPENGLES: Fix the projection matrix and the includes.
svn-id: r54756
2010-12-03 19:43:27 +00:00
Jordi Vilalta Prat
bd6f33380e OPENGL: Fix the fullscreen mode detection when SDL accepts any resolution.
svn-id: r54754
2010-12-03 19:09:27 +00:00
Max Horn
df05ed1a46 BACKENDS: Include scummsys.h at top of all .cpp files, *before* any #ifdefs
svn-id: r54573
2010-11-29 16:18:43 +00:00
Max Horn
4e0e406181 SDL: Move #include <SDL.h> into a special wrapper file
svn-id: r54572
2010-11-29 16:16:50 +00:00
Max Horn
ee4510aed4 OPENGL: Modify source files to force recompilation
svn-id: r54542
2010-11-28 18:10:40 +00:00
Willem Jan Palenstijn
66cb595f22 SDL: re-enable unicode after graphics init
svn-id: r54531
2010-11-28 17:12:43 +00:00
Alejandro Marzini
30cbd35e74 OPENGL: Fix enable aspect ratio feature.
svn-id: r52502
2010-09-03 03:47:05 +00:00
Alejandro Marzini
19bf2b9eb6 OPENGL: Improve scaling, aspect ratio correction and display(GFX) modes.
Now the previous aspect ratio modes are handled as GFX modes. The previous
GFX modes were for scaling, but are removed now. A new 4/3 display mode
added. Added Ctrl-Shift-A for backward switching through display modes, and
Ctrl-Alt-<number key> for switching to a specific GFX mode.
Window resizing now is available for all display modes, and will
automatically change the scale factor as well as maintain the aspect ratio
when needed.

svn-id: r52501
2010-09-03 03:23:46 +00:00
Alejandro Marzini
27beca0e8c OPENGL: Add Ctrl-Shift-Enter hotkey for backward switching fullscreen modes.
svn-id: r52310
2010-08-23 20:28:04 +00:00
Alejandro Marzini
942e104e33 OPENGL: Fix issue with resize events generated after going out of fullscreen mode.
svn-id: r52248
2010-08-20 22:56:13 +00:00
Alejandro Marzini
503578ac10 OPENGL: Restrict window scaling if current desktop resolution is not big enough.
svn-id: r52057
2010-08-13 05:26:23 +00:00
Alejandro Marzini
610f041930 OPENGL: Remove unnecessary best fullscreen mode detection code.
svn-id: r52056
2010-08-13 05:16:42 +00:00
Alejandro Marzini
d84428e678 OPENGL: Disable resizable window when not using an aspect ratio correction.
svn-id: r52055
2010-08-13 05:00:38 +00:00
Alejandro Marzini
a3711160ef OPENGL: Remove unnecessary aspect ratio corrections, and add "Original Size" correction. Rename _transactionDetails.needHotswap to _transactionDetails.needRefresh.
svn-id: r52054
2010-08-13 04:48:58 +00:00
Alejandro Marzini
58d256c15e SDL: Make use of SDL_BACKEND instead of platform specific defines.
svn-id: r52029
2010-08-12 06:30:26 +00:00
Alejandro Marzini
7b898648bc OPENGL: Add 5/3 and 5/4 aspect ratio corrections.
svn-id: r51806
2010-08-06 21:39:54 +00:00
Alejandro Marzini
7968374e27 OPENGL: Fix compiling for GLES.
svn-id: r51721
2010-08-04 04:23:00 +00:00
Alejandro Marzini
498c17655d OPENGL: Refresh OpenGL textures on all loadGFX() calls.
OpenGL context may be destroyed after calling SDL_SetVideoMode, so it is better to always recreate the textures.

svn-id: r51675
2010-08-03 02:30:36 +00:00
Alejandro Marzini
5439b173b3 OPENGL: Prioritize desktop resolution as default fullscreen mode.
svn-id: r51674
2010-08-03 02:10:55 +00:00
Alejandro Marzini
d542648a89 OPENGL: Add missing header.
svn-id: r51605
2010-08-02 03:38:35 +00:00
Alejandro Marzini
905ec1104e OPENGL: Save last fullscreen mode size to config file.
svn-id: r51604
2010-08-02 03:17:12 +00:00
Alejandro Marzini
4d8f8195b8 OPENGL: Improve fullscreen mode selection. Add warpMouse adjusting.
svn-id: r51603
2010-08-02 03:03:28 +00:00
Alejandro Marzini
7f8e7fc29d OPENGL: Remove use of floats for aspect ratio correction. Improved fullscreen toggling default mode selection.
Floats can lead to calculation errors because, now uints are used and aspect ratio values are handled with a x 10000 scale.
When entering fullscreen, it will be looked for the fullscreen mode with the smallest metric that mantains the game screen aspect ratio.

svn-id: r51563
2010-08-01 02:26:20 +00:00
Alejandro Marzini
dd7bcc051f OPENGL: Switch to native resolution fullscreen as default.
svn-id: r51560
2010-07-31 23:50:54 +00:00
Alejandro Marzini
7dbe257da8 OPENGL: Add support for BGR and rgb(a) reversed formats (Not available for GLES). General cleanup and commenting.
svn-id: r51559
2010-07-31 22:54:10 +00:00