79 Commits

Author SHA1 Message Date
Johannes Schickel
c064fa5c5b OPENGL: Fix mouse cursor position in Normal mode when AR is enabled. 2011-03-21 00:43:16 +01:00
Johannes Schickel
33cf1f8f59 OPENGL: Get rid of unused switchDisplayMode. 2011-03-20 17:30:23 +01: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
8ab136dafb OPENGL: Fix screenshots when the display width is not divisible by 4. 2011-03-17 21:20:20 +01:00
Johannes Schickel
83c638ad02 OPENGL: Setup the correct header size for BMP screenshots.
This fixes an color bug in the resulting screenshots.
2011-03-17 21:20:20 +01:00
Johannes Schickel
8d35d91bdf OPENGL: Cleanup switchDisplayMode. 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
daf6050d7c OPENGL: Make setScale non-virtual. 2011-03-17 21:20:20 +01:00
Johannes Schickel
758aa78acc OPENGL: Get rid of _aspectRatioCorrection. 2011-03-17 19:55:06 +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
372af10a7b OPENGL: Update the OSD texture when visible while the output mode changes.
This fixes annoying graphics glitches, which occured sometimes when resizing
the Window.
2011-03-17 18:35:32 +01:00
Johannes Schickel
019aa63b15 OPENGL: Fix "Original" mode by setting up the corret screen dimensions. 2011-03-17 18:35:18 +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
dhewg
0b24fc3acc OPENGL: Fix compilation for --disable-16bit 2011-03-06 16:59:20 +01:00
Johannes Schickel
5ffecd85b3 OPENGL: Limit maximum cursor scale.
This avoids too big cursors when the screen resolution is really high.
2011-03-01 05:45:56 +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
dhewg
f26707e353 OPENGL: Fix 16bit cursors 2011-02-26 08:56:49 +01:00
dhewg
a441069a49 OPENGL: Reset the scale on mode changes
Resets defaultTo1XScaler when going back to the launcher
2011-02-25 20:49:48 +01:00
Johannes Schickel
63cc9de1df OPENGL: Cleanup cursor refresh code a bit. 2011-02-25 04:04:56 +01:00
Johannes Schickel
f1b16fe084 OPENGL: Implement support for non CLUT8 cursor.
Currently all the cursor data is converted to RGBA8888 to allow for
easy colorkeying.
2011-02-25 04:01:37 +01:00
Johannes Schickel
972cdaea35 OPENGL: Add support for RGB555 output format. 2011-02-25 03:35:55 +01:00
Johannes Schickel
020a413247 OPENGL: Set _gameTexture to 0 after deleting it.
This fixes a segfault when trying to use the OpenGL backend with 16bpp games,
however this does not make Last Express nor Loom PC-Engine Japanese work for
me. They now fail with a "Pixel format not supported" error.
2011-02-24 18:36:57 +01:00
Johannes Schickel
f5e10f33f5 OPENGL: Properly setup pixel data alignment.
If we do not do this, we might end up with a default alignment of 4, which will
fail (as in the graphics will be messed up) in case the screen resolution is
not divisible by 4.

Thanks to digitall for noticing this problem and finding out about
GL_UNPACK_ALIGNMENT.
2011-02-24 05:11:00 +01:00
Johannes Schickel
e21d6e0d11 Merge branch 'osystem-palette' of https://github.com/lordhoto/scummvm into master
Conflicts:
	backends/platform/android/android.cpp
	engines/sci/graphics/screen.cpp
	engines/sci/graphics/transitions.cpp
2011-02-19 21:46:45 +01:00
Johannes Schickel
9954eb5a99 OPENGL: Get rid of adjustMouseEvent.
Rather than that I introduced a function which converts hardware screen
coordinates to overlay / game screen coordinates.

The logic which converts mouse movement events with hardware screen
coordinates to overlay / game screen coordinates is now inside notifyEvent.

This is still broken design, since one should not abuse an observer for that.
2011-02-19 20:46:47 +01:00
Johannes Schickel
6adfbe5f54 OPENGL: Adapt the OpenGL module to the setPalette/grabPalette RGBA->RGB change. 2011-02-14 17:08:31 +01:00
Johannes Schickel
d184686189 OPENGL: Fix OSD support by only updating the OSD texture in internUpdateScreen.
This actually still has the drawback that if one calls OSystem::updateScreen
from the sound thread that it might crash. Hopefully no code does this though...

svn-id: r54830
2010-12-08 01:53:20 +00:00
Johannes Schickel
da2880be47 OPENGL: Disable OSD support for now.
I added an comment explaining why OSD is broken currently. The basic problem is
that OpenGL is not thread safe, thus in case we try to display any message on
the OSD from the sound thread for example it will result in crashes.

svn-id: r54829
2010-12-08 01:35:54 +00:00
Jordi Vilalta Prat
5884f5a7ac OPENGLES: Fix the projection matrix and the includes.
svn-id: r54756
2010-12-03 19:43: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
ee4510aed4 OPENGL: Modify source files to force recompilation
svn-id: r54542
2010-11-28 18:10:40 +00:00
Max Horn
a5ffdcf6cf OPENGL: cleanup
svn-id: r54520
2010-11-28 14:57:26 +00:00
Alejandro Marzini
9136724110 SDL/OPENGL: Fix backend initialization when building with ENABLE_VKEYBD.
svn-id: r52503
2010-09-03 04:23:01 +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
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
a16ca00113 OPENGL: Fix problem when switching between SDL and OpenGL Graphics Managers.
svn-id: r52025
2010-08-12 04:12:37 +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
f97809a9a6 OPENGL: Improve aspect ratio correction mode selection.
svn-id: r51752
2010-08-05 06:20:44 +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
905ec1104e OPENGL: Save last fullscreen mode size to config file.
svn-id: r51604
2010-08-02 03:17:12 +00:00
Alejandro Marzini
41204282ec OPENGL: By default only enable None, Conserve and 4/3 aspect ratio corrections.
svn-id: r51599
2010-08-01 22:53:18 +00:00
Alejandro Marzini
b816849c78 Fix warnings.
svn-id: r51592
2010-08-01 20:49:13 +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
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
Alejandro Marzini
c93adcbd29 OPENGL: For GLES, add glOrthox and do not use GL_BGR.
svn-id: r51552
2010-07-31 20:58:14 +00:00
Alejandro Marzini
6d6756b46a Add OpenGL dependencies to MinGW configure.
svn-id: r51551
2010-07-31 19:57:54 +00:00
Alejandro Marzini
7b070bbef8 SDL/OPENGL: Add ability to switch between SDL and OpenGL graphics managers.
OSystem_SDL will create a merged list of all graphics modes from SDL and OpenGL. When the user changes the graphics mode in options and restarts ScummVM should switch to that graphics mode in the corresponding graphics manager.

svn-id: r51493
2010-07-30 03:31:05 +00:00
Alejandro Marzini
9daa1c7f93 OSYSTEM: Add resetGraphicsScale() method.
This fixes a hack for resetting the graphics scale to x1 when starting games that have a large screen size. The SDL graphics manager should now scale back to x1 without changing the current scaler in use, as well as the OpenGL graphics manager.

svn-id: r51492
2010-07-30 03:06:57 +00:00