Commit Graph
122 Commits
Author SHA1 Message Date
Asdow 82aca548f5 Merge branch 'master' into ExtraMercs 2025-09-24 16:14:10 +03:00
BeatAroundTheBuscherandGitHub ed00830202 Fixes Upper/Lower Casing for include paths (#487)
* Fixing upper/lower case for includes

types.h, zconf.h and zlib.h were renamed so that global includes like Types.h
are not used.
2025-08-16 22:01:12 -03:00
Asdow c62d767622 Update to Master 2025-08-08 18:00:31 +03:00
Asdow fffb3a45fb Remove 8bit mode
Obsolete and doesn't work

* Remove gbPixelDepth
* Remove 8-bit to 8-bit blitters
* FileNameForBPP now only calls strcopy
2025-02-24 21:42:36 +02:00
Asdow e59d915e58 Use SoldierID 2024-12-01 00:20:41 +02:00
Asdow 47824c97a1 Fix UB compilation 2024-11-18 23:58:04 +02:00
Asdow b74ccf3ddc Convert to SoldierID 2024-11-17 23:45:48 +02:00
Asdow 274be524e6 More functions converted to SoldierID 2024-11-17 16:25:12 +02:00
Asdow 34f0b40f93 Convert functions and globals to SoldierID 2024-11-17 14:53:52 +02:00
Asdow f58cf588a6 Mark TacticalStatusType::sSlideReason as _UNUSED
Removed from function call parameters at the same time.
It was supplied to SlideTo, SlideToLocation and SoldierLocationRelativeToScreen but was never used.
2024-11-17 14:20:37 +02:00
Asdow 3e1c87f53c Remove unused global gusOldSelectedSoldier 2024-11-17 10:27:42 +02:00
Asdow b98732daa7 Convert gusSelectedSoldier to SoldierID 2024-11-15 19:06:34 +02:00
Asdow 10250dc035 Merge branch 'master' into ExtraMercs 2024-11-09 13:44:53 +02:00
AsdowandGitHub 49a119e6b9 Convert INVTYPE boolean fields to flagmask (#325)
Rearranged fields from largest to smallest to remove alignment padding
2024-08-22 08:48:29 +03:00
AsdowandGitHub b8a870df02 Reduce code duplication (#233)
* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Add direction utility function

We have a lot of places in the code that calculate direction based on center cell coordinates, but lack a utility function for it similar to other direction methods.

* Use utility function for calculating direction

* Use ConvertGridNoToCenterCellXY

* Use utility function for direction

* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Remove CenterX & CenterY functions

Use ConvertGridNoToCenterCellXY instead

* Remove CenterX & CenterY calls from UB configuration

* Address review feedback

* Remove duplicate function

ConvertGridNoToCenterCellXY and ConvertMapPosToWorldTileCenter do the exact same thing

* Use PythSpacesAway instead of GetRangeFromGridNoDiff

Both functions calculate the same thing

* Remove GetRangeFromGridNoDiff

* Remove calls to abs()

The values end up being squared anyways making these unnecessary
2023-10-07 15:14:15 +03:00
Asdow 03482ffc3d Merge branch 'master' into ExtraMercs 2023-07-26 13:17:49 +03:00
majcostaandGitHub 24425a82b1 More unused stuff removal (#49)
* More unused stuff removal

delete:
- giant 'metaheaders' (JA2 All.h, Laptop All.h, etc), preferring to add #includes directly where needed
- unused ExceptionHandling and DbMan translation units
- unused WizShare.h, Bitmap.h, trle.h, video_private.h headers

* remove mentions from vc proj files too

* remove preprocessor conditionals for unused definitions

find . -iname '*.h' -o -iname '*.cpp' -exec unifdef.exe -m -UPRECOMPILED_HEADERS -UJA2_PRECOMPILED_HEADERS -UWIZ8_PRECOMPILED_HEADERS -UPRECOMPILEDHEADERS {} ';'

then manually fixed a couple files the tool errored out on

* yes, the comments too

as title
2023-01-03 15:51:48 +02:00
Asdow 1f0a8f46e8 Import changes from the local SVN working copy 2022-10-10 10:08:44 +03:00
Sevenfm 0cc70519d3 Widescreen UI patch (by Asdow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9216 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-11-21 12:56:27 +00:00
Shadooow fbade9d355 fixed rain disappearing with NCTH
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9207 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-31 00:20:10 +00:00
Sevenfm b11957691c Fix for critical bug introduced in r9182: replace CoweringShockLevel check which calculates suppression tolerance every time, with IsCowering, which uses cowering animation check.
DrawBarsInUIBox: fix possible divide by zero.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9184 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-10-16 16:07:31 +00:00
Sevenfm 191db0b2ac Fixed vs2010 compilation errors.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8914 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-11-01 05:01:11 +00:00
Sevenfm 2cdf1b2f0a Changed the way the STI file for CTH indicator is loaded to prevent the game from constantly loading and unloading the graphics file from the disk every time the function gets called. Now it's only done once per the lifetime of the game. (by Asdow)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8881 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-08-12 11:54:12 +00:00
Flugente ce61a0b85b Fix: if no squad name is provided in xml, fall back on hardcoded name
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8867 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-07-15 21:23:53 +00:00
Flugente c5022fa1e5 New feature: turncoats can be created from enemies and ordered to switch sides
Requires GameDir >= r2535

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=360191&#msg_360191

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8811 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-05-30 00:13:42 +00:00
Sevenfm 84afe6b160 GetSoldierAboveGuyPositions:
- use max value so that animation and text do not overlap
- lowered Y offset for crouched stance

DrawSelectedUIAboveGuy:
- reduce vertical gap if not showing health bars

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8805 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-05-18 06:04:34 +00:00
Sevenfm 0578c2a89a New option: SOLDIER_TOOLTIP_DEBUG_AI shows additional AI debug information.
Show tooltips for all persons.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8784 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-11 11:13:53 +00:00
Sevenfm f10590587a New option AUTO_HIDE_PB (TRUE) enables auto hiding of the progress bar when mouse cursor is on the top map row.
AI soldiers will now avoid staying at top map row.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8723 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-01-05 08:20:42 +00:00
Sevenfm 54e7c1e24d DrawCTHIndicator: bAimTime -> bShownAimTime fix.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8694 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-09-25 18:40:51 +00:00
silversurfer 384572098b - fixed incorrect rounding in several places in the code
- diagonal movement now uses the proper amount of AP and BP

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8634 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-11-03 16:11:21 +00:00
Flugente 494dbc6e69 Store the profile type in the profile structure and remove superfluous code
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8620 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-24 19:36:28 +00:00
Flugente 2dbacd32de The following options have been moved from the campaign the campaign start screen to JA2_Options.ini:
- Maximum number of IMPs (now MAX_IMP_CHARACTERS (Default: 10))
- Enemies drop all items (now DROP_ALL (Default: FALSE))
- Merc Story Backgrounds (now BACKGROUNDS (Default: TRUE))
- Food System (now FOOD (Default: FALSE))
- Improved Interrupt System (now IMPROVED_INTERRUPT_SYSTEM (Default: TRUE))
- Inventory Manipulation Costs AP (now INVENTORY_MANIPULATION_COSTS_AP (Default: FALSE))

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23855&goto=354656&#msg_354656

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8610 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-02 15:14:01 +00:00
Flugente 92e759555d - New enemy role: display whether an enemy carries a key
For more, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=21774&goto=352502&#msg_352502
- If ENHANCED_CLOSE_COMBAT_SYSTEM is on, stealing multiple items from an enemy is possible if he is not on alert

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8523 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-02-21 18:49:35 +00:00
Flugente 2fe522db4b Fix: compiler warnings
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8471 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-09-13 20:01:48 +00:00
silversurfer cedb77bffb Fixes (by Sevenfm):
- put back AIM_VISIBILITY calculation in function "CalcNewChanceToHitGun"
- fixed possible NULL pointer condition

Added an indicator to the NCTH cursor to show aiming penalty for moving target.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8294 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-09-03 11:56:00 +00:00
silversurfer 73e3e1172c Fix: gGameCTHConstants.BASE_CROUCHING_STANCE was missing from handling calculations in NCTH
- removed gGameExternalOptions.fUseNewCTHCalculation as it is not needed anymore
- cleaned up function CalcNewChanceToHitGun

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8281 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-08-06 10:44:42 +00:00
Sevenfm 90594fb43f ShowEnemyWeapon: bVisible fix
MinAPsToPunch fix: allow correct calculation when no target gridno supplied
World Items: don't allow max repair threshold less than current object status

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8261 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-06-25 10:31:55 +00:00
silversurfer 196a1eb84d AI and tactics improvements (by Sevenfm):
New options:
 AI_YELLOW_FLANKING - yellow flanking is disabled by default
 IMPROVED_TACTICAL_UI - use name color to show soldier's status (disguised, drunk)

Removed obsolete options:
 SHOW_COVER_INDICATOR
 SHOW_ENEMY_RANK_ICON
 SHOW_ENEMY_AWARENESS

Fixes and improvements:
 - collapsed enemies should not taunt
 - if soldier is unconscious, he can't see anything or anybody
 - ClosestReachableDisturbance - performance improvement
 - allow InternalGoAsFarAsPossibleTowards to jump over fences

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8226 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-05-20 18:25:33 +00:00
Flugente 9f52c940a8 New feature: individual militia creates small militia profiles that track a militia's history and allow it to be recreated, thereby maintaining the illusion of persistent militia.
Requires GameDir >= r2316.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=tree&th=23044&goto=345324&#msg_345324

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8202 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-05-06 14:51:24 +00:00
Flugente def585ef80 The merc profile #71 (RPC71) is now used for all combat jeeps.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8116 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-21 21:30:10 +00:00
Flugente 9e97538d89 New feature: enemy combat jeeps fill the role between infantry and tanks. For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=344628&#msg_344628
This is savegame compatible. GameDir >= r2305 required.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8114 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-20 18:45:51 +00:00
Flugente 908923e813 New display mode: "CTH mode" displays a very rough cth indication in the current merc's firing cone. For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=20659&goto=344441&#msg_344441
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8099 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-03-08 22:36:39 +00:00
Flugente 330925b0ef When displaying a merc's maximum assignment points, factor in backgrounds values.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8050 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-02-05 22:18:05 +00:00
Flugente 929d15ec8a changed several variable names for body types to 'ubBodyType', as this is more consistent and allows wider use of macros
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-08-07 20:09:10 +00:00
Flugente b2217eaab9 Deleted Feature: The poison feature has been made obsolete by the disease feature and has been removed.
GameDir >= r2245 is recommended.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7870 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-05-20 20:39:51 +00:00
silversurfer 8ef0c1e353 Fix: It's not allowed to use scope modes other than iron sight and alternative weapon holding anymore when dual wielding guns.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7792 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-20 21:26:28 +00:00
silversurfer 8ae8c147f9 Fix (by Sevenfm): NCTH aperture was offset by 1 to the bottom right
EDB enhancement: rechamber display now includes effects from traits

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7765 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-03-02 17:15:29 +00:00
Flugente 499ff2db06 If the itemlist is huge and one uses New Inventory System, New Attachment System and a lot of MOLLE items, there is a noticable slowdown if inventory is open in tactical. I cleaned up code to ease that somewhat, but the problem will likely persist.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7600 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-10-19 21:53:05 +00:00
silversurfer a2be5b06c2 added new option to CTHConstants.ini:
IRON_SIGHTS_MAX_APERTURE_MODIFIER = 3.0

This modifies how fast the aperture grows for iron sights when IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT = TRUE

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7504 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-09-10 12:16:45 +00:00
Flugente 36e9d15edc New feature: Diseaes affect your mercenaries. They can be contracted in varíous ways and have varying effects.
For more info, see http://www.ja-galaxy-forum.com/ubbthreads.php/topics/334918#Post334918

Requires GameDir >= r2099.

Does not break savegame compatibility.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7384 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-08-10 13:45:11 +00:00