Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 8f1e5bb

Browse files
committed
Merge branch 'development' into FrameMan-Breakdown
2 parents f290763 + f4d181c commit 8f1e5bb

File tree

6 files changed

+105
-31
lines changed

6 files changed

+105
-31
lines changed

CHANGELOG.md

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,65 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
89
### Added
910

10-
- Lua binding for Box::IntersectsBox(otherBox), that returns true if 2 boxes intersect.
11+
- Lua binding for `Box::IntersectsBox(otherBox)`, that returns true if 2 boxes intersect.
12+
13+
- Command line arguments for launching directly into editors using `-editor "EditorName"`.
14+
Valid editor names are: `ActorEditor`, `GibEditor`, `SceneEditor`, `AreaEditor` and `AssemblyEditor`.
15+
16+
- Added handling for custom number and string values in INI.
17+
```
18+
AddCustomValue = NumberValue
19+
YourKeyName = YourNumberValue // Integer or floating point number.
20+
21+
AddCustomValue = StringValue
22+
YourKeyName = YourStringValue
23+
```
24+
`YourKeyName` is a string value and is not limited to just numbers.
1125

1226
### Changed
1327

28+
- Codebase now uses the C++14 standard.
29+
30+
- Major cleanup and reformatting in the `System` folder.
31+
1432
- Upgraded to new, modern FMOD audio library. Sounds now play in 3D space, so they pan to the left and right, and attenuate automatically based on the player's viewpoint. ([Issue #72](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/72))
1533

16-
- Sounds have been renamed to SoundContainers, and are able to handle multiple sounds playing at once. INI definitions have changed accordingly. They must be added using `... = SoundContainer`, and individual sounds for them must be added using `AddSound = ContentFile...`
34+
- `Sound`s have been renamed to `SoundContainer`s, and are able to handle multiple sounds playing at once. INI definitions have changed accordingly.
35+
They must be added using `... = SoundContainer`, and individual sounds for them must be added using `AddSound = ContentFile...`
1736

1837
- Various lua bindings around audio have been upgraded, changed or fixed, giving modders a lot more control over sounds. See documentation for more details.
1938

20-
### Removed
39+
- Centered the loading splash screen image when `DisableLoadingScreen` is true.
40+
41+
- `Box:WithinBox` lua bindings have been renamed.
42+
`Box:WithinBox` is now `Box:IsWithinBox`.
43+
`Box:WithinBoxX` is now `Box:IsWithinBoxX`.
44+
`Box:WithinBoxY` is now `Box:IsWithinBoxY`.
45+
46+
- Made `AHuman` show both weapon ammo states when 2 one-handed weapons are equipped.
2147

2248
### Fixed
2349

50+
- Fixed LuaBind being all sorts of messed up. All lua bindings now work properly like they were before updating to the v141 toolset.
51+
2452
- Explosives (and other thrown devices) will no longer reset their explosion triggering timer when they're picked up. ([Issue #71](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/71))
2553

26-
- Sprite Animation Mode ALWAYSPINGPONG now works properly. Sprite animation has also been moved to MOSprite instead of MOSRotating, they they'll be able to properly animate now. ([Issue#77](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/77))
54+
- Sprite Animation Mode `ALWAYSPINGPONG` now works properly. Sprite animation has also been moved to `MOSprite` instead of `MOSRotating`, they they'll be able to properly animate now. ([Issue#77](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/77))
55+
56+
- Fixed `BG Arm` flailing when reloading one-handed weapon, so shields are no longer so useless.
57+
58+
### Removed
59+
60+
- Removed all Gorilla Audio and SDL Mixer related code and files.
61+
62+
- Removed all Steam Workshop and Achievement related code.
63+
64+
- Removed a bunch of outdated/unused sources in the repo.
65+
66+
- Removed all OSX/Linux related code and files because we don't care. See [Liberated Cortex](https://github.com/liberated-cortex) for working Linux port.
2767

2868
***
2969

@@ -78,16 +118,6 @@ Removing wounds remains the same as before.
78118

79119
- Built-in Actor angular velocity reduction on death has been lessened.
80120

