Merge branch 'MontyTRC89:develop' into develop

This commit is contained in:
davidmarr 2024-12-29 12:48:24 +01:00 committed by GitHub
commit 676762e115
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
88 changed files with 418 additions and 263 deletions

View file

@ -3,17 +3,26 @@
The dates are in European standard format where date is presented as **YYYY-MM-DD**.
TombEngine releases are located in this repository (alongside with Tomb Editor): https://github.com/TombEngine/TombEditorReleases
## Version 1.8 - xxxx-xx-xx
## Version 1.7.1 - xxxx-xx-xx
### Bug fixes
* Fixed static meshes with dynamic light mode not accepting room lights.
* Fixed silent crashes if no Visual C++ runtimes are installed, and provide a dialog box to download them instead.
* Fixed issues with launching the engine from directories with non-Western characters in the path.
* Fixed rare case of not being able to start a new game or exit game from the main menu on very slow GPUs.
* Fixed occasional crashes with creatures stuck in a sector with no pathfinding set.
* Fixed antialiasing quality not changing after changing it in display settings.
* Fixed endless explosion effect for Puna.
* Fixed diary pick-up item inventory state not preserved in the savegame.
### New Features
* Added realtime shader reloading in debug mode by pressing F9 key.
* Added load, save, stopwatch and compass as a functional pick-up items with ability to add or remove them from inventory.
* Increased particle limit from 1024 to 4096.
### Lua API changes
* Fixed Flow.FreezeMode.FULL drawing incorrect background.
* Fixed DisplayString scale argument not being optional, as stated in documentation.
## [Version 1.7](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.7.3) - 2024-12-25

View file

@ -12,7 +12,7 @@ new_type("luautil", "5 Lua utility modules", true)
not_luadoc = true
local version = "1.7"
local version = "1.7.1"
project = " TombEngine"
title = "TombEngine " .. version .. " Lua API"
description = "TombEngine " .. version .. " scripting interface"

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
@ -854,7 +854,7 @@ FLARE_ITEM
FLARE_INV_ITEM
COMPASS_ITEM
DIARY_ITEM
TIMEX_ITEM
STOPWATCH_ITEM
MEMCARD_LOAD_INV_ITEM
MEMCARD_SAVE_INV_ITEM
PC_LOAD_INV_ITEM
@ -1325,9 +1325,7 @@ FLARE_ITEM
FLARE_INV_ITEM
COMPASS_ITEM
DIARY_ITEM
TIMEX_ITEM
MEMCARD_LOAD_INV_ITEM
MEMCARD_SAVE_INV_ITEM
STOPWATCH_ITEM
PC_LOAD_INV_ITEM
PC_SAVE_INV_ITEM
</code></pre>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

View file

@ -3,7 +3,7 @@
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7 Lua API</title>
<title>TombEngine 1.7.1 Lua API</title>
<link rel="stylesheet" href="ldoc.css" type="text/css" />
</head>
<body>
@ -107,7 +107,7 @@
<div id="content">
<h2>TombEngine 1.7 scripting interface</h2>
<h2>TombEngine 1.7.1 scripting interface</h2>
<p>Welcome to the TombEngine scripting API. This is a work in progress and some information might be wrong or outdated. Please also note that this is primarily a reference document, not a tutorial, so expect descriptions to be fairly sparse.</p>
<p>At the time of writing, there is a tutorial describing the basics of Lua, as well as a number of example scripts, on <a href="https://www.tombengine.com">the TombEngine website</a>.</p>

View file

@ -58,12 +58,12 @@ namespace TEN::Gui
{ ID_SMALLMEDI_ITEM, 0, 0.7f, EulerAngles(ANGLE(112.0f), ANGLE(180.0f), 0), OPT_USE, STRING_SMALL_MEDIPACK, NO_JOINT_BITS, INV_ROT_Y },
{ ID_BINOCULARS_ITEM, -1, 0.5f, EulerAngles(ANGLE(10.0f), ANGLE(180.0f), 0), OPT_USE, STRING_BINOCULARS, NO_JOINT_BITS, INV_ROT_Y },
{ ID_FLARE_INV_ITEM, 52, 0.8f, EulerAngles::Identity, OPT_USE, STRING_FLARES, NO_JOINT_BITS, INV_ROT_Y },
{ ID_TIMEX_ITEM, 2, 0.4f, EulerAngles::Identity, OPT_STATS, STRING_STATISTICS, NO_JOINT_BITS, INV_ROT_Y },
{ ID_STOPWATCH_ITEM, 2, 0.4f, EulerAngles::Identity, OPT_STATS, STRING_STATISTICS, NO_JOINT_BITS, INV_ROT_Y },
{ ID_PC_LOAD_INV_ITEM, 52, 0.3f, EulerAngles(0, ANGLE(180.0f), 0), OPT_LOAD, STRING_LOAD_GAME, NO_JOINT_BITS, INV_ROT_Y },
{ ID_PC_SAVE_INV_ITEM, 52, 0.3f, EulerAngles(0, ANGLE(180.0f), 0), OPT_SAVE, STRING_SAVE_GAME, NO_JOINT_BITS, INV_ROT_Y },
{ ID_BURNING_TORCH_ITEM, 14, 0.5f, EulerAngles(ANGLE(90.0f), 0, 0), OPT_USE, STRING_TORCH, NO_JOINT_BITS, INV_ROT_Y },
{ ID_CROWBAR_ITEM, 4, 0.5f, EulerAngles(ANGLE(90.0f), 0, 0), OPT_USE, STRING_CROWBAR, NO_JOINT_BITS, INV_ROT_Y },
{ ID_DIARY_ITEM, 0, 0.3f, EulerAngles(0, ANGLE(180.0f), 0), OPT_DIARY, STRING_DIARY, NO_JOINT_BITS, INV_ROT_Y },
{ ID_DIARY_ITEM, 0, 0.3f, EulerAngles(0, ANGLE(180.0f), 0), OPT_USE, STRING_DIARY, NO_JOINT_BITS, INV_ROT_Y },
{ ID_COMPASS_ITEM, -14, 0.5f, EulerAngles(ANGLE(90.0f), ANGLE(180.0f), 0), 0, STRING_LOAD_GAME, NO_JOINT_BITS, INV_ROT_Y },
{ ID_CLOCKWORK_BEETLE, 14, 0.5f, EulerAngles::Identity, OPT_USE, STRING_MECHANICAL_SCARAB, NO_JOINT_BITS, INV_ROT_Y },
{ ID_CLOCKWORK_BEETLE_COMBO1, 18, 0.5f, EulerAngles::Identity, OPT_COMBINABLE, STRING_MECHANICAL_SCARAB_1, NO_JOINT_BITS, INV_ROT_Y },

