Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
b5740ca
Cleanup and refactor SceneLayer
MaximDude Aug 7, 2021
7a60bb0
Separate TerrainFrosting from SLTerrain
MaximDude Aug 7, 2021
12afa0a
Move terrain frosting application from SLTerrain to TerrainFrosting
MaximDude Aug 7, 2021
aee6bb9
Cleanup and refactor SLTerrain
MaximDude Aug 9, 2021
0575440
Misc changes
MaximDude Aug 9, 2021
a93c61b
Merge branch 'development' into GI66-Backdrop-Layer-Improvements
MaximDude Aug 9, 2021
889613c
Merge branch 'development' into GI66-Backdrop-Layer-Improvements
MaximDude Aug 9, 2021
c3a3fb8
More cleanup and refactor SLTerrain
MaximDude Aug 9, 2021
386b889
Move temp bitmaps handling from SLTerrain to SceneMan
MaximDude Aug 9, 2021
75ebaba
More cleanup and refactor in SceneLayer and SLTerrain
MaximDude Aug 10, 2021
63c2135
Add new class SLBackground to specifically deal with background layer…
MaximDude Aug 10, 2021
e825cd0
Replace SceneLayer with SLBackground where applicable
MaximDude Aug 10, 2021
713079d
Move SpriteAnimMode enum from MOSprite to Constants - need to be avai…
MaximDude Aug 10, 2021
13ef98d
Get background layers working with SLBackground
MaximDude Aug 11, 2021
c669fcb
Implement background layer animation
MaximDude Aug 11, 2021
3136ea0
Implement background layer auto scrolling
MaximDude Aug 11, 2021
ccd4936
Misc changes
MaximDude Aug 11, 2021
01f5537
Expose SLBackground to Lua
MaximDude Aug 11, 2021
07314c5
Implement background layer auto scaling
MaximDude Aug 13, 2021
46ef962
Comments, cleanup and more refactor in SceneLayer and SLBackground
MaximDude Aug 13, 2021
96e03e0
Expose more SLBackground properties to Lua
MaximDude Aug 13, 2021
dd4e7f9
Add SLBackgrounds property to ignore the auto-scaling setting
MaximDude Aug 13, 2021
a48eee1
More refactor in SceneLayer drawing
MaximDude Aug 13, 2021
81653e8
Fix material view not drawing correctly in 2+ player splitscreen - Re…
MaximDude Aug 13, 2021
78f780b
Calculate auto-scale factor from player screen buffer instead of the …
MaximDude Aug 14, 2021
b63de7b
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
MaximDude Aug 14, 2021
16e986c
No need to clear background layer data during Scene::ClearData - bitm…
MaximDude Aug 14, 2021
e0dc733
Fix offset jitter when background layer is wrapped during auto-scroll…
MaximDude Aug 14, 2021
90712e0
Move material color key enum from SceneMan to Constants
MaximDude Aug 14, 2021
7858200
Clean up a bunch of includes
MaximDude Aug 14, 2021
985246a
Minor refactor in TerrainFrosting
MaximDude Aug 14, 2021
04b9b47
Fix auto-scroll stepping logic
MaximDude Aug 16, 2021
6ab2045
Refactor SceneLayer tiled drawing so it works properly with X+Y wrapping
MaximDude Aug 16, 2021
d194f14
Minor refactor in TerrainDebris
MaximDude Aug 17, 2021
01015ac
Add support for Material background textures
MaximDude Aug 17, 2021
d2e1eaf
Implement SLTerrain background layer texturization with Material back…
MaximDude Aug 18, 2021
76559d0
Rework and expand TerrainDebris placement logic
MaximDude Aug 18, 2021
b7f292c
Implement TerrainDebris rotation and flipping
MaximDude Aug 19, 2021
c33176c
Improve SLBackground auto-scaling when the player screen buffer is ta…
MaximDude Aug 19, 2021
181f3e0
Misc changes
MaximDude Aug 20, 2021
e362701
Refactor SLTerrain drawing mode handling and cleanup SceneMan::Draw
MaximDude Aug 20, 2021
0fcdf04
Adjust background layer scroll ratio to scale factor so scrolling is …
MaximDude Aug 20, 2021
8967905
Move background layer edge gap filling handling from SceneLayer to SL…
MaximDude Aug 20, 2021
8ad88a3
Add more temp bitmap sizes for settling into terrain and improve logi…
MaximDude Aug 21, 2021
fbafd3f
Refactor drawing settled objects to terrain
MaximDude Aug 21, 2021
872b56c
Refactor SceneLayer offset handling and drawing
MaximDude Aug 21, 2021
fddd0cd
Cleanup some title screen scrolling handling
MaximDude Aug 21, 2021
140e637
Remove SceneLayer ini property Offset - handled internally so does no…
MaximDude Aug 22, 2021
54b64aa
Add SLBackground ini property OriginPointOffset and handling
MaximDude Aug 22, 2021
b848a58
Comments and misc cleanup
MaximDude Aug 23, 2021
7418adf
Misc changes
MaximDude Aug 23, 2021
f2a9dd4
Remove SLTerrain ini alt property AddTerrainObject - Use PlaceTerrain…
MaximDude Aug 23, 2021
25f636f
Make ScrollRatio, ScaleFactor and DrawTransparent ini properties excl…
MaximDude Aug 23, 2021
1b2c98d
And SLBackground animation controls and expose to Lua
MaximDude Aug 23, 2021
c5eb9af
Fix random SceneLayer scrolling jitter
MaximDude Aug 23, 2021
c148d46
Cleanup and minor refactor in SceneMan::Update
MaximDude Aug 23, 2021
37ebdb7
Remove SceneLayer scroll overriding - unnecessary since SLTerrain::Ap…
MaximDude Aug 23, 2021
3e092c0
Add handling for setting scene background layer auto-scaling mode fro…
MaximDude Aug 23, 2021
20af581
Update Entities meson build file
MaximDude Aug 23, 2021
c88966d
Fix duplicate loaded bitmaps in SLBackground
MaximDude Aug 23, 2021
156b668
Comments, cleanup and misc changes in SLTerrain
MaximDude Aug 24, 2021
8199cd3
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
MaximDude Aug 25, 2021
0c4bb8f
Remove unimplemented SLTerrain structural integrity stuff - maybe one…
MaximDude Aug 26, 2021
4c7f96f
Reformat and partial refactor in TerrainObject
MaximDude Aug 26, 2021
c9b0da9
More refactor in TerrainObject
MaximDude Aug 27, 2021
8767523
Move terrain object application from SLTerrain to TerrainObject
MaximDude Aug 27, 2021
c09cff6
Fix SceneEditor crash after changing background layers from SceneLaye…
MaximDude Aug 27, 2021
e177829
Add Y wrap handling to TerrainObject::ApplyTerrainObject
MaximDude Aug 27, 2021
268e59b
Move movable object application from SLTerrain to MovableObject
MaximDude Aug 27, 2021
be84a98
Rename ApplyObject methods to DrawToTerrain
MaximDude Aug 27, 2021
e7a653f
Misc changes in SLTerrain
MaximDude Aug 27, 2021
87f3acd
Forgot to add some checks when drawing TerrainObjects
MaximDude Aug 27, 2021
e3da819
Decouple a bunch of headers
MaximDude Aug 28, 2021
34b2e9b
More renaming (followup to be84a98ad5482ee6ea09fa28a2cdf94e81b5cac2)
MaximDude Aug 28, 2021
c760cd5
Remove a bunch of useless drawing modes
MaximDude Aug 28, 2021
18a4980
Remove deprecated and unused properties from SceneMan::ReadProperty
MaximDude Aug 29, 2021
a137387
Eliminate SceneLayer::GetBitmapHash
MaximDude Aug 29, 2021
1d25f77
Eliminate SLTerrain::ClearAllMaterial - handle in GibEditor as ClearT…
MaximDude Aug 29, 2021
d2cae4b
Comments, renaming and misc changes
MaximDude Aug 29, 2021
3519099
Eliminate duplicate handling for getting/setting pixels on SLTerrain …
MaximDude Aug 29, 2021
c08c710
Misc changes and cleanup
MaximDude Aug 29, 2021
2abd097
Merge SLTerrain::PlaceObjectOnTerrain and SceneMan::AddTerrainObject …
MaximDude Aug 31, 2021
ac4adb1
Add some checks for TerrainObject bitmaps
MaximDude Aug 31, 2021
67ced2b
Misc changes
MaximDude Sep 1, 2021
e9e03a4
Save SceneLayer data as PNG for reduced filesizes and multithread so …
MaximDude Sep 1, 2021
72e1208
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
MaximDude Sep 1, 2021
a49283a
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
MaximDude Oct 22, 2021
3e02aca
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
MaximDude Oct 24, 2021
dda4f6b
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
MaximDude Dec 28, 2021
3d38d90
Comments and misc changes
MaximDude Dec 28, 2021
d4b1749
Update changelog
MaximDude Jan 2, 2022
9041008
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
MaximDude Mar 1, 2022
8358d3e
Fix changelog
MaximDude Mar 2, 2022
a02bf3a
Review changes
MaximDude May 23, 2022
7ecde6c
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
MaximDude May 23, 2022
6c7f847
Review changes
MaximDude May 29, 2022
b69a571
Review changes
MaximDude Jun 20, 2022
380e375
I accidentally the whole SLBackground
MaximDude Jun 20, 2022
8dc1b4d
Review changes
MaximDude Jul 2, 2022
7bac1fb
Review changes
MaximDude Jul 24, 2022
2fc7dd5
Set dislodged terrain pixel PresetName in debug builds only
MaximDude Jul 24, 2022
400d85b
Merge branch 'development' into GI66-CF243-Background-Layer-Improvements
garethyr Jul 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Activities/ActorEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ void ActorEditor::DrawGUI(BITMAP *pTargetBitmap, const Vector &targetPos, int wh
if (m_pEditedActor)
{
m_pEditedActor->Draw(pTargetBitmap, targetPos, g_DrawColor);
m_pEditedActor->Draw(pTargetBitmap, targetPos, g_DrawDebug);
}

// Clear out annoying blooms
Expand Down
4 changes: 2 additions & 2 deletions Activities/AreaEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ bool AreaEditor::SaveScene(string saveAsName, bool forceOverwrite)
if (g_PresetMan.GetDataModule(m_ModuleSpaceID)->GetFileName() == "Scenes.rte")
{
string sceneFilePath(g_PresetMan.GetDataModule(m_ModuleSpaceID)->GetFileName() + "/" + saveAsName + ".ini");
string previewFilePath(g_PresetMan.GetDataModule(m_ModuleSpaceID)->GetFileName() + "/" + saveAsName + ".preview.bmp");
string previewFilePath(g_PresetMan.GetDataModule(m_ModuleSpaceID)->GetFileName() + "/" + saveAsName + ".preview.png");
if (g_PresetMan.AddEntityPreset(g_SceneMan.GetScene(), m_ModuleSpaceID, forceOverwrite, sceneFilePath))
{
// Save preview
Expand All @@ -638,7 +638,7 @@ bool AreaEditor::SaveScene(string saveAsName, bool forceOverwrite)
{
// Try to save to the data module
string sceneFilePath(g_PresetMan.GetDataModule(m_ModuleSpaceID)->GetFileName() + "/Scenes/" + saveAsName + ".ini");
string previewFilePath(g_PresetMan.GetDataModule(m_ModuleSpaceID)->GetFileName() + "/Scenes/" + saveAsName + ".preview.bmp");
string previewFilePath(g_PresetMan.GetDataModule(m_ModuleSpaceID)->GetFileName() + "/Scenes/" + saveAsName + ".preview.png");
if (g_PresetMan.AddEntityPreset(g_SceneMan.GetScene(), m_ModuleSpaceID, forceOverwrite, sceneFilePath))
{
// Save preview
Expand Down
13 changes: 10 additions & 3 deletions Activities/GibEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void GibEditor::Update()
// Clear out the terrain after a few tests
if (m_TestCounter >= 3)
{
g_SceneMan.GetScene()->GetTerrain()->ClearAllMaterial();
ClearTestArea();
m_TestCounter = 0;
}
// Clear all crap still flying around
Expand Down Expand Up @@ -529,7 +529,7 @@ void GibEditor::Update()
}

// Clear out the testing area
g_SceneMan.GetScene()->GetTerrain()->ClearAllMaterial();
ClearTestArea();
m_TestCounter = 0;

m_pObjectToLoad = 0;
Expand Down Expand Up @@ -955,4 +955,11 @@ void GibEditor::UpdateOverwriteDialog()
m_pOverwriteNameLabel->SetText(g_PresetMan.GetDataModule(m_ModuleSpaceID)->GetFileName() + "/NewData/" + m_pEditedObject->GetPresetName() + ".ini");
}

} // namespace RTE
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void GibEditor::ClearTestArea() const {
clear_bitmap(g_SceneMan.GetTerrain()->GetFGColorBitmap());
clear_bitmap(g_SceneMan.GetTerrain()->GetBGColorBitmap());
clear_bitmap(g_SceneMan.GetTerrain()->GetMaterialBitmap());
}
}
5 changes: 5 additions & 0 deletions Activities/GibEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ ClassInfoGetters;

private:

/// <summary>
/// Clears all the layers of the testing area terrain so nothing that somehow settled lingers between edited object changes and testing phases.
/// </summary>
void ClearTestArea() const;


//////////////////////////////////////////////////////////////////////////////////////////
// Method: Clear
Expand Down
19 changes: 10 additions & 9 deletions Activities/SceneEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "HeldDevice.h"
#include "Scene.h"
#include "DataModule.h"
#include "SLBackground.h"

#include "GUI.h"
#include "GUIFont.h"
Expand Down Expand Up @@ -417,22 +418,22 @@ void SceneEditor::Update()
pItem = m_pNewBG1Combo->GetItem(m_pNewBG1Combo->GetSelectedIndex());
if (pItem && !pItem->m_Name.empty())
{
SceneLayer *pNewLayer = dynamic_cast<SceneLayer *>(g_PresetMan.GetEntityPreset("SceneLayer", pItem->m_Name, m_ModuleSpaceID)->Clone());
RTEAssert(pNewLayer, "No SceneLayer of the name set as BG1 is defined!");
SLBackground *pNewLayer = dynamic_cast<SLBackground *>(g_PresetMan.GetEntityPreset("SLBackground", pItem->m_Name, m_ModuleSpaceID)->Clone());
RTEAssert(pNewLayer, "No SLBackground of the name set as BG1 is defined!");
Comment thread
garethyr marked this conversation as resolved.
pNewScene->GetBackLayers().push_back(pNewLayer);
}
pItem = m_pNewBG2Combo->GetItem(m_pNewBG2Combo->GetSelectedIndex());
if (pItem && !pItem->m_Name.empty())
{
SceneLayer *pNewLayer = dynamic_cast<SceneLayer *>(g_PresetMan.GetEntityPreset("SceneLayer", pItem->m_Name, m_ModuleSpaceID)->Clone());
RTEAssert(pNewLayer, "No SceneLayer of the name set as BG2 is defined!");
SLBackground *pNewLayer = dynamic_cast<SLBackground *>(g_PresetMan.GetEntityPreset("SLBackground", pItem->m_Name, m_ModuleSpaceID)->Clone());
RTEAssert(pNewLayer, "No SLBackground of the name set as BG2 is defined!");
pNewScene->GetBackLayers().push_back(pNewLayer);
}
pItem = m_pNewBG3Combo->GetItem(m_pNewBG3Combo->GetSelectedIndex());
if (pItem && !pItem->m_Name.empty())
{
SceneLayer *pNewLayer = dynamic_cast<SceneLayer *>(g_PresetMan.GetEntityPreset("SceneLayer", pItem->m_Name, m_ModuleSpaceID)->Clone());
RTEAssert(pNewLayer, "No SceneLayer of the name set as BG3 is defined!");
SLBackground *pNewLayer = dynamic_cast<SLBackground *>(g_PresetMan.GetEntityPreset("SLBackground", pItem->m_Name, m_ModuleSpaceID)->Clone());
RTEAssert(pNewLayer, "No SLBackground of the name set as BG3 is defined!");
pNewScene->GetBackLayers().push_back(pNewLayer);
}

Expand Down Expand Up @@ -795,21 +796,21 @@ void SceneEditor::UpdateNewDialog()

// Get the list of all read in NEAR background layers
list<Entity *> bgList;
g_PresetMan.GetAllOfGroupInModuleSpace(bgList, "Near Backdrops", "SceneLayer", selectedModuleID);
g_PresetMan.GetAllOfGroupInModuleSpace(bgList, "Near Backdrops", "SLBackground", selectedModuleID);
// Go through the list and add their names to the combo box
for (list<Entity *>::iterator itr = bgList.begin(); itr != bgList.end(); ++itr)
m_pNewBG1Combo->AddItem((*itr)->GetPresetName());

// Get the list of all read in MID background layers
bgList.clear();
g_PresetMan.GetAllOfGroupInModuleSpace(bgList, "Mid Backdrops", "SceneLayer", selectedModuleID);
g_PresetMan.GetAllOfGroupInModuleSpace(bgList, "Mid Backdrops", "SLBackground", selectedModuleID);
// Go through the list and add their names to the combo box
for (list<Entity *>::iterator itr = bgList.begin(); itr != bgList.end(); ++itr)
m_pNewBG2Combo->AddItem((*itr)->GetPresetName());

// Get the list of all read in FAR background layers
bgList.clear();
g_PresetMan.GetAllOfGroupInModuleSpace(bgList, "Far Backdrops", "SceneLayer", selectedModuleID);
g_PresetMan.GetAllOfGroupInModuleSpace(bgList, "Far Backdrops", "SLBackground", selectedModuleID);
// Go through the list and add their names to the combo box
for (list<Entity *>::iterator itr = bgList.begin(); itr != bgList.end(); ++itr)
m_pNewBG3Combo->AddItem((*itr)->GetPresetName());
Expand Down
101 changes: 99 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,121 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

<details><summary><b>Added</b></summary>

- New `DataModule` INI property `SupportedGameVersion` to define what version of the game a mod supports. This must be specified, and must match the current game version, in order for the mod to load succesfully.
- New `DataModule` INI property `SupportedGameVersion` to define what version of the game a mod supports. This must be specified, and must match the current game version, in order for the mod to load successfully.

- New `Actor` INI properties `Organic = 0/1` and `Robotic = 0/1` and supporting Lua functions `Actor:IsOrganic()` and `Actor:IsRobotic()`. These have no direct gameplay effect (and default to false), but will be very useful for inter-mod compatibility, as they allow scripts to know if an `Actor` is organic or robotic, and treat them accordingly.
- New `Actor` INI properties `Organic = 0/1` and `Robotic = 0/1` and supporting Lua functions `Actor:IsOrganic()` and `Actor:IsRobotic()`.
These have no direct gameplay effect (and default to false), but will be very useful for inter-mod compatibility, as they allow scripts to know if an `Actor` is organic or robotic, and treat them accordingly.

- New INI and Lua (R/W) `ACDropShip` property `HoverHeightModifier`. This allows for modification of the height at which an `ACDropShip` will hover when unloading cargo, or staying at a location.

- New `Scene` Lua property `BackgroundLayers` (R/O) to access an iterator of the `Scene`'s `SLBackground` layers.

- `SLBackground` layers can now be animated using the same INI and Lua animation controls as everything else (`FrameCount`, `SpriteAnimMode`, etc). ([Issue #66](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/66))
The collection of the `Scene`'s background layers can be accessed via `scene.BackgroundLayers`.

- Added `SLBackground` auto-scrolling INI and Lua controls. ([Issue #66](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/66))
The INI definition looks like this:
```
CanAutoScrollX = 0/1 // Whether this can auto-scroll on the X axis. Scrolling will take effect only when combined with WrapX = 1, otherwise ignored.
CanAutoScrollY = 0/1 // Whether this can auto-scroll on the Y axis. Scrolling will take effect only when combined with WrapY = 1, otherwise ignored.

AutoScrollStepInterval = intValue // The duration between auto-scrolling steps on both axis, in milliseconds.

AutoScrollStep = Vector
X = intValue // The number of pixels to progress the scrolling on the X axis each step. Float values are supported but may end up choppy and inconsistent due to internal rounding and lack of sub-pixel precision.
Y = intValue // The number of pixels to progress the scrolling on the Y axis each step. Float values are supported but may end up choppy and inconsistent due to internal rounding and lack of sub-pixel precision.
```
You can read and write the following Lua properties:
```
slBackground.CanAutoScrollX = bool -- this may be true even if X axis scrolling is not in effect due to WrapX = 0.
slBackground.CanAutoScrollY = bool -- this may be true even if Y axis scrolling is not in effect due to WrapY = 0.
slBackground.AutoScrollInterval = intValue
slBackground.AutoScrollStep = vector
slBackground.AutoScrollStepX = intValue
slBackground.AutoScrollStepY = intValue
```
`slBackground:IsAutoScrolling()` - (R/O) returns whether auto-scrolling is actually in effect on either axis (meaning either `WrapX` and `CanAutoScrollX` or `WrapY` and `CanAutoScrollY` are true).

The collection of the `Scene`'s background layers can be accessed via `scene.BackgroundLayers`.

- New `Settings.ini` property `SceneBackgroundAutoScaleMode = 0/1/2`. ([Issue #243](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/243))
Auto-scaling modes are: 0 = Off, 1 = Fit Screen, 2 = Always 2x.
This will auto-scale all `Scene` background layers to cover the whole screen vertically in cases where the layer's sprite is too short and creates a gap at the bottom.
In cases where a layer is short by design, auto-scaling behavior can be disabled on a per-layer basis using the `SLBackground` INI property `IgnoreAutoScaling`, otherwise it may be excessively scaled up to 2x (maximum).
Note that any `ScaleFactor` definitions in layers that aren't set to ignore auto-scaling will be overridden.

Only relevant when playing on un-scaled vertical resolutions of 640p and above as most background layer sprites are currently around 580px tall, and comes with a minor performance impact.
Note that in fit screen mode each layer is scaled individually so some layers may be scaled more than others, or not scaled at all.
In always 2x mode all layers will be equally scaled to 2x.

- New `SLBackground` INI property `IgnoreAutoScaling = 0/1` to ignore the global background layer auto-scaling setting and use the `ScaleFactor` defined in the preset, if any.

- New `SLBackground` INI property `OriginPointOffset` to offset the layer from the top left corner of the screen.

- Added new `TerrainDebris` scattering functionality. ([Issue #152](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/152))
New INI properties are:
```
MinRotation/MaxRotation = angleDegrees // Rotates each debris piece to a random angle within the specified values. Values in degrees, negative values are counter-clockwise.

FlipChance = floatValue // Chance for a debris piece to be flipped when either `CanHFlip` or `CanYFlip` are set true. 0-1, defaults to 0.5.

CanHFlip/CanVFlip = 0/1 // Flips each debris piece on the X, Y or both axis.
```

- Added support for `Material` background textures with INI property `BGTextureFile`.

</details>

<details><summary><b>Changed</b></summary>

- Completely replaced `ScriptFile` with `ScriptPath`.

- `Scene` background layer presets in INI are now defined as `SLBackground` rather than `SceneLayer`.

- `TerrainDebris` INI property `OnlyOnSurface = 0/1` replaced with `DebrisPlacementMode = 0-6`.
Placement modes are:
```
0 (NoPlacementRestrictions) // Debris will be placed anywhere where there is target material (currently not strictly enforced when being offset by min/max depth, so can end up being placed mid-air/cavity unless set to OnlyBuried = 1).

1 (OnSurfaceOnly) // Debris will be placed only on the surface (scanning from top to bottom) where no background cavity material (material index 1) was encountered before the target material.

2 (OnCavitySurfaceOnly) // Debris will be placed only on the surface (scanning from top to bottom) where background cavity material (material index 1) was encountered before the target material.

3 (OnSurfaceAndCavitySurface) // Debris will be placed only on the surface (scanning from top to bottom) regardless whether background cavity material (material index 1) was encountered before the target material.

4 (OnOverhangOnly) // Debris will be placed only on overhangs (scanning from bottom to top) where no background cavity material (material index 1) was encountered before the target material.

5 (OnCavityOverhangOnly) // Debris will be placed only on overhangs (scanning from bottom to top) where background cavity material (material index 1) was encountered before the target material.

6 (OnOverhangAndCavityOverhang) // Debris will be placed only on overhangs (scanning from bottom to top) regardless whether background cavity material (material index 1) was encountered before the target material.
```

- `Material` INI property `TextureFile` renamed to `FGTextureFile` to accommodate new background texture property.

- `TerrainObject`s no longer have a hard requirement for `FG` and `Mat` layer sprites. Any layer may be omitted as long as at least one is defined.

- `Scene` layer data will now be saved as compressed PNG to reduce file sizes of MetaGame saves and is threaded to prevent the game from freezing when layer data is being saved.

</details>

<details><summary><b>Fixed</b></summary>

- Fixed material view not drawing correctly when viewed in split-screen. ([Issue #54](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/54))

- Fix `TerrainObject`s not wrapping when placed over the Y seam on Y-wrapped scenes.

</details>

<details><summary><b>Removed</b></summary>

- Removed `SLTerrain` and `SLBackground` INI property `Offset`. Internal and shouldn't have been exposed.

- Removed `SLTerrain` INI alt property `AddTerrainObject`. Use `PlaceTerrainObject` for consistency with similar properties.

- Removed `TerrainObject` INI property `DisplayAsTerrain`. Wasn't implemented and did nothing.

- Removed `SceneMan` Lua function `AddTerrainObject`. `SceneMan:AddSceneObject` should be used instead.

</details>

***
Expand Down
Loading