Commit graph

1818 commits

Author SHA1 Message Date
hispidence
cdf27e54d2 No good reason not to load Lua's math library that I can think of. 2021-08-29 17:05:43 +01:00
hispidence
e834d38522 Fix GameScriptColor's D3DCOLOR operator and __tostring, and add a converting constructor. 2021-08-29 17:05:06 +01:00
hispidence
d946f4c118 Add more reserved script names. 2021-08-29 17:03:51 +01:00
hispidence
434b1f146e Change PrintString arg names to better reflect what it does. 2021-08-27 19:08:28 +01:00
hispidence
96441572bf Make default s_callbackRemoveName not throw. 2021-08-27 19:07:55 +01:00
hispidence
6bc5a561a0 Make variables an unordered_map for consistency and speed. 2021-08-27 19:04:03 +01:00
hispidence
aefe320bb0 Add OnStart, OnEnd and FreeLevelScript calls to DoTitle. 2021-08-27 19:03:23 +01:00
hispidence
77c4e709ac Add calls to SetCallbackDrawString and ProcessDisplayStrings. 2021-08-27 19:02:10 +01:00
hispidence
e63153cc88 Implement ShowString, HideString, and PrintString. 2021-08-27 18:56:35 +01:00
hispidence
04710bc1bd Update VS proj with new files. 2021-08-27 18:50:24 +01:00
hispidence
538fe191a8 Add GameScriptDisplayString.h and .cpp. 2021-08-27 18:49:59 +01:00
hispidence
6cf9120415 AddLuaName* -> AddName 2021-08-27 18:49:14 +01:00
hispidence
5a5ca519dc Replace Get*ByName with GetByName, AddLuaName* with AddName, and RemoveLuaName* with RemoveName. Replace m_*MapName with m_nameMap. Use a std::variant for the types that m_nameMap elements could be. Modify SetNameCallbacks params to be variadic. These do make it look more complex, but also make it more generic, and mean that specific parameters do not need to be repeated (which will make it easier if/when we change said parameters). 2021-08-27 18:21:37 +01:00
hispidence
b71555efa8 Add ReservedScriptNames.h. This holds some static const strings to be used as template arguments. 2021-08-27 18:11:59 +01:00
hispidence
b5fe8904c1 Add IdentifierType for named script types. This is in an effort to consolidate a lot of very similar functions into a few templates. 2021-08-27 18:10:19 +01:00
hispidence
f7cff1076e Add comment for prev commit. 2021-08-27 14:32:00 +01:00
hispidence
824a65e603 Make GameScriptColor able to convert to D3DCOLOR. 2021-08-27 14:30:41 +01:00
hispidence
578724a9c6 Set callbacks to nil and collect garbage when unloading level. 2021-08-27 12:46:01 +01:00
hispidence
770a791c0d Make ExecuteFunction print a better error message with the name of the function. 2021-08-23 22:07:18 +01:00
hispidence
d0b488a488 Replace a cout with a TENLog. 2021-08-23 22:06:36 +01:00
hispidence
cb1ad16b2d Remove more vestiges of old trigger system. Replace TO_LUA_SCRIPT with the enum that used to be there - TO_BODYBAG - so that the following enums still have their same values. 2021-08-23 22:05:58 +01:00
hispidence
f3354fa0ef Fix broken links in documentation. Add title and description. 2021-08-23 20:16:01 +01:00
hispidence
5f66005277 Remove j. 2021-08-23 19:22:31 +01:00
hispidence
c8377e4ab7 Add new compiled doc files. 2021-08-23 19:19:36 +01:00
hispidence
bc9e863307 Give documentation comments new tag names. Part 2 of making the documentation better. 2021-08-23 19:16:24 +01:00
hispidence
14361edad3 Add ldoc template and modify config file. Part 1 of making the documentation prettier and more sensibly-arranged. 2021-08-23 19:06:15 +01:00
MontyTRC89
4d6658ebef Cleaned last commit 2021-08-23 13:37:13 +02:00
MontyTRC89
dc7e1f683a Fixed the minus sign inside TestLaraPosition 2021-08-23 13:35:26 +02:00
MontyTRC89
26822afb3f Merge branch 'master' of https://github.com/MontyTRC89/TombEngine 2021-08-23 05:50:06 +02:00
MontyTRC89
0cdc6c90a2 Fixed drawing of little beetles 2021-08-23 05:49:47 +02:00
hispidence
bdbded2221 Rename ItemInfo functions newItem and newItemTemporary to new and newTemporary for consistency. 2021-08-23 02:07:17 +01:00
hispidence
99b730b06c Merge remote-tracking branch 'origin/master' 2021-08-23 02:03:20 +01:00
hispidence
9bf5c361e2 Clean up GameLogicScript.
Add some new member functions, ResetLevelTables and GetLevelFunc. The former is called in FreeLevelScripts, which is now called in control.cpp.

