Merge branch 'develop' into voncroy_reworked

This commit is contained in:
TokyoSU 2024-10-27 10:04:26 +01:00
commit 356b31a372
213 changed files with 6250 additions and 2509 deletions

View file

@ -1,5 +1,5 @@
name: Bug report
description: Create a report to help us improve
description: Create a report to help us understand and diagnose your issue. Your contribution is welcomed and valued!
title: "[ bug Report ]"
labels: Awaiting Triage
@ -16,10 +16,8 @@ body:
description: |
Please select the TombEngine Version from the dropdown list.
options:
- v1.5 (development build)
- v1.4
- v1.3
- v1.2
- v1.1
validations:
required: true
@ -29,10 +27,9 @@ body:
description: |
Please select the Tomb Editor version used from the dropdown list.
options:
- v1.7.2 (development version)
- v1.7.1
- v1.7.0
- v1.6.9
- v1.6.8
validations:
required: true
@ -68,18 +65,6 @@ body:
validations:
required: true
- type: textarea
attributes:
label: Screenshots
description: |
Please check this box if you have provided screenshots or any other media for this issue
**note** If you do not provide screenshots or anything else, it may be hard for devs to investigate
provide a link to your screenshot here or simply drag and drop your screenshot into this textbox
placeholder: |
A description of any additional content here.
validations:
required: true
- type: textarea
attributes:
label: Additional Content

View file

@ -1,18 +1,17 @@
# Changelog
Here you will find the full changelog of TEN's releases from Version 1.0 and up
The dates are in European standard format where date is presented as **YYYY-MM-DD**
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.5 - xxxx-xx-xx
### Bug fixes
* Fixed original issue with classic switch off trigger incorrectly activating some trigger actions.
* Fixed moveable status after antitriggering.
* Fixed leveljump vehicle transfer.
* Fixed weapons not properly hitting enemies.
* Fixed falling through dynamic bridges that move upwards.
* Fixed laserhead teleporting Lara and making her invisible on death.
* Fixed sarcophagus pick-ups.
* Fixed issue with Lara not rotating together with bridges while picking up items.
@ -40,32 +39,31 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
### Features/Amendments
* Added variable framerate , that allows the engine to run at an unlocked framerate for a much smoother experience. Setting can be toggled on or off in the graphical settings menu.
* Added high framerate mode (also known as 60 FPS mode).
* Added a customisable global lensflare effect. https://tombengine.com/docs/level-settings/#lensflare
* Added a customisable starry sky and meteor effect (based on TR5). https://tombengine.com/docs/level-settings/#stars
* Added the ability to display "Lara's Home" entry in the main menu.
* Added the ability to change pickup item count by modifying item hit points.
* Added F12 as alternative to PrtSc for screenshots.
* Added option to enable or disable menu option looping.
- Menu scrolling using held inputs will stop at the last option until a new input is made.
* Added TR3 seal mutant. https://tombengine.com/docs/ocb-and-setup-instructions/#sealmutant
* Added TR3 Seal Mutant. https://tombengine.com/docs/ocb-and-setup-instructions/#sealmutant
- You must use this version: https://github.com/TombEngine/Resources/raw/main/Wad2%20Objects/Enemies/TEN_Seal_Mutant.wad2
* Add new sound conditions: Quicksand and Underwater.
* Added new sound conditions: Quicksand and Underwater.
- Quicksand - sound effect plays when a moveable is in quicksand.
- Underwater - sound plays when the camera is submerged.
* Added TR4 Enemy_Jeep https://tombengine.com/docs/ocb-and-setup-instructions/#enemy_jeep
* Changed Rome Hammer to not hurt player whilst deactivated.
* Changed Statue with blade damage, from 20 to 200.
* Changed sound effect that is triggered when using the `level.rumble` feature in a level. Sound effect now part of the default soundmap (ID 359) and additional hardcoded pitch shift has been removed.
* Changed hardcoded sound for RAISING_BLOCKS back to the soundID used in TRLE (ID 149)
* Changed Water sound condition to ShallowWater.
* Enhanced Rolling Spindle detection to avoid them going down through pits.
* Enhanced Sentry Guns, with a new ItemFlags[3], to contain the ID of the inventory item that deactivates the sentry guns ( by default PUZZLE_ITEM5 )
* Enhanced Dart Emitter, with a new ItemFlags[0], to contain the number of frames between shots ( by default 32 in dart emitter, and 24 in homing-dart emitter ).
* Enhanced raptor behaviour and handling. https://tombengine.com/docs/ocb-and-setup-instructions/#raptor
* Added TR4 Enemy Jeep. https://tombengine.com/docs/ocb-and-setup-instructions/#enemy_jeep
* Changed TR5 Rome Hammer to not hurt player whilst deactivated.
* Changed TR2 Statue with blade damage from 20 to 200.
* Changed sound effect that is triggered when using the `level.rumble` feature in a level (ID 359 in the soundmap).
* Changed hardcoded sound for Raising Block 1/2 back to the ID used in TRLE (ID 149).
* Enhanced TR2 Rolling Spindle detection to avoid them going down through pits.
* Enhanced Sentry Guns, with a new ItemFlags[3], to contain the ID of the inventory item that deactivates the sentry guns (Puzzle Item 5 by default).
* Enhanced Dart Emitter, with a new ItemFlags[0], to contain the number of frames between shots (by default 32 in Dart Emitter, and 24 in Homing-Dart Emitter).
* Enhanced Raptor behaviour and handling. https://tombengine.com/docs/ocb-and-setup-instructions/#raptor
- You must use this version: https://github.com/TombEngine/Resources/raw/main/Wad2%20Objects/Enemies/TEN_Raptor.wad2
* The limit of 32 active Flame Emitters has been removed.
* Removed original limit of 32 active Flame Emitters.
### Lua API changes
* Added Flow.EnableHomeLevel() function.
* Added Flow.IsStringPresent() function.
* Added Flow.LensFlare() and Flow.Starfield() classes.
@ -78,7 +76,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
## [Version 1.4](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.7.1) - 2024-04-21
### Bug Fixes
### Bug fixes
* Fixed drawing of display sprites in title level.
* Fixed drawing of smoke sprites and various other sprites.
* Fixed drawing of transparent surfaces when debris are present in scene.
@ -121,7 +119,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
## [Version 1.3](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.7) - 2024-01-06
### Bug Fixes
### Bug fixes
* Fixed crash if title logo is removed from Textures folder.
* Fixed crash if unknown player state ID is encountered.
* Fixed bug with OCB 2 on pushables, and some other pushable bugs.
@ -177,7 +175,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
## [Version 1.2](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.6.9) - 2023-11-11
### Bug Fixes
### Bug fixes
* Fix burning torch not working properly if there are more than 256 objects in a level.
* Fix grenade and rocket projectiles smoke offset in certain directions.
* Fix projectiles flying through animating objects.
@ -254,7 +252,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
## [Version 1.1.0](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.6.8) - 2023-07-29
### Bug Fixes
### Bug fixes
* Fix enemies shooting Lara through static meshes and moveables.
* Fix skeletons and mummies not being affected by explosive weapons.
* Fix crash on loading if static meshes with IDs above maximum are present.
@ -465,7 +463,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
## [Version 1.0.6](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.6.4) - 2023-01-29
### Bug FIxes
### Bug fixes
* Fix major pathfinding bug which could have caused lots of issues with enemy behaviour.
* Fix potential random crashes due to incorrect rendering behaviour.
* Fix savegame crash for disabled enemies with partially set activation mask.

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <here>Flow.Animations</here></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <here>Flow.Fog</here></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <here>Flow.InventoryItem</here></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -0,0 +1,397 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.4 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>TombEngine</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>1 Modules</h2>
<ul class="nowrap">
<li> <a href="../1 modules/Effects.html">Effects</a></li>
<li> <a href="../1 modules/Flow.html">Flow</a></li>
<li> <a href="../1 modules/Input.html">Input</a></li>
<li> <a href="../1 modules/Inventory.html">Inventory</a></li>
<li> <a href="../1 modules/Logic.html">Logic</a></li>
<li> <a href="../1 modules/Objects.html">Objects</a></li>
<li> <a href="../1 modules/Sound.html">Sound</a></li>
<li> <a href="../1 modules/Strings.html">Strings</a></li>
<li> <a href="../1 modules/Util.html">Util</a></li>
<li> <a href="../1 modules/View.html">View</a></li>
</ul>
<h2>2 Classes</h2>
<ul class="nowrap">
<li> <a href="../2 classes/View.DisplaySprite.html">View.DisplaySprite</a></li>
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <here>Flow.LensFlare</here></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
<li> <a href="../2 classes/Objects.Moveable.html">Objects.Moveable</a></li>
<li> <a href="../2 classes/Objects.Room.html">Objects.Room</a></li>
<li> <a href="../2 classes/Objects.Sink.html">Objects.Sink</a></li>
<li> <a href="../2 classes/Objects.SoundSource.html">Objects.SoundSource</a></li>
<li> <a href="../2 classes/Objects.Static.html">Objects.Static</a></li>
<li> <a href="../2 classes/Objects.Volume.html">Objects.Volume</a></li>
<li> <a href="../2 classes/Strings.DisplayString.html">Strings.DisplayString</a></li>
</ul>
<h2>3 Primitive Classes</h2>
<ul class="nowrap">
<li> <a href="../3 primitive classes/Color.html">Color</a></li>
<li> <a href="../3 primitive classes/Rotation.html">Rotation</a></li>
<li> <a href="../3 primitive classes/Vec2.html">Vec2</a></li>
<li> <a href="../3 primitive classes/Vec3.html">Vec3</a></li>
</ul>
<h2>4 Enums</h2>
<ul class="nowrap">
<li> <a href="../4 enums/Effects.BlendID.html">Effects.BlendID</a></li>
<li> <a href="../4 enums/Effects.EffectID.html">Effects.EffectID</a></li>
<li> <a href="../4 enums/Flow.GameStatus.html">Flow.GameStatus</a></li>
<li> <a href="../4 enums/Input.ActionID.html">Input.ActionID</a></li>
<li> <a href="../4 enums/Objects.AmmoType.html">Objects.AmmoType</a></li>
<li> <a href="../4 enums/Objects.MoveableStatus.html">Objects.MoveableStatus</a></li>
<li> <a href="../4 enums/Objects.ObjID.html">Objects.ObjID</a></li>
<li> <a href="../4 enums/Objects.RoomFlagID.html">Objects.RoomFlagID</a></li>
<li> <a href="../4 enums/Objects.RoomReverb.html">Objects.RoomReverb</a></li>
<li> <a href="../4 enums/Sound.SoundTrackType.html">Sound.SoundTrackType</a></li>
<li> <a href="../4 enums/Util.LogLevel.html">Util.LogLevel</a></li>
<li> <a href="../4 enums/View.AlignMode.html">View.AlignMode</a></li>
<li> <a href="../4 enums/View.CameraType.html">View.CameraType</a></li>
<li> <a href="../4 enums/View.PostProcessMode.html">View.PostProcessMode</a></li>
<li> <a href="../4 enums/View.ScaleMode.html">View.ScaleMode</a></li>
</ul>
<h2>5 Lua utility modules</h2>
<ul class="nowrap">
<li> <a href="../5 lua utility modules/EventSequence.html">EventSequence</a></li>
<li> <a href="../5 lua utility modules/Timer.html">Timer</a></li>
</ul>
</div>
<div id="content">
<h1>Class <code>Flow.LensFlare</code></h1>
<p>Represents a lens flare.</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" ><a href="#LensFlare">LensFlare(Pitch, Yaw, Color.)</a></td>
<td class="summary">Create a LensFlare object.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:GetEnabled">LensFlare:GetEnabled()</a></td>
<td class="summary">Get the lens flare's enabled status.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:GetSunSpriteID">LensFlare:GetSunSpriteID()</a></td>
<td class="summary">Get the sun's sprite ID.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:GetPitch">LensFlare:GetPitch()</a></td>
<td class="summary">Get the lens flare's pitch angle in degrees.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:GetYaw">LensFlare:GetYaw()</a></td>
<td class="summary">Get the lens flare's yaw angle in degrees.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:SetColor">LensFlare:SetColor()</a></td>
<td class="summary">Get the lens flare's color.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:SetSunSpriteID">LensFlare:SetSunSpriteID(New)</a></td>
<td class="summary">Set the lens flare's sun sprite ID.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:SetPitch">LensFlare:SetPitch(New)</a></td>
<td class="summary">Set the lens flare's pitch angle.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:SetYaw">LensFlare:SetYaw(New)</a></td>
<td class="summary">Set the lens flare's yaw angle.</td>
</tr>
<tr>
<td class="name" ><a href="#LensFlare:SetColor">LensFlare:SetColor(New)</a></td>
<td class="summary">Set the lens flare's color.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "LensFlare"></a>
<strong>LensFlare(Pitch, Yaw, Color.)</strong>
</dt>
<dd>
Create a LensFlare object. ()
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Pitch</span>
<span class="types"><span class="type">float</span></span>
angle in degrees.
</li>
<li><span class="parameter">Yaw</span>
<span class="types"><span class="type">float</span></span>
angle in degrees.
</li>
<li><span class="parameter">Color.</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../2 classes/Flow.LensFlare.html#LensFlare">LensFlare</a></span>
A new LensFlare object.
</ol>
</dd>
<dt>
<a name = "LensFlare:GetEnabled"></a>
<strong>LensFlare:GetEnabled()</strong>
</dt>
<dd>
Get the lens flare's enabled status. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Lens flare's enabled status.
</ol>
</dd>
<dt>
<a name = "LensFlare:GetSunSpriteID"></a>
<strong>LensFlare:GetSunSpriteID()</strong>
</dt>
<dd>
Get the sun's sprite ID. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
Sprite ID.
</ol>
</dd>
<dt>
<a name = "LensFlare:GetPitch"></a>
<strong>LensFlare:GetPitch()</strong>
</dt>
<dd>
Get the lens flare's pitch angle in degrees. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">float</span></span>
Pitch angle in degrees.
</ol>
</dd>
<dt>
<a name = "LensFlare:GetYaw"></a>
<strong>LensFlare:GetYaw()</strong>
</dt>
<dd>
Get the lens flare's yaw angle in degrees. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">float</span></span>
Yaw angle in degrees.
</ol>
</dd>
<dt>
<a name = "LensFlare:SetColor"></a>
<strong>LensFlare:SetColor()</strong>
</dt>
<dd>
Get the lens flare's color. ()
</dd>
<dt>
<a name = "LensFlare:SetSunSpriteID"></a>
<strong>LensFlare:SetSunSpriteID(New)</strong>
</dt>
<dd>
Set the lens flare's sun sprite ID. ()
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">New</span>
<span class="types"><span class="type">int</span></span>
sprite ID.
</li>
</ul>
</dd>
<dt>
<a name = "LensFlare:SetPitch"></a>
<strong>LensFlare:SetPitch(New)</strong>
</dt>
<dd>
Set the lens flare's pitch angle. (float)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">New</span>
<span class="types"><span class="type">float</span></span>
pitch angle in degrees.
</li>
</ul>
</dd>
<dt>
<a name = "LensFlare:SetYaw"></a>
<strong>LensFlare:SetYaw(New)</strong>
</dt>
<dd>
Set the lens flare's yaw angle. (float)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">New</span>
<span class="types"><span class="type">float</span></span>
yaw angle in degrees.
</li>
</ul>
</dd>
<dt>
<a name = "LensFlare:SetColor"></a>
<strong>LensFlare:SetColor(New)</strong>
</dt>
<dd>
Set the lens flare's color. (Color)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">New</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
color.
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="https://github.com/hispidence/TEN-LDoc">TEN-LDoc</a> (a fork of <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a>)</i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <here>Flow.Level</here></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
@ -106,10 +108,6 @@
<h2><a href="#Members">Members</a></h2>
<table class="function_list">
<tr>
<td class="name" ><a href="#nameKey">nameKey</a></td>
<td class="summary">(string) string key for the level's (localised) name.</td>
</tr>
<tr>
<td class="name" ><a href="#scriptFile">scriptFile</a></td>
<td class="summary">(string) Level-specific Lua script file.</td>
@ -135,6 +133,14 @@
<td class="summary">(<a href="../2 classes/Flow.SkyLayer.html#">Flow.SkyLayer</a>) Secondary sky layer</td>
</tr>
<tr>
<td class="name" ><a href="#starfield">starfield</a></td>
<td class="summary">(<a href="../2 classes/Flow.Starfield.html#">Flow.Starfield</a>) Starfield.</td>
</tr>
<tr>
<td class="name" ><a href="#lensFlare">lensFlare</a></td>
<td class="summary">(<a href="../2 classes/Flow.LensFlare.html#">Flow.LensFlare</a>) Global lens flare .</td>
</tr>
<tr>
<td class="name" ><a href="#fog">fog</a></td>
<td class="summary">(<a href="../2 classes/Flow.Fog.html#">Flow.Fog</a>) omni fog RGB color and distance.</td>
</tr>
@ -198,22 +204,6 @@
<h2 class="section-header "><a name="Members"></a>Members</h2>
<dl class="function">
<dt>
<a name = "nameKey"></a>
<strong>nameKey</strong>
</dt>
<dd>
(string) string key for the level's (localised) name.
Corresponds to an entry in strings.lua.
</dd>
<dt>
<a name = "scriptFile"></a>
<strong>scriptFile</strong>
@ -307,6 +297,36 @@
</dd>
<dt>
<a name = "starfield"></a>
<strong>starfield</strong>
</dt>
<dd>
(<a href="../2 classes/Flow.Starfield.html#">Flow.Starfield</a>) Starfield.
</dd>
<dt>
<a name = "lensFlare"></a>
<strong>lensFlare</strong>
</dt>
<dd>
(<a href="../2 classes/Flow.LensFlare.html#">Flow.LensFlare</a>) Global lens flare .
</dd>
<dt>
<a name = "fog"></a>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <here>Flow.Mirror</here></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <here>Flow.Settings</here></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <here>Flow.SkyLayer</here></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
@ -154,13 +156,14 @@
<dd>
(int) cloud speed. </p>
<p>Values can be between [-32768, 32767], with positive numbers resulting in a sky that scrolls from
west to east, and negative numbers resulting in one that travels east to west.</p>
<p>Please note that speeds outside of the range of about [-1000, 1000] will cause the
sky to scroll so fast that it will no longer appear as a coherent stream of clouds.
Less is more. City of The Dead, for example, uses a speed value of 16.
<pre><code> Values can be between [-32768, 32767], with positive numbers resulting in a sky that scrolls from
west to east, and negative numbers resulting in one that travels east to west.
Please note that speeds outside of the range of about [-1000, 1000] will cause the
sky to scroll so fast that it will no longer appear as a coherent stream of clouds.
Less is more. City of The Dead, for example, uses a speed value of 16.
</code></pre>
<p>

