Commit graph

215 commits

Author SHA1 Message Date
Christian Krause
6acf4984d0 GRIM/EMI: Use proper GL constants 2014-02-15 18:40:30 +01:00
Christian Krause
446f56eb67 GRIM/EMI: Fix compile warnings 2014-02-15 18:40:19 +01:00
Dries Harnie
5da8aa7144 GRAPHICS: Introduce GfxOpenGLS 2014-01-14 00:26:39 +01:00
Joel Teichroeb
850f576082 Merge pull request #812 from chkr-private/sprite-fixes
EMI/GRIM: Fix unaligned sprites
2014-01-11 18:35:39 -08:00
Christian Krause
3f7d7df273 EMI/GRIM: Fix unaligned sprites and use correct axis
When an actor which is drawn using sprites moved due to water float
effects and if that actor uses multiple sprites, then these sprites are
not aligned (e.g. in the very first scene, the ship in the background is
not shown as one piece).

That is because the sprites are first rotated and then moved to
the correct position. It is necessary to first move them to their
correct position on the actor and then rotate the whole actor.

Additionally, non-overworld sprites needs to be rotated by the Yaw axis.
Otherwise the ship did not rock but only moved vertically.

This changes fixes:
- the ship in the background in the first scene
- the clock hands in the swamp
2014-01-11 23:58:49 +01:00
Ingo van Lil
f106a2a8b9 GRIM/EMI: Fix sprite scaling with non-native screen resolutions
When mapping a sprite to a GL polygon its dimensions are scaled by the ratio
between the current screen resolution and the native game resolution. When
the polygon is rendered it is scaled again, causing sprites to be displayed
unproportionally big when using larger screen resolutions.
2014-01-09 23:32:47 +01:00
Ingo van Lil
ea6ffdb934 EMI: Flip y coordinate when creating screenshot textures
The MakeScreenTextures() opcode is used to create texture tiles from the
current screen content for use with an overworld actor, e.g. when fading over
the slides in the intro. With OpenGL the created textures were mirrorered in
y direction because OpenGL uses a different coordinate system where (0, 0)
is the bottom left corner.
2013-12-22 20:11:39 +01:00
Dries Harnie
9edcb2fd67 JANITORIAL: Add FIXME about refactoring cf. #789 2013-12-17 01:09:18 +01:00
Dries Harnie
180b4659b9 Merge pull request #789 from sietschie/master
EMI: Place text when actors talk
2013-12-16 16:05:12 -08:00
sietschie
d06762ec52 EMI: removed unnecessary comments, made getBoundingBox const 2013-12-12 14:46:53 +01:00
Einar Johan Trøan Sømåen
a11670047a EMI: Apply alpha when drawing sprites.
This fixes the health bars in Monkey Kombat.
2013-12-12 03:36:21 +01:00
sietschie
98e9b41010 EMI: Implement GetBoundingPos for EMIModel
Added the ability to compute the bounding boxes of models so that the
text can be correctly placed near the actors.
2013-12-10 17:19:07 +01:00
Dries Harnie
46e7cf29cd EMI: Rotate overworld sprites again 2013-12-04 14:31:12 +01:00
Dries Harnie
b1a910c800 GRIM/EMI: Refactor GfxBase::startActorDraw 2013-12-04 14:31:06 +01:00
Christian Krause
15d134f2c1 EMI: Fix display of "dock" video
During the run of the "dock" video (first arrival at melee island) only
a black screen was displayed although the sound did work.
The lua code dims (_dimLevel = 1) the scene before showing a video so
that only the video is visible. GfxOpenGL::drawBitmap sets the current
color according to the dim level before it starts drawing the bitmap:

glColor3f(1.0f - _dimLevel, 1.0f - _dimLevel, 1.0f  - _dimLevel);

If there is no other glColor* call before drawing the video, the current
color stays (0, 0, 0) and the video won't be visible.