View file

@ -50,7 +50,7 @@ namespace TEN::Gui
INV_OBJECT_SMALL_MEDIPACK,
INV_OBJECT_BINOCULARS,
INV_OBJECT_FLARES,
INV_OBJECT_TIMEX,
INV_OBJECT_STOPWATCH,
INV_OBJECT_LOAD_FLOPPY,
INV_OBJECT_SAVE_FLOPPY,
INV_OBJECT_BURNING_TORCH,
@ -271,8 +271,7 @@ namespace TEN::Gui
OPT_CHOOSE_AMMO_HK = (1 << 14),
OPT_STATS = (1 << 15),
OPT_CHOOSE_AMMO_HARPOON = (1 << 16),
OPT_CHOOSE_AMMO_ROCKET = (1 << 17),
OPT_DIARY = (1 << 18)
OPT_CHOOSE_AMMO_ROCKET = (1 << 17)
};
enum RotationFlags

View file

@ -321,6 +321,18 @@ void InitializeLaraDefaultInventory(ItemInfo& item)
if (Objects[ID_BINOCULARS_ITEM].loaded)
player.Inventory.HasBinoculars = true;
if (Objects[ID_STOPWATCH_ITEM].loaded)
player.Inventory.HasStopwatch = true;
if (Objects[ID_PC_LOAD_INV_ITEM].loaded)
player.Inventory.HasLoad = true;
if (Objects[ID_PC_SAVE_INV_ITEM].loaded)
player.Inventory.HasSave = true;
if (Objects[ID_COMPASS_ITEM].loaded)
player.Inventory.HasCompass = true;
player.Inventory.BeetleLife = DEFAULT_BEETLE_LIFE;
auto weaponType = LaraWeaponType::None;

View file