View file

@ -0,0 +1,454 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.4 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>TombEngine</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>1 Modules</h2>
<ul class="nowrap">
<li> <a href="../1 modules/Effects.html">Effects</a></li>
<li> <a href="../1 modules/Flow.html">Flow</a></li>
<li> <a href="../1 modules/Input.html">Input</a></li>
<li> <a href="../1 modules/Inventory.html">Inventory</a></li>
<li> <a href="../1 modules/Logic.html">Logic</a></li>
<li> <a href="../1 modules/Objects.html">Objects</a></li>
<li> <a href="../1 modules/Sound.html">Sound</a></li>
<li> <a href="../1 modules/Strings.html">Strings</a></li>
<li> <a href="../1 modules/Util.html">Util</a></li>
<li> <a href="../1 modules/View.html">View</a></li>
</ul>
<h2>2 Classes</h2>
<ul class="nowrap">
<li> <a href="../2 classes/View.DisplaySprite.html">View.DisplaySprite</a></li>
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <here>Flow.Starfield</here></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
<li> <a href="../2 classes/Objects.Moveable.html">Objects.Moveable</a></li>
<li> <a href="../2 classes/Objects.Room.html">Objects.Room</a></li>
<li> <a href="../2 classes/Objects.Sink.html">Objects.Sink</a></li>
<li> <a href="../2 classes/Objects.SoundSource.html">Objects.SoundSource</a></li>
<li> <a href="../2 classes/Objects.Static.html">Objects.Static</a></li>
<li> <a href="../2 classes/Objects.Volume.html">Objects.Volume</a></li>
<li> <a href="../2 classes/Strings.DisplayString.html">Strings.DisplayString</a></li>
</ul>
<h2>3 Primitive Classes</h2>
<ul class="nowrap">
<li> <a href="../3 primitive classes/Color.html">Color</a></li>
<li> <a href="../3 primitive classes/Rotation.html">Rotation</a></li>
<li> <a href="../3 primitive classes/Vec2.html">Vec2</a></li>
<li> <a href="../3 primitive classes/Vec3.html">Vec3</a></li>
</ul>
<h2>4 Enums</h2>
<ul class="nowrap">
<li> <a href="../4 enums/Effects.BlendID.html">Effects.BlendID</a></li>
<li> <a href="../4 enums/Effects.EffectID.html">Effects.EffectID</a></li>
<li> <a href="../4 enums/Flow.GameStatus.html">Flow.GameStatus</a></li>
<li> <a href="../4 enums/Input.ActionID.html">Input.ActionID</a></li>
<li> <a href="../4 enums/Objects.AmmoType.html">Objects.AmmoType</a></li>
<li> <a href="../4 enums/Objects.MoveableStatus.html">Objects.MoveableStatus</a></li>
<li> <a href="../4 enums/Objects.ObjID.html">Objects.ObjID</a></li>
<li> <a href="../4 enums/Objects.RoomFlagID.html">Objects.RoomFlagID</a></li>
<li> <a href="../4 enums/Objects.RoomReverb.html">Objects.RoomReverb</a></li>
<li> <a href="../4 enums/Sound.SoundTrackType.html">Sound.SoundTrackType</a></li>
<li> <a href="../4 enums/Util.LogLevel.html">Util.LogLevel</a></li>
<li> <a href="../4 enums/View.AlignMode.html">View.AlignMode</a></li>
<li> <a href="../4 enums/View.CameraType.html">View.CameraType</a></li>
<li> <a href="../4 enums/View.PostProcessMode.html">View.PostProcessMode</a></li>
<li> <a href="../4 enums/View.ScaleMode.html">View.ScaleMode</a></li>
</ul>
<h2>5 Lua utility modules</h2>
<ul class="nowrap">
<li> <a href="../5 lua utility modules/EventSequence.html">EventSequence</a></li>
<li> <a href="../5 lua utility modules/Timer.html">Timer</a></li>
</ul>
</div>
<div id="content">
<h1>Class <code>Flow.Starfield</code></h1>
<p>Represents a starfield.</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" ><a href="#Starfield">Starfield(starCount)</a></td>
<td class="summary">Create a starfield object with only stars.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield">Starfield(starCount, meteorCount)</a></td>
<td class="summary">Create a starfield object with stars and meteors.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:GetStarsEnabled">Starfield:GetStarsEnabled()</a></td>
<td class="summary">Get the starfield's enabled status of stars.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:GetMeteorsEnabled">Starfield:GetMeteorsEnabled()</a></td>
<td class="summary">Get the starfield's enabled status of meteors.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:GetStarCount">Starfield:GetStarCount()</a></td>
<td class="summary">Get the starfield's number of stars.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:GetMeteorCount">Starfield:GetMeteorCount()</a></td>
<td class="summary">Get the starfield's number of meteors.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:GetMeteorSpawnDensity">Starfield:GetMeteorSpawnDensity()</a></td>
<td class="summary">Get the starfield's meteor spawn density.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:GetMeteorVelocity">Starfield:GetMeteorVelocity()</a></td>
<td class="summary">Get the starfield's meteor velocity.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:SetStarCount">Starfield:SetStarCount(New)</a></td>
<td class="summary">Set the starfield's number of stars (6000 max).</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:SetMeteorCount">Starfield:SetMeteorCount(New)</a></td>
<td class="summary">Set the starfield's number of meteors (100 max).</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:SetMeteorSpawnDensity">Starfield:SetMeteorSpawnDensity(New)</a></td>
<td class="summary">Set the starfield's meteor spawn density.</td>
</tr>
<tr>
<td class="name" ><a href="#Starfield:SetMeteorVelocity">Starfield:SetMeteorVelocity(New)</a></td>
<td class="summary">Set the starfield's meteor velocity.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Starfield"></a>
<strong>Starfield(starCount)</strong>
</dt>
<dd>
Create a starfield object with only stars. ()
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">starCount</span>
<span class="types"><span class="type">int</span></span>
Star count.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../2 classes/Flow.Starfield.html#Starfield">Starfield</a></span>
A new Starfield object.
</ol>
</dd>
<dt>
<a name = "Starfield"></a>
<strong>Starfield(starCount, meteorCount)</strong>
</dt>
<dd>
Create a starfield object with stars and meteors. ()
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">starCount</span>
<span class="types"><span class="type">int</span></span>
Star count (6000 max).
</li>
<li><span class="parameter">meteorCount</span>
<span class="types"><span class="type">int</span></span>
Meteor count (100 max).
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../2 classes/Flow.Starfield.html#Starfield">Starfield</a></span>
A new Starfield object.
</ol>
</dd>
<dt>
<a name = "Starfield:GetStarsEnabled"></a>
<strong>Starfield:GetStarsEnabled()</strong>
</dt>
<dd>
Get the starfield's enabled status of stars. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Stars enabled status.
</ol>
</dd>
<dt>
<a name = "Starfield:GetMeteorsEnabled"></a>
<strong>Starfield:GetMeteorsEnabled()</strong>
</dt>
<dd>
Get the starfield's enabled status of meteors. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Meteors enabled status.
</ol>
</dd>
<dt>
<a name = "Starfield:GetStarCount"></a>
<strong>Starfield:GetStarCount()</strong>
</dt>
<dd>
Get the starfield's number of stars. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
Count.
</ol>
</dd>
<dt>
<a name = "Starfield:GetMeteorCount"></a>
<strong>Starfield:GetMeteorCount()</strong>
</dt>
<dd>
Get the starfield's number of meteors. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
Count.
</ol>
</dd>
<dt>
<a name = "Starfield:GetMeteorSpawnDensity"></a>
<strong>Starfield:GetMeteorSpawnDensity()</strong>
</dt>
<dd>
Get the starfield's meteor spawn density. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
Spawn density.
</ol>
</dd>
<dt>
<a name = "Starfield:GetMeteorVelocity"></a>
<strong>Starfield:GetMeteorVelocity()</strong>
</dt>
<dd>
Get the starfield's meteor velocity. ()
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">float</span></span>
Velocity.
</ol>
</dd>
<dt>
<a name = "Starfield:SetStarCount"></a>
<strong>Starfield:SetStarCount(New)</strong>
</dt>
<dd>
Set the starfield's number of stars (6000 max). (int)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">New</span>
<span class="types"><span class="type">int</span></span>
count.
</li>
</ul>
</dd>
<dt>
<a name = "Starfield:SetMeteorCount"></a>
<strong>Starfield:SetMeteorCount(New)</strong>
</dt>
<dd>
Set the starfield's number of meteors (100 max). (int)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">New</span>
<span class="types"><span class="type">int</span></span>
count.
</li>
</ul>
</dd>
<dt>
<a name = "Starfield:SetMeteorSpawnDensity"></a>
<strong>Starfield:SetMeteorSpawnDensity(New)</strong>
</dt>
<dd>
Set the starfield's meteor spawn density. (int)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">New</span>
<span class="types"><span class="type">int</span></span>
spawn density.
</li>
</ul>
</dd>
<dt>
<a name = "Starfield:SetMeteorVelocity"></a>
<strong>Starfield:SetMeteorVelocity(New)</strong>
</dt>
<dd>
Set the starfield's meteor velocity. (float)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">New</span>
<span class="types"><span class="type">int</span></span>
velocity.
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="https://github.com/hispidence/TEN-LDoc">TEN-LDoc</a> (a fork of <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a>)</i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <here>Objects.AIObject</here></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <here>Objects.Camera</here></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <here>Objects.LaraObject</here></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
@ -178,7 +180,7 @@
<strong>DisplaySprite(ID, int, pos, rot, scale[, color])</strong>
</dt>
<dd>
Create a DisplaySprite object.
Create a DisplaySprite object. ()

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
@ -101,7 +103,7 @@
<h1>Primitive Class <code>Rotation</code></h1>
<p>Represents a degree-based 3D rotation.</p>
<p>All values are clamped to the range [0.0, 360.0].</p>
<p> All values are clamped to the range [0.0, 360.0].</p>
<h2><a href="#Members">Members</a></h2>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="../2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="../2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>

