27 Commits

Author SHA1 Message Date
Joni Vähämäki
b5cdd1240f EMI: Only draw models for actors inside the view frustum.
This adds math classes for doing frustum culling in software. These could be used for optimizing performance in many other places as well. For example, if an actor is outside the view frustum, it may not be necessary to do expensive keyframe animation and vertex skinning calculations for that actor.
2014-06-16 15:42:18 +03:00
Joni Vähämäki
8f9f541f17 EMI: Implemented dynamic lighting for models.
Lighting is done by calculating vertex colors in software, since the attenuation model used in EMI cannot be simulated with OpenGL fixed function lighting. The original game does the lighting this way as well. Ideally for the modern shader-based renderer a shader would be used for this instead.
2014-06-16 15:41:06 +03:00
Joseph Jezak josejx@gentoo.org
190dbfacb2 EMI: Load default room image when missing a background bitmap. Fixes #881. 2014-05-22 22:24:39 -04:00
Pawel Kolodziejski
8759900b6a ALL: synced with ScummVM 2014-04-05 18:18:42 +02:00
Christian Krause
98e1375763 EMI: Correct cacluation of sound position
In GRIM the position, direction and the roll of the camera is set via
gluLookAt but in EMI the camera is steady and its view is adjusted via
matrix rotations.

This patch adjusts the calculation for EMI and refactors the code to
do the calculation in the separate function Set::calculateSoundPosition.
That function will be used for implementing the positional sounds in
EMI.
2013-12-01 23:30:21 +01:00
Joel Teichroeb
03bfaf93f4 GRIM: Give LightType explicit values 2013-07-10 16:41:50 -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
Einar Johan Trøan Sømåen
fe3883cecd GRIM: Reformat code to be closer to convention. 2013-07-09 21:12:55 +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
Giulio Camuffo
1d5a5ede46 GRIM: Make the lights sorting stable. Fix #678 2013-01-14 22:32:27 +01:00
Giulio Camuffo
d8d701c6dd GRIM: Implement Lua_V1::NextSetup and Lua_V1::PreviousSetup. 2013-01-08 22:10:41 +01:00
Giulio Camuffo
81ba83caa0 GRIMDEMO: Fix ObjectState creation. Fix #29 2013-01-08 21:30:14 +01:00
Giulio Camuffo
3b496abcb6 GRIM: Find the sector with the exact name in MakeSectorActive(). 2012-12-28 18:50:53 +01:00
Paweł Kołodziejski
175620b62a ALL: change license headers from LGPL to GPL, and few updates 2012-12-19 23:15:43 +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
Joel Teichroeb
94aeca9663 GRIM: Remove tag from the pool template 2012-04-05 15:20:30 -07:00
Giulio Camuffo
0c68ad8a67 GRIM: Return the right sector in IsActorInSector(). Fix #538
There may be more than one sector that match the name wanted, so
we must push the one containing the actor position.
2012-02-19 16:08:01 +01:00
Giulio Camuffo
3344b3c756 GRIM: Setup the lights from the closest to the farthest to the actor position.
This way if OpenGL can't handle all the set lights it will use the most
important ones. Fix #481
2012-02-10 14:57:58 +01:00
Joel Teichroeb
7ff91c5817 GRIM: Various cleanups to code 2012-02-04 18:07:24 -08:00
Joel Teichroeb
cd4adf5ac1 GRIM: Created a function out of some duplicated code 2012-02-02 12:18:11 -08:00
Joel Teichroeb
a476452d6c GRIM: Move saving and loading code for Lights and Setups to their own functions 2012-01-19 14:19:36 -08:00
Paweł Kołodziejski
e350c7f777 renames 2012-01-06 23:29:45 +01:00
Andrea Corna
23bc633f3a GRIM: Make Set and Sector load from a stream instead of a data Block 2011-12-30 17:17:08 +01:00
Giulio Camuffo
a98c561668 GRIM: Do not create a new ObjectState if it exists already.
This way commit 075c1cae is practically reverted without reintroducing #296
and fixing #423. Fix #423
2011-11-19 19:31:32 +01:00
Giulio Camuffo
3193fec1e6 GRIM: Use a smart pointer to store objects that can be deleted behind our back. Fix #398 2011-10-29 15:13:39 +02:00
Giulio Camuffo
6a3dc3e9c8 GRIM: Turn off the lights of a set when changing it. 2011-10-18 18:01:52 +02:00
Giulio Camuffo
73684f1fbc GRIM: Rename Scene to Set, and scene.{h,cpp} to set.{h, cpp}. 2011-09-19 16:53:08 +02:00