@ -1146,29 +1146,6 @@ struct TorchData
TorchState State = TorchState::Holding;
};
// TODO: Troye's abandoned dairy feature.
constexpr int MAX_DIARY_PAGES = 64;
constexpr int MAX_DIARY_STRINGS_PER_PAGE = 8;
struct DiaryString
{
Vector2i Position = Vector2i::Zero;
int StringID = 0;
};
struct DiaryPage
{
DiaryString Strings[MAX_DIARY_STRINGS_PER_PAGE] = {};
};
struct DiaryInfo
{
bool Present = false;
DiaryPage Pages[MAX_DIARY_PAGES] = {};
unsigned int NumPages = 0;
unsigned int CurrentPage = 0;
};
struct LaraCountData
{
unsigned int Pose = 0;
@ -1302,8 +1279,6 @@ struct PlayerInventoryData
bool IsBusy = false;
bool OldBusy = false;
DiaryInfo Diary = {};
byte BeetleLife;
int BeetleComponents; // BeetleComponentFlags enum
byte SmallWaterskin; // 1 = has waterskin, 2 = has waterskin with 1 liter, etc. max value is 4 (has skin + 3 = 4)
@ -1315,6 +1290,11 @@ struct PlayerInventoryData
int TotalFlares;
unsigned int TotalSecrets;
bool HasLoad = false;
bool HasSave = false;
bool HasStopwatch = false;
bool HasCompass = false;
bool HasDiary = false;
bool HasBinoculars = false;
bool HasCrowbar = false;
bool HasTorch = false;

View file

@ -307,16 +307,20 @@ bool CreaturePathfind(ItemInfo* item, Vector3i prevPos, short angle, short tilt)
item->Pose.Position.z = prevPos.z | WALL_MASK;
floor = GetFloor(item->Pose.Position.x, y, item->Pose.Position.z, &roomNumber);
height = g_Level.PathfindingBoxes[floor->PathfindingBoxID].height;
if (!Objects[item->ObjectNumber].nonLot)
if (floor->PathfindingBoxID != NO_VALUE)
{
nextBox = LOT->Node[floor->PathfindingBoxID].exitBox;
}
else
{
floor = GetFloor(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z, &roomNumber);
height = g_Level.PathfindingBoxes[floor->PathfindingBoxID].height;
nextBox = floor->PathfindingBoxID;
if (!Objects[item->ObjectNumber].nonLot)
{
nextBox = LOT->Node[floor->PathfindingBoxID].exitBox;
}
else
{
floor = GetFloor(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z, &roomNumber);
height = g_Level.PathfindingBoxes[floor->PathfindingBoxID].height;
nextBox = floor->PathfindingBoxID;
}
}
if (nextBox == NO_VALUE)
@ -798,7 +802,7 @@ void CreatureHealth(ItemInfo* item)
}
}
void CreatureDie(int itemNumber, bool doExplosion)
void CreatureDie(int itemNumber, bool doExplosion, bool forceExplosion)
{
int flags = 0;
if (doExplosion)
@ -817,6 +821,11 @@ void CreatureDie(int itemNumber, bool doExplosion)
break;
case HitEffect::NonExplosive:
if (forceExplosion)
{
flags |= BODY_DO_EXPLOSION;
break;
}
return;
default:

View file

@ -103,7 +103,7 @@ void CreatureFloat(short itemNumber);
void CreatureJoint(ItemInfo* item, short joint, short required, short maxAngle = ANGLE(70.0f));
void CreatureTilt(ItemInfo* item, short angle);
short CreatureTurn(ItemInfo* item, short maxTurn);
void CreatureDie(int itemNumber, bool doExplosion);
void CreatureDie(int itemNumber, bool doExplosion, bool forceExplosion = false);
void CreatureDie(int itemNumber, bool doExplosion, int flags);
bool BadFloor(int x, int y, int z, int boxHeight, int nextHeight, short roomNumber, LOTInfo* LOT);
int CreatureCreature(short itemNumber);

View file

@ -273,7 +273,7 @@ GameStatus FreezePhase()
if (g_GameFlow->LastFreezeMode == FreezeMode::None)
{
// Capture the screen for drawing it as a background.
if (g_GameFlow->LastFreezeMode == FreezeMode::Full)
if (g_GameFlow->CurrentFreezeMode == FreezeMode::Full)
g_Renderer.DumpGameScene(SceneRenderMode::NoHud);
StopRumble();
@ -751,13 +751,13 @@ GameStatus HandleMenuCalls(bool isTitle)
bool doInventory = (IsClicked(In::Inventory) || g_Gui.GetEnterInventory() != NO_VALUE) && playerAlive;
// Handle inventory.
if (doSave && g_GameFlow->IsLoadSaveEnabled() && g_Gui.GetInventoryMode() != InventoryMode::Save)
if (doSave && g_GameFlow->IsLoadSaveEnabled() && Lara.Inventory.HasSave && g_Gui.GetInventoryMode() != InventoryMode::Save)
{
SaveGame::LoadHeaders();
g_Gui.SetInventoryMode(InventoryMode::Save);
g_Gui.CallInventory(LaraItem, false);
}
else if (doLoad && g_GameFlow->IsLoadSaveEnabled() && g_Gui.GetInventoryMode() != InventoryMode::Load)
else if (doLoad && g_GameFlow->IsLoadSaveEnabled() && Lara.Inventory.HasLoad && g_Gui.GetInventoryMode() != InventoryMode::Load)
{
SaveGame::LoadHeaders();
g_Gui.SetInventoryMode(InventoryMode::Load);

View file

@ -19,7 +19,7 @@ constexpr auto MAX_NODE = 23;
constexpr auto MAX_DYNAMICS = 64;
constexpr auto MAX_SPLASHES = 8;
constexpr auto MAX_PARTICLES = 1024;
constexpr auto MAX_PARTICLES = 4096;
constexpr auto MAX_PARTICLE_DYNAMICS = 8;
extern int Wibble;

View file

@ -65,7 +65,6 @@ namespace TEN::Gui
STRING_VIEW,
STRING_CHOOSE_WEAPON,
""
// STRING_READ_DIARY
};
std::vector<std::string> GeneralActionStrings =
@ -713,12 +712,10 @@ namespace TEN::Gui
}
else
{
// Just for updating blink time
g_Renderer.PrepareScene();
g_Renderer.PrepareScene(); // Just for updating blink time.
UpdateInputActions(item);
}
UpdateInputActions(item);
if (CurrentSettings.IgnoreInput)
{
if (NoAction())
@ -1694,7 +1691,8 @@ namespace TEN::Gui
if (player.Inventory.TotalFlares)
InsertObjectIntoList(INV_OBJECT_FLARES);
InsertObjectIntoList(INV_OBJECT_TIMEX);//every level has the timex? what's a good way to check?!
if (player.Inventory.HasStopwatch)
InsertObjectIntoList(INV_OBJECT_STOPWATCH);
if (player.Inventory.TotalSmallMedipacks)
InsertObjectIntoList(INV_OBJECT_SMALL_MEDIPACK);
@ -1771,13 +1769,15 @@ namespace TEN::Gui
InsertObjectIntoList(INV_OBJECT_EXAMINE1_COMBO1 + i);
}
if (player.Inventory.Diary.Present)
if (player.Inventory.HasDiary)
InsertObjectIntoList(INV_OBJECT_DIARY);
if (g_GameFlow->IsLoadSaveEnabled())
{
InsertObjectIntoList(INV_OBJECT_LOAD_FLOPPY);
InsertObjectIntoList(INV_OBJECT_SAVE_FLOPPY);
if (player.Inventory.HasLoad)
InsertObjectIntoList(INV_OBJECT_LOAD_FLOPPY);
if (player.Inventory.HasSave)
InsertObjectIntoList(INV_OBJECT_SAVE_FLOPPY);
}
Rings[(int)RingTypes::Inventory].ObjectListMovement = 0;
@ -2440,13 +2440,6 @@ namespace TEN::Gui
CurrentOptions[n].Text = g_GameFlow->GetString(OptionStrings[3].c_str());
n++;
}
if (options & OPT_DIARY)
{
CurrentOptions[n].Type = MenuType::Diary;
CurrentOptions[n].Text = g_GameFlow->GetString(OptionStrings[11].c_str());
n++;
}
}
else
{
@ -2577,11 +2570,6 @@ namespace TEN::Gui
MenuActive = false;
ItemUsed = true;
break;
case MenuType::Diary:
SetInventoryMode(InventoryMode::Diary);
player.Inventory.Diary.CurrentPage = 1;
break;
}
}
@ -3320,10 +3308,6 @@ namespace TEN::Gui
DoExamineMode();
break;
case InventoryMode::Diary:
DoDiary(item);
break;
case InventoryMode::Load:
switch (DoLoad())
{
@ -3434,6 +3418,9 @@ namespace TEN::Gui
void GuiController::DrawCompass(ItemInfo* item)
{
if (!Lara.Inventory.HasCompass)
return;
constexpr auto POS_2D = Vector2(130.0f, 450.0f);
constexpr auto LERP_ALPHA = 0.1f;
@ -3448,33 +3435,6 @@ namespace TEN::Gui
g_Renderer.DrawObjectIn2DSpace(ID_COMPASS_ITEM, POS_2D, EulerAngles::Identity, invObject.Scale1 * 1.5f);
}
void GuiController::DoDiary(ItemInfo* item)
{
auto& player = GetLaraInfo(*item);
SetInventoryMode(InventoryMode::Diary);
if (GuiIsPulsed(In::Right) &&
player.Inventory.Diary.CurrentPage < player.Inventory.Diary.NumPages)
{
player.Inventory.Diary.CurrentPage++;
SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);
}
if (GuiIsPulsed(In::Left) &&
player.Inventory.Diary.CurrentPage > 1)
{
player.Inventory.Diary.CurrentPage--;
SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);
}
if (GuiIsDeselected())
{
SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always);
SetInventoryMode(InventoryMode::None);
}
}
int GuiController::GetLoadSaveSelection()
{
return SelectedSaveSlot;

View file

@ -20,7 +20,6 @@ namespace TEN::Gui
Pause,
Statistics,
Examine,
Diary,
Load,
Save
};
@ -59,8 +58,7 @@ namespace TEN::Gui
Load,
Save,
Examine,
Statistics,
Diary
Statistics
};
enum class RingTypes
@ -230,7 +228,6 @@ namespace TEN::Gui
void UpdateWeaponStatus(ItemInfo* item);
void DoStatisticsMode();
void DoExamineMode();
void DoDiary(ItemInfo* item);
LoadResult DoLoad();
bool DoSave();
void DoInventory(ItemInfo* item);