View file

@ -49,10 +49,12 @@
<li> <a href="2 classes/Flow.Animations.html">Flow.Animations</a></li>
<li> <a href="2 classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="2 classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="2 classes/Flow.Mirror.html">Flow.Mirror</a></li>
<li> <a href="2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="2 classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
@ -183,6 +185,10 @@ local door = GetMoveableByName("door_type4_14")
<td class="name" ><a href="2 classes/Flow.InventoryItem.html">Flow.InventoryItem</a></td>
<td class="summary">Represents the properties of an object as it appears in the inventory.</td>
</tr>
<tr>
<td class="name" ><a href="2 classes/Flow.LensFlare.html">Flow.LensFlare</a></td>
<td class="summary">Represents a lens flare.</td>
</tr>
<tr>
<td class="name" ><a href="2 classes/Flow.Level.html">Flow.Level</a></td>
<td class="summary">Stores level metadata.</td>
@ -199,6 +205,10 @@ local door = GetMoveableByName("door_type4_14")
<td class="name" ><a href="2 classes/Flow.SkyLayer.html">Flow.SkyLayer</a></td>
<td class="summary">Describes a layer of moving clouds.</td>
</tr>
<tr>
<td class="name" ><a href="2 classes/Flow.Starfield.html">Flow.Starfield</a></td>
<td class="summary">Represents a starfield.</td>
</tr>
<tr>
<td class="name" ><a href="2 classes/Objects.AIObject.html">Objects.AIObject</a></td>
<td class="summary">AI object</td>

View file

@ -75,6 +75,7 @@ local strings =
exit_to_title = { "Exit to Title" },
general_actions = { "General Actions" },
high = { "High" },
high_framerate = { "High Framerate" },
level_secrets_found = { "Secrets Found in Level" },
load_game = { "Load Game" },
low = { "Low" },

View file

@ -2,6 +2,8 @@
#include "Game/Hud/PickupSummary.h"
#include "Game/pickup/pickup.h"
#include "Game/pickup/pickup_ammo.h"
#include "Game/pickup/pickup_consumable.h"
#include "Math/Math.h"
#include "Renderer/Renderer.h"
#include "Specific/clock.h"
@ -39,6 +41,8 @@ namespace TEN::Hud
constexpr auto ROT_RATE = ANGLE(360.0f / (LIFE_MAX * FPS));
constexpr auto ROT = EulerAngles(0, ROT_RATE, 0);
StoreInterpolationData();
// Move offscreen.
if (Life <= 0.0f && isHead)
{
@ -122,6 +126,20 @@ namespace TEN::Hud
pickup.StringScalar = 0.0f;
}
void PickupSummaryController::AddDisplayPickup(ItemInfo& item)
{
// Ammo and consumables are a special case, as internal amount differs from pickup amount.
int ammoCount = GetDefaultAmmoCount(item.ObjectNumber);
int consumableCount = GetDefaultConsumableCount(item.ObjectNumber);
int count = DISPLAY_PICKUP_COUNT_ARG_DEFAULT;
if (ammoCount != NO_VALUE) count = ammoCount;
if (consumableCount != NO_VALUE) count = consumableCount;
AddDisplayPickup(item.ObjectNumber, item.Pose.Position.ToVector3(), item.HitPoints > 0 ? item.HitPoints : count);
}
void PickupSummaryController::AddDisplayPickup(GAME_OBJECT_ID objectID, const Vector3& pos, unsigned int count)
{
// Project 3D position to 2D origin.

View file

@ -25,8 +25,21 @@ namespace TEN::Hud
float StringScale = 0.0f;
float StringScalar = 0.0f;
Vector2 PrevPosition = Vector2::Zero;
EulerAngles PrevOrientation = EulerAngles::Identity;
float PrevScale = 0.0f;
float PrevOpacity = 0.0f;
bool IsOffscreen() const;
void Update(bool isHead);
void StoreInterpolationData()
{
PrevPosition = Position;
PrevOrientation = Orientation;
PrevScale = Scale;
PrevOpacity = Opacity;
}
};
class PickupSummaryController
@ -46,6 +59,7 @@ namespace TEN::Hud
void AddDisplayPickup(GAME_OBJECT_ID objectID, const Vector2& origin, unsigned int count = DISPLAY_PICKUP_COUNT_ARG_DEFAULT);
void AddDisplayPickup(GAME_OBJECT_ID objectID, const Vector3& pos, unsigned int count = DISPLAY_PICKUP_COUNT_ARG_DEFAULT);
void AddDisplayPickup(ItemInfo& item);
void Update();
void Draw() const;

View file

@ -4,10 +4,13 @@
#include "Game/effects/DisplaySprite.h"
#include "Math/Math.h"
#include "Specific/clock.h"
#include "Renderer/Renderer.h"
using namespace TEN::Effects::DisplaySprite;
using namespace TEN::Math;
using TEN::Renderer::g_Renderer;
namespace TEN::Hud
{
void SpeedometerController::UpdateValue(float value)
@ -28,6 +31,8 @@ namespace TEN::Hud
return;
}
StoreInterpolationData();
// Update life and updated value status.
_life = std::clamp(_life + (_hasValueUpdated ? 1.0f : -1.0f), 0.0f, LIFE_MAX * FPS);
_hasValueUpdated = false;
@ -44,7 +49,7 @@ namespace TEN::Hud
void SpeedometerController::Draw() const
{
constexpr auto POS = Vector2(DISPLAY_SPACE_RES.x - (DISPLAY_SPACE_RES.x / 6), DISPLAY_SPACE_RES.y - (DISPLAY_SPACE_RES.y / 10));
constexpr auto ORIENT_OFFSET = ANGLE(90.0f);
constexpr auto POINTER_ANGLE_OFFSET = ANGLE(90.0f);
constexpr auto SCALE = Vector2(0.35f);
constexpr auto DIAL_ELEMENT_SPRITE_ID = 0;
constexpr auto POINTER_ELEMENT_SPRITE_ID = 1;
@ -56,19 +61,22 @@ namespace TEN::Hud
if (_life <= 0.0f)
return;
auto color = Color(1.0f, 1.0f, 1.0f, _opacity);
short pointerAngle = (short)Lerp(_prevPointerAngle, _pointerAngle, g_Renderer.GetInterpolationFactor());
auto color = Color(1.0f, 1.0f, 1.0f, Lerp(_prevOpacity, _opacity, g_Renderer.GetInterpolationFactor()));
// Draw dial.
AddDisplaySprite(
ID_SPEEDOMETER, DIAL_ELEMENT_SPRITE_ID,
POS, 0, SCALE, color,
DIAL_PRIORITY, DisplaySpriteAlignMode::Center, DisplaySpriteScaleMode::Fit, BlendMode::AlphaBlend);
DIAL_PRIORITY, DisplaySpriteAlignMode::Center, DisplaySpriteScaleMode::Fit, BlendMode::AlphaBlend,
DisplaySpritePhase::Draw);
// Draw pointer.
AddDisplaySprite(
ID_SPEEDOMETER, POINTER_ELEMENT_SPRITE_ID,
POS, _pointerAngle + ORIENT_OFFSET, SCALE, color,
POINTER_PRIORITY, DisplaySpriteAlignMode::Center, DisplaySpriteScaleMode::Fit, BlendMode::AlphaBlend);
POS, pointerAngle + POINTER_ANGLE_OFFSET, SCALE, color,
POINTER_PRIORITY, DisplaySpriteAlignMode::Center, DisplaySpriteScaleMode::Fit, BlendMode::AlphaBlend,
DisplaySpritePhase::Draw);
}
void SpeedometerController::Clear()

View file

@ -18,6 +18,15 @@ namespace TEN::Hud
float _opacity = 0.0f;
float _life = 0.0f;
short _prevPointerAngle = 0;
float _prevOpacity = 0.0f;
void StoreInterpolationData()
{
_prevPointerAngle = _pointerAngle;
_prevOpacity = _opacity;
}
public:
// Utilities

View file

@ -74,6 +74,9 @@ namespace TEN::Hud
constexpr auto ORIENT_LERP_ALPHA = 0.1f;
constexpr auto RADIUS_LERP_ALPHA = 0.2f;
if (Position.has_value())
StoreInterpolationData();
// Update active status.
IsActive = isActive;
@ -133,30 +136,36 @@ namespace TEN::Hud
constexpr auto STATIC_ELEMENT_SPRITE_ID = 0;
constexpr auto SEGMENT_ELEMENT_SPRITE_ID = 1;
constexpr auto PRIORITY = 0; // TODO: Check later. May interfere with Lua display sprites. -- Sezz 2023.10.06
constexpr auto ALIGN_MODE = DisplaySpriteAlignMode::Center;
constexpr auto SCALE_MODE = DisplaySpriteScaleMode::Fill;
constexpr auto BLEND_MODE = BlendMode::Additive;
if (!Position.has_value())
return;
auto pos0 = Vector2::Lerp(PrevPosition, *Position, g_Renderer.GetInterpolationFactor());
short orient0 = PrevOrientation + Geometry::GetShortestAngle(PrevOrientation, Orientation) * g_Renderer.GetInterpolationFactor();
float scale = Lerp(PrevScale, Scale, g_Renderer.GetInterpolationFactor());
auto color = Color::Lerp(PrevColor, Color, g_Renderer.GetInterpolationFactor());
// Draw main static element.
AddDisplaySprite(
SPRITE_SEQUENCE_OBJECT_ID, STATIC_ELEMENT_SPRITE_ID,
*Position, Orientation, Vector2(Scale), Color,
PRIORITY, ALIGN_MODE, SCALE_MODE, BLEND_MODE);
pos0, orient0, Vector2(scale), color,
PRIORITY, DisplaySpriteAlignMode::Center, DisplaySpriteScaleMode::Fill,
BlendMode::Additive, DisplaySpritePhase::Draw);
// Draw animated outer segment elements.
for (const auto& segment : Segments)
for (int i = 0; i < Segments.size(); i++)
{
auto pos = *Position + segment.PosOffset;
short orient = Orientation + segment.OrientOffset;
auto scale = Vector2(Scale / 2);
const auto& segment = Segments[i];
const auto& prevSegment = PrevSegments[i];
auto pos1 = pos0 + Vector2::Lerp(prevSegment.PosOffset, segment.PosOffset, g_Renderer.GetInterpolationFactor());
short orient1 = orient0 + (prevSegment.OrientOffset + (Geometry::GetShortestAngle(prevSegment.OrientOffset, segment.OrientOffset) * g_Renderer.GetInterpolationFactor()));
AddDisplaySprite(
SPRITE_SEQUENCE_OBJECT_ID, SEGMENT_ELEMENT_SPRITE_ID,
pos, orient, scale, Color,
PRIORITY, ALIGN_MODE, SCALE_MODE, BLEND_MODE);
pos1, orient1, Vector2(scale / 2), color,
PRIORITY, DisplaySpriteAlignMode::Center, DisplaySpriteScaleMode::Fill,
BlendMode::Additive, DisplaySpritePhase::Draw);
}
}
@ -175,23 +184,23 @@ namespace TEN::Hud
// Loop over player targets.
auto itemNumbers = std::vector<int>{};
for (const auto* itemPtr : player.TargetList)
for (const auto* item : player.TargetList)
{
if (itemPtr == nullptr)
if (item == nullptr)
continue;
// Collect item number.
if (itemPtr->HitPoints != NOT_TARGETABLE)
itemNumbers.push_back(itemPtr->Index);
if (item->HitPoints != NOT_TARGETABLE)
itemNumbers.push_back(item->Index);
// Find crosshair at item number key.
auto it = _crosshairs.find(itemPtr->Index);
auto it = _crosshairs.find(item->Index);
if (it == _crosshairs.end())
continue;
// Set crosshair as primary or peripheral.
auto& crosshair = it->second;
if (player.TargetEntity != nullptr && itemPtr->Index == player.TargetEntity->Index)
if (player.TargetEntity != nullptr && item->Index == player.TargetEntity->Index)
{
crosshair.SetPrimary();
}

View file

@ -36,6 +36,12 @@ namespace TEN::Hud
std::array<SegmentData, SEGMENT_COUNT> Segments = {};
Vector2 PrevPosition = Vector2::Zero;
short PrevOrientation = 0;
float PrevScale = 0.0f;
Vector4 PrevColor = Vector4::Zero;
std::array<SegmentData, SEGMENT_COUNT> PrevSegments = {};
// Getters
float GetScale(float cameraDist) const;
@ -51,6 +57,15 @@ namespace TEN::Hud
void Update(const Vector3& targetPos, bool isActive, bool doPulse);
void Draw() const;
void StoreInterpolationData()
{
PrevPosition = *Position;
PrevOrientation = Orientation;
PrevScale = Scale;
PrevColor = Color;
PrevSegments = Segments;
}
};
class TargetHighlighterController

