Commit graph

1650 commits

Author SHA1 Message Date
Lwmte
c9a0f65251 Fix keyhole deadlock 2021-08-01 22:24:09 +03:00
Lwmte
054dafeeac Fix blending modes issue (#281)
Only for rooms and some objects but not for Lara or most effects
2021-08-01 15:54:54 +03:00
Lwmte
fce029ae69 Update shaders 2021-08-01 14:07:14 +03:00
Lwmte
95bd4f7466 Use refraction as before but accounting for vertex weight factor 2021-08-01 11:39:02 +03:00
Lwmte
20528997db Increase max refraction value 2021-07-31 19:11:02 +03:00
Lwmte
2966d5da02 Add refraction vertex attribute, separate attribs into separate normalized float values 2021-07-31 18:51:38 +03:00
hispidence
7216b7b0af Remove accidental scope specifier thingy. 2021-07-31 13:23:22 +01:00
hispidence
d31ecdf58e Change TitleType member initializer. 2021-07-31 12:50:52 +01:00
Lwmte
48a714b92b Fix #276 2021-07-31 07:32:01 +03:00
Lwmte
752cf5a35c Fix #266 2021-07-31 05:28:42 +03:00
Lwmte
755708cae8 Fix #268 2021-07-31 04:48:15 +03:00
Lwmte
f642a7fb93 Fix puzzle holes. NOTE: Commented a line which caused stack overflow, needs fixing 2021-07-31 04:40:28 +03:00
Lwmte
a620558375 Update spotcam.cpp 2021-07-31 04:07:41 +03:00
Lwmte
e81ca65849 Fix #286 2021-07-31 03:47:56 +03:00
Lwmte
633e0eadc3 Implement per-vertex effects for rooms and objects 2021-07-30 20:55:03 +03:00
Lwmte
e0b504ff00 Draw vertex colors for moveables too 2021-07-30 14:45:18 +03:00
hispidence
d61b38647b Compile fix; forgot to commit this last time. 2021-07-30 11:44:00 +01:00
hispidence
8b7928d83e Missed these in the last commit. 2021-07-28 19:06:15 +01:00
hispidence
5562667f98 Move GameScriptLevel, GameScriptAudioTrack, GameScriptInventoryObject, GameScriptSkyLayer, GameScriptSettings and GameScriptMirror into their own files. This could be changed later as this does create many small .h and .cpp files, but for now this cleans things up and makes it easier to check things class by class.
Treat functions as global that would previously be accessed through the GameFlow table. This does pollute the global environment in Lua a bit, but keeps it consistent with the functions in GameLogicScript, which are all accessed as globals.

Add some default member initialisers.

Remove WriteDefaults. Rename Intro to IntroImagePath and make it a std::string.

Add some documentation for the functions of GameFlowScript.

Fix some comments.
2021-07-28 18:44:24 +01:00
hispidence
4de85da46a Include GameScriptColor.h in GameFlowScript.h as it uses it. 2021-07-26 18:28:13 +01:00
hispidence
dba2f8ac91 Delete copy operations for GameScriptAIObject, GameScriptCameraInfo, GameScriptSinkInfo and GameScriptSoundSourceInfo - this can be changed later, but for now is a safety measure since we hold a reference, which means copying these would take some extra thought. 2021-07-26 18:25:50 +01:00
hispidence
e33e821cb8 Clean up GameFlow and GameScriptLevel by adding default member initialisers. Replace GameScriptFog with GameScriptColor. Rename some enums for consistency. Make TITLE_TYPE and enum for consistency. 2021-07-26 18:23:29 +01:00
hispidence
945082ce54 Change mesh loading to use emplace_back.
Change some remaining vector::back calls to use the already-existing references.
2021-07-24 19:14:23 +01:00
hispidence
daf46fed61 Clean up a load of warnings and possible errors:
Fix buffer from char*[255] to char[255]. This also allows us to avoid the C-style cast to char const *.

Remove original push_back call to g_Level.SoundSources which I left in by accident.

Use string constructor which takes pointer to first char and pointer to last char + 1. This removes the need to zero the memory (the calls were generating warnings about accessing buffer[256] when buffer is only 255 elements) and also gets rid of warning C6054 about string possibly not being zero-terminated.

Change calls to push_back and back with an emplace_back. Aside from being shorter and slightly more efficient, it gets rid of warning C26444 (about creating local variables with no name).
2021-07-24 19:08:17 +01:00
hispidence
520acc7180 Make the GAME_OBJECT_ID compound addition-assignment operator take references, as is the canonical implementation (and so we don't return a reference to a local, as cppcheck very correctly warned me about). 2021-07-24 14:10:16 +01:00
hispidence
9dd4bcf4ca Add SOUND_SOURCE_INFO and AI_OBJECT names when loading in the level data. Implement remaining functions on the GameLogicScript side. 2021-07-24 12:45:33 +01:00
hispidence
07d8a254b9 Fix comment. 2021-07-24 12:29:54 +01:00
hispidence
cf8723c448 Add GameScriptSoundSourceInfo and GameScriptAIObject, and associated functions. 2021-07-24 12:29:25 +01:00
hispidence
6720fb2318 Make color getters const. 2021-07-24 12:26:48 +01:00
hispidence
d9036969e0 Update Sol version as the old version wasn't compiling under C++latest. Define SOL_NO_CHECK_NUMBER_PRECISION to stop Sol throwing exceptions when we pass a float to an int parameter instead of just truncating (which we were doing with the previous version). 2021-07-23 22:06:32 +01:00
hispidence
0c4536f7a0 Make Write and WriteString take char const * args. 2021-07-23 22:00:18 +01:00
hispidence
70a51ed80b Rearrange the args to BASS calls so that we're not taking addresses of temporaries. 2021-07-23 21:59:34 +01:00
hispidence
8997ae0f09 Make uhmG.text a const char * now that GetValue returns one. 2021-07-23 21:58:55 +01:00
hispidence
7a94c3214d The explicit cast to void * made this line resolve to an assignment to an rvalue, but removing it fixes it. 2021-07-23 21:54:57 +01:00
hispidence
eb3b2316b5 Define some PHD_3DPOS vars before TriggerShockwave calls so that we don't take an address of a temporary. 2021-07-23 21:51:41 +01:00
hispidence
f6f3210159 Make more functions take reference-to-const args. 2021-07-23 21:50:29 +01:00
hispidence
9c90ecf338 Make functions take reference-to-const args. 2021-07-23 21:49:44 +01:00
hispidence
b0089ef059 Make GetString return a char const *.
Make Intro a char const *.
2021-07-23 21:48:49 +01:00
hispidence
6a04c3ba16 Define scale and translation vectors just before the Decompose call instead of in its arguments, since it takes them by non-const reference. 2021-07-23 21:48:06 +01:00
hispidence
4bc5e60fbc De-ambiguate a comparison operator and define PHD_3DPOS variables before TriggerShockWave calls, because taking an address of a temporary in this way is apparently not standard-compliant. 2021-07-23 21:46:38 +01:00
hispidence
16a5998abc Declare WarningsAsErrors so that files which end up indirectly including GameScriptNamedBase.h don't complain 2021-07-23 21:43:08 +01:00
hispidence
9bdd6d0058 Rearrange headers so generic_bridge.h sees g_Level. 2021-07-23 21:41:44 +01:00
hispidence
97d5d85f7a Add AddLuaNameSink, RemoveLuaNameSink, and GetSinkByName.
Make a template that all GetXByName member functions work off, to reduce copypasted functions.
For consistency, rename RemoveLuaName and AddLuaName to RemoveLuaNameItem and AddLuaNameItem.
Fix some documentation comments, order function documentation into sections.
2021-07-23 16:02:30 +01:00
hispidence
278a52c49a Add GameScriptSinkInfo/SinkInfo. 2021-07-23 15:59:13 +01:00
hispidence
5f64de39dd Change ReadRooms to push back the ROOM_INFO to g_Level.Rooms first, and then working on the reference. This means that the MESH_INFO reference that gets added to the mesh-name table correctly refers to the copy that sits in the vector of an element of g_Level.Rooms and not a local copy that goes out of scope before the end of the function. It also makes loading about 50ms faster. 2021-07-23 02:41:39 +01:00
hispidence
3635bfca8f Call AddLuaNameCamera when loading a level to add a reference to the camera to the name-camera map. 2021-07-23 02:12:12 +01:00
hispidence
c13106252f Add m_camerasMapName, AddLuaNameCamera, RemoveLuaNameCamera, GetCameraByName, and GetMeshByName. 2021-07-23 02:09:52 +01:00
hispidence
1be51d0f9f Add GameScriptCameraInfo.h and GameScriptCameraInfo.cpp. 2021-07-23 02:08:13 +01:00
hispidence
c0c4310bed Add __tostring metamethod to GameScriptPosition, GameScriptRotation and GameScriptColor.
Make their properties lowercase to keep them consistent with the properties of other classes.

Move documentation from GameScriptPosition.h to GameScriptPosition.cpp.
2021-07-23 02:06:50 +01:00
hispidence
38291e7b60 Add m_temporary to GameScriptMeshInfo, as well as a constructor and destructor.
Fix documentation.

Remove duplicated pos property.
2021-07-23 02:04:47 +01:00