View file

@ -78,7 +78,23 @@ bool TryModifyMiscCount(LaraInfo & lara, GAME_OBJECT_ID objectID, std::optional<
break;
case ID_DIARY_ITEM:
lara.Inventory.Diary.Present = add;
lara.Inventory.HasDiary = add;
break;
case ID_PC_LOAD_INV_ITEM:
lara.Inventory.HasLoad = add;
break;
case ID_PC_SAVE_INV_ITEM:
lara.Inventory.HasSave = add;
break;
case ID_STOPWATCH_ITEM:
lara.Inventory.HasStopwatch = add;
break;
case ID_COMPASS_ITEM:
lara.Inventory.HasCompass = add;
break;
case ID_WATERSKIN1_EMPTY:
@ -173,7 +189,19 @@ std::optional<bool> HasMiscItem(LaraInfo& lara, GAME_OBJECT_ID objectID)
return lara.Inventory.HasCrowbar;
case ID_DIARY_ITEM:
return lara.Inventory.Diary.Present;
return lara.Inventory.HasDiary;
case ID_PC_LOAD_INV_ITEM:
return lara.Inventory.HasLoad;
case ID_PC_SAVE_INV_ITEM:
return lara.Inventory.HasSave;
case ID_STOPWATCH_ITEM:
return lara.Inventory.HasStopwatch;
case ID_COMPASS_ITEM:
return lara.Inventory.HasCompass;
case ID_WATERSKIN1_EMPTY:
return lara.Inventory.SmallWaterskin == 1;

View file

@ -396,6 +396,11 @@ const std::vector<byte> SaveGame::Build()
inventory.add_examines_combo(examinesComboOffset);
inventory.add_beetle_components(Lara.Inventory.BeetleComponents);
inventory.add_has_binoculars(Lara.Inventory.HasBinoculars);
inventory.add_has_diary(Lara.Inventory.HasDiary);
inventory.add_has_load(Lara.Inventory.HasLoad);
inventory.add_has_save(Lara.Inventory.HasSave);
inventory.add_has_compass(Lara.Inventory.HasCompass);
inventory.add_has_stopwatch(Lara.Inventory.HasStopwatch);
inventory.add_has_crowbar(Lara.Inventory.HasCrowbar);
inventory.add_has_lasersight(Lara.Inventory.HasLasersight);
inventory.add_has_silencer(Lara.Inventory.HasSilencer);
@ -1996,6 +2001,11 @@ static void ParsePlayer(const Save::SaveGame* s)
Lara.Inventory.BeetleLife = s->lara()->inventory()->beetle_life();
Lara.Inventory.BigWaterskin = s->lara()->inventory()->big_waterskin();
Lara.Inventory.HasBinoculars = s->lara()->inventory()->has_binoculars();
Lara.Inventory.HasDiary = s->lara()->inventory()->has_diary();
Lara.Inventory.HasLoad = s->lara()->inventory()->has_load();
Lara.Inventory.HasSave = s->lara()->inventory()->has_save();
Lara.Inventory.HasStopwatch = s->lara()->inventory()->has_stopwatch();
Lara.Inventory.HasCompass = s->lara()->inventory()->has_compass();
Lara.Inventory.HasCrowbar = s->lara()->inventory()->has_crowbar();
Lara.Inventory.HasLasersight = s->lara()->inventory()->has_lasersight();
Lara.Inventory.HasSilencer = s->lara()->inventory()->has_silencer();

View file

@ -268,9 +268,9 @@ namespace TEN::Effects::Boss
if (counter >= countUntilDeath)
{
CreatureDie(itemNumber, allowExplosion);
if (!allowExplosion)
if (allowExplosion)
CreatureDie(itemNumber, allowExplosion, true);
else
KillItem(itemNumber);
}
}

View file

@ -325,28 +325,28 @@ namespace TEN::Entities::Creatures::TR3
creature.MaxTurn = 0;
}
auto deathCount = item.GetFlagField((int)BossItemFlags::DeathCount);
item.Pose.Orientation.z = (Random::GenerateInt() % deathCount) - (item.ItemFlags[(int)BossItemFlags::DeathCount] >> 1);
if (deathCount < 2048)
item.ItemFlags[(int)BossItemFlags::DeathCount] += 32;
int frameEnd = GetAnimData(object, PUNA_ANIM_DEATH).frameEnd;
if (item.Animation.FrameNumber >= frameEnd)
{
// Avoid having the object stop working.
item.Animation.FrameNumber = frameEnd;
item.MeshBits.ClearAll();
if (item.GetFlagField((int)BossItemFlags::ExplodeCount) < PUNA_EXPLOSION_NUM_MAX)
item.ItemFlags[(int)BossItemFlags::ExplodeCount]++;
if (item.ItemFlags[7] < PUNA_EXPLOSION_NUM_MAX)
item.ItemFlags[7]++;
// Do explosion effect.
ExplodeBoss(itemNumber, item, PUNA_EXPLOSION_NUM_MAX, PUNA_EFFECT_COLOR, PUNA_EXPLOSION_MAIN_COLOR, PUNA_EXPLOSION_SECOND_COLOR);
return;
}
else
{
auto deathCount = item.GetFlagField((int)BossItemFlags::DeathCount);
item.Pose.Orientation.z = (Random::GenerateInt() % deathCount) - (item.ItemFlags[(int)BossItemFlags::DeathCount] >> 1);
if (deathCount < 2048)
item.ItemFlags[(int)BossItemFlags::DeathCount] += 32;
}
}
else
{

View file

@ -1042,6 +1042,10 @@ static void StartPickup(ObjectInfo *obj)
InitPickup(obj, ID_WATERSKIN2_EMPTY);
InitPickup(obj, ID_GOLDROSE_ITEM);
InitPickup(obj, ID_DIARY_ITEM);
InitPickup(obj, ID_PC_LOAD_INV_ITEM);
InitPickup(obj, ID_PC_SAVE_INV_ITEM);
InitPickup(obj, ID_STOPWATCH_ITEM);
InitPickup(obj, ID_COMPASS_ITEM);
}
void InitializeTR5Objects()