View file

@ -59,8 +59,8 @@ using namespace TEN::Gui;
using TEN::Renderer::g_Renderer;
LaraInfo Lara = {};
ItemInfo* LaraItem;
LaraInfo Lara = {};
ItemInfo* LaraItem = nullptr;
CollisionInfo LaraCollision = {};
void LaraControl(ItemInfo* item, CollisionInfo* coll)
@ -628,6 +628,7 @@ void UpdateLara(ItemInfo* item, bool isTitle)
// Control player.
InItemControlLoop = true;
LaraControl(item, &LaraCollision);
HandlePlayerFlyCheat(*item);
InItemControlLoop = false;

View file

@ -93,8 +93,8 @@ constexpr auto WADE_WATER_DEPTH = STEPUP_HEIGHT;
constexpr auto SWIM_WATER_DEPTH = CLICK(2.75f);
constexpr auto SLOPE_DIFFERENCE = 60;
extern LaraInfo Lara;
extern ItemInfo* LaraItem;
extern LaraInfo Lara;
extern ItemInfo* LaraItem;
extern CollisionInfo LaraCollision;
void LaraControl(ItemInfo* item, CollisionInfo* coll);

View file

@ -1044,6 +1044,8 @@ void HandlePlayerElevationChange(ItemInfo* item, CollisionInfo* coll)
if (CanStepUp(*item, *coll))
{
item->Animation.TargetState = LS_STEP_UP;
item->DisableInterpolation = true;
if (GetStateDispatch(item, GetAnimData(*item)))
{
item->Pose.Position.y += coll->Middle.Floor;

View file

@ -79,7 +79,14 @@ ObjectInfo& ObjectHandler::GetFirstAvailableObject()
// NOTE: JointRotationFlags allows bones to be rotated with CreatureJoint().
void ObjectInfo::SetBoneRotationFlags(int boneID, int flags)
{
g_Level.Bones[boneIndex + (boneID * 4)] |= flags;
int index = boneIndex + (boneID * 4);
if (index < 0 || index >= g_Level.Bones.size())
{
TENLog("Failed to set rotation flag for bone ID " + std::to_string(boneID), LogLevel::Warning);
return;
}
g_Level.Bones[index] |= flags;
}
void ObjectInfo::SetHitEffect(HitEffect hitEffect)

View file

@ -16,16 +16,16 @@ constexpr auto MAX_STATICS = 1000;
enum JointRotationFlags
{
ROT_X = (1 << 2),
ROT_Y = (1 << 3),
ROT_Z = (1 << 4)
ROT_X = 1 << 2,
ROT_Y = 1 << 3,
ROT_Z = 1 << 4
};
// Unused.
enum ShatterFlags
{
NoCollision = (1 << 0),
Shatterable = (1 << 1)
NoCollision = 1 << 0,
Shatterable = 1 << 1
};
// Custom LOT definition for Creature. Used in InitializeSlot() in lot.cpp.
@ -39,10 +39,11 @@ enum class LotType
HumanPlusJump,
HumanPlusJumpAndMonkey,
Flyer,
Blockable, // For large creatures such as trex and shiva.
Spider, // Only 2 block vault allowed.
Ape, // Only 2 block vault allowed.
SnowmobileGun // Only 1 block vault allowed and 4 block drop max.
Blockable, // For large creatures such as trex and shiva.
Spider, // Only 2 block vault allowed.
Ape, // Only 2 block vault allowed.
SnowmobileGun, // Only 1 block vault allowed and 4 block drop max.
EnemyJeep
};
enum class HitEffect

View file

@ -62,6 +62,8 @@ static void PerformAnimCommands(ItemInfo& item, bool isFrameBased)
{
UpdateItemRoom(item.Index);
}
item.DisableInterpolation = true;
}
commandDataPtr += 3;
@ -210,6 +212,13 @@ static void PerformAnimCommands(ItemInfo& item, bool isFrameBased)
commandDataPtr += 2;
break;
case AnimCommandType::DisableInterpolation:
if (isFrameBased && item.Animation.FrameNumber == commandDataPtr[0])
item.DisableInterpolation = true;
commandDataPtr += 1;
break;
default:
break;
}

View file

@ -24,7 +24,8 @@ enum class AnimCommandType
AttackReady,
Deactivate,
SoundEffect,
Flipeffect
Flipeffect,
DisableInterpolation
};
struct AnimFrame

View file

@ -194,15 +194,8 @@ void LookCamera(ItemInfo& item, const CollisionInfo& coll)
void LookAt(CAMERA_INFO* cam, short roll)
{
auto pos = cam->pos.ToVector3();
auto target = cam->target.ToVector3();
auto up = Vector3::Down;
float fov = TO_RAD(CurrentFOV / 1.333333f);
float r = TO_RAD(roll);
float levelFarView = g_GameFlow->GetLevel(CurrentLevel)->GetFarView() * float(BLOCK(1));
g_Renderer.UpdateCameraMatrices(cam, r, fov, levelFarView);
cam->Fov = TO_RAD(CurrentFOV / 1.333333f);
cam->Roll = TO_RAD(roll);
}
void AlterFOV(short value, bool store)
@ -248,13 +241,13 @@ void InitializeCamera()
Camera.targetDistance = BLOCK(1.5f);
Camera.item = nullptr;
Camera.numberFrames = 1;
Camera.type = CameraType::Chase;
Camera.speed = 1;
Camera.flags = CF_NONE;
Camera.bounce = 0;
Camera.number = -1;
Camera.fixedCamera = false;
Camera.DisableInterpolation = true;
AlterFOV(ANGLE(DEFAULT_FOV));
@ -1171,7 +1164,6 @@ void CalculateCamera(const CollisionInfo& coll)
Lara.ExtraTorsoRot.x = Lara.ExtraHeadRot.x;
Lara.Control.Look.Orientation = lookOrient;
Camera.type = CameraType::Look;
Camera.item->LookedAt = true;
}
@ -1294,6 +1286,8 @@ void CalculateCamera(const CollisionInfo& coll)
Camera.fixedCamera = isFixedCamera;
Camera.last = Camera.number;
Camera.DisableInterpolation = (Camera.DisableInterpolation || Camera.lastType != Camera.type);
Camera.lastType = Camera.type;
if ((Camera.type != CameraType::Heavy || Camera.timer == -1) &&
LaraItem->HitPoints > 0)
@ -1521,6 +1515,15 @@ void ItemsCollideCamera()
staticList.clear();
}
void PrepareCamera()
{
if (TrackCameraInit)
{
UseSpotCam = false;
AlterFOV(LastFOV);
}
}
void UpdateCamera()
{
if (UseSpotCam)
@ -1534,6 +1537,9 @@ void UpdateCamera()
TrackCameraInit = false;
CalculateCamera(LaraCollision);
}
// Update cameras matrices there, after having done all the possible camera logic.
g_Renderer.UpdateCameraMatrices(&Camera, BLOCK(g_GameFlow->GetLevel(CurrentLevel)->GetFarView()));
}
void UpdateMikePos(const ItemInfo& item)

View file

@ -24,11 +24,11 @@ struct CAMERA_INFO
GameVector target;
CameraType type;
CameraType oldType;
CameraType lastType;
int shift;
int flags;
bool fixedCamera;
bool underwater;
int numberFrames;
int bounce;
int targetDistance;
short targetAngle;
@ -46,6 +46,11 @@ struct CAMERA_INFO
ItemInfo* lastItem;
int mikeAtLara;
Vector3i mikePos;
float Roll = 0.0f;
float Fov = 0.0f;
bool DisableInterpolation = false;
};
struct ObjectCameraInfo
@ -113,6 +118,7 @@ void SetScreenFadeOut(float speed, bool force = false);
void SetScreenFadeIn(float speed, bool force = false);
void SetCinematicBars(float height, float speed);
void ClearCinematicBars();
void PrepareCamera();
void UpdateCamera();
void UpdateFadeScreenAndCinematicBars();
void UpdateMikePos(const ItemInfo& item);

View file

@ -1863,9 +1863,10 @@ void DoObjectCollision(ItemInfo* item, CollisionInfo* coll)
if (linkItem.HitPoints <= 0 || linkItem.HitPoints == NOT_TARGETABLE)
continue;
if (isHarmless || abs(item->Animation.Velocity.z) < VEHICLE_COLLISION_TERMINAL_VELOCITY)
if (isHarmless || abs(item->Animation.Velocity.z) < VEHICLE_COLLISION_TERMINAL_VELOCITY ||
object.damageType == DamageMode::None)
{
// If vehicle is harmless or speed is too low, just push enemy.
// If vehicle is harmless, enemy is non-damageable, or speed is too low, push enemy.
ItemPushItem(&linkItem, item, coll, false, 0);
continue;
}

View file