81-
### Removed
82-
83-
- All licensing-related code has been removed since it's no longer needed.
84-
85-
- Wounds can no longer be added via ini, as used to be doable buggily through ini `AddEmitter`.
86-
87-
- All usage of the outdated Slick Profiler has been removed.
88-
89-
- `TDExplosive.ParticleNumberToAdd` property has been removed.
90-
91121
### Fixed
92122

93123
- SFX slider now works properly.
@@ -104,6 +134,17 @@ Removing wounds remains the same as before.
104134

105135
- Various minor other things that have gotten lost in the shuffle.
106136

137+
138+
### Removed
139+
140+
- All licensing-related code has been removed since it's no longer needed.
141+
142+
- Wounds can no longer be added via ini, as used to be doable buggily through ini `AddEmitter`.
143+
144+
- All usage of the outdated Slick Profiler has been removed.
145+
146+
- `TDExplosive.ParticleNumberToAdd` property has been removed.
147+
107148
***
108149

109150
Note: For a log of changes made prior to the commencement of the open source community project, look [here.](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/wiki/Previous-Closed-Source-Changelog)

Entities/AHuman.cpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3410,8 +3410,9 @@ void AHuman::Update()
34103410
if (!pDevice->IsFull() && m_Controller.IsState(WEAPON_RELOAD) && !m_pItemInReach)
34113411
{
34123412
pDevice->Reload();
3413-
if (m_pBGArm && m_pBGArm->IsAttached())
3413+
if (m_pBGArm && m_pBGArm->IsAttached() && GetEquippedBGItem() == NULL) {
34143414
m_pBGArm->SetHandPos(m_Pos + m_HolsterOffset.GetXFlipped(m_HFlipped));
3415+
}
34153416
m_DeviceSwitchSound.Play(m_Pos);
34163417

34173418
// Interrupt sharp aiming
@@ -3422,15 +3423,17 @@ void AHuman::Update()
34223423
// Detect reloading and move hand accordingly
34233424
if (pDevice->IsReloading())
34243425
{
3425-
if (m_pBGArm && m_pBGArm->IsAttached())
3426+
if (m_pBGArm && m_pBGArm->IsAttached() && GetEquippedBGItem() == NULL) {
34263427
m_pBGArm->SetHandPos(m_Pos + m_HolsterOffset.GetXFlipped(m_HFlipped));
3428+
}
34273429
}
34283430

34293431
// Detect reloading being completed and move hand accordingly
34303432
if (pDevice->DoneReloading())
34313433
{
3432-
if (m_pBGArm && m_pBGArm->IsAttached())
3434+
if (m_pBGArm && m_pBGArm->IsAttached() && GetEquippedBGItem() == NULL) {
34333435
m_pBGArm->SetHandPos(pDevice->GetMagazinePos());
3436+
}
34343437
}
34353438
}
34363439
}
@@ -4905,16 +4908,20 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
49054908
// Ammo
49064909
if (pHeldFirearm)
49074910
{
4911+
MovableObject *bgHeldItem = GetEquippedBGItem();
4912+
HDFirearm const *bgHeldFirearm = bgHeldItem == NULL ? NULL : dynamic_cast<HDFirearm *>(bgHeldItem);
4913+
49084914
str[0] = -56; str[1] = 0;
49094915
pSymbolFont->DrawAligned(&allegroBitmap, drawPos.m_X - 10, drawPos.m_Y + m_HUDStack, str, GUIFont::Left);
4910-
if (pHeldFirearm->IsReloading())
4911-
sprintf_s(str, sizeof(str), "%s", "Reloading...");
4912-
else
4913-
{
4914-
if (pHeldFirearm->GetRoundInMagCount() < 0)
4915-
sprintf_s(str, sizeof(str), "%s", "Infinite");
4916-
else
4917-
sprintf_s(str, sizeof(str), "%i", pHeldFirearm->GetRoundInMagCount());
4916+
std::string fgWeaponString = pHeldFirearm->GetRoundInMagCount() < 0 ? "Infinite" : std::to_string(pHeldFirearm->GetRoundInMagCount());
4917+
fgWeaponString = pHeldFirearm->IsReloading() ? "Reloading" : fgWeaponString;
4918+
4919+
if (bgHeldItem && bgHeldFirearm) {
4920+
std::string bgWeaponString = bgHeldFirearm->GetRoundInMagCount() < 0 ? "Infinite" : std::to_string(bgHeldFirearm->GetRoundInMagCount());
4921+
bgWeaponString = bgHeldFirearm->IsReloading() ? "Reloading" : bgWeaponString;
4922+
sprintf_s(str, sizeof(str), "%s | %s", fgWeaponString.c_str(), bgWeaponString.c_str());
4923+
} else {
4924+
sprintf_s(str, sizeof(str), "%s", fgWeaponString.c_str());
49184925
}
49194926
pSmallFont->DrawAligned(&allegroBitmap, drawPos.m_X - 0, drawPos.m_Y + m_HUDStack + 3, str, GUIFont::Left);
49204927

Entities/HDFirearm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ ENTITYALLOCATION(HDFirearm)
587587
// Arguments: None.
588588
// Return value: Whetehr being reloaded.
589589

590-
virtual bool IsReloading() { return m_Reloading; }
590+
virtual bool IsReloading() const { return m_Reloading; }
591591

592592

593593
//////////////////////////////////////////////////////////////////////////////////////////

Entities/MOSRotating.cpp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,18 +475,38 @@ int MOSRotating::ReadProperty(std::string propName, Reader &reader)
475475
reader >> m_EffectOnGib;
476476
else if (propName == "LoudnessOnGib")
477477
reader >> m_LoudnessOnGib;
478-
else if (propName == "DamageMultiplier")
479-
{
478+
else if (propName == "DamageMultiplier") {
480479
reader >> m_DamageMultiplier;
481480
m_DamageMultiplierRedefined = true;
482-
}
483-
else
481+
} else if (propName == "AddCustomValue") {
482+
ReadCustomValueProperty(reader);
483+
} else
484484
// See if the base class(es) can find a match instead
485485
return MOSprite::ReadProperty(propName, reader);
486486

487487
return 0;
488488
}
489489

490+
void MOSRotating::ReadCustomValueProperty(Reader &reader) {
491+
std::string customValueType;
492+
reader >> customValueType;
493+
std::string customKey = reader.ReadPropName();
494+
std::string customValue = reader.ReadPropValue();
495+
if (customValueType == "NumberValue") {
496+
try {
497+
SetNumberValue(customKey, std::stod(customValue));
498+
} catch (const std::invalid_argument) {
499+
reader.ReportError("Tried to read a non-number value for SetNumberValue.");
500+
}
501+
} else if (customValueType == "StringValue") {
502+
SetStringValue(customKey, customValue);
503+
} else {
504+
reader.ReportError("Invalid CustomValue type " + customValueType);
505+
}
506+
// Artificially end reading this property since we got all we needed
507+
reader.NextProperty();
508+
}
509+
490510

491511
//////////////////////////////////////////////////////////////////////////////////////////
492512
// Virtual method: Save

Entities/MOSRotating.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,12 @@ ENTITYALLOCATION(MOSRotating)
12191219

12201220
void Clear();
12211221

1222+
/// <summary>
1223+
/// Handles reading for custom values, dealing with the various types of custom values.
1224+
/// </summary>
1225+
/// <param name="reader">A Reader lined up to the custom value type to be read.</param>
1226+
void ReadCustomValueProperty(Reader &reader);
1227+
12221228

12231229
// Disallow the use of some implicit methods.
12241230
MOSRotating(const MOSRotating &reference);

System/Controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ namespace RTE {
336336
}
337337

338338
// Translate analog aim input into sharp aim control state
339-
m_ControlStates[AIM_SHARP] = m_AnalogAim.GetMagnitude() > 0.1 && !m_ControlStates[PIE_MENU_ACTIVE];
339+
if (m_AnalogAim.GetMagnitude() > 0.1 && !m_ControlStates[PIE_MENU_ACTIVE]) { m_ControlStates[AIM_SHARP] = true; }
340340

341341
// Disable sharp aim while moving - this also helps with keyboard vs mouse fighting when moving and aiming in opposite directions
342342
if (m_ControlStates[PRESS_RIGHT] || m_ControlStates[PRESS_LEFT] || m_ControlStates[BODY_JUMPSTART] || (m_ControlStates[PIE_MENU_ACTIVE] && !m_ControlStates[SECONDARY_ACTION])) {

0 commit comments

Comments
 (0)