View file

@ -730,7 +730,7 @@ enum GAME_OBJECT_ID : short
ID_FLARE_INV_ITEM,
ID_COMPASS_ITEM,
ID_DIARY_ITEM,
ID_TIMEX_ITEM,
ID_STOPWATCH_ITEM,
ID_MEMCARD_LOAD_INV_ITEM,
ID_MEMCARD_SAVE_INV_ITEM,
ID_PC_LOAD_INV_ITEM,

View file

@ -444,7 +444,6 @@ namespace TEN::Renderer
void DrawLocusts(RenderView& view, RendererPass rendererPass);
void DrawStatistics();
void DrawExamines();
void DrawDiary();
void DrawDebris(RenderView& view, RendererPass rendererPass);
void DrawFullScreenImage(ID3D11ShaderResourceView* texture, float fade, ID3D11RenderTargetView* target,
ID3D11DepthStencilView* depthTarget);

View file

@ -955,29 +955,6 @@ namespace TEN::Renderer
object.Scale1 = savedScale;
}
void Renderer::DrawDiary()
{
constexpr auto SCREEN_POS = Vector2(400.0f, 300.0f);
const auto& object = InventoryObjectTable[INV_OBJECT_OPEN_DIARY];
unsigned int currentPage = Lara.Inventory.Diary.CurrentPage;
DrawObjectIn2DSpace(g_Gui.ConvertInventoryItemToObject(INV_OBJECT_OPEN_DIARY), SCREEN_POS, object.Orientation, object.Scale1);
for (int i = 0; i < MAX_DIARY_STRINGS_PER_PAGE; i++)
{
if (!Lara.Inventory.Diary.Pages[Lara.Inventory.Diary.CurrentPage].Strings[i].Position.x && !Lara.Inventory.Diary.Pages[Lara.Inventory.Diary.CurrentPage].
Strings[i].Position.y && !Lara.Inventory.Diary.Pages[Lara.Inventory.Diary.CurrentPage].Strings[i].StringID)
{
break;
}
//AddString(Lara.Diary.Pages[currentPage].Strings[i].x, Lara.Diary.Pages[currentPage].Strings[i].y, g_GameFlow->GetString(Lara.Diary.Pages[currentPage].Strings[i].stringID), PRINTSTRING_COLOR_WHITE, 0);
}
DrawAllStrings();
}
void Renderer::RenderInventoryScene(RenderTarget2D* renderTarget, TextureBase* background, float backgroundFade)
{
// Set basic render states
@ -1070,10 +1047,6 @@ namespace TEN::Renderer
case InventoryMode::Pause:
RenderPauseMenu(g_Gui.GetMenuToDisplay());
break;
case InventoryMode::Diary:
DrawDiary();
break;
}
}

View file

@ -131,14 +131,25 @@ namespace TEN::Renderer::Utils
// Reset compile counter.
_compileCounter = 0;
// LoadAAShaders should always be the first in the list, so that when AA settings are changed,
// they recompile with the same index as before.
LoadAAShaders(width, height, recompileAAShaders);
LoadCommonShaders();
LoadPostprocessShaders();
LoadAAShaders(width, height, recompileAAShaders);
}
void ShaderManager::Bind(Shader shader, bool forceNull)
{
const auto& shaderObj = _shaders[(int)shader];
int shaderIndex = (int)shader;
if (shaderIndex >= _shaders.size())
{
TENLog("Attempt to access nonexistent shader with index " + std::to_string(shaderIndex), LogLevel::Error);
return;
}
const auto& shaderObj = _shaders[shaderIndex];
if (shaderObj.Vertex.Shader != nullptr || forceNull)
_context->VSSetShader(shaderObj.Vertex.Shader.Get(), nullptr, 0);

View file

@ -729,7 +729,7 @@ The following constants are inside ObjID.
FLARE_INV_ITEM
COMPASS_ITEM
DIARY_ITEM
TIMEX_ITEM
STOPWATCH_ITEM
MEMCARD_LOAD_INV_ITEM
MEMCARD_SAVE_INV_ITEM
PC_LOAD_INV_ITEM
@ -1188,9 +1188,7 @@ The following ObjID members refer to pickups.
FLARE_INV_ITEM
COMPASS_ITEM
DIARY_ITEM
TIMEX_ITEM
MEMCARD_LOAD_INV_ITEM
MEMCARD_SAVE_INV_ITEM
STOPWATCH_ITEM
PC_LOAD_INV_ITEM
PC_SAVE_INV_ITEM
Table of constants.
@ -1910,7 +1908,7 @@ static const std::unordered_map<std::string, GAME_OBJECT_ID> kObjIDs {
{ "FLARE_INV_ITEM", ID_FLARE_INV_ITEM },
{ "COMPASS_ITEM", ID_COMPASS_ITEM },
{ "DIARY_ITEM", ID_DIARY_ITEM },
{ "TIMEX_ITEM", ID_TIMEX_ITEM },
{ "STOPWATCH_ITEM", ID_STOPWATCH_ITEM },
{ "MEMCARD_LOAD_INV_ITEM", ID_MEMCARD_LOAD_INV_ITEM },
{ "MEMCARD_SAVE_INV_ITEM", ID_MEMCARD_SAVE_INV_ITEM },
{ "PC_LOAD_INV_ITEM", ID_PC_LOAD_INV_ITEM },

View file

@ -104,10 +104,10 @@ sol::object DisplayStringWrapper(const std::string& key, sol::object unkArg0, so
TypeOrNil<bool> isTranslated, TypeOrNil<sol::table> flags, sol::this_state state)
{
// Regular constructor.
if (unkArg0.is<Vec2>() && unkArg1.is<float>())
if (unkArg0.is<Vec2>() && (unkArg1.is<float>() || unkArg1 == sol::nil))
{
auto pos = (Vec2)unkArg0.as<Vec2>();
float scale = unkArg1.as<float>();
float scale = unkArg1 == sol::nil ? 1.0f : unkArg1.as<float>();
auto displayString = CreateString(key, pos, scale, color, isTranslated, flags, state);
return sol::make_object(state, displayString.release());

View file

@ -709,11 +709,16 @@ namespace TEN::Input
void UpdateInputActions(ItemInfo* item, bool applyQueue)
{
ClearInputData();
UpdateRumble();
ReadKeyboard();
ReadMouse();
ReadGameController();
// Don't update input data during frameskip.
if (!g_Synchronizer.Locked())
{
ClearInputData();
UpdateRumble();
ReadKeyboard();
ReadMouse();
ReadGameController();
}
DefaultConflict();
// Update action map.

View file

@ -43,6 +43,13 @@ void HighFramerateSynchronizer::Sync()
_lastTime = _currentTime;
_controlDelay += _frameTime;
}
_locked = true;
}
bool HighFramerateSynchronizer::Locked()
{
return _locked;
}
bool HighFramerateSynchronizer::Synced()
@ -56,6 +63,13 @@ bool HighFramerateSynchronizer::Synced()
}
#endif
// If frameskip is in action, lock flag will remain set until synchronizer is
// about to break out from it. This flag is later reused in input polling to
// prevent engine from de-registering input events prematurely.
if (_controlDelay > CONTROL_FRAME_TIME && _controlDelay <= CONTROL_FRAME_TIME * 2)
_locked = false;
return (_controlDelay >= CONTROL_FRAME_TIME);
}

View file

@ -15,12 +15,14 @@ private:
LARGE_INTEGER _frequency;
double _controlDelay = 0.0;
double _frameTime = 0.0;
bool _locked = false;
public:
void Init();
void Sync();
void Step();
bool Synced();
bool Locked();
float GetInterpolationFactor();
};