@ -204,16 +204,21 @@ int FloorInfo::GetSurfaceHeight(const Vector3i& pos, bool isFloor) const
// 2.1) Get bridge surface height.
auto bridgeSurfaceHeight = isFloor ? bridge.GetFloorHeight(bridgeItem, pos) : bridge.GetCeilingHeight(bridgeItem, pos);
if (!bridgeSurfaceHeight.has_value())
continue;
// Use bridge midpoint to decide whether to return bridge height or room height, in case probe point
// is located within the bridge. Without it, dynamic bridges may fail while Lara is standing on them.
int midpoint = (bridge.GetFloorBorder(bridgeItem) + bridge.GetCeilingBorder(bridgeItem)) / 2;
// 2.2) Track closest floor or ceiling height.
if (isFloor)
{
// Test if bridge floor height is closer.
if (*bridgeSurfaceHeight >= pos.y && // Bridge floor height is below position.
*bridgeSurfaceHeight < floorHeight && // Bridge floor height is above current closest floor height.
*bridgeSurfaceHeight >= ceilingHeight) // Bridge ceiling height is below sector ceiling height.
if (midpoint >= pos.y && // Bridge midpoint is below position.
*bridgeSurfaceHeight < floorHeight && // Bridge floor height is above current closest floor height.
*bridgeSurfaceHeight >= ceilingHeight) // Bridge ceiling height is below sector ceiling height.
{
floorHeight = *bridgeSurfaceHeight;
}
@ -221,7 +226,7 @@ int FloorInfo::GetSurfaceHeight(const Vector3i& pos, bool isFloor) const
else
{
// Test if bridge ceiling height is closer.
if (*bridgeSurfaceHeight <= pos.y && // Bridge ceiling height is above position.
if (midpoint <= pos.y && // Bridge midpoint is above position.
*bridgeSurfaceHeight > ceilingHeight && // Bridge ceiling height is below current closest ceiling height.
*bridgeSurfaceHeight <= floorHeight) // Bridge floor height is above sector floor height.
{

View file

@ -1297,11 +1297,15 @@ void GetAITarget(CreatureInfo* creature)
{
auto* enemy = creature->Enemy;
short enemyObjectNumber;
int enemyObjectID = 0;
if (enemy)
enemyObjectNumber = enemy->ObjectNumber;
{
enemyObjectID = enemy->ObjectNumber;
}
else
enemyObjectNumber = NO_VALUE;
{
enemyObjectID = NO_VALUE;
}
auto* item = &g_Level.Items[creature->ItemNumber];
@ -1329,12 +1333,12 @@ void GetAITarget(CreatureInfo* creature)
}
else if (!creature->Patrol)
{
if (enemyObjectNumber != ID_AI_PATROL1)
FindAITargetObject(creature, ID_AI_PATROL1);
if (enemyObjectID != ID_AI_PATROL1)
FindAITargetObject(*item, ID_AI_PATROL1);
}
else if (enemyObjectNumber != ID_AI_PATROL2)
else if (enemyObjectID != ID_AI_PATROL2)
{
FindAITargetObject(creature, ID_AI_PATROL2);
FindAITargetObject(*item, ID_AI_PATROL2);
}
else if (abs(enemy->Pose.Position.x - item->Pose.Position.x) < REACHED_GOAL_RADIUS &&
abs(enemy->Pose.Position.y - item->Pose.Position.y) < REACHED_GOAL_RADIUS &&
@ -1350,8 +1354,8 @@ void GetAITarget(CreatureInfo* creature)
// First if was removed probably after TR3 and was it used by monkeys?
/*if (!(item->aiBits & MODIFY) && !creature->hurtByLara)
creature->enemy = LaraItem;
else*/ if (enemyObjectNumber != ID_AI_AMBUSH)
FindAITargetObject(creature, ID_AI_AMBUSH);
else*/ if (enemyObjectID != ID_AI_AMBUSH)
FindAITargetObject(*item, ID_AI_AMBUSH);
/*else if (item->objectNumber == ID_MONKEY)
return;*/
else if (abs(enemy->Pose.Position.x - item->Pose.Position.x) < REACHED_GOAL_RADIUS &&
@ -1362,6 +1366,7 @@ void GetAITarget(CreatureInfo* creature)
creature->ReachedGoal = true;
creature->Enemy = LaraItem;
item->AIBits &= ~(AMBUSH /* | MODIFY*/);
if (item->AIBits != MODIFY)
{
item->AIBits |= GUARD;
@ -1381,9 +1386,9 @@ void GetAITarget(CreatureInfo* creature)
{
item->AIBits &= ~FOLLOW;
}
else if (enemyObjectNumber != ID_AI_FOLLOW)
else if (enemyObjectID != ID_AI_FOLLOW)
{
FindAITargetObject(creature, ID_AI_FOLLOW);
FindAITargetObject(*item, ID_AI_FOLLOW);
}
else if (abs(enemy->Pose.Position.x - item->Pose.Position.x) < REACHED_GOAL_RADIUS &&
abs(enemy->Pose.Position.y - item->Pose.Position.y) < REACHED_GOAL_RADIUS &&
@ -1393,17 +1398,18 @@ void GetAITarget(CreatureInfo* creature)
item->AIBits &= ~FOLLOW;
}
}
/*else if (item->objectNumber == ID_MONKEY && item->carriedItem == NO_VALUE)
/*else if (item->ObjectNumber == ID_MONKEY && item->CarriedItem == NO_VALUE)
{
if (item->aiBits != MODIFY)
if (item->AIBits != MODIFY)
{
if (enemyObjectNumber != ID_SMALLMEDI_ITEM)
FindAITargetObject(creature, ID_SMALLMEDI_ITEM);
if (enemyObjectID != ID_SMALLMEDI_ITEM)
FindAITargetObject(*item, ID_SMALLMEDI_ITEM);
}
else
{
if (enemyObjectNumber != ID_KEY_ITEM4)
FindAITargetObject(creature, ID_KEY_ITEM4);
if (enemyObjectID != ID_KEY_ITEM4)
FindAITargetObject(*item, ID_KEY_ITEM4);
}
}*/
}
@ -1432,69 +1438,101 @@ void FindAITarget(CreatureInfo* creature, short objectNumber)
}
}
void FindAITargetObject(CreatureInfo* creature, int objectNumber)
void FindAITargetObject(ItemInfo& item, GAME_OBJECT_ID objectID, std::optional<int> ocb, std::optional<bool> checkSameZone)
{
const auto& item = g_Level.Items[creature->ItemNumber];
auto& creature = *GetCreatureInfo(&item);
FindAITargetObject(creature, objectNumber, item.ItemFlags[3], true);
auto data = AITargetData{};
data.CheckDistance = false;
data.CheckOcb = ocb.has_value();
data.ObjectID = objectID;
data.Ocb = ocb.value_or(item.ItemFlags[3]);
data.CheckSameZone = checkSameZone.value_or(true);
if (FindAITargetObject(item, data))
{
*creature.AITarget = data.FoundItem;
creature.Enemy = creature.AITarget;
}
}
void FindAITargetObject(CreatureInfo* creature, int objectNumber, int ocb, bool checkSameZone)
bool FindAITargetObject(ItemInfo& item, AITargetData& data)
{
auto& item = g_Level.Items[creature->ItemNumber];
if (g_Level.AIObjects.empty())
return;
return false;
AI_OBJECT* foundObject = nullptr;
auto& creature = *GetCreatureInfo(&item);
for (auto& aiObject : g_Level.AIObjects)
const AI_OBJECT* foundAIObject = nullptr;
for (const auto& aiObject : g_Level.AIObjects)
{
if (aiObject.objectNumber == objectNumber &&
aiObject.triggerFlags == ocb &&
aiObject.roomNumber != NO_VALUE)
// Check if object IDs match.
if (aiObject.objectNumber != data.ObjectID)
continue;
// Check if room is valid.
if (aiObject.roomNumber == NO_VALUE)
continue;
// Check if distance is valid.
if (data.CheckDistance)
{
int* zone = g_Level.Zones[(int)creature->LOT.Zone][(int)FlipStatus].data();
if (Vector3i::Distance(item.Pose.Position, aiObject.pos.Position) > data.DistanceMax)
continue;
}
// Check if OCBs match (useful for pathfinding).
if (data.CheckOcb)
{
if (aiObject.triggerFlags != data.Ocb)
continue;
}
// Check if zone IDs match.
if (data.CheckSameZone)
{
int* zone = g_Level.Zones[(int)creature.LOT.Zone][(int)FlipStatus].data();
auto* room = &g_Level.Rooms[item.RoomNumber];
item.BoxNumber = GetSector(room, item.Pose.Position.x - room->Position.x, item.Pose.Position.z - room->Position.z)->PathfindingBoxID;
// NOTE: Avoid changing box ID of item or AI item so a local variable isn't required when searching for AI object near it.
int boxID = GetSector(room, item.Pose.Position.x - room->Position.x, item.Pose.Position.z - room->Position.z)->PathfindingBoxID;
room = &g_Level.Rooms[aiObject.roomNumber];
aiObject.boxNumber = GetSector(room, aiObject.pos.Position.x - room->Position.x, aiObject.pos.Position.z - room->Position.z)->PathfindingBoxID;
int aiBoxID = GetSector(room, aiObject.pos.Position.x - room->Position.x, aiObject.pos.Position.z - room->Position.z)->PathfindingBoxID;
if (item.BoxNumber == NO_VALUE || aiObject.boxNumber == NO_VALUE)
return;
// Box is invalid or zones don't match; continue.
if (boxID == NO_VALUE || aiBoxID == NO_VALUE)
continue;
if (checkSameZone && (zone[item.BoxNumber] != zone[aiObject.boxNumber]))
return;
// Don't check for same zone. Needed for Sophia Leigh.
foundObject = &aiObject;
// Zone is invalid; continue.
if (zone[boxID] != zone[aiBoxID])
continue;
}
// HACK: Don't check for matching zone. Needed for Sophia Leigh.
foundAIObject = &aiObject;
}
if (foundObject == nullptr)
return;
if (foundAIObject == nullptr)
return false;
auto& aiItem = *creature->AITarget;
auto aiItem = ItemInfo{};
aiItem.ObjectNumber = foundAIObject->objectNumber;
aiItem.RoomNumber = foundAIObject->roomNumber;
aiItem.Pose.Position = foundAIObject->pos.Position;
aiItem.Pose.Orientation.y = foundAIObject->pos.Orientation.y;
aiItem.Flags = foundAIObject->flags;
aiItem.TriggerFlags = foundAIObject->triggerFlags;
aiItem.BoxNumber = foundAIObject->boxNumber;
creature->Enemy = &aiItem;
aiItem.ObjectNumber = foundObject->objectNumber;
aiItem.RoomNumber = foundObject->roomNumber;
aiItem.Pose.Position = foundObject->pos.Position;
aiItem.Pose.Orientation.y = foundObject->pos.Orientation.y;
aiItem.Flags = foundObject->flags;
aiItem.TriggerFlags = foundObject->triggerFlags;
aiItem.BoxNumber = foundObject->boxNumber;
if (!(creature->AITarget->Flags & ItemFlags::IFLAG_TRIGGERED))
if (!(aiItem.Flags & IFLAG_TRIGGERED))
{
float sinY = phd_sin(creature->AITarget->Pose.Orientation.y);
float cosY = phd_cos(creature->AITarget->Pose.Orientation.y);
creature->AITarget->Pose.Position.x += CLICK(1) * sinY;
creature->AITarget->Pose.Position.z += CLICK(1) * cosY;
aiItem.Pose.Position.x += CLICK(1) * phd_sin(aiItem.Pose.Orientation.y);
aiItem.Pose.Position.z += CLICK(1) * phd_cos(aiItem.Pose.Orientation.y);
}
data.FoundItem = aiItem;
return true;
}
int TargetReachable(ItemInfo* item, ItemInfo* enemy)

View file

@ -11,8 +11,7 @@ struct LOTInfo;
enum class JumpDistance
{
Block1,
Block2,
Block3
Block2
};
enum TARGET_TYPE
@ -84,22 +83,23 @@ constexpr auto CLIP_ALL = (CLIP_LEFT | CLIP_RIGHT | CLIP_TOP | CLIP_BOTTOM);
constexpr auto CLIP_SECONDARY = 0x10;
struct AITargetFlags
struct AITargetData
{
bool checkDistance = false;
bool checkSameZone = true;
bool checkOcb = false;
float maxDistance = 0.0f;
int ocb = NO_VALUE;
int objectNumber = ID_NO_OBJECT;
ItemInfo foundItem = {};
ItemInfo FoundItem = {};
GAME_OBJECT_ID ObjectID = GAME_OBJECT_ID::ID_NO_OBJECT;
float DistanceMax = 0.0f;
int Ocb = NO_VALUE;
bool CheckDistance = false;
bool CheckSameZone = true;
bool CheckOcb = false;
};
void GetCreatureMood(ItemInfo* item, AI_INFO* AI, bool isViolent);
void CreatureMood(ItemInfo* item, AI_INFO* AI, bool isViolent);
void FindAITargetObject(CreatureInfo* creature, int objectNumber);
void FindAITargetObject(CreatureInfo* creature, int objectNumber, int ocb, bool checkSameZone = true);
bool FindAITargetObject(CreatureInfo* creature, AITargetFlags* data);
void FindAITargetObject(ItemInfo& item, GAME_OBJECT_ID objectID, std::optional<int> ocb = std::nullopt, std::optional<bool> checkSameZone = std::nullopt);
bool FindAITargetObject(ItemInfo& item, AITargetData& data);
void GetAITarget(CreatureInfo* creature);
int CreatureVault(short itemNumber, short angle, int vault, int shift);
bool MoveCreature3DPos(Pose* fromPose, Pose* toPose, int velocity, short angleDif, int angleAdd);
@ -135,7 +135,7 @@ void CreatureHealth(ItemInfo* item);
void AdjustStopperFlag(ItemInfo* item, int direction);
void InitializeItemBoxData();
bool CanCreatureJump(ItemInfo& item, float stepDist, JumpDistance jumpDistType);
bool CanCreatureJump(ItemInfo& item, JumpDistance jumpDistType);
void DrawBox(int boxIndex, Vector3 color);
void DrawNearbyPathfinding(int boxIndex);

View file

@ -1,7 +1,6 @@
#include "framework.h"
#include "Game/control/control.h"
#include <chrono>
#include <process.h>
#include "Game/camera.h"
@ -39,6 +38,7 @@
#include "Game/Setup.h"
#include "Game/spotcam.h"
#include "Math/Math.h"
#include "Objects/Effects/LensFlare.h"
#include "Objects/Effects/tr4_locusts.h"
#include "Objects/Generic/Object/objects.h"
#include "Objects/Generic/Object/rope.h"
@ -59,7 +59,6 @@
#include "Specific/Input/Input.h"
#include "Specific/level.h"
#include "Specific/winmain.h"
#include "Game/Lara/lara_initialise.h"
using namespace std::chrono;
using namespace TEN::Effects;
@ -87,6 +86,8 @@ using namespace TEN::Hud;
using namespace TEN::Input;
using namespace TEN::Math;
using namespace TEN::Renderer;
using namespace TEN::Entities::Creatures::TR3;
using namespace TEN::Entities::Effects;
int GameTimer = 0;
int GlobalCounter = 0;
@ -112,177 +113,163 @@ short NextFxFree;
int ControlPhaseTime;
int DrawPhase(bool isTitle)
void DrawPhase(bool isTitle, float interpolationFactor)
{
if (isTitle)
{
g_Renderer.RenderTitle();
g_Renderer.RenderTitle(interpolationFactor);
}
else
{
g_Renderer.Render();
g_Renderer.Render(interpolationFactor);
}
// Clear display sprites.
ClearDisplaySprites();
Camera.numberFrames = g_Renderer.Synchronize();
return Camera.numberFrames;
g_Renderer.Lock();
}
GameStatus ControlPhase(int numFrames)
GameStatus ControlPhase()
{
auto time1 = std::chrono::high_resolution_clock::now();
bool isTitle = (CurrentLevel == 0);
g_Renderer.PrepareScene();
g_Renderer.SaveOldState();
ClearFires();
ClearLensFlares();
ClearAllDisplaySprites();
SetupInterpolation();
PrepareCamera();
RegeneratePickups();
numFrames = std::clamp(numFrames, 0, 10);
if (TrackCameraInit)
{
UseSpotCam = false;
AlterFOV(LastFOV);
}
g_GameStringsHandler->ProcessDisplayStrings(DELTA_TIME);
bool isFirstTime = true;
static int framesCount = 0;
for (framesCount += numFrames; framesCount > 0; framesCount -= LOOP_FRAME_COUNT)
{
// Controls are polled before OnLoop, so input data could be
// overwritten by script API methods.
HandleControls(isTitle);
// Controls are polled before OnLoop to allow input data to be overwritten by script API methods.
HandleControls(isTitle);
// Pre-loop script and event handling.
g_GameScript->OnLoop(DELTA_TIME, false); // TODO: Don't use DELTA_TIME constant with variable framerate
HandleAllGlobalEvents(EventType::Loop, (Activator)LaraItem->Index);
// Pre-loop script and event handling.
g_GameScript->OnLoop(DELTA_TIME, false); // TODO: Don't use DELTA_TIME constant with high framerate.
HandleAllGlobalEvents(EventType::Loop, (Activator)LaraItem->Index);
// Clear last selected item in inventory (need to be after on loop event handling, so they can detect that).
g_Gui.CancelInventorySelection();
// Control lock is processed after handling scripts because builder may want to process input externally while locking player from input.
if (!isTitle && Lara.Control.IsLocked)
ClearAllActions();
// Control lock is processed after handling scripts, because builder may want to
// process input externally, while still locking Lara from input.
if (!isTitle && Lara.Control.IsLocked)
ClearAllActions();
// Item update should happen before camera update, so potential flyby/track camera triggers are processed correctly.
UpdateAllItems();
UpdateAllEffects();
UpdateLara(LaraItem, isTitle);
g_GameScriptEntities->TestCollidingObjects();
// Handle inventory / pause / load / save screens.
auto result = HandleMenuCalls(isTitle);
if (result != GameStatus::Normal)
return result;
// Smash shatters and clear stopper flags under them.
UpdateShatters();
// Handle global input events.
result = HandleGlobalInputEvents(isTitle);
if (result != GameStatus::Normal)
return result;
// Clear last selected item in inventory (must be after on loop event handling, so they can detect that).
g_Gui.CancelInventorySelection();
// Queued input actions are read again and cleared after UI
// interrupts are processed, so first frame after exiting UI
// will still register it.
ApplyActionQueue();
ClearActionQueue();
// Control lock is processed after handling scripts because builder may want to
// process input externally while locking player from input.
if (!isTitle && Lara.Control.IsLocked)
ClearAllActions();
UpdateCamera();
UpdateAllItems();
UpdateAllEffects();
UpdateLara(LaraItem, isTitle);
// Update weather.
Weather.Update();
g_GameScriptEntities->TestCollidingObjects();
// Update effects.
StreamerEffect.Update();
UpdateWibble();
UpdateSparks();
UpdateFireSparks();
UpdateSmoke();
UpdateBlood();
UpdateBubbles();
UpdateDebris();
UpdateGunShells();
UpdateFootprints();
UpdateSplashes();
UpdateElectricityArcs();
UpdateHelicalLasers();
UpdateDrips();
UpdateRats();
UpdateRipples();
UpdateBats();
UpdateSpiders();
UpdateSparkParticles();
UpdateSmokeParticles();
UpdateSimpleParticles();
UpdateExplosionParticles();
UpdateShockwaves();
UpdateBeetleSwarm();
UpdateLocusts();
UpdateUnderwaterBloodParticles();
UpdateFishSwarm();
UpdateGlobalLensFlare();
// Smash shatters and clear stopper flags under them.
UpdateShatters();
// Update HUD.
g_Hud.Update(*LaraItem);
UpdateFadeScreenAndCinematicBars();
// Update weather.
Weather.Update();
// Rumble screen (like in submarine level of TRC).
if (g_GameFlow->GetLevel(CurrentLevel)->Rumble)
RumbleScreen();
// Update effects.
UpdateWibble();
StreamerEffect.Update();
UpdateSparks();
UpdateFireSparks();
UpdateSmoke();
UpdateBlood();
UpdateBubbles();
UpdateDebris();
UpdateGunShells();
UpdateFootprints();
UpdateSplashes();
UpdateElectricityArcs();
UpdateHelicalLasers();
UpdateDrips();
UpdateRats();
UpdateRipples();
UpdateBats();
UpdateSpiders();
UpdateSparkParticles();
UpdateSmokeParticles();
UpdateSimpleParticles();
UpdateExplosionParticles();
UpdateShockwaves();
UpdateBeetleSwarm();
UpdateFishSwarm();
UpdateLocusts();
UpdateUnderwaterBloodParticles();
DoFlipEffect(FlipEffect, LaraItem);
// Update HUD.
g_Hud.Update(*LaraItem);
UpdateFadeScreenAndCinematicBars();
UpdateCamera();
// Rumble screen (like in submarine level of TRC).
if (g_GameFlow->GetLevel(CurrentLevel)->Rumble)
RumbleScreen();
PlaySoundSources();
Sound_UpdateScene();
PlaySoundSources();
DoFlipEffect(FlipEffect, LaraItem);
// Post-loop script and event handling.
g_GameScript->OnLoop(DELTA_TIME, true);
// Post-loop script and event handling.
g_GameScript->OnLoop(DELTA_TIME, true);
// Clear savegame loaded flag.
JustLoaded = false;
// Clear savegame loaded flag.
JustLoaded = false;
// Update timers.
GameTimer++;
GlobalCounter++;
// Update timers.
GameTimer++;
GlobalCounter++;
// Handle inventory, pause, load, save screens.
auto result = HandleMenuCalls(isTitle);
if (result != GameStatus::Normal)
return result;
// Add renderer objects on the first processed frame.
if (isFirstTime)
{
g_Renderer.Lock();
isFirstTime = false;
}
}
using ns = std::chrono::nanoseconds;
using get_time = std::chrono::steady_clock;
// Handle global input events.
result = HandleGlobalInputEvents(isTitle);
if (result != GameStatus::Normal)
return result;
auto time2 = std::chrono::high_resolution_clock::now();
ControlPhaseTime = (std::chrono::duration_cast<ns>(time2 - time1)).count() / 1000000;
ControlPhaseTime = (std::chrono::duration_cast<std::chrono::nanoseconds>(time2 - time1)).count() / 1000000;
return GameStatus::Normal;
}
unsigned CALLBACK GameMain(void *)
{
TENLog("Starting GameMain...", LogLevel::Info);
TENLog("Starting GameMain()...", LogLevel::Info);
TimeInit();
// Do a fixed time title image.
// Do fixed-time title image.
if (g_GameFlow->IntroImagePath.empty())
TENLog("Intro image path is not set.", LogLevel::Warning);
{
TENLog("Intro image path not set.", LogLevel::Warning);
}
else
{
g_Renderer.RenderTitleImage();
}
// Execute the Lua gameflow and play the game.
// Execute Lua gameflow and play game.
g_GameFlow->DoFlow();
DoTheGame = false;
// Finish the thread.
// Finish thread.
PostMessage(WindowsHandle, WM_CLOSE, NULL, NULL);
EndThread();
@ -298,7 +285,7 @@ GameStatus DoLevel(int levelIndex, bool loadGame)
// Load level. Fall back to title if unsuccessful.
if (!LoadLevelFile(levelIndex))
return isTitle ? GameStatus::ExitGame : GameStatus::ExitToTitle;
return (isTitle ? GameStatus::ExitGame : GameStatus::ExitToTitle);
// Initialize items, effects, lots, and cameras.
HairEffect.Initialize();
@ -355,11 +342,15 @@ void KillMoveItems()
{
for (int i = 0; i < ItemNewRoomNo; i++)
{
short itemNumber = ItemNewRooms[2 * i];
int itemNumber = ItemNewRooms[i * 2];
if (itemNumber >= 0)
ItemNewRoom(itemNumber, ItemNewRooms[2 * i + 1]);
{
ItemNewRoom(itemNumber, ItemNewRooms[(i * 2) + 1]);
}
else
{
KillItem(itemNumber & 0x7FFF);
}
}
}
@ -372,11 +363,15 @@ void KillMoveEffects()
{
for (int i = 0; i < ItemNewRoomNo; i++)
{
short itemNumber = ItemNewRooms[2 * i];
int itemNumber = ItemNewRooms[i * 2];
if (itemNumber >= 0)
EffectNewRoom(itemNumber, ItemNewRooms[2 * i + 1]);
{
EffectNewRoom(itemNumber, ItemNewRooms[(i * 2) + 1]);
}
else
{
KillEffect(itemNumber & 0x7FFF);
}
}
}
@ -399,13 +394,13 @@ void CleanUp()
// Reset oscillator seed.
Wibble = 0;
// Needs to be cleared, otherwise controls will lock if user exits to title while playing flyby with locked controls.
// Clear player lock, otherwise controls will lock if user exits to title while playing flyby with locked controls.
Lara.Control.IsLocked = false;
// Resets lightning and wind parameters to avoid holding over previous weather to new level.
Weather.Clear();
// Needs to be cleared, otherwise a list of active creatures from previous level will spill into new level.
// Clear creatures, otherwise list of active creatures from previous level will spill into new level.
ActiveCreatures.clear();
// Clear ropes.
@ -419,7 +414,7 @@ void CleanUp()
StreamerEffect.Clear();
ClearUnderwaterBloodParticles();
ClearBubbles();
ClearDisplaySprites();
ClearAllDisplaySprites();
ClearFootprints();
ClearDrips();
ClearRipples();
@ -455,26 +450,27 @@ void InitializeScripting(int levelIndex, LevelLoadType type)
g_GameStringsHandler->ClearDisplayStrings();
g_GameScript->ResetScripts(!levelIndex || type != LevelLoadType::New);
auto* level = g_GameFlow->GetLevel(levelIndex);
const auto& level = *g_GameFlow->GetLevel(levelIndex);
// Run level script if it exists.
if (!level->ScriptFileName.empty())
if (!level.ScriptFileName.empty())
{
g_GameScript->ExecuteScriptFile(g_GameFlow->GetGameDir() + level->ScriptFileName);
g_GameScript->ExecuteScriptFile(g_GameFlow->GetGameDir() + level.ScriptFileName);
g_GameScript->InitCallbacks();
g_GameStringsHandler->SetCallbackDrawString([](const std::string& key, D3DCOLOR color, const Vec2& pos, float scale, int flags)
{
g_Renderer.AddString(
key,
Vector2(((float)pos.x / (float)g_Configuration.ScreenWidth * DISPLAY_SPACE_RES.x),
((float)pos.y / (float)g_Configuration.ScreenHeight * DISPLAY_SPACE_RES.y)),
Vector2(
(pos.x / g_Configuration.ScreenWidth) * DISPLAY_SPACE_RES.x,
(pos.y / g_Configuration.ScreenHeight) * DISPLAY_SPACE_RES.y),
Color(color), scale, flags);
});
}
// Play default background music.
if (type != LevelLoadType::Load)
PlaySoundTrack(level->GetAmbientTrack(), SoundTrackType::BGM);
PlaySoundTrack(level.GetAmbientTrack(), SoundTrackType::BGM);
}
void DeInitializeScripting(int levelIndex, GameStatus reason)
@ -485,7 +481,7 @@ void DeInitializeScripting(int levelIndex, GameStatus reason)
g_GameScript->FreeLevelScripts();
g_GameScriptEntities->FreeEntities();
if (!levelIndex)
if (levelIndex == 0)
g_GameScript->ResetScripts(true);
}
@ -494,7 +490,7 @@ void InitializeOrLoadGame(bool loadGame)
g_Gui.SetInventoryItemChosen(NO_VALUE);
g_Gui.SetEnterInventory(NO_VALUE);
// Restore the game?
// Restore game?
if (loadGame)
{
SaveGame::Load(g_GameFlow->SelectedSaveGame);
@ -515,7 +511,7 @@ void InitializeOrLoadGame(bool loadGame)
}
else
{
// If not loading a savegame, clear all info.
// If not loading savegame, clear all info.
SaveGame::Statistics.Level = {};
if (InitializeGame)
@ -532,10 +528,6 @@ void InitializeOrLoadGame(bool loadGame)
{
SaveGame::LoadHub(CurrentLevel);
TENLog("Starting new level.", LogLevel::Info);
// Restore vehicle.
auto* item = FindItem(ID_LARA);
InitializePlayerVehicle(*item);
}
g_GameScript->OnStart();
@ -545,62 +537,47 @@ void InitializeOrLoadGame(bool loadGame)
GameStatus DoGameLoop(int levelIndex)
{
int numFrames = LOOP_FRAME_COUNT;
int frameCount = LOOP_FRAME_COUNT;
auto& status = g_GameFlow->LastGameStatus;
// Before entering actual game loop, ControlPhase must be
// Before entering actual game loop, ControlPhase() must be
// called once to sort out various runtime shenanigangs (e.g. hair).
status = ControlPhase(numFrames);
status = ControlPhase();
g_Synchronizer.Init();
bool legacy30FpsDoneDraw = false;
while (DoTheGame)
{
status = ControlPhase(numFrames);
g_Synchronizer.Sync();
if (!levelIndex)
while (g_Synchronizer.Synced())
{
UpdateInputActions(LaraItem);
status = ControlPhase();
g_Synchronizer.Step();
auto invStatus = g_Gui.TitleOptions(LaraItem);
legacy30FpsDoneDraw = false;
}
switch (invStatus)
if (status != GameStatus::Normal)
break;
if (!g_Configuration.EnableHighFramerate)
{
if (!legacy30FpsDoneDraw)
{
case InventoryResult::NewGame:
case InventoryResult::NewGameSelectedLevel:
status = GameStatus::NewGame;
break;
case InventoryResult::HomeLevel:
status = GameStatus::HomeLevel;
break;
case InventoryResult::LoadGame:
status = GameStatus::LoadGame;
break;
case InventoryResult::ExitGame:
status = GameStatus::ExitGame;
break;
DrawPhase(!levelIndex, 0.0f);
legacy30FpsDoneDraw = true;
}
if (invStatus != InventoryResult::None)
break;
}
else
{
if (status == GameStatus::ExitToTitle ||
status == GameStatus::LaraDead ||
status == GameStatus::LoadGame ||
status == GameStatus::LevelComplete)
{
break;
}
DrawPhase(!levelIndex, g_Synchronizer.GetInterpolationFactor());
}
numFrames = DrawPhase(!levelIndex);
Sound_UpdateScene();
}
EndGameLoop(levelIndex, status);
return status;
}
@ -614,28 +591,50 @@ void EndGameLoop(int levelIndex, GameStatus reason)
StopRumble();
}
void SetupInterpolation()
{
for (int i = 0; i < g_Level.Items.size(); i++)
g_Level.Items[i].DisableInterpolation = false;
}
void HandleControls(bool isTitle)
{
// Poll input devices and update input variables.
if (!isTitle)
{
// TODO: To allow cutscene skipping later, don't clear Deselect action.
UpdateInputActions(LaraItem, true);
}
else
{
// TODO: To allow cutscene skipping later, don't clear Deselect action.
UpdateInputActions(LaraItem, true);
if (isTitle)
ClearAction(In::Look);
}
}
GameStatus HandleMenuCalls(bool isTitle)
{
auto result = GameStatus::Normal;
auto gameStatus = GameStatus::Normal;
if (isTitle || ScreenFading)
return result;
if (ScreenFading)
return gameStatus;
// Does the player want to enter inventory?
if (isTitle)
{
auto invStatus = g_Gui.TitleOptions(LaraItem);
switch (invStatus)
{
case InventoryResult::NewGame:
case InventoryResult::NewGameSelectedLevel:
return GameStatus::NewGame;
case InventoryResult::LoadGame:
return GameStatus::LoadGame;
case InventoryResult::ExitGame:
return GameStatus::ExitGame;
}
return gameStatus;
}
// Handle inventory.
if (IsClicked(In::Save) && LaraItem->HitPoints > 0 &&
g_Gui.GetInventoryMode() != InventoryMode::Save &&
g_GameFlow->IsLoadSaveEnabled())
@ -652,28 +651,28 @@ GameStatus HandleMenuCalls(bool isTitle)
g_Gui.SetInventoryMode(InventoryMode::Load);
if (g_Gui.CallInventory(LaraItem, false))
result = GameStatus::LoadGame;
gameStatus = GameStatus::LoadGame;
}
else if (IsClicked(In::Pause) && LaraItem->HitPoints > 0 &&
g_Gui.GetInventoryMode() != InventoryMode::Pause)
{
if (g_Gui.CallPause())
result = GameStatus::ExitToTitle;
gameStatus = GameStatus::ExitToTitle;
}
else if ((IsClicked(In::Inventory) || g_Gui.GetEnterInventory() != NO_VALUE) &&
LaraItem->HitPoints > 0 && !Lara.Control.Look.IsUsingBinoculars)
{
if (g_Gui.CallInventory(LaraItem, true))
result = GameStatus::LoadGame;
gameStatus = GameStatus::LoadGame;
}
if (result != GameStatus::Normal)
if (gameStatus != GameStatus::Normal)
{
StopAllSounds();
StopRumble();
}
return result;
return gameStatus;
}
GameStatus HandleGlobalInputEvents(bool isTitle)

View file

@ -50,7 +50,7 @@ enum FadeStatus
constexpr int MAX_ROOMS = 1024;
constexpr int LOOP_FRAME_COUNT = 2;
constexpr auto LOOP_FRAME_COUNT = 2;
extern int GameTimer;
extern int RumbleTimer;
@ -78,9 +78,9 @@ extern int ControlPhaseTime;
extern std::vector<short> OutsideRoomTable[OUTSIDE_SIZE][OUTSIDE_SIZE];
int DrawPhase(bool isTitle);
void DrawPhase(bool isTitle, float interpolationFactor);
GameStatus ControlPhase(int numFrames);
GameStatus ControlPhase();
GameStatus DoLevel(int levelIndex, bool loadGame = false);
GameStatus DoGameLoop(int levelIndex);
void EndGameLoop(int levelIndex, GameStatus reason);
@ -102,4 +102,6 @@ void InitializeOrLoadGame(bool loadGame);
void InitializeScripting(int levelIndex, LevelLoadType type);
void DeInitializeScripting(int levelIndex);
void SetupInterpolation();
unsigned CALLBACK GameMain(void*);

View file

@ -329,6 +329,8 @@ void Turn180(ItemInfo* item)
item->Pose.Orientation.x = -item->Pose.Orientation.x;
item->Pose.Orientation.y += ANGLE(180.0f);
item->Pose.Orientation.z = -item->Pose.Orientation.z;
item->DisableInterpolation = true;
}
void FinishLevel(ItemInfo* item)