Remove AddTrigger, as the LevelFuncs table takes care of triggers.
2021-08-23 02:02:47 +01:00
MontyTRC89
9474284c87 Refactoring ID_LITTLE_BEETLES 2021-08-22 06:08:02 +02:00
MontyTRC89
517ba6b88a Fixed ID_SKELETON 2021-08-22 05:48:14 +02:00
Lwmte
0f5ca8e55e Use lasersight overlay in lasersight mode 2021-08-21 04:13:42 +03:00
hispidence
369e4c7562 Add and fix documentation. 2021-08-21 00:29:54 +01:00
hispidence
afdec32c1f Fix GetFrameNumber, SetFrameNumber, GetAnimNumber and SetAnimNumber. 2021-08-21 00:25:15 +01:00
hispidence
a75b43b7c5 Implement ScriptAssertF and ScriptAssertTerminateF.
These are like ScriptAssert, but make use of the fmt library (atm hijacking the version that comes with spdlog). This allows us to pass in a format string and some args, and then only create the format string if there's an actual error. This means we won't waste time doing a ton of std::string concatenations if the assert succeeds.

As these are variadic templates, we can't use a std::optional as the last argument to check if we're forcing a different error mode (we possibly could by assuming the last arg is a std::optional, but that seems unclean), so instead I've just separated them out into two functions.
2021-08-21 00:23:14 +01:00
hispidence
f83add0f4c Float->short to fix a warning. 2021-08-21 00:16:22 +01:00
hispidence
6c3f2d1673 Update SetScriptErrorMode call. 2021-08-21 00:15:56 +01:00
hispidence
8d84ee6f3f Rename SetErrorMode to SetScriptErrorMode to avoid VS getting confused by some MS function with the same name. Add GetScriptErrorMode. 2021-08-21 00:13:44 +01:00
hispidence
2981c75827 Set project to C++17, which apparently is what it should be. 2021-08-21 00:11:34 +01:00
MontyTRC89
3bc685dc3b Fixed missile control routine; Improved ID_CROCODILE_GOD; 2021-08-20 16:03:53 +02:00
MontyTRC89
7093a8df24 Refactored energy bubbles function names; Removed LanguageScript.cpp from the project; Working on ID_CROCODILE_GOD; 2021-08-20 06:00:34 +02:00
MontyTRC89
eebb8dfbba Merge branch 'master' of https://github.com/MontyTRC89/TombEngine 2021-08-20 05:26:07 +02:00
MontyTRC89
0ed8181cda Merge branch 'master' of https://github.com/MontyTRC89/TombEngine; Renamed namespaces;
# Conflicts:
#	TR5Main/TR5Main.vcxproj.user
2021-08-20 05:25:51 +02:00
hispidence
a20cad7ed6 Remove obsolete class. 2021-08-20 03:01:32 +01:00
hispidence
1d052a73e1 Remove comments; these are technically no longer unused as they're linked up with Lua variables. 2021-08-20 02:43:56 +01:00
hispidence
10419d15a8 Fixed some GameFlowScript.cpp warnings:
Remove SkyVelocity1 and SkyVelocity2 - they weren't being used.
Change a loop var to a size_t.
Make GameScriptInventoryObject.yOffset a short.
2021-08-20 02:42:47 +01:00