View file

@ -2290,6 +2290,11 @@ struct LaraInventoryDataT : public flatbuffers::NativeTable {
int32_t small_waterskin = 0;
int32_t big_waterskin = 0;
bool has_binoculars = false;
bool has_compass = false;
bool has_stopwatch = false;
bool has_diary = false;
bool has_load = false;
bool has_save = false;
bool has_crowbar = false;
bool has_torch = false;
bool has_lasersight = false;
@ -2320,22 +2325,27 @@ struct LaraInventoryData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
VT_SMALL_WATERSKIN = 12,
VT_BIG_WATERSKIN = 14,
VT_HAS_BINOCULARS = 16,
VT_HAS_CROWBAR = 18,
VT_HAS_TORCH = 20,
VT_HAS_LASERSIGHT = 22,
VT_HAS_SILENCER = 24,
VT_TOTAL_SMALL_MEDIPACKS = 26,
VT_TOTAL_LARGE_MEDIPACKS = 28,
VT_TOTAL_FLARES = 30,
VT_TOTAL_SECRETS = 32,
VT_PUZZLES = 34,
VT_KEYS = 36,
VT_PICKUPS = 38,
VT_EXAMINES = 40,
VT_PUZZLES_COMBO = 42,
VT_KEYS_COMBO = 44,
VT_PICKUPS_COMBO = 46,
VT_EXAMINES_COMBO = 48
VT_HAS_COMPASS = 18,
VT_HAS_STOPWATCH = 20,
VT_HAS_DIARY = 22,
VT_HAS_LOAD = 24,
VT_HAS_SAVE = 26,
VT_HAS_CROWBAR = 28,
VT_HAS_TORCH = 30,
VT_HAS_LASERSIGHT = 32,
VT_HAS_SILENCER = 34,
VT_TOTAL_SMALL_MEDIPACKS = 36,
VT_TOTAL_LARGE_MEDIPACKS = 38,
VT_TOTAL_FLARES = 40,
VT_TOTAL_SECRETS = 42,
VT_PUZZLES = 44,
VT_KEYS = 46,
VT_PICKUPS = 48,
VT_EXAMINES = 50,
VT_PUZZLES_COMBO = 52,
VT_KEYS_COMBO = 54,
VT_PICKUPS_COMBO = 56,
VT_EXAMINES_COMBO = 58
};
bool is_busy() const {
return GetField<uint8_t>(VT_IS_BUSY, 0) != 0;
@ -2358,6 +2368,21 @@ struct LaraInventoryData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool has_binoculars() const {
return GetField<uint8_t>(VT_HAS_BINOCULARS, 0) != 0;
}
bool has_compass() const {
return GetField<uint8_t>(VT_HAS_COMPASS, 0) != 0;
}
bool has_stopwatch() const {
return GetField<uint8_t>(VT_HAS_STOPWATCH, 0) != 0;
}
bool has_diary() const {
return GetField<uint8_t>(VT_HAS_DIARY, 0) != 0;
}
bool has_load() const {
return GetField<uint8_t>(VT_HAS_LOAD, 0) != 0;
}
bool has_save() const {
return GetField<uint8_t>(VT_HAS_SAVE, 0) != 0;
}
bool has_crowbar() const {
return GetField<uint8_t>(VT_HAS_CROWBAR, 0) != 0;
}
@ -2415,6 +2440,11 @@ struct LaraInventoryData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
VerifyField<int32_t>(verifier, VT_SMALL_WATERSKIN) &&
VerifyField<int32_t>(verifier, VT_BIG_WATERSKIN) &&
VerifyField<uint8_t>(verifier, VT_HAS_BINOCULARS) &&
VerifyField<uint8_t>(verifier, VT_HAS_COMPASS) &&
VerifyField<uint8_t>(verifier, VT_HAS_STOPWATCH) &&
VerifyField<uint8_t>(verifier, VT_HAS_DIARY) &&
VerifyField<uint8_t>(verifier, VT_HAS_LOAD) &&
VerifyField<uint8_t>(verifier, VT_HAS_SAVE) &&
VerifyField<uint8_t>(verifier, VT_HAS_CROWBAR) &&
VerifyField<uint8_t>(verifier, VT_HAS_TORCH) &&
VerifyField<uint8_t>(verifier, VT_HAS_LASERSIGHT) &&
@ -2471,6 +2501,21 @@ struct LaraInventoryDataBuilder {
void add_has_binoculars(bool has_binoculars) {
fbb_.AddElement<uint8_t>(LaraInventoryData::VT_HAS_BINOCULARS, static_cast<uint8_t>(has_binoculars), 0);
}
void add_has_compass(bool has_compass) {
fbb_.AddElement<uint8_t>(LaraInventoryData::VT_HAS_COMPASS, static_cast<uint8_t>(has_compass), 0);
}
void add_has_stopwatch(bool has_stopwatch) {
fbb_.AddElement<uint8_t>(LaraInventoryData::VT_HAS_STOPWATCH, static_cast<uint8_t>(has_stopwatch), 0);
}
void add_has_diary(bool has_diary) {
fbb_.AddElement<uint8_t>(LaraInventoryData::VT_HAS_DIARY, static_cast<uint8_t>(has_diary), 0);
}
void add_has_load(bool has_load) {
fbb_.AddElement<uint8_t>(LaraInventoryData::VT_HAS_LOAD, static_cast<uint8_t>(has_load), 0);
}
void add_has_save(bool has_save) {
fbb_.AddElement<uint8_t>(LaraInventoryData::VT_HAS_SAVE, static_cast<uint8_t>(has_save), 0);
}
void add_has_crowbar(bool has_crowbar) {
fbb_.AddElement<uint8_t>(LaraInventoryData::VT_HAS_CROWBAR, static_cast<uint8_t>(has_crowbar), 0);
}
@ -2539,6 +2584,11 @@ inline flatbuffers::Offset<LaraInventoryData> CreateLaraInventoryData(
int32_t small_waterskin = 0,
int32_t big_waterskin = 0,
bool has_binoculars = false,
bool has_compass = false,
bool has_stopwatch = false,
bool has_diary = false,
bool has_load = false,
bool has_save = false,
bool has_crowbar = false,
bool has_torch = false,
bool has_lasersight = false,
@ -2576,6 +2626,11 @@ inline flatbuffers::Offset<LaraInventoryData> CreateLaraInventoryData(
builder_.add_has_lasersight(has_lasersight);
builder_.add_has_torch(has_torch);
builder_.add_has_crowbar(has_crowbar);
builder_.add_has_save(has_save);
builder_.add_has_load(has_load);
builder_.add_has_diary(has_diary);
builder_.add_has_stopwatch(has_stopwatch);
builder_.add_has_compass(has_compass);
builder_.add_has_binoculars(has_binoculars);
builder_.add_old_busy(old_busy);
builder_.add_is_busy(is_busy);
@ -2596,6 +2651,11 @@ inline flatbuffers::Offset<LaraInventoryData> CreateLaraInventoryDataDirect(
int32_t small_waterskin = 0,
int32_t big_waterskin = 0,
bool has_binoculars = false,
bool has_compass = false,
bool has_stopwatch = false,
bool has_diary = false,
bool has_load = false,
bool has_save = false,
bool has_crowbar = false,
bool has_torch = false,
bool has_lasersight = false,
@ -2629,6 +2689,11 @@ inline flatbuffers::Offset<LaraInventoryData> CreateLaraInventoryDataDirect(
small_waterskin,
big_waterskin,
has_binoculars,
has_compass,
has_stopwatch,
has_diary,
has_load,
has_save,
has_crowbar,
has_torch,
has_lasersight,
@ -8839,6 +8904,11 @@ inline void LaraInventoryData::UnPackTo(LaraInventoryDataT *_o, const flatbuffer
{ auto _e = small_waterskin(); _o->small_waterskin = _e; }
{ auto _e = big_waterskin(); _o->big_waterskin = _e; }
{ auto _e = has_binoculars(); _o->has_binoculars = _e; }
{ auto _e = has_compass(); _o->has_compass = _e; }
{ auto _e = has_stopwatch(); _o->has_stopwatch = _e; }
{ auto _e = has_diary(); _o->has_diary = _e; }
{ auto _e = has_load(); _o->has_load = _e; }
{ auto _e = has_save(); _o->has_save = _e; }
{ auto _e = has_crowbar(); _o->has_crowbar = _e; }
{ auto _e = has_torch(); _o->has_torch = _e; }
{ auto _e = has_lasersight(); _o->has_lasersight = _e; }
@ -8872,6 +8942,11 @@ inline flatbuffers::Offset<LaraInventoryData> CreateLaraInventoryData(flatbuffer
auto _small_waterskin = _o->small_waterskin;
auto _big_waterskin = _o->big_waterskin;
auto _has_binoculars = _o->has_binoculars;
auto _has_compass = _o->has_compass;
auto _has_stopwatch = _o->has_stopwatch;
auto _has_diary = _o->has_diary;
auto _has_load = _o->has_load;
auto _has_save = _o->has_save;
auto _has_crowbar = _o->has_crowbar;
auto _has_torch = _o->has_torch;
auto _has_lasersight = _o->has_lasersight;
@ -8897,6 +8972,11 @@ inline flatbuffers::Offset<LaraInventoryData> CreateLaraInventoryData(flatbuffer
_small_waterskin,
_big_waterskin,
_has_binoculars,
_has_compass,
_has_stopwatch,
_has_diary,
_has_load,
_has_save,
_has_crowbar,
_has_torch,
_has_lasersight,

View file

@ -143,6 +143,11 @@ table LaraInventoryData {
small_waterskin: int32;
big_waterskin: int32;
has_binoculars: bool;
has_compass: bool;
has_stopwatch: bool;
has_diary: bool;
has_load: bool;
has_save: bool;
has_crowbar: bool;
has_torch: bool;
has_lasersight: bool;

View file

@ -205,44 +205,46 @@ namespace TEN::Utils
((1.0f - ndc.y) * DISPLAY_SPACE_RES.y) / 2);
}
std::vector<unsigned short> GetProductOrFileVersion(bool productVersion)
{
char fileName[UCHAR_MAX] = {};
std::vector<unsigned short> GetProductOrFileVersion(bool productVersion)
{
wchar_t fileName[UCHAR_MAX] = {};
if (!GetModuleFileNameA(nullptr, fileName, UCHAR_MAX))
if (!GetModuleFileNameW(nullptr, fileName, UCHAR_MAX))
{
TENLog("Can't get current assembly filename", LogLevel::Error);
return {};
}
int size = GetFileVersionInfoSizeA(fileName, NULL);
DWORD dummy;
DWORD size = GetFileVersionInfoSizeW(fileName, &dummy);
if (size == 0)
{
TENLog("GetFileVersionInfoSizeA failed", LogLevel::Error);
TENLog("GetFileVersionInfoSizeW failed", LogLevel::Error);
return {};
}
std::unique_ptr<unsigned char> buffer(new unsigned char[size]);
std::unique_ptr<unsigned char[]> buffer(new unsigned char[size]);
// Load version info.
if (!GetFileVersionInfoA(fileName, 0, size, buffer.get()))
if (!GetFileVersionInfoW(fileName, 0, size, buffer.get()))
{
TENLog("GetFileVersionInfoA failed", LogLevel::Error);
TENLog("GetFileVersionInfoW failed", LogLevel::Error);
return {};
}
VS_FIXEDFILEINFO* info;
unsigned int infoSize;
if (!VerQueryValueA(buffer.get(), "\\", (void**)&info, &infoSize))
if (!VerQueryValueW(buffer.get(), L"\\", (void**)&info, &infoSize))
{
TENLog("VerQueryValueA failed", LogLevel::Error);
TENLog("VerQueryValueW failed", LogLevel::Error);
return {};
}
if (infoSize != sizeof(VS_FIXEDFILEINFO))
{
TENLog("VerQueryValueA returned wrong size for VS_FIXEDFILEINFO", LogLevel::Error);
TENLog("VerQueryValueW returned wrong size for VS_FIXEDFILEINFO", LogLevel::Error);
return {};
}

View file

@ -49,6 +49,53 @@ bool ArgEquals(wchar_t* incomingArg, std::string name)
return (lowerArg == "-" + name) || (lowerArg == "/" + name);
}
bool IsRedistInstalled()
{
const char* redistKey =
#ifdef _WIN64
R"(SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64)";
#else
R"(SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86)";
#endif
HKEY hKey;
LSTATUS result = RegOpenKeyExA(HKEY_LOCAL_MACHINE, redistKey, 0, KEY_READ, &hKey);
if (result == ERROR_SUCCESS)
{
RegCloseKey(hKey);
HMODULE hModule = LoadLibraryW(L"vcruntime140.dll");
if (hModule != NULL)
{
FreeLibrary(hModule);
return true;
}
}
const char* redistUrl =
#ifdef _WIN64
R"(https://aka.ms/vs/17/release/vc_redist.x64.exe)";
#else
R"(https://aka.ms/vs/17/release/vc_redist.x86.exe)";
#endif
const char* message = "TombEngine requires Visual C++ Redistributable to be installed. Would you like to download it now?";
int msgBoxResult = MessageBoxA(NULL, message, "Missing libraries", MB_ICONWARNING | MB_OKCANCEL);
if (msgBoxResult == IDOK)
{
HINSTANCE hResult = ShellExecuteA(NULL, "open", redistUrl, NULL, NULL, SW_SHOWNORMAL);
if ((intptr_t)hResult <= 32)
{
MessageBoxA(NULL, (LPCSTR)("Failed to start browser to download runtimes. Error code: " +
std::to_string((long)(intptr_t)hResult)).c_str(), "Error", MB_ICONERROR | MB_OK);
}
}
return false;
}
Vector2i GetScreenResolution()
{
RECT desktop;
@ -298,6 +345,12 @@ int main()
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
if (!IsRedistInstalled())
{
WinClose();
exit(EXIT_SUCCESS);
}
// Process command line arguments.
bool setup = false;
std::string levelFile = {};
@ -347,19 +400,26 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// Initialize logging.
InitTENLog(gameDir);
auto windowName = std::string("Starting TombEngine");
// Indicate version.
auto ver = GetProductOrFileVersion(false);
auto windowName = (std::string("Starting TombEngine version ") +
std::to_string(ver[0]) + "." +
std::to_string(ver[1]) + "." +
std::to_string(ver[2]) + "." +
std::to_string(ver[3]) + " " +
if (ver.size() == 4)
{
windowName = windowName + " version " +
std::to_string(ver[0]) + "." +
std::to_string(ver[1]) + "." +
std::to_string(ver[2]) + "." +
std::to_string(ver[3]);
}
#ifdef _WIN64
"(64-bit)"
windowName = windowName + " (64-bit)";
#else
"(32-bit)"
windowName = windowName + " (32-bit)";
#endif
);
TENLog(windowName, LogLevel::Info);
// Initialize savegame and scripting systems.
@ -532,14 +592,14 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
while (DoTheGame);
TENLog("Cleaning up and exiting...", LogLevel::Info);
WinClose();
exit(EXIT_SUCCESS);
}
void WinClose()
{
TENLog("Cleaning up and exiting...", LogLevel::Info);
WaitForSingleObject((HANDLE)ThreadHandle, 5000);
DestroyAcceleratorTable(hAccTable);

View file

@ -2,15 +2,15 @@
#define TE_MAJOR_VERSION 1
#define TE_MINOR_VERSION 7
#define TE_BUILD_NUMBER 3
#define TE_BUILD_NUMBER 4
#define TE_REVISION_NUMBER 0
#define TEN_MAJOR_VERSION 1
#define TEN_MINOR_VERSION 7
#define TEN_BUILD_NUMBER 0
#define TEN_BUILD_NUMBER 1
#define TEN_REVISION_NUMBER 0
#define TEST_BUILD 0
#define TEST_BUILD 1
#define TOSTR(x) #x
#define MAKE_VERSION_STRING(major, minor, build, revision) TOSTR(major) "." TOSTR(minor) "." TOSTR(build) "." TOSTR(revision)