View file

@ -197,6 +197,13 @@ void InitializeSlot(short itemNumber, bool makeTarget)
creature->LOT.Drop = -BLOCK(1);
creature->LOT.Zone = ZoneType::Human;
break;
case LotType::EnemyJeep:
creature->LOT.Step = BLOCK(4);
creature->LOT.Drop = -BLOCK(4);
creature->LOT.CanJump = true;
creature->LOT.Zone = ZoneType::Human;
break;
}
ClearLOT(&creature->LOT);

View file

@ -344,18 +344,13 @@ void Antitrigger(short const value, short const flags)
if (flags & ONESHOT)
item->Flags |= ATONESHOT;
if (item->Active)
item->Status = ITEM_DEACTIVATED;
if (item->Active && Objects[item->ObjectNumber].intelligent)
{
item->Active = false;
item->Status = ITEM_DEACTIVATED;
if (Objects[item->ObjectNumber].intelligent)
{
DisableEntityAI(value);
RemoveActiveItem(value, false);
item->Status = ITEM_INVISIBLE;
}
DisableEntityAI(value);
RemoveActiveItem(value, false);
item->Status = ITEM_INVISIBLE;
}
}

View file

@ -58,6 +58,8 @@ namespace TEN::Effects::Blood
if (uwBlood.Life <= 0.0f)
continue;
uwBlood.StoreInterpolationData();
// Update size.
if (uwBlood.Size < UW_BLOOD_SIZE_MAX)
uwBlood.Size += 4.0f;