The bug fix resets the color to (1.0, 1.0, 1.0) after the drawing of the
bitmap at the end of GfxOpenGL::drawBitmap.
2013-11-26 20:58:19 +01:00
Ingo van Lil
09466c556a EMI: Rotate sprite actors to face camera
Sprite actors, e.g. ships of the balloon in the Scumm bar, should
always face the camera, so the rotation part of their matrix has
to be reset before rendering. The code already exists for Grim, but
appears to work for EMI as well.
2013-11-24 15:24:04 +01:00
Joel Teichroeb
42bbcc6ddb GRIM: Fix scaling text on different aspect ratios with OpenGL 2013-11-10 10:01:04 -08:00
Dries Harnie
43fcfa765f GRAPHICS: Pass Mesh* to GfxBase::drawModelFace 2013-11-05 07:29:30 -08:00
Joel Teichroeb
c0cb2f1f9c GRIM: Use a consitent style for constructor initializers 2013-10-26 13:57:55 -07:00
Pawel Kolodziejski
790db038c0 ALL: sync with scummvm 2013-10-13 11:30:34 +02:00
Andrea Corna
a0d9f46f31 GRIM/EMI: Break up global config keys from Grim registry and turn off it in EMI 2013-09-09 19:38:10 +02:00
Dries Harnie
92f5deadc5 EMI: Allow sprites to rotate
The clock in mot.set depends on rotating sprites.
2013-08-07 20:05:48 +02:00
Dries Harnie
1b8e815c1d Revert "EMI: Enable GL_BLEND when drawing EMI-model-faces"
This reverts commit 5769dffca2.
2013-07-30 20:51:16 +02:00
Dries Harnie
0d28bfad19 EMI: Properly set modelview matrix for overworld 2013-07-29 22:02:03 +02:00
Joel Teichroeb
7a4b847fdf Revert "EMI: Allow lighting to be enabled"
This reverts commit 48bc8de2c8.
2013-07-12 12:08:14 -07:00
Joel Teichroeb
be41e30c00 GRIM: Make lights use an enum instead of checking against a string to get the type 2013-07-10 16:17:28 -07:00
Joel Teichroeb
48bc8de2c8 EMI: Allow lighting to be enabled 2013-07-10 15:08:47 -07:00
Joel Teichroeb
c7ad13aa92 EMI: Enable GL_BLEND when drawing a TIL 2013-07-09 17:11:06 -07:00
Einar Johan Trøan Sømåen
fe3883cecd GRIM: Reformat code to be closer to convention. 2013-07-09 21:12:55 +02:00
Joel Teichroeb
f4cd7c68d1 EMI: Disable depth mask for sprites 2013-07-08 14:33:29 -07:00
Joel Teichroeb
21afde3846 GRIM: Move Sprite into it's own file 2013-07-07 17:25:35 -07:00
Christian Mayer
5769dffca2 EMI: Enable GL_BLEND when drawing EMI-model-faces
This fixes the fading in the EMI-intro
2013-07-02 22:38:34 +02:00
Dries Harnie
3196c0a0fb EMI: Draw to depth buffer if sortorder >= 100 2013-07-02 00:22:58 +02:00
Dries Harnie
a723b0e3f5 EMI: Draw background layers at intervals
Previously, we split the background layers into everything
before SO 15 and after, and drew like that. However, this caused
the pink ship in shi.setb to not be drawn.

This patch draws the layers of the background at intervals of ten.
So if a set has six layers, layer 5 is the background and 4,3,2,1,0
are rendered at sortorder 40,30,20,10,0.
2013-06-29 14:41:17 +02:00
Einar Johan Trøan Sømåen
960f48f0f7 GRIM: Initialize all members in GfxOpenGL. 2013-04-21 15:09:39 +02:00
Joel Teichroeb
c6aa8425dd GRIM: Fix C++11 related warnings 2013-04-02 13:08:38 -07:00
Giulio Camuffo
61eeb63278 GRIM: Add a config option to disable ARB shaders: "use_arb_shaders", defaulted to true 2013-01-21 17:04:26 +01:00
Giulio Camuffo
e3c85997a2 GRIM: Don't enable lighting if we're drawing the shadow. Fix #294 2013-01-12 14:20:51 +01:00
Joni Vähämäki
2c5bfd586e GRIM: Fixed formatting. 2013-01-02 02:20:51 +02:00
Joni Vähämäki
8b283945e4 GRIM: Fixed formatting. 2013-01-02 02:15:01 +02:00
Joni Vähämäki
12ef0d6ccb GRIM: Fixed regression in sprite drawing. 2013-01-02 00:50:26 +02:00
Paweł Kołodziejski
175620b62a ALL: change license headers from LGPL to GPL, and few updates 2012-12-19 23:15:43 +01:00
Einar Johan Trøan Sømåen
6cc1d9e6a0 EMI: Avoid using TIL-specific code for TGAs 2012-11-26 17:37:56 +01:00
Dries Harnie
b239104e7b EMI: Rename Offset to Layer 2012-11-26 02:08:58 +01:00
Dries Harnie
bde37f96a8 EMI: Over-draw some actors in Set::drawForeground
EMI draws portions of the background over actors
with sortOrder >= 15.
2012-11-26 02:08:58 +01:00
Einar Johan Trøan Sømåen
4f1f4aeb4d EMI: Implement DimScreen and add hacks to UnDimRegion to make it work 2012-11-21 18:17:24 +01:00
Paweł Kołodziejski
1ef0301b2f Merge pull request #666 from klusark/emidepth
EMI: Load TIL files correctly
2012-11-18 13:15:55 -08:00
Joel Teichroeb
84db0881fa EMI: Add BM_BGRA for correct sprite colour 2012-11-18 09:47:23 -08:00
Joel Teichroeb
e27a6ad833 EMI: Load TIL files correctly 2012-11-18 09:17:21 -08:00
Dries Harnie
a23f804d9a EMI: Add glViewport call to make APITrace happy 2012-11-18 17:28:15 +01:00