View file

@ -14,6 +14,21 @@ namespace TEN::Effects::Blood
float Init = 0.0f;
float Size = 0.0f;
float Opacity = 0.0f;
Vector3 PrevPosition = Vector3::Zero;
Vector4 PrevColor = Vector4::Zero;
float PrevLife = 0.0f;
float PrevSize = 0.0f;
float PrevOpacity = 0.0f;
void StoreInterpolationData()
{
PrevPosition = Position;
PrevColor = Color;
PrevLife = Life;
PrevSize = Size;
PrevOpacity = Opacity;
}
};
extern std::vector<UnderwaterBlood> UnderwaterBloodParticles;

View file

@ -14,7 +14,8 @@ namespace TEN::Effects::DisplaySprite
std::vector<DisplaySprite> DisplaySprites = {};
void AddDisplaySprite(GAME_OBJECT_ID objectID, int spriteID, const Vector2& pos, short orient, const Vector2& scale, const Vector4& color,
int priority, DisplaySpriteAlignMode alignMode, DisplaySpriteScaleMode scaleMode, BlendMode blendMode)
int priority, DisplaySpriteAlignMode alignMode, DisplaySpriteScaleMode scaleMode,
BlendMode blendMode, DisplaySpritePhase source)
{
auto displaySprite = DisplaySprite{};
displaySprite.ObjectID = objectID;
@ -27,12 +28,25 @@ namespace TEN::Effects::DisplaySprite
displaySprite.AlignMode = alignMode;
displaySprite.ScaleMode = scaleMode;
displaySprite.BlendMode = blendMode;
displaySprite.Source = source;
DisplaySprites.push_back(displaySprite);
}
void ClearDisplaySprites()
void ClearAllDisplaySprites()
{
DisplaySprites.clear();
}
void ClearDrawPhaseDisplaySprites()
{
DisplaySprites.erase(
std::remove_if(
DisplaySprites.begin(), DisplaySprites.end(),
[](const DisplaySprite& displaySprite)
{
return (displaySprite.Source == DisplaySpritePhase::Draw);
}),
DisplaySprites.end());
}
}

View file

@ -23,6 +23,12 @@ namespace TEN::Effects::DisplaySprite
Fill,
Stretch
};
enum class DisplaySpritePhase
{
Control,
Draw
};
struct DisplaySprite
{
@ -38,11 +44,15 @@ namespace TEN::Effects::DisplaySprite
DisplaySpriteAlignMode AlignMode = DisplaySpriteAlignMode::Center;
DisplaySpriteScaleMode ScaleMode = DisplaySpriteScaleMode::Fit;
BlendMode BlendMode = BlendMode::AlphaBlend;
DisplaySpritePhase Source = DisplaySpritePhase::Control;
};
extern std::vector<DisplaySprite> DisplaySprites;
void AddDisplaySprite(GAME_OBJECT_ID objectID, int spriteID, const Vector2& pos, short orient, const Vector2& scale, const Vector4& color,
int priority, DisplaySpriteAlignMode alignMode, DisplaySpriteScaleMode scaleMode, BlendMode blendMode);
void ClearDisplaySprites();
int priority, DisplaySpriteAlignMode alignMode, DisplaySpriteScaleMode scaleMode,
BlendMode blendMode, DisplaySpritePhase source);
void ClearAllDisplaySprites();
void ClearDrawPhaseDisplaySprites();
}

View file

@ -175,6 +175,8 @@ namespace TEN::Effects::Electricity
for (auto& laser : HelicalLasers)
{
laser.StoreInterpolationData();
// Set to despawn.
laser.Life -= 1.0f;
if (laser.Life <= 0.0f)
@ -213,6 +215,8 @@ namespace TEN::Effects::Electricity
if (arc.life <= 0.0f)
continue;
arc.StoreInterpolationData();
// If/when this behaviour is changed, modify AddLightningArc accordingly.
arc.life -= 2.0f;
if (arc.life > 0.0f)

View file

@ -39,6 +39,27 @@ namespace TEN::Effects::Electricity
int rotation;
int type;
int flags;
Vector3 PrevPos1 = Vector3::Zero;
Vector3 PrevPos2 = Vector3::Zero;
Vector3 PrevPos3 = Vector3::Zero;
Vector3 PrevPos4 = Vector3::Zero;
byte PrevR = 0;
byte PrevG = 0;
byte PrevB = 0;
float PrevLife = 0.0f;
void StoreInterpolationData()
{
PrevPos1 = pos1;
PrevPos2 = pos2;
PrevPos3 = pos3;
PrevPos4 = pos4;
PrevR = r;
PrevG = g;
PrevB = b;
PrevLife = life;
}
};
struct HelicalLaser
@ -57,6 +78,27 @@ namespace TEN::Effects::Electricity
float LengthEnd = 0.0f;
float Opacity = 0.0f;
short Rotation = 0;
Vector3 PrevOrigin = Vector3::Zero;
Vector3 PrevTarget = Vector3::Zero;
short PrevOrientation2D = 0;
Vector4 PrevColor = Vector4::Zero;
float PrevLife = 0.0f;
float PrevRadius = 0.0f;
float PrevLength = 0.0f;
float PrevOpacity = 0.0f;
void StoreInterpolationData()
{
PrevOrigin = Origin;
PrevTarget = Target;
PrevOrientation2D = Orientation2D;
PrevColor = Color;
PrevLife = Life;
PrevRadius = Radius;
PrevLength = Length;
PrevOpacity = Opacity;
}
};
extern std::vector<Electricity> ElectricityArcs;

View file

@ -59,6 +59,8 @@ namespace TEN::Effects::Ripple
if (ripple.Life <= 0.0f)
continue;
ripple.StoreInterpolationData();
// Update size.
if (ripple.Size < RIPPLE_SIZE_MAX)
ripple.Size += (ripple.Flags & ((int)RippleFlags::SlowFade | (int)RippleFlags::OnGround)) ? SIZE_STEP_SMALL : SIZE_STEP_LARGE;

View file

@ -23,6 +23,17 @@ namespace TEN::Effects::Ripple
float Size = 0.0f;
float FadeDuration = 0.0f;
int Flags = 0;
Vector3 PrevPosition = Vector3::Zero;
Vector4 PrevColor = Vector4::Zero;
float PrevSize = 0.0f;
void StoreInterpolationData()
{
PrevPosition = Position;
PrevColor = Color;
PrevSize = Size;
}
};
extern std::vector<Ripple> Ripples;

View file

@ -21,6 +21,8 @@ namespace TEN::Effects::Streamer
void Streamer::StreamerSegment::Update()
{
StoreInterpolationData();
// Update opacity.
if (Color.w > 0.0f)
Color.w = EaseInOutSine(0.0f, OpacityMax, Life / LifeMax);
@ -190,7 +192,10 @@ namespace TEN::Effects::Streamer
pool.erase(
std::remove_if(
pool.begin(), pool.end(),
[](const auto& streamer) { return streamer.Segments.empty(); }),
[](const auto& streamer)
{
return streamer.Segments.empty();
}),
pool.end());
}

View file

@ -9,10 +9,9 @@ namespace TEN::Effects::Streamer
{
enum class StreamerFlags
{
FadeLeft = (1 << 0),
FadeRight = (1 << 1),
BlendModeAdditive = (1 << 2)
FadeLeft = 1 << 0,
FadeRight = 1 << 1,
BlendModeAdditive = 1 << 2
};
class Streamer
@ -39,11 +38,21 @@ namespace TEN::Effects::Streamer
std::array<Vector3, VERTEX_COUNT> Vertices = {};
Vector4 PrevColor = Vector4::Zero;
std::array<Vector3, VERTEX_COUNT> PrevVertices = {};
void InitializeVertices(const Vector3& pos, float width);
void Update();
private:
void TransformVertices(float vel, float scaleRate);
void StoreInterpolationData()
{
PrevColor = Color;
PrevVertices[0] = Vertices[0];
PrevVertices[1] = Vertices[1];
}
};
// Members

View file

@ -147,6 +147,8 @@ namespace TEN::Effects::Bubble
if (bubble.Life <= 0.0f)
continue;
bubble.StoreInterpolationData();
// Update room number. TODO: Should use GetPointCollision(), but calling it for each bubble is very inefficient.
auto roomVector = RoomVector(bubble.RoomNumber, int(bubble.Position.y - bubble.Gravity));
int roomNumber = GetRoomVector(roomVector, Vector3i(bubble.Position.x, bubble.Position.y - bubble.Gravity, bubble.Position.z)).RoomNumber;

View file

@ -30,6 +30,19 @@ namespace TEN::Effects::Bubble
float Gravity = 0.0f;
float OscillationPeriod = 0.0f;
float OscillationVelocity = 0.0f;
Vector3 PrevPosition = Vector3::Zero;
Vector4 PrevColor = Vector4::Zero;
Vector2 PrevSize = Vector2::Zero;
float PrevLife = 0.0f;
void StoreInterpolationData()
{
PrevPosition = Position;
PrevColor = Color;
PrevSize = Size;
PrevLife = Life;
}
};
extern std::vector<Bubble> Bubbles;

View file

@ -133,12 +133,12 @@ void TriggerChaffSmoke(const Vector3i& pos, const Vector3i& vel, int speed, bool
smoke->blendMode = BlendMode::Additive;
smoke->x = pos.x + (GetRandomControl() & 7) - 3;
smoke->y = pos.y + (GetRandomControl() & 7) - 3;
smoke->z = pos.z + (GetRandomControl() & 7) - 3;
smoke->xVel = vel.x + ((GetRandomDraw() & 63) - 32);
smoke->yVel = vel.y;
smoke->zVel = vel.z + ((GetRandomDraw() & 63) - 32);
smoke->position.x = pos.x + (GetRandomControl() & 7) - 3;
smoke->position.y = pos.y + (GetRandomControl() & 7) - 3;
smoke->position.z = pos.z + (GetRandomControl() & 7) - 3;
smoke->velocity.x = vel.x + ((GetRandomDraw() & 63) - 32);
smoke->velocity.y = vel.y;
smoke->velocity.z = vel.z + ((GetRandomDraw() & 63) - 32);
smoke->friction = 4;
if (GetRandomControl() & 1)

View file

@ -216,6 +216,8 @@ void UpdateDebris()
{
if (deb.active)
{
deb.StoreInterpolationData();
FloorInfo* floor;
short roomNumber;

View file

@ -70,6 +70,13 @@ struct DebrisFragment
bool active;
bool isStatic;
Matrix Transform;
Matrix PrevTransform = Matrix::Identity;
void StoreInterpolationData()
{
PrevTransform = Transform;
}
};
extern SHATTER_ITEM ShatterItem;

View file

@ -107,6 +107,8 @@ namespace TEN::Effects::Drip
if (drip.Life <= 0.0f)
continue;
drip.StoreInterpolationData();
// Update velocity.
drip.Velocity.y += drip.Gravity;
if (TestEnvironment(ENV_FLAG_WIND, drip.RoomNumber))

View file

@ -15,6 +15,21 @@ namespace TEN::Effects::Drip
float Life = 0.0f;
float LifeMax = 0.0f;
float Gravity = 0.0f;
Vector3 PrevPosition = Vector3::Zero;
Vector3 PrevVelocity = Vector3::Zero;
Vector2 PrevSize = Vector2::Zero;
Vector4 PrevColor = Vector4::Zero;
float PrevLife = 0.0f;
void StoreInterpolationData()
{
PrevPosition = Position;
PrevColor = Color;
PrevSize = Size;
PrevLife = Life;
PrevVelocity = Velocity;
}
};
extern std::vector<Drip> Drips;

View file

@ -126,46 +126,42 @@ void DetatchSpark(int number, SpriteEnumFlag type)
Particle* GetFreeParticle()
{
int result = -1;
// Get first free available spark
int partID = NO_VALUE;
// Get first free available particle.
for (int i = 0; i < MAX_PARTICLES; i++)
{
auto* particle = &Particles[i];
if (!particle->on)
const auto& part = Particles[i];
if (!part.on)
{
result = i;
partID = i;
break;
}
}
// No free sparks left, hijack existing one with less possible life
int life = INT_MAX;
if (result == -1)
// No free particles; get particle with shortest life.
float shortestLife = INFINITY;
if (partID == NO_VALUE)
{
for (int i = 0; i < MAX_PARTICLES; i++)
{
auto* particle = &Particles[i];
const auto& part = Particles[i];
if (particle->life < life && particle->dynamic == -1 && !(particle->flags & SP_EXPLOSION))
if (part.life < shortestLife && part.dynamic == NO_VALUE && !(part.flags & SP_EXPLOSION))
{
result = i;
life = particle->life;
partID = i;
shortestLife = part.life;
}
}
}
auto* spark = &Particles[result];
auto& part = Particles[partID];
part.spriteIndex = Objects[ID_DEFAULT_SPRITES].meshIndex;
part.blendMode = BlendMode::Additive;
part.extras = 0;
part.dynamic = NO_VALUE;
spark->extras = 0;
spark->dynamic = -1;
spark->spriteIndex = Objects[ID_DEFAULT_SPRITES].meshIndex;
spark->blendMode = BlendMode::Additive;
return spark;
return &part;
}
void SetSpriteSequence(Particle& particle, GAME_OBJECT_ID objectID)
@ -209,6 +205,8 @@ void UpdateSparks()
if (spark->on)
{
spark->StoreInterpolationData();
spark->life--;
if (!spark->life)
@ -1057,6 +1055,8 @@ void UpdateSplashes()
if (splash.isActive)
{
splash.StoreInterpolationData();
splash.life--;
if (splash.life <= 0)
splash.isActive = false;
@ -1246,7 +1246,7 @@ void KillAllCurrentItems(short itemNumber)
// TODO: Reimplement this functionality.
}
// TODO: Rname to SpawnDynamicLight().
// TODO: Rename to SpawnDynamicLight().
void TriggerDynamicLight(const Vector3& pos, const Color& color, float falloff)
{
g_Renderer.AddDynamicLight(
@ -1470,21 +1470,21 @@ void TriggerFlashSmoke(int x, int y, int z, short roomNumber)
spark->fadeToBlack = 16;
spark->blendMode = BlendMode::Additive;
spark->life = spark->sLife = (GetRandomControl() & 0xF) + 64;
spark->x = (GetRandomControl() & 0x1F) + x - 16;
spark->y = (GetRandomControl() & 0x1F) + y - 16;
spark->z = (GetRandomControl() & 0x1F) + z - 16;
spark->position.x = (GetRandomControl() & 0x1F) + x - 16;
spark->position.y = (GetRandomControl() & 0x1F) + y - 16;
spark->position.z = (GetRandomControl() & 0x1F) + z - 16;
if (water)
{
spark->xVel = spark->yVel = GetRandomControl() & 0x3FF - 512;
spark->zVel = (GetRandomControl() & 0x3FF) - 512;
spark->velocity.x = spark->velocity.y = GetRandomControl() & 0x3FF - 512;
spark->velocity.z = (GetRandomControl() & 0x3FF) - 512;
spark->friction = 68;
}
else
{
spark->xVel = 2 * (GetRandomControl() & 0x3FF) - 1024;
spark->yVel = -512 - (GetRandomControl() & 0x3FF);
spark->zVel = 2 * (GetRandomControl() & 0x3FF) - 1024;
spark->velocity.x = 2 * (GetRandomControl() & 0x3FF) - 1024;
spark->velocity.y = -512 - (GetRandomControl() & 0x3FF);
spark->velocity.z = 2 * (GetRandomControl() & 0x3FF) - 1024;
spark->friction = 85;
}

View file

@ -91,6 +91,8 @@ struct FX_INFO
Vector4 color;
short flag1;
short flag2;
bool DisableInterpolation;
};
struct NODEOFFSET_INFO
@ -112,17 +114,6 @@ struct SPLASH_SETUP
int room;
};
struct RIPPLE_STRUCT
{
int x;
int y;
int z;
char flags;
unsigned char life;
unsigned char size;
unsigned char init;
};
struct Particle
{
int x;
@ -162,6 +153,27 @@ struct Particle
int fxObj;
int roomNumber;
unsigned char nodeNumber; // ParticleNodeOffsetIDs enum.
int PrevX;
int PrevY;
int PrevZ;
short PrevRotAng;
byte PrevR;
byte PrevG;
byte PrevB;
byte PrevScalar;
void StoreInterpolationData()
{
PrevX = x;
PrevY = y;
PrevZ = z;
PrevRotAng = rotAng;
PrevR = r;
PrevG = g;
PrevB = b;
PrevScalar = scalar;
}
};
struct SPLASH_STRUCT
@ -183,6 +195,25 @@ struct SPLASH_STRUCT
unsigned short life;
bool isRipple;
bool isActive;
Vector3 PrevPosition = Vector3::Zero;
float PrevInnerRad = 0.0f;
float PrevOuterRad = 0.0f;
float PrevHeight = 0.0f;
float PrevHeightSpeed = 0.0f;
float PrevAnimPhase = 0.0f;
unsigned short PrevLife = 0;
void StoreInterpolationData()
{
PrevPosition = Vector3(x, y, z);
PrevInnerRad = innerRad;
PrevOuterRad = outerRad;
PrevHeight = height;
PrevHeightSpeed = heightSpeed;
PrevAnimPhase = animationPhase;
PrevLife = life;
}
};
struct ParticleDynamic

View file

@ -49,6 +49,8 @@ namespace TEN::Effects::Explosion
if (!e.active)
continue;
e.StoreInterpolationData();
e.age++;
if (e.age > e.life)
{

View file

@ -1,28 +1,41 @@
#pragma once
#include <array>
#include <d3d11.h>
#include <SimpleMath.h>
namespace TEN::Effects::Explosion
{
struct ExplosionParticle
{
Vector3 pos;
Vector3 vel;
Vector4 tint;
float size;
float rotation;
float angularVel;
float age;
float life;
int room;
int sprite;
bool active;
};
extern std::array<ExplosionParticle, 64> explosionParticles;
void TriggerExplosion(const Vector3& pos, float size, bool triggerSparks, bool triggerSmoke, bool triggerShockwave, int room);
void UpdateExplosionParticles();
ExplosionParticle& getFreeExplosionParticle();
void SpawnExplosionParticle(const Vector3& pos);
}
#pragma once
#include <array>
#include <d3d11.h>
#include <SimpleMath.h>
namespace TEN::Effects::Explosion
{
struct ExplosionParticle
{
Vector3 pos;
Vector3 vel;
Vector4 tint;
float size;
float rotation;
float angularVel;
float age;
float life;
int room;
int sprite;
bool active;
Vector3 oldPos;
Vector4 oldTint;
float oldSize;
float oldRotation;
void StoreInterpolationData()
{
oldPos = pos;
oldTint = tint;
oldSize = size;
oldRotation = rotation;
}
};
extern std::array<ExplosionParticle, 64> explosionParticles;
void TriggerExplosion(const Vector3& pos, float size, bool triggerSparks, bool triggerSmoke, bool triggerShockwave, int room);
void UpdateExplosionParticles();
ExplosionParticle& getFreeExplosionParticle();
void SpawnExplosionParticle(const Vector3& pos);
}

Some files were not shown because too many files have changed in this diff Show more