Author SHA1 Message Date
Asdow 9353bf27a1 Revert "Make new kit selection respect TonsOfGuns & Scifi tags"
This reverts commit 69904ee003.
2026-06-19 21:58:41 +03:00
Asdow ef51b578c3 Discard items based on gamestyle 2026-06-19 21:58:27 +03:00
Asdow 69904ee003 Make new kit selection respect TonsOfGuns & Scifi tags 2026-06-19 10:10:48 +03:00
db29feed11 Don't strip robot's installed components on mapscreen drop-all
The mapscreen "drop everything" hotkey (Shift+W) looped over every
inventory slot from HELMETPOS to NUM_INV_SLOTS and dumped each one.
Madlab's robot stores its installed gear in those same slots - ammo (14),
targeting (15), chassis/armour (16) and utility (17). Dropping these left
the robot defenceless, and the player cannot re-install the components
through normal inventory, so the loss was permanent.

Skip the robot's component slots in the drop loop; only its general cargo
slot (ROBOT_INVENTORY_SLOT) may still be emptied. Regular mercs are
unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 23:06:33 +03:00
Asdow 1fc5f939bf Use new RandomGridNoUnloadedSector() for autoresolve
* Load required mapinfo for checking suitable gridnos
* Modify SOLDIERTYPE::DropSectorEquipment( ) to take an external gridno when placing items into an unloaded sector
2026-06-15 22:01:07 +03:00
Asdow 9e0105caec Add function for choosing random gridno in an unloaded sector 2026-06-15 22:01:07 +03:00
Asdow 0cc7fb4e39 Add function for loading world height data 2026-06-15 22:01:07 +03:00
Asdow db15679ec1 Add missing Iter->Exists() checks 2026-06-12 15:52:24 +03:00
Asdow 6a8a22aba2 Move iter->exists() check to first 2026-06-12 15:52:24 +03:00
Asdow 9b654ff3f1 Fix typo 2026-06-12 15:51:03 +03:00
Asdow a67f4b8a8f Formatting 2026-06-12 15:51:03 +03:00
Asdow 673dea01af Use correct sector for Chitzena 2026-06-12 15:51:03 +03:00
Marco Antonio J. Costaandmajcosta b44b6cebb8 Revert PR544
"Corpses are not properly shown even if within mercs' vision due to the check only
running intermittently since we're not constantly running the reveal roofs and items
function. In addition, mercs such as Raven who have the quoteexpheadshotonly set to true,
will NEVER reveal any corpses"

Revert "Remove extra line"

This reverts commit 1e1eb88864.

Revert "Move visibility check after already included pCorpse check"

This reverts commit 72e586a378.

Revert "Make 3rd party corpses invisible till they in fov"

This reverts commit 07dbf9c848.
2026-06-02 19:17:31 -03:00
Asdow 8bc3dbd0aa Prevent RebelCommand::DailyUpdate() from running twice when loading autosave 2026-06-02 23:59:30 +03:00
Marco Antonio J. Costaandmajcosta b4176bb2d9 Fix/drag unconscious softlock
Same logic but cleaned up version of https://github.com/1dot13/source/pull/602 which Tais contributed with Claude Code's help

Most calls to SOLDIERTYPE::IsDragging() aren't supposed to have a side effect of cancelling a drag, being simple queries.
Changing the default to reflect that is right move.

Assisted-by: Claude:
2026-06-01 21:45:55 -03:00
Asdow 8b3e417872 Guard against illegal array access
Hovering mouse over an option long enough that the popup text appears and scrolling to last page with mouse wheel would run into assertion error in gprintfdirty()  Assert(pFontString!=NULL); if the option was one of the last ones that didn't have a text box in the last option page.
2026-05-28 17:44:21 +03:00
AsdowandClaude Opus 4.7 b949189881 Fix palette resolution
The LayerProp palette lookup was gated on the *filter* attribute instead
of the *palette* attribute -- the filter checks from the line above were
copy-pasted verbatim. As a result, any LayerProp with an empty filter but
a real palette never resolved its palette table: paletteTable stayed NULL
and the layer fell back to the merc's shade table.

The most visible victim is the heli fast-rope arrival layer
(filter="" palette="hats"): rendered with the merc palette, the rope's
pixel indices (45-81, 166-172) hit the merc's unreplaced orange/red glow
ramp instead of the rope's own tan/green, painting orange specks along the
rope. Testing the palette attribute restores the intended "hats" palette
and the correct rope colours; it also fixes any other empty-filter layers.

Co-Authored-By: Claude Opus 4.7
2026-05-28 16:33:48 +03:00
JuqiandAsdow cc19490898 update Chinese translations 2026-05-25 08:37:30 +03:00
GreysaandAsdow 9fac0a8ecd Tidy up code 2026-05-23 21:22:28 +03:00
GreysaandAsdow 346e5c6293 fix for issue #580 2026-05-23 21:22:28 +03:00
GreysaandAsdow 0bea84374e fixed some screenmsg strings not changed 2026-05-23 21:22:28 +03:00
GreysaandAsdow 3d589bd78e A little code cleanup and moved debug reload to shift + alt + r 2026-05-23 21:22:28 +03:00
GreysaandAsdow e1c8bee1d1 Message strings added to language files. 2026-05-23 21:22:28 +03:00
GreysaandAsdow ead2932316 Added dual wielding unjamming, tidied up reload and unjam code a little 2026-05-23 21:22:28 +03:00
GreysaandAsdow bb55299ff6 Basic implementaion of unjamming on reload hotkey.
TODO:
text strings
check dual wielding
2026-05-23 21:22:28 +03:00
JuqiandAsdow 2d4f62a5b6 Correct two errors in the Chinese translation 2026-05-13 16:02:28 +03:00
Asdow 03a7b017b6 Change mouse cursor if attachment attempt fails 2026-05-06 23:23:07 +03:00
Asdow edf8f2f086 Fix crash when failing an attachment via item desc popup callback 2026-05-06 23:23:07 +03:00
Asdow 78ed49c73d Remove corpse structure from world when removing corpse
Fixes not being able to take all corpses from one tile, if multiple corpses were stacked on top of each other. With the structure not deleted, the  GetCorpseAtGridNo would not find an existing corpse anymore.
2026-05-06 11:28:11 +03:00
Asdow 5697acabb3 Take most recent corpse from tile
Fixes crash when taking a corpse on roof when multiple corpses are stacked on one tile.
2026-05-06 11:28:11 +03:00
Asdow 09197e421c Add a function for finding last matching structure 2026-05-06 11:28:11 +03:00
JuqiandAsdow 46afd90fdc Add Chinese translation 2026-05-04 12:10:10 +03:00
JuqiandAsdow 80ba0a05d7 Revert "Add Chinese translation"
This reverts commit e7d436d9fa.
2026-05-04 12:10:10 +03:00
JuqiandAsdow aab34bff20 Add Chinese translation 2026-05-04 12:10:10 +03:00
JuqiandAsdow ef325c1cde (Chinese) Add support for line breaks in ITEMS.XML
Added detection of the NEWLINE_CHAR character "±" to enable line breaks not only when text exceeds display width, but also upon encountering NEWLINE_CHAR.
Note: This character has been conventionally adopted in the Chinese community as a line break marker within XML item descriptions. The modification affects Chinese text display only.
2026-05-02 09:39:03 +03:00
Asdow 99a4ff1527 Guard against invalid value 2026-05-02 09:31:09 +03:00
Marco Antonio J. Costaandmajcosta f2d1b09fc6 add comment to CMakeLists.txt
save people a trip to learn.microsoft.com
2026-04-08 15:25:48 -03:00
Marco Antonio J. CostaandAsdow 31970291bd make preprocessor definitions consistent in every single lib
SGP did not seem to make any use of compilationFlags or debugFlags when
translating from msbuild to cmake, but there could be a thrice removed
transitive include I've missed.

there's a small probability this fixes some obscure UB or one-definition rule
violation that's causing the mystery crashes people have reported
2026-04-08 21:06:34 +03:00
GreysaandGitHub 0a758179c2 Advanced repairs skill check (#581)
* Add technician level skill check for advanced repair

* changed readability
2026-03-17 10:35:29 +01:00
noooooo4499andAsdow 481e95d42d Avoid breaking compatibility with gamedirs with old HourlyUpdate scripts
They are mapped to the right variable now
2026-02-25 10:47:47 +02:00
Asdow 8f178a59ab Add filename to error text for pngloader 2026-02-23 18:23:08 +02:00
Asdow a6d96f5f31 Remove compiler warnings 2026-02-21 21:00:38 +02:00
Asdow 67f41d4de6 Remove superfluous variable 2026-02-21 21:00:38 +02:00
Asdow 1d53b92731 Add const keyword 2026-02-21 21:00:38 +02:00
Asdow 42b2cbc7f5 add const keyword 2026-02-21 21:00:38 +02:00
Asdow 04ace5df24 add const keyword 2026-02-21 21:00:38 +02:00
Asdow 323944757d Improve DisplayCover() performance
* Replaced gCoverViewArea[2000][2000][2] with std::vector that is adjusted to the actual viewport size. Size difference for example in 720p resolution is 8 000 000 vs 3969 elements
* FPS improved in merc view mode 6-8 frames and in enemy view mode 10-20 frames
2026-02-21 21:00:38 +02:00
noooooo4499andAsdow 7d5a1c2e9e Remove useless lua gameclock variables, add lua externalized function to heal boxers
- These gameclock variables were not updated properly so it created a discrepancy between it and the proper gameclock variables, and it was causing issues with the lua hourly update script

- Function that heals boxers after they finish resting
2026-02-12 10:24:47 +02:00
noooooo4499andAsdow dc107f5044 Fix Darren sometimes never giving fights if the boxers's IDs aren't assigned 2026-02-07 12:03:03 +02:00
Asdow f3ce1d5ff9 Fix Tank suppression fire
Code used wrong item to calculate recoil and burst APs causing the burst length loop to be stuck until the whole 2000 round mg magazine would be fired in one go.
2026-01-10 16:38:00 +02:00
Asdow b1c076416c Remove magic numbers 2026-01-04 14:57:55 +02:00
Asdow cc984b09f6 Fix comparison check 2026-01-03 17:27:43 +02:00
Asdow 8d00a316c5 Remove unused enum conditionals 2026-01-03 17:27:43 +02:00
Asdow d51f1e6088 Add comment 2026-01-03 17:27:43 +02:00
Asdow 1c86d96e9d Remove custom_email.edt
Unfinished feature as far as I can tell and new emails will be easier to add via Emails.xml
2026-01-03 17:27:43 +02:00
Asdow 1368962244 Rename function to be more descriptive 2026-01-03 17:27:43 +02:00
Asdow 6f6aadf89c Remove unused & unfinished email externalizations 2026-01-03 17:27:43 +02:00
Asdow 96de96e9c6 Remove unused includes
* Formatting
2026-01-03 17:27:43 +02:00
Asdow ebcc5449c5 Make functions static 2026-01-03 17:27:43 +02:00
Asdow 6b7bc51a52 Remove commented out variables 2026-01-03 17:27:43 +02:00
Asdow 622cffce82 Use #define instead of magic numbers 2026-01-03 17:27:43 +02:00
Asdow 5ed79c3edb Fix email sorting
* Simplify pSubject copying else ifs
* Formatting
2026-01-03 17:27:43 +02:00
Asdow fe69dba958 Add missing email 2026-01-03 17:27:43 +02:00
Asdow f8b6ee1672 Use externalized emails 2026-01-03 17:27:43 +02:00
Asdow 30070035cc Correct pSubject size 2026-01-03 17:27:43 +02:00
Asdow ff3079ff23 Formatting 2026-01-03 17:27:43 +02:00
Asdow aba3688b4b Add framework for adding externalized emails
Emails from new GameDir file TableData/Email/Emails.xml can be added via lua scripting using calls to AddEmailFromXML & AddPreReadEmailFromXML. The order of emails in Emails.xml acts as the index to be referenced and provided when calling lua  functions.

An error message  will be displayed if an email is added with an out-of-scope index but game will be able to continue.

Localization is supported and was tested on Chinese localization.
2026-01-03 17:27:43 +02:00
Asdow d6b30c6f43 Add #ifdef for cheats.h include 2025-12-09 00:35:18 +02:00
Asdow 4fcf03d31a Include cleanup Tactical/.*cpp 2025-12-09 00:35:18 +02:00
Asdow 03edc532e1 Clean up Strategic/*:cpp includes 2025-12-09 00:35:18 +02:00
Asdow 1db41f4c36 Fix helicopter airspace view when switching to travel mode
* Clicking destination column in teamlist for a squad in a helicopter will switch to first airspace view that shows safe / unsafe air sectors instead of the second sector.

* Clicking destination column in teamlist for a squad not in a helicopter while in either airspace view will now correctly turn it off
2025-12-04 23:06:08 +02:00
majcostaandAsdow 96ede9299f Change CMake build type from Release to RelWithDebInfo 2025-12-04 19:47:04 +02:00
Asdow b226f2a21d set functions static 2025-12-03 23:52:05 +02:00
Asdow 6629562b34 Formatting 2025-12-03 23:52:05 +02:00
Asdow 91d7620c0b include cleanup 2025-12-03 23:52:05 +02:00
Asdow c341402fe1 set functions static 2025-12-03 23:52:05 +02:00
Asdow 80b1af930a include cleanup 2025-12-03 23:52:05 +02:00
Asdow 608eb8e4e6 set functions static 2025-12-03 23:52:05 +02:00
Asdow ec1c6fc112 include cleanup 2025-12-03 23:52:05 +02:00
Asdow 4fabab680f set functions static 2025-12-03 23:52:05 +02:00
Asdow def815988b include cleanup 2025-12-03 23:52:05 +02:00
Asdow 21df179941 Set function static 2025-12-03 23:52:05 +02:00
Asdow ff674e79b9 Set function static 2025-12-03 23:52:05 +02:00
Asdow 9efa5e1108 Include cleanup 2025-12-03 23:52:05 +02:00
Asdow c235345a22 formatting 2025-12-03 23:52:05 +02:00
Asdow 97791bfcc3 include cleanup 2025-12-03 23:52:05 +02:00
Asdow d49185c291 Move nullptr check to be checked first
Kinda defeats the purpose of checking for nullptr if we dereference it before the check, no?
2025-12-03 23:52:05 +02:00
Asdow 41eba8ff3a include cleanup 2025-12-03 23:52:05 +02:00
Asdow 2fd5e2c255 set functions static 2025-12-03 23:52:05 +02:00
Asdow a83bb00d52 include cleanup 2025-12-03 23:52:05 +02:00
Asdow cb27d0cd72 Set functions static 2025-12-03 23:52:05 +02:00
Asdow 020cd270c0 include cleanup 2025-12-03 23:52:05 +02:00
Asdow a6e1b93af0 Set functions static 2025-12-03 23:52:05 +02:00
Asdow 5dd4043f00 Formatting 2025-12-03 23:52:05 +02:00
Asdow 61f8efaac0 include cleanup 2025-12-03 23:52:05 +02:00
Asdow 3ee22bdb31 Set functions static 2025-12-03 23:52:05 +02:00
Asdow 032ac8e566 Remove forward declarations that are included already 2025-12-03 23:52:05 +02:00
Asdow 1e78fc68bc Formatting 2025-12-03 23:52:05 +02:00
Asdow a074dbf3ee include cleanup 2025-12-03 23:52:05 +02:00
Asdow 9cfcfac376 include cleanup 2025-12-03 23:52:05 +02:00
Asdow fb8feca896 include cleanup 2025-12-03 23:52:05 +02:00
Asdow be70cd18a2 Formatting 2025-12-03 23:52:05 +02:00
Asdow 6a1b84e53b include cleanup 2025-12-03 23:52:05 +02:00
Asdow 584e10d14f include cleanup 2025-12-03 23:52:05 +02:00
Asdow 4f0f6f9f23 set function static 2025-12-03 23:52:05 +02:00
Asdow 2f13ef79b6 Remove unused function declaration 2025-12-03 23:52:05 +02:00
Asdow f8f9c18cda Remove duplicate includes 2025-12-03 23:52:05 +02:00
Asdow 37c081f3db Formatting 2025-12-03 23:52:05 +02:00
Asdow e684f61f55 include cleanup 2025-12-03 23:52:05 +02:00
Asdow c2f4ca5da1 Set functions static 2025-12-03 23:52:05 +02:00
Asdow 5befb47881 Include cleanup 2025-12-03 23:52:05 +02:00
Asdow 780831611d Remove unused #defines 2025-12-03 23:52:05 +02:00
Asdow bb13225778 Include cleanup 2025-12-03 23:52:05 +02:00
Asdow 2f62d6fe44 Set functions static 2025-12-03 23:52:05 +02:00
Asdow 6e94ac144b formatting 2025-12-03 23:52:05 +02:00
Asdow 6e45ca9825 include cleanup 2025-12-03 23:52:05 +02:00
Asdow 142de9b02e Formatting 2025-12-03 23:52:05 +02:00
Asdow 7a024aecd7 include cleanup 2025-12-03 23:52:05 +02:00
Asdow c81d290957 Remove duplicate include 2025-12-03 23:52:05 +02:00
Asdow 3c498abe82 Set function static 2025-12-03 23:52:05 +02:00
Asdow fdf494c28a Remove unused LaserLock system 2025-12-03 23:52:05 +02:00
Asdow b903ead06a Formatting 2025-12-03 23:52:05 +02:00
Asdow 591a1a63c8 include cleanup 2025-12-03 23:52:05 +02:00
Asdow e60dcbc3e9 Remove unused function 2025-12-03 23:52:05 +02:00
Asdow d73d56d85a Formatting 2025-12-03 23:52:05 +02:00
Asdow d21293d4ad include cleanup 2025-12-03 23:52:05 +02:00
Asdow 297d052670 Formatting 2025-12-03 23:52:05 +02:00
Asdow f21508ad15 include cleanup 2025-12-03 23:52:05 +02:00
Asdow 4c53bb70f3 Formatting 2025-12-03 23:52:05 +02:00
Asdow 6c5f94c0cc Combine JA2UB ifdefs 2025-12-03 23:52:05 +02:00
Asdow 65e5c1768a include cleanup 2025-12-03 23:52:05 +02:00
Asdow 04f03fb2cc formatting 2025-12-03 23:52:05 +02:00
Asdow a8218462e1 include cleanup 2025-12-03 23:52:05 +02:00
Asdow 00c8bd0aa7 Remove duplicate include 2025-12-03 23:52:05 +02:00
Asdow d3cd51e7eb Formatting 2025-12-03 23:52:05 +02:00
Asdow 37795bb73c Remove unused and transitive includes 2025-12-03 23:52:05 +02:00
Asdow 5b4099a828 Set functions static 2025-12-03 23:52:05 +02:00
Asdow 977b7a5b2d Remove unused includes 2025-12-03 23:52:05 +02:00
Asdow e6824bf15d set function static 2025-12-03 23:52:05 +02:00
Asdow 63a58502d1 Remove duplicate includes 2025-12-03 23:52:05 +02:00
Asdow 173f786f55 Remove unused includes 2025-12-03 23:52:05 +02:00
Asdow ea1a3a9e9e Set functions static 2025-12-03 23:52:05 +02:00
Asdow c1b8309753 Expand UB_SetNumberJa25EnemiesInSurfaceSector
* Allow adding jeeps and robots to sectors now
* From Lua side, it is now possible to add differing amount of arguments to the function. Minimum required is 3 (sector x & y and amount of admins)
So all of the following examples will work correctly:

- UB_SetNumberJa25EnemiesInSurfaceSector( x, y, ubNumAdmins )

- UB_SetNumberJa25EnemiesInSurfaceSector( x, y, ubNumAdmins, ubNumTroops )

- - UB_SetNumberJa25EnemiesInSurfaceSector( x, y, ubNumAdmins, ubNumTroops,ubNumElites )

- UB_SetNumberJa25EnemiesInSurfaceSector( x, y, ubNumAdmins, ubNumTroops,ubNumElites, ubNumTanks )

- UB_SetNumberJa25EnemiesInSurfaceSector( x, y, ubNumAdmins, ubNumTroops,ubNumElites, ubNumTanks , ubNumJeeps )

- UB_SetNumberJa25EnemiesInSurfaceSector( x, y, ubNumAdmins, ubNumTroops,ubNumElites, ubNumTanks , ubNumJeeps, ubNumRobots )
2025-11-29 11:46:45 +02:00
Asdow d86dc39f9f Add enemies also on insane difficulty 2025-11-27 22:38:29 +02:00
Asdow b580459e57 Remove unused local variable 2025-11-27 22:38:29 +02:00
Asdow b562b45c00 Externalize tunnel sectors for adding enemies to 2025-11-27 22:38:29 +02:00
Asdow 4a43b7704e Set functions static 2025-11-23 18:28:17 +02:00
Asdow 4a813e567a Remove unused includes 2025-11-23 18:28:17 +02:00
Asdow ea4cea2231 Set functions static 2025-11-23 18:28:17 +02:00
Asdow f263c7270f Remouve unused function declarations 2025-11-23 18:28:17 +02:00
Asdow 4b38f56d1f Set functions static 2025-11-23 18:28:17 +02:00
Asdow 9bf289561b Move includes to top of file 2025-11-23 18:28:17 +02:00
Asdow 10fa5f37d6 Formatting 2025-11-23 18:28:17 +02:00
Asdow 0d8873d2c0 Remove unused includes 2025-11-23 18:28:17 +02:00
Asdow f2b88ef080 Remove duplicate include 2025-11-23 18:28:17 +02:00
Asdow 1e6586f187 Set functions static 2025-11-23 18:28:17 +02:00
Asdow dbb1c0a929 Formatting 2025-11-23 18:28:17 +02:00
Asdow 91ae6e1223 Remove unused includes 2025-11-23 18:28:17 +02:00
Asdow 04bf102614 Remove duplicate include 2025-11-23 18:28:17 +02:00
Asdow 677b320534 Set functions static 2025-11-23 18:28:17 +02:00
Asdow 265a7c0af7 Remove unused function declaration 2025-11-23 18:28:17 +02:00
Asdow 04b1937caa Fix function definition 2025-11-23 18:28:17 +02:00
Asdow 842009ab3f Make function static 2025-11-23 18:28:17 +02:00
Asdow f27164b9dc Remove unused includes 2025-11-23 18:28:17 +02:00
Asdow 20ee284e42 Remove transitive include 2025-11-23 18:28:17 +02:00
Asdow ec6401ee5d Initialize variables 2025-11-23 18:28:17 +02:00
Asdow d8d3db89d2 Make functions static 2025-11-23 18:28:17 +02:00
Asdow af1ad3885f Fix typo 2025-11-23 18:28:17 +02:00
Asdow 0199084f05 Remove commented out extern 2025-11-23 18:28:17 +02:00
Asdow 1db9af545c Remove commented out function 2025-11-23 18:28:17 +02:00
Asdow 951a88e947 Combine JA2UB includes with its function declaration ifdef 2025-11-23 18:28:17 +02:00
Asdow b6e276ac34 Formatting & whitespace 2025-11-23 18:28:17 +02:00
Asdow 3a3b415cc5 Remove unused includes 2025-11-23 18:28:17 +02:00
Asdow d0b86e69d8 Combine JA2UB ifdef includes 2025-11-23 18:28:17 +02:00
Asdow 10f6a48f50 Remove duplicate includes 2025-11-23 18:28:17 +02:00
Asdow 18dfda46f2 Remove unused function declarations and commented out functions 2025-11-23 18:28:17 +02:00
Asdow 4e24a6b9ba Fix nullptr dereference when spotting mines 2025-11-22 17:10:58 +02:00
Asdow 3061237e58 Fix Debug build includes 2025-11-22 16:11:45 +02:00
Asdow d05e9ec916 Fix actionitem conversion 2025-11-22 16:06:20 +02:00
Asdow 8fe051dc8d Declare functions static 2025-11-19 21:11:19 +02:00
Asdow 9c9d6ebb4a Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow 8bda0aaaf3 Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow fc824fb556 Declare functions static 2025-11-19 21:11:19 +02:00
Asdow e3845520f8 Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow fa8e3113fe Declare function static 2025-11-19 21:11:19 +02:00
Asdow 62fbf90daa Remove unnecessary function declaration 2025-11-19 21:11:19 +02:00
Asdow 10ac8624fe Move ExecuteAdditionalCharacterDialogue defintion before the first call
This allows us to declare it static
2025-11-19 21:11:19 +02:00
Asdow 4e60877add Declare compatible functions static 2025-11-19 21:11:19 +02:00
Asdow 740a1a8851 Remove duplicate include 2025-11-19 21:11:19 +02:00
Asdow 55afb83eb2 Move UB specific header under UB #ifdef 2025-11-19 21:11:19 +02:00
Asdow dfd5cfd42e Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow 518f7959aa Remove commented out include 2025-11-19 21:11:19 +02:00
Asdow f4f1bb25b6 Replace transitive include with explicit 2025-11-19 21:11:19 +02:00
Asdow 731f3a7d99 Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow cf048f9629 Remvoe unused includes 2025-11-19 21:11:19 +02:00
Asdow 34a369938b Declare compatible functions static 2025-11-19 21:11:19 +02:00
Asdow 2979f49e8d Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow 0dc080b01d Declare compatbile function static 2025-11-19 21:11:19 +02:00
Asdow 014b06641e Remove unused function declarations 2025-11-19 21:11:19 +02:00
Asdow 56d4499262 Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow 92c58d9fb6 Declare compatible function static 2025-11-19 21:11:19 +02:00
Asdow 330470353c Remove unused include 2025-11-19 21:11:19 +02:00
Asdow 7c274fd87a Declare compatible functions static 2025-11-19 21:11:19 +02:00
Asdow 5e28730c2a Make fallthrough explicit 2025-11-19 21:11:19 +02:00
Asdow fccb2e15bd Replace transitive include with explicit 2025-11-19 21:11:19 +02:00
Asdow e354885b16 Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow 056fc5ea6e Remove unused function declaration 2025-11-19 21:11:19 +02:00
Asdow 2c50518b61 Make compatible function static 2025-11-19 21:11:19 +02:00
Asdow 803ee8d90b Declare compatible function static 2025-11-19 21:11:19 +02:00
Asdow 243e22a8c6 Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow d85643b895 Initialize local variable 2025-11-19 21:11:19 +02:00
Asdow 413eaa08fb Declare compatible functions static 2025-11-19 21:11:19 +02:00
Asdow 08c82aa056 Remove unused local variable 2025-11-19 21:11:19 +02:00
Asdow 03e4898061 Declare compatible functions static 2025-11-19 21:11:19 +02:00
Asdow 6799d68b3c Remove duplicate includes 2025-11-19 21:11:19 +02:00
Asdow 5f6114fed9 Remove unused files 2025-11-19 21:11:19 +02:00
Asdow eace375a3b Remove unused function declaration 2025-11-19 21:11:19 +02:00
Asdow 419f9f3bf5 Remove duplicate includes 2025-11-19 21:11:19 +02:00
Asdow 9e4b819f69 Declare compatible functions static 2025-11-19 21:11:19 +02:00
Asdow 8296bfbf8a Move Handle UI.h include under JA2UB define 2025-11-19 21:11:19 +02:00
Asdow 12250a34ae Remove unused includes 2025-11-19 21:11:19 +02:00
Asdow 9f7b545528 Combine search loops into one
Reduces code duplication and fixes an illegal memory access that was still present.
2025-11-19 13:57:41 +02:00
Asdow f902b01497 Fix ubID underflow
Fixes illegal memory access if we tried to find previous merc and our currently selected one has ubID == 0
2025-11-19 10:12:53 +02:00
Asdow 0bbb01ae87 Fix pTeamSoldier initialization 2025-11-18 17:39:27 +02:00
Marco Antonio J. Costaandmajcosta 4cb1ebac88 fix invalid use of std::wstring in swprintf
fixes #554
2025-11-17 20:57:18 -03:00
AsdowandGitHub 264105071a Load old ObjectData correctly (#553)
* Load old ObjectData correctly

ITS changed ObjectDataStructs::OBJECT_BOMBS_AND_OTHER::ubBombOwner data size from 1 byte to 2 bytes, and it was not taken into account when loading ObjectData
2025-11-11 20:14:46 +02:00
steph-pgandmajcosta 9ce1492651 Add visual muzzle flash for invisible soldiers 2025-10-19 09:42:20 -03:00
steph-pgandmajcosta 7499daf06a Let 'w' allow to look with no extra click 2025-10-15 16:55:54 -03:00
steph-pgandmajcosta 1e1eb88864 Remove extra line 2025-10-14 05:35:40 -03:00
steph-pgandmajcosta 72e586a378 Move visibility check after already included pCorpse check 2025-10-14 05:35:40 -03:00
steph-pgandmajcosta 07dbf9c848 Make 3rd party corpses invisible till they in fov 2025-10-14 05:35:40 -03:00
steph-pgandmajcosta b19efcf1b4 Make disease healing a highest prior 2025-10-13 16:19:44 -03:00
Marco Antonio J. Costaandmajcosta 332b267ae6 use en_US locale instead of user's, fallback to C if not found
most likely every windows install has en_US available, even if in other
languages. if not, bring back the insertcommas function from history, no
biggie
2025-10-11 09:02:11 -03:00
Asdow 584f6b47e6 Supply ProfileID to LUA scripts instead of SoldierID
Lua scripts expect to receive the same profileID value back from l_FindSolderByProfileID() that is supplied to it on the script side. This is a bit suboptimal as we constantly keep searching for the correct soldier on different calls to C++ side with the way it works now.
2025-10-11 11:43:37 +03:00
Marco Antonio J. Costaandmajcosta 219cc6f88d missed one 2025-10-10 17:54:58 -03:00
Marco Antonio J. Costaandmajcosta 8257f2c9df edit remaining default settings
TODO make this have a single source of truth instead of three or four
2025-10-10 17:51:08 -03:00
Marco Antonio J. Costaandmajcosta c6fd81d289 Fix discrepant TOPTION values in GameSettings.cpp
Ja2_Settings was supposed to be automatically generated but over time we
started to edit defaults either there or in GameSettings.cpp inconsistently
2025-10-09 21:53:55 -03:00
steph-pgandAsdow d98de9e793 Adjust soldier create traits due to demolitions change
Since demolitions no longer affects grenades damage and range grenades
check should be moved to throwing. Keep demolitions trait at lower prior
because it can still be helpful to detect mines
2025-10-08 23:01:46 +03:00
Marco Antonio J. Costaandmajcosta 049981b35f remove now unused functions
we use a single function to turn a number into a money formatted string
now
2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta 1088ffc5b2 prevent shopkeeper interface from adding a second $ 2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta 3d29eff4d8 use FormatMoney everywhere 2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta 0dd32c4670 move FormatMoney to Text Utils 2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta fee56e37e7 better FormatMoney 2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta d79a445ad1 remove ATM_BUTTONS_* definitions 2025-10-08 03:07:23 -03:00
Marco Antonio J. Costaandmajcosta b1ccdf4e38 remove unused TransferFundsFromBankToMerc/MercToBank 2025-10-08 03:07:23 -03:00
Marco Antonio J. Costaandmajcosta 3af3b3fbbc remove sATMText[] 2025-10-08 03:07:23 -03:00
Marco Antonio J. Costaandmajcosta 86ec94b40a stop using sATMText for "Insufficient Funds" message
it is about to go
2025-10-08 03:07:23 -03:00
Marco Antonio J. Costaandmajcosta 395c18c557 remove gsAtmSideButtonText[] 2025-10-08 03:07:23 -03:00
Marco Antonio J. Costaandmajcosta 2eff78a2cf remove scope and fix whitespace in RenderAtmPanel 2025-10-07 23:09:53 -03:00
Marco Antonio J. Costaandmajcosta 3d95c47356 refactor UpDateStateOfStartButton 2025-10-07 23:09:53 -03:00
Marco Antonio J. Costaandmajcosta 0ebcf0fa06 remove comments 2025-10-07 23:09:53 -03:00
Marco Antonio J. Costaandmajcosta d6166000c9 rename fShowAtmPanelStartButton into something truthful
there is no start button, this just controls whether to draw the four
buttons in the Personnel tab of the laptop or not

also get rid of lying comments

also make it static, laptop.cpp doesn't use it at all
2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta 08b8d2f04f remove leftover unused stuff from personnel.cpp 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta ba2e69d045 remove fATMFlags-dependent code since it is always 0 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta c9cf34d608 remove unused ATMNumberButtonCallback 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta be109b71fa unused RenderRectangleForPersonnelTransactionAmount 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta 690d9e1336 remove unused HandleStateOfATMButtons 2025-10-07 22:59:05 -03:00
Marco Antonio J. Costaandmajcosta 3c87ae2724 remove unused code when fShowAtmPanel is FALSE
fShowAtmPanel is always FALSE
2025-10-07 22:59:05 -03:00
stephandmajcosta f6ae1a96cd Some BP, and snitch settings were using wrong mapping 2025-10-07 20:41:24 -03:00
Marco Antonio J. Costaandmajcosta 6c96b80afc Remove unused ATMOther2ButtonCallback 2025-10-07 20:36:22 -03:00
Marco Antonio J. Costaandmajcosta 00b5758af1 remove unused ATMOtherButtonCallback 2025-10-07 20:36:22 -03:00
Marco Antonio J. Costaandmajcosta 72ab9b0135 Remove unused CreateDestroyATMButton 2025-10-07 20:36:22 -03:00
Marco Antonio J. Costaandmajcosta 92813f5ce1 remove unused ATMStartButtonCallback 2025-10-07 20:36:22 -03:00
Asdow da83c6a557 Fix power gen fan sound
* Stop fan sound when switching sector
* Start fan sound when loading a save where current sector is power gen sector
2025-10-06 22:09:39 +03:00
Marco Antonio J. Costaandmajcosta a9dd9d0ca6 fix visual bug introduced by removing DrawMoneyOnScreen
AIM profile fees now display correctly for old inventory system as well
2025-10-05 10:54:44 -03:00
Asdow 710941edd3 Dynamically adjust contract box position
Create contract renewal box right next to mouse position. Small QoL change to have the box closer.
2025-10-03 23:47:15 +03:00
Asdow 0b0fffa21d Improve multiselection contract renewal
* Contract duration lines are greyed out if the player lacks funds
*Selecting a mix of AIM and other merc types allows renewing contracts for selected AIM mercs
* Multiselection of only mercs whose contracts are not renewable (IMPs, rebels, etc) will have greyed out contract lines
2025-10-03 23:47:15 +03:00
Asdow e1acf181df Add FIXME 2025-09-29 11:58:55 +03:00
Asdow 0f8c14e72e Remove FindSoldierByProfileID_()
All the calls where this was used are functionally identical when we just supply UID to the original FindSoldierByProfileID() call with fPlayerMercsOnly set to FALSE
2025-09-29 11:58:55 +03:00
Asdow ecea18f57c Add FIXME to l_ActionInProgress 2025-09-29 11:58:55 +03:00
Asdow e63e936715 Clean up
* Removed superfluous for-if loops
* Wrapped function contents inside if(lua_gettop(L)) scopes similar to other, already fixed functions
* Harmonized whitespace
* Added FIXMEs to two unfinished functions
2025-09-29 11:58:55 +03:00
Asdow a15ed3aceb Fix l_SoldierGiveItem(lua_State* L)
Don't use SoldierID when matching for profile id
2025-09-29 11:58:55 +03:00
Asdow 0cb13650ed Fix whitespace formatting 2025-09-29 11:58:55 +03:00
Asdow 601ef4dc30 Remove duplicate includes 2025-09-29 11:58:55 +03:00
Asdow 8fa2189a66 Fix schedule compatibility between map versions 7 & 8 2025-09-28 10:35:13 +03:00
Marco Antonio J. Costaandmajcosta cf6cc2a213 Revert "use link-time optimization when creating a release"
If this is ever the default, it should be set in the CMakeLists.txt file, not in the CI alone. My bad.

This reverts commit a7b0091a27.
2025-09-27 20:02:15 -03:00
Asdow fb34eb6776 Use SoldierID for checks 2025-09-28 00:34:07 +03:00
Asdow 35984f57d0 Check for valid ubAttacker 2025-09-27 23:57:14 +03:00
Asdow 6c42f222e1 Fix PBI when enemy attacks starting sector in tactical view
When enemy attacks the starting sector and player is in tactical view. We go from tactical to strategic screen to show the prebattle interface instead of staying in tactical. The game errors on the sector assert when trying to draw the glowing red locator around the sector just before displaying the prebattle interface.

Normally the sector gets set properly when compressing time for the first time in a new game start but due to UB going into playing the intro video, it skips the call to HandleTimeCompressWithTeamJackedInAndGearedToGo() that would eventually set it. Neither can we rely on setting the sector when initiating the prebattle interface since MapScreenHandle() tries to display the locator before the PBI gets initialized.
2025-09-27 01:01:23 +03:00
Marco Antonio J. Costaandmajcosta e8aedb29d5 show daily discounted costs for 1week and 2week contracts
also shorten translations to fit the UI
2025-09-26 02:31:02 -03:00
Marco Antonio J. Costaandmajcosta ffe987061e remove DrawMoneyOnScreen
there's already a function to draw text on the screen. a money amount is
text, so just return a string and print that.
2025-09-26 02:31:02 -03:00
Asdow 1f6e545a39 Make enemy battle sound respect speech volume setting 2025-09-25 23:26:29 +03:00
Asdow 2b9efd3702 Make helicopter sound respect sound effect volume setting
Helicopter sound would play upon heli insertion even if sound effects volume was set to 0 in options.
2025-09-25 22:55:33 +03:00
Asdow f5a7c32bff Use SoldierID instead of pSoldier
ContinueDialogue was possible to be called with pSoldier that isn't null but is not valid pointer to MercPtrs array resulting in debugger catching an illegal memory access.
2025-09-25 22:47:51 +03:00
Marco Antonio J. Costaandmajcosta e14a337e03 Prevent AllowReinforcements from reverting to TRUE regardless of setting whenever you save 2025-09-25 15:27:30 -03:00
Asdow d21b487884 Fix include filenames 2025-09-25 13:06:18 +03:00
Asdow a161dcc509 Fix selecting soldiers via right click in editor 2025-09-25 10:17:04 +03:00
Asdow f3b99edbff Fix Debug build 2025-09-24 19:21:58 +03:00
Asdow f47908e033 Fix debug mode defines
JA2BETAVERSION gets defined in cmake depending on selected config
2025-09-24 19:21:58 +03:00
AsdowandGitHub f52ab32952 Merge pull request #331 from 1dot13/ExtraMercs
Increased Team Sizes (ITS)
2025-09-24 17:07:51 +03:00
Asdow 82aca548f5 Merge branch 'master' into ExtraMercs 2025-09-24 16:14:10 +03:00
Marco Antonio J. Costaandmajcosta 4ec012ce7b fix bug where combat doesn't end on team retreat
fixes issue #498 where retreating from combat in a sector that has a merc
inbound via the airdrop marker causes combat not to end

the reason this fails is that a the inbound soldier counts as being in
the sector being retreated from, even though he isn't

I add a check for `MercPtrs[i]->bInSector` so this doesn't happen

that way the function doesn't leave early and CheckForEndOfCombatMode is
reached
2025-09-11 22:00:32 -03:00
Marco Antonio J. Costaandmajcosta ac59eba898 get rid of unnecessary #defines 2025-09-05 20:31:11 -03:00
Marco Antonio J. Costaandmajcosta 216cd78b18 Let players make an IMP with 3 major and 0 minor traits 2025-09-02 20:02:15 -03:00
Marco Antonio J. Costaandmajcosta 7d9cd87da8 fully externalize bQueenLosingControlOfSector 2025-09-02 20:01:47 -03:00
Marco Antonio J. Costaandmajcosta e5d25810f6 nuke console 2025-08-31 13:50:19 -03:00
Marco Antonio J. Costaandmajcosta 5d3cc7969f fix code that relies on transitive includes 2025-08-30 19:09:06 -03:00
Marco Antonio J. Costaandmajcosta 272ba56fa1 remove unused function 2025-08-30 18:48:16 -03:00
Buscherandmajcosta 1004ab6c8c Added Right Click to time compression to fast forward a single hour 2025-08-24 15:06:10 -03:00
Marco Antonio J. Costaandmajcosta 3c44f133fd Actually fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected 2025-08-24 07:39:00 -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
BeatAroundTheBuscherandGitHub e9b12908f7 ASD/ARC: Fix Error by One in gasCan Vector (#472)
* ASD/ARC: Fix Error by One in gasCan Vector

* Add size check for the gasCan vector as part of ARC

* Remove unused Vectors for ARC
2025-08-15 18:40:43 -07:00
BeatAroundTheBuscherandGitHub e8399bb7c8 Make backpack AP stance costs depend on actual weight instead of a bool checking if a backpack is equipped or not (#486)
* Externalize the Divisor for usBackPackWeight

A new ini value BACKPACK_WEIGHT_FACTOR is introduced to replace the hard coded 50.
The value goes from 1 to 250 and its default value is 50 as before.

* Refactor usBPPenalty into its own function GetBackbackAPPenaltyFromBackpack

The same code is also used in GetAPsCrouch as well as GetAPsProne

The intent of the change is to make sure that backpacks including their content
do not add an additional AP cost of +1. Now it checks if
the backpack weight is > ubBackPackWeightFactorForAPPenalty (default value 50).
The min exists to make sure that the AP cost does not become higher than previously.

Previously the bool fBackpackCheck was used to add +1 if there is any backpack.
But this also includes an empty tactical sling (backpack with 0.2 kg) and
therefore makes the item much less interesting to use.
2025-08-15 22:52:43 +02:00
KittyandGitHub 11202d7e7e Expanded and sorted nationalities (#485)
- added Tracona for use with UB, etc
- sorted alphabetical (english) for more ease of use during IMP creation
- that sorting starts only after original nationalities (from after Metaviran)
- expanded and adjusted the existing ones
- tried to achieve a decent amount from every continent
- while sorting the language specific files, preserved existing translations
- adjusted MercProfiles in related gamedir change
2025-08-14 12:53:10 +02:00
Marco Antonio J. Costaandmajcosta 616d9a08e6 Fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected 2025-08-12 23:18:49 -03:00
Asdow f3194718e4 Remove useless check for savegame version
ITS breaks save games.
2025-08-08 21:21:48 +03:00
Asdow fd9611ae04 Remove compiler warnings 2025-08-08 18:38:53 +03:00
Asdow c62d767622 Update to Master 2025-08-08 18:00:31 +03:00
Asdow b7bfd8a2eb Use FLAGS64 for flagmasks 2025-08-08 17:42:25 +03:00
Asdow c78f8faefc Whitespace changes 2025-08-08 17:41:51 +03:00
Asdow 63f614f957 Add FLAGS64 typedef 2025-08-08 17:41:40 +03:00
Asdow d078a3439f Fix squad movement popupbox for increased squads 2025-08-08 17:01:13 +03:00
Asdow 9b83d6a3bc Increase squad amount to 40 2025-08-08 16:39:52 +03:00
KittyandGitHub 9ff8476c15 Fixes to npc-actions Pacos
Fixes to npc-actions Pacos
2025-08-07 23:33:35 +02:00
kitty624 6a9df9f22c Fixes to npc-actions Pacos 2025-08-07 23:30:09 +02:00
Asdow 56dc0088b6 Fix underflow in loop 2025-08-07 23:46:24 +03:00
Asdow c3a34a660d Check squads are on the same level 2025-08-07 22:02:49 +03:00
Asdow 1074e9c408 Fix save game compability for MERCPROFILESTRUCT 2025-08-07 21:34:54 +03:00
KittyandGitHub 4537f5d4dc IniOption Food items can show without using Food (#475)
IniOption: Food items can show without using Food

food items are usualy not shown in game without using Food

option ALWAYS_FOOD allows them to be shown even without
    
default is false, no food items without Food
2025-08-03 08:23:34 +02:00
kitty624 4ae331c19e IniOption Food items can show without using Food
- food items are usualy not shown in game without using Food
- option ALWAYS_FOOD allows them to be shown even without
- default is false, no food items without Food
2025-08-03 08:12:48 +02:00
KittyandGitHub b85380c958 Reverting Commit 9122d7a (#474) from kitty624
Reverting Commit 9122d7a

 it made: CAN_FAN_THE_HAMMER = FALSE now disables the burst mode on pistols

 which effectivly resulted in pistols burst mode only being avaialbale with can fan the hammer active

 which further resulted in being required to fire from hip mode when using burst with pistols

 that's not a desired behaviour for burst on pistols, their burst should not depend on fan the hammer

 therefore reverted
2025-08-01 21:10:57 +02:00
kitty624 eb3f62c3d5 Reverting Commit 9122d7a
it made: CAN_FAN_THE_HAMMER = FALSE now disables the burst mode on pistols
which effectivly resulted in pistols burst mode only being avaialbale with can fan the hammer active
which further resulted in being required to fire from hip mode when using burst with pistols
that's not a desired behaviour for burst on pistols, their burst should not depend on fan the hammer
therefore reverted
2025-08-01 20:52:22 +02:00
CptMoore 8644e5f8b9 Update build.yml 2025-07-25 10:25:46 +02:00
Asdow 872a356e82 Correct column size check 2025-07-23 15:11:03 +03:00
AsdowandGitHub 7bb7c54317 Guard against integer underflow (#462) 2025-07-20 17:30:22 -07:00
Asdow 49a56d01ac Load correct militia icons for 720p resolution 2025-07-08 20:21:54 +03:00
Asdow 9d1e9e8948 Fix line highlighting 2025-06-27 20:28:15 +03:00
Asdow b3b3270e1e Adjust constructors 2025-06-27 19:59:01 +03:00
Asdow 1a8db5d15b More conversions to SoldierID 2025-06-27 19:58:20 +03:00
Asdow 09ce332721 Allow 10 size squads for 720p resolution in UB 2025-06-27 16:00:10 +03:00
Asdow 5e2c61ef12 Externalized UB bloodcat quest sector 2025-06-25 22:54:53 +03:00
Asdow 4d948fda06 Fix powergen fan stopping in UB
Sector Y & Z coordinates were mixed up in code, which would then always fail the check for correct sector.
2025-06-24 22:54:44 +03:00
Asdow 2ae110971b spelling fixes 2025-06-24 22:54:44 +03:00
Asdow 9a78e7dfa0 Formatting changes 2025-06-24 22:54:44 +03:00
Asdow d95bae2bf6 Re-enable power generator fan sound effect for UB 2025-06-24 22:54:44 +03:00
Asdow a1bb85ca95 Externalize fan exitgrid location in the source sector 2025-06-24 22:54:44 +03:00
Asdow d9391de58a Fix laptop crush popup text
Due to additional dialogue flag having the value 8, and UB not having a specific flag for mercs standing up after heli crash, the FindSoldierByProfileID would always find Steroid if he was on the team, and then display the crunched laptop popup text.

Adding a new flag that is checked before we go into that branch in HandleDialogue fixes the issue.
2025-06-22 12:43:33 +03:00
Asdow c02bbc90cb Fix helicopter for UB
No need to force an assert error here. We can simply ignore the meanwhile scene just like all the others.
2025-06-18 22:58:17 +03:00
Asdow efb54202ea Fix Mercprofile usStrategicInsertionData for bigmaps
NPCs would not appear in the map if their gridno was over 65535 in large maps
2025-06-15 14:42:34 +03:00
zwwoooooandmajcosta 11caa6529c Fix the issue of garbled UTF-8 text in the szTileSetDisplayName field of the StructureMove.xml file in the game's "Drag" menu.(Method provided by @Learner) 2025-05-10 14:28:14 -03:00
Asdow e2f296c42c Remove #pragma optimize("", off)
Managed to slip in in commit f21cb38. Bad Asdow, bad!
2025-05-01 10:39:19 +03:00
Asdow ee2807ae64 Default to 1st kit if deciding not to buy gear in UB
1st one is included in the hiring fee
2025-04-26 00:37:38 +03:00
Asdow b23c9ac8b1 Do not prompt for buying inventory for 1st kit in UB 2025-04-26 00:37:38 +03:00
Asdow fa0c5a2862 Prevent hiring MERC in UB if not enough funds 2025-04-26 00:37:38 +03:00
Asdow db6da100e1 Reset selected gear kit when browsing mercs 2025-04-26 00:37:38 +03:00
Asdow a3e7ce5794 Display special offer for 1st M.E.R.C. inv kit in UB
* Use weekly instead of daily salary for total cost calculation
2025-04-26 00:37:38 +03:00
Asdow 5062ae74f2 Display correct salary info for MERCs in UB campaign 2025-04-26 00:37:38 +03:00
Asdow dd58f904f4 Do not offer surrender for multiplayer 2025-04-24 21:52:11 +03:00
Asdow 8dcb431ef2 Use (0,0) sector coordinates as unused cache
Makes the comment in Mod_Settings.ini valid advice
2025-04-17 23:51:44 +03:00
Asdow 5f45d06852 Fix possible integer overflow 2025-04-16 20:10:11 +03:00
Asdow 92103e36a6 Fix formatting 2025-04-16 01:28:07 +03:00
Asdow 8f98a9b985 Move UpdateAirspaceControl() out of #ifdef
Fixes UB not updating samsite airspace correctly after battle
2025-04-16 01:28:07 +03:00
Asdow c2e78d0461 Use correct macro to index StrategicMap 2025-04-16 01:28:07 +03:00
Asdow 36a84ffe59 Remove pSecondColumnString
* Use the new columns added to Text instead
* Changed most functions to allow choosing a column
* Removed unneeded SecondColumn specific functions to lessen code duplication
* Lots of formatting changes to Popupbox.cpp, indentation was messed up in majority of the functions
2025-04-13 22:26:32 +03:00
Asdow 865288e622 Implement multicolumn popupbox
Mainly aimed for strategic movement popup box to accommodate increased team sizes
2025-04-13 19:11:45 +03:00
AsdowandGitHub 3e45217a9a Add compilationFlags to {exe} (#428)
* Add compilationFlags to {exe}

sgp.cpp is not recognizing JA2EDITOR preprocessor definition otherwise and therefore does not read EDITOR_SCREEN_RESOLUTION when starting map editor

* Add debugFlags too
2025-04-12 17:48:12 -03:00
Asdow da3c3bace8 Use mouse position for squad movement popup box initial location 2025-04-09 23:11:11 +03:00
Asdow ec4dc8b058 Provide gMapViewRegion through mapscreen.h 2025-04-09 23:10:32 +03:00
CptMoore 9df885a264 Fixed tagged releases #2 2025-04-09 20:33:32 +02:00
Asdow 07320ba996 Limit TeamList mouseregions to correct amount 2025-04-09 21:33:28 +03:00
CptMooreandGitHub 5ed70befb4 Fixed tagged releases (#429)
Fixed tagged releases
2025-04-09 19:52:23 +02:00
Asdow f21cb38647 Increase TileNo to UINT32
Bigmap grid number values go over uint16 max
2025-04-05 16:20:37 +03:00
Asdow 4823ef4929 Add check for vest position attachments 2025-03-06 17:39:35 +02:00
Asdow 586a46bb78 Remove last reference to gbPixelDepth 2025-02-24 23:08:52 +02: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 9c951adfea Read correct variable from CTHconstants.ini 2025-02-24 16:11:58 +02:00
Asdow e3a542bf5d Exclude robots from trying to activate panic triggers 2025-02-14 16:47:03 +02:00
Asdow 222daead0e Remove unused ItemFlags
Detonator and Remote Detonator are specified by AttachmentClass
No items in items.xml actually even contained these flags.
2025-01-27 18:30:11 +02:00
Marco Antonio J. Costaandmajcosta ebd2e25e0f Fix a wrong #ifdef to runtime check conversion
I didn't get this right the first time, non-Chinese text was looking
funny in dialog boxes
2025-01-09 21:37:19 -03:00
Marco Antonio J. Costaandmajcosta ff8376d625 Keep UB specific enum value for all builds
but at the end, not beginning as to not make a mess

along with an intro.lua change in gamedir/Data-UB/Scripts this gets rid of a nasty preprocessor conditional in a header file
2025-01-09 21:34:07 -03:00
Marco Antonio J. Costaandmajcosta 7aa0e18352 Revert "make sure these steps run"
This reverts commit 1976dee738.

Revert "yet another fix for the github actions"

This reverts commit 552951795c.

Revert "make sure CI to assemble release on 'v*' tag push or manually"

This reverts commit 8897769f0d.
2025-01-07 16:51:30 -03:00
Marco Antonio J. Costaandmajcosta 1976dee738 make sure these steps run
otherwise there is no 'source' working directory for the final step
2025-01-07 14:13:46 -03:00
Marco Antonio J. Costaandmajcosta 552951795c yet another fix for the github actions
github.ref_name isn't 'master' when a tag is pushed, but the tag name,
so it won't trigger a release build when a 'v*' tag is pushed
2025-01-07 13:19:03 -03:00
Marco Antonio J. Costaandmajcosta 8897769f0d make sure CI to assemble release on 'v*' tag push or manually
also put bash script through shellcheck to be more posix compliant
2025-01-07 13:09:23 -03:00
Asdow dcf202990f Remove duplicate header includes 2025-01-05 17:08:02 +02:00
Asdow db40cd433e Move mapscreen bottom coordinates' initialization
Fixes radar map's initial  position in strategic screen being in the top right corner.
2025-01-05 17:08:02 +02:00
Marco Antonio J. Costaandmajcosta ac6a1504df add a space to string to prevent compilation errors in GB2312 2025-01-05 10:04:04 -03:00
Marco Antonio J. Costaandmajcosta 22e67f66fa Move wine.cpp into its own library
avoid extra compilations that way
2025-01-05 07:57:57 -03:00
FunkyFr3shandmajcosta fd6ffd8d69 automatically add needed dll override for Linux/macOS/Android (WINE) 2025-01-05 07:06:01 -03:00
Marco Antonio J. Costaandmajcosta f471b74f5b fix inconsistent case for a few files
you can now build in a case-sensitive filesystem
2025-01-04 13:14:22 -03:00
majcostaandGitHub 4a16698cdb CHINESE: actually display BobbyR amount purchased correctly at runtime (#398)
* Revert "Move CHINESE BOBBYR_ITEMS_BOUGHT_X conditional definition to i18n"

This reverts commit ecdc8916f2.

* actually display the amount purchased correctly at runtime
2025-01-03 21:03:09 -03:00
Marco Antonio J. Costaandmajcosta 846abf5f1c Convert Text.h to utf-8-sig and move ChineseSpecString* there
This time without mangling the characters
2025-01-02 13:53:27 -03:00
Marco Antonio J. Costaandmajcosta ed73bd07ae Revert "Make Chinese specific strings compile-time instead of conditional"
When these lines were edited, I likely opened _ChineseText.cpp in the
wrong encoding, and therefore saved it in the wrong encoding, mangling
the characters

This reverts commit cd69f5f3ae.
2025-01-02 13:53:27 -03:00
Marco Antonio J. Costaandmajcosta b908bcecb9 fix missing icon in executable
the Ja2.rc file needs to be in the add_executable target for the icon
to appear, and that one requires WinMain.

so get rid of dummy.cpp and put sgp/sgp.cpp in there
2025-01-02 08:02:52 -03:00
Marco Antonio J. Costaandmajcosta a7b0091a27 use link-time optimization when creating a release
it's a lot slower, but we don't release often
2025-01-01 18:10:47 -03:00
Marco Antonio J. Costaandmajcosta 7aafa7aada fix the GitHub actions for VS2022's quirk too
missed this change in 98cdffe5, fix it now
2025-01-01 18:10:47 -03:00
majcostaandGitHub 3e76e9525e Merge pull request #378 from majcosta/pr_remove_language_from_preprocessor
Get every language preprocessor conditional into one library
2024-12-31 18:32:50 -03:00
Marco Antonio J. Costa 959c29434e Adjust the build system
Language is now just built once per app (still some JA2UB conditionals
going on in there) but building everything should now take eight times
less work
2024-12-31 18:24:36 -03:00
Marco Antonio J. Costa e9686c0dca reformat CMakeLists.txt 2024-12-31 16:28:45 -03:00
Marco Antonio J. Costa 10037291f3 remove preprocessor from i18n Multi Language Graphic Utils.cpp 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 9ed713f952 move Utils/Multi Language Graphic Utils.* to i18n
has language preprocessor silliness, straight to jail
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa cccec0ef11 straggler in Utils/Font Control.cpp 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 4a7625cef0 Slightly clunky RUSSIAN conversion 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 70f09471c2 just cast g_lang into lua's language code
because magically I got the enum order right first try
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa b15c4ef96c the really gnarly CHINESE #ifdef conversions
these seem to be right, chinese text appears to be flowing correctly
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa ecdc8916f2 Move CHINESE BOBBYR_ITEMS_BOUGHT_X conditional definition to i18n
Just awful
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 4b563fefc8 Slightly clunkier fix for RUSSIAN conditional 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa cf0b4dfc40 Manual unrolling preprocessor stuff and added function
This function is just for GERMAN but it has a unique name so it's no
problem.

Had to slightly change how MercID gets populated
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 5fb989a1fc Move Text.h over to i18n too
Never use relative paths for #includes. Didn't touch the rest because
out of scope.
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 33e8c1dc39 Move all the translated strings over to i18n
It's where all conditional language preprocessor goes
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 73f7812165 Slightly less straightforward CHINESE conversion in Interface Items.cpp
A bit clunkier, had to repeat function calls because of how
preprocessor tricks don't map 1:1 with actual C++.
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa d008d10b31 Replace a ton of trivial #ifdefs with runtime checks
This one is big, but unless I missed something, should be all be
trivial.

scripted-diff with the following, then manually tweaked whatever needed:
```

if [ $# -ne 3 ]; then
    echo "Usage: $0 '<pattern>' '<replacement>' '<filename>'"
    exit 1
fi

pattern="$1"
replacement="$2"
filename="$3"

if [ ! -f "$filename" ]; then
    echo "Error: File $filename does not exist."
    exit 1
fi

sed -i '/'"$pattern"'/ {
    :loop
    $ !{
        N
        /'"$pattern"'.*\n.*#endif/ {
            s/'"$pattern"'/'"$replacement"'/
            s/#else/} else {/
            s/#endif/}/
            P
            D
        }
        /'"$pattern"'/ b loop
    }
}' "$filename"

echo "Replacement complete in $filename"
```

h/t to Grok2 for the sed command
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa cd69f5f3ae Make Chinese specific strings compile-time instead of conditional
eventually we'll switch between CHINESE and other languages during
runtime, so even if language is not chinese, these symbols must still
be there

these symbol names aren't used so this is fine
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa bf6de9f342 Move GetLanguagePrefix function into i18n 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 5d19c1fe25 make conditional CHINESE preprocessor def into global constant 2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 4624fe92f0 leave CHINESE struct member UINT8 Width[0x80]
this might cause a horrifying alignment bug, but I doubt it
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 3acd2cea97 move Ja 2 Libs.* to i18n
it has preprocessor silliness in it
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 4d4e039da7 add an internationalization constant
gather all ENGLISH|GERMAN|CHINESE etc preprocessor hell into a single
library, so to restrict the number of targets that need to be built 8x

this still has UB/EDITOR definitions so that still needs to be dealt
with before we can build it only 8 times
2024-12-31 16:28:44 -03:00
Asdow 3cfde817ba Set table mouse_region priorities lower than bookmark bar 2024-12-30 21:21:30 +02:00
Marco Antonio J. Costaandmajcosta dd5cabc6ba actually make link-time optimization default to OFF
sorry, I lied in the last commit. didn't mean to
2024-12-29 07:29:13 -03:00
Marco Antonio J. Costaandmajcosta a83dfbefb0 add option to enable link time optimization
a bit slower to compile for developing so defaults to 'false', but
might be a good idea for the releases.
2024-12-27 18:17:20 -03:00
Marco Antonio J. Costaandmajcosta dc72a43a19 silence narrowing conversions in MSVC
we all know they're there, whenever someone fixes it (lol), this
should be removed
2024-12-27 03:08:36 -03:00
Marco Antonio J. Costaandmajcosta 897f684705 remove all #include's for Language Defines
scripted diff:

find . -type f -iname "*.h" -exec sed -i -E '/#include.*language\ defines\.h/I d' {} \;
find . -type f -iname "*.cpp" -exec sed -i -E '/#include.*language\ defines\.h/I d' {} \;
2024-12-27 02:35:29 -03:00
Marco Antonio J. Costaandmajcosta 0993789430 remove Language Defines file
we don't do it like that anymore, the build system takes care of it
2024-12-27 02:35:29 -03:00
Marco Antonio J. Costaandmajcosta 6b9997b9c5 we don't use USE_CODE_PAGE anymore 2024-12-26 11:51:31 -03:00
Asdow 4ed7b1fb98 Increase selection window size 2024-12-25 22:03:03 +02:00
Asdow 5499d1fba2 Whitespace formatting 2024-12-25 22:03:03 +02:00
Asdow 22af6e8ec8 Implement mousewheel scroll for selection window 2024-12-25 22:03:03 +02:00
Asdow a9ab60e5e5 Fix road tiles for big maps 2024-12-25 17:35:11 +02:00
Asdow c30b1c1b25 Reimplement UB pricing for AIM 2024-12-24 22:48:41 +02:00
Marco Antonio Jaguaribe Costaandmajcosta f4f48f23c7 cmake: favor vertical layout and absolute paths for include_directories
just the way git works should tilt us towards tall code rather than very
long lines, easier for merging/conflicts
2024-12-24 08:28:02 -03:00
Asdow 5b966b4df9 Provide MAX_TACTICAL_ENEMIES to lua 2024-12-24 00:16:09 +02:00
Asdow eb7837bc3e Increase filename buffer length
The mapeditor filedialog is big enough to show longer filenames than 20 characters.
2024-12-23 20:45:48 +02:00
Asdow c88fbbe749 Fix assertion error due to too long filenames 2024-12-23 20:45:48 +02:00
Asdow a580052e40 Read new tags
Maybe *this* time it'll finally be fixed. Sigh...
2024-12-23 19:26:37 +02:00
Asdow 7fa8ff930b Remove unused tag
PercentCounterForceFrequency is never read from items.xml and INVTYPE doesn't have a field for it either
2024-12-22 00:08:45 +02:00
Asdow c7d021f5f3 Read updated items.xml format
Requires accompanying GameDir change.

Removed ItemFlag as an xml tag and added  bitmask flags as their own individual tags. Makes modding easier when the flags can be modified without math in the xml files
2024-12-22 00:08:45 +02:00
KittyandGitHub bfc78e2ef8 Simplified rework foodsystem allowed items (#357)
Simplified rework foodsystem allowed items
now no more need for a tag when checking IsItemLegal for Food System
ontop of checking for foodpoints, now also check if is drug
as a result, as previously, all eatable food will be excluded without food system,
but now only if it isn't a drug at the same time
and no more tag to check for that in items.xml needed
2024-12-17 13:23:58 +01:00
kitty624 0bd932f20f Simplified rework foodsystem allowed items
simplified the previous commit, now no more need for a tag
when checking IsItemLegal for Food System, ontop of checking for foodpoints, now also check if is drug
as a result, as previously, all eatable food will be excluded without food system, but now only if it isn't a drug at the same time
and no more tag to check for that in items.xml needed
2024-12-17 13:13:37 +01:00
KittyandGitHub 28a51e0e7b Reworked foodsystem exclusive items
no food items if the food system is off
whether the item is exclusive is defined by tag in items.xml
replaced previous way of decision, which used Item[usItemIndex].foodtype > 0 as criteria
that also restricted dual use items (i.e. drugs that also have a foodtype, like coffee, etc.)
2024-12-16 10:07:20 +01:00
kitty624 2fcba8b9f7 Reworked foodsystem exclusive items:
no food items if the food system is off
whether the item is exclusive is defined by tag in items.xml
replaced previous way of decision, which used Item[usItemIndex].foodtype > 0 as criteria
that also restricted dual use items (i.e. drugs that also have a foodtype, like coffee, etc.)
2024-12-16 09:54:54 +01:00
Marco Antonio Jaguaribe Costaandmajcosta 184b44c386 a couple consistency extension changes
iniErrorReport is a log file, all other log files have .log extension, so make it
consistent with that

make Ja2_settings.ini's extension lowercase. OCD, sorry.
2024-12-15 15:25:28 -03:00
Marco Antonio J. Costaandmajcosta 86ad401186 add newline at end of file where it's lacking
.editorconfig already enforces it but it's getting changed piecemeal in
every commit. just get it done with.

the script:
```

find . -type f -not -path "./.git/*" -not -path "./.vs/*" | while read -r file; do
	isFile=$(file -0 "$file" | cut -d $'\0' -f2)
	case "$isFile" in
		(*text*)
			echo "$file is text"
			if [[ $(tail -c 1 "$file" | wc -l) -ne 1 ]]; then
				echo "" >> "$file"
			fi
			;;
		(*)
			echo "file isn't text"
			;;
	esac
done
```
2024-12-14 19:05:48 -03:00
Marco Antonio J. Costaandmajcosta 1d58bda82d cross-compilation scaffolding WIP
requires clang/lld or mingw, obviously

just make sure the MSVC_DIRECTORY env variable points to valid Visual Studio Build Tools directory
and do: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=clang_or_mingw_toolchain_file`
2024-12-13 19:24:59 -03:00
momoko-handGitHub 87f51f0f6e Fix warning C4715 in Music Control.cpp (#351) 2024-12-10 17:15:21 +02:00
Marco Antonio Jaguaribe Costaandmajcosta 98cdffe5fd (actually) fix broken MS2022 behavior
a recent Visual Studio update introduced an error unless there is a
CMakePresets.json file present, completely blowing up the previous
setup.

after this commit, you should either delete the CMakeUserPresets.json
file from your root or add it to your system - NOT repo! - excludesFile:
https://stackoverflow.com/questions/7335420/global-git-ignore
2024-12-09 14:19:25 -03:00
Marco Antonio Jaguaribe Costaandmajcosta 2424066aab Revert "fix broken MS2022 behavior"
This reverts commit b89c63058f.
2024-12-09 13:45:08 -03:00
Marco Antonio Jaguaribe Costaandmajcosta b89c63058f fix broken MS2022 behavior
a recent Visual Studio update introduced an error unless there is a
CMakePresets.json file present, this patches it over for now and makes
note to remove it once this is fixed
2024-12-09 13:38:40 -03:00
Marco Antonio Jaguaribe Costaandmajcosta 0b21d1d798 add a TODO file
put your TODOs here so you won't forget, or in case you do, maybe
someone can pick it up in the decades to come
2024-12-09 12:58:43 -03:00
AsdowandGitHub dcde413b7b Initialize AI morale to normal instead of hopeless (#345) 2024-12-05 23:05:50 +02:00
Asdow febb283c3a Allow bloodcats in RED state to roam farther
Bloodcat lair had a few cats with CLOSE PATROL orders, resulting them to move only 15 tiles from their starting point, allowing them to be picked off from afar with scoped rifles.
2024-12-05 22:56:57 +02:00
Asdow 678ef822ca Fix passive bloodcats 2024-12-05 22:56:57 +02:00
AsdowandGitHub 1eff9f6aaa Fix bloodcat ambush endless loop (#343)
Some bloodcats during ambushes could have ubInsertionDirection with values > 100, which then causes endless looping in pathfinding algorithms as valid direction values range from 0 to 7
2024-12-05 16:13:09 +02:00
Asdow 20a33893d9 Fix Teamlist for smaller resolutions
Merc names were being printed past the end of teamlist area
2024-12-04 20:49:53 +02:00
Asdow ffccdfa654 Fix Tactical Placement GUI for increased teamsizes
Requires new file OverheadInterface_scrollarea.sti in Gamedir/Data/Interface/
2024-12-04 00:18:22 +02:00
AsdowandGitHub 11bb0f741f Fix music playing when crepitus is present (#341)
UseCreatureMusic( HostileZombiesPresent() ); was overriding the music mode set in PrepareCreaturesForBattle() when encountering crepitus or being in the creature caves, resulting in regular tense and battle music being played.
2024-12-02 01:10:58 +02:00
Asdow abe6877d90 Delete VS project files
Remnant from the initial branch commit
2024-12-01 21:51:56 +02:00
Asdow d0dbb9afb1 Remove unused function 2024-12-01 21:37:52 +02:00
Asdow 1013531a7f Remove #pragma optimize("", off) calls 2024-12-01 21:17:23 +02:00
Asdow bfb724eab9 Use SoldierID 2024-12-01 18:23:52 +02:00
Asdow e59d915e58 Use SoldierID 2024-12-01 00:20:41 +02:00
Asdow 4e8c5fa9ab Remove unused function & globals 2024-11-30 23:50:17 +02:00
Asdow de56f653ec Use SoldierID 2024-11-30 23:47:00 +02:00
Asdow 79b57c326e Move check for surgery into its own function 2024-11-30 18:29:55 +02:00
Asdow c2b1ac0109 use SoldierID 2024-11-30 18:29:17 +02:00
Asdow 2eb16c583c Use SoldierID 2024-11-30 17:18:04 +02:00
Asdow 5bbbec18bb Use SoldierID 2024-11-30 17:06:11 +02:00
Asdow 66f5156f03 Use SoldierID 2024-11-30 16:52:18 +02:00
Asdow 4645a09722 Use SoldierID 2024-11-30 16:07:36 +02:00
Asdow d244ef4c91 use SoldierID 2024-11-30 15:25:48 +02:00
Asdow 24656f2810 Use SoldierID 2024-11-30 15:20:18 +02:00
Asdow d960403514 Use SoldierID 2024-11-21 23:56:57 +02:00
Asdow 0d97e36c34 Use SoldierID 2024-11-21 23:56:44 +02:00
Asdow 1ac5d153fb Correct inc/dec operator overloads 2024-11-21 23:55:51 +02:00
Asdow d687956cf1 Remove unused function 2024-11-21 21:53:48 +02:00
Asdow 94f2e830e0 Lessen repetition 2024-11-21 21:53:36 +02:00
Asdow 67c8081104 Use SoldierID 2024-11-21 21:29:28 +02:00
Asdow 0dc2ceabb2 Use SoldierID 2024-11-21 19:48:54 +02:00
Asdow 1ec2867ced Use SoldierID
Fixed if conditions as well
SOLDIERTYPE::ubProfile would never match with values above NOBODY
2024-11-20 23:02:39 +02:00
Asdow a9120ef984 Remove unused function 2024-11-20 22:35:55 +02:00
Asdow a50a6de1b5 Make fewer calls to MercPtrs 2024-11-20 22:34:30 +02:00
Asdow 845d784bff Use SoldierID 2024-11-20 22:33:33 +02:00
Asdow 99703fa8b6 Use SoldierID 2024-11-20 21:52:28 +02:00
Asdow 58bfffff55 Simplify if checks 2024-11-20 21:27:46 +02:00
Asdow 7fffcd295c Simplify function 2024-11-20 21:27:18 +02:00
Asdow 65a8b4fd77 Use SoldierID 2024-11-20 21:19:28 +02:00
Asdow 9d0ec49e88 Use SoldierID 2024-11-20 21:17:19 +02:00
Asdow 29354135dc Use SoldierID 2024-11-20 21:14:10 +02:00
Asdow 63fe0be512 Use SoldierID
Rename function parameter to make it clear it needs to be profileID
Change the parameter type to UINT8
2024-11-20 21:10:44 +02:00
Asdow 3f4c94642e Fix compiler warnings 2024-11-20 21:04:12 +02:00
Asdow 8856813768 Lessen copy & paste 2024-11-20 21:03:54 +02:00
Asdow dbc4135974 Use SoldierID 2024-11-20 21:03:08 +02:00
Asdow d826491c83 Remove unused function parameter 2024-11-20 20:26:50 +02:00
Asdow bb1c63d4e8 Convert to SoldierID 2024-11-20 20:12:05 +02:00
Asdow 8e4307b2fb Use SoldierID 2024-11-20 19:56:38 +02:00
Asdow e4fe066da0 Fix comment 2024-11-20 19:56:30 +02:00
Asdow cabb50a361 Update Game Event Hook.cpp 2024-11-20 00:48:40 +02:00
Asdow cebd20f5d0 Update ShopKeeper Interface.cpp 2024-11-20 00:47:51 +02:00
Asdow aee7c23aa4 Update Air Raid.cpp 2024-11-20 00:35:29 +02:00
Asdow c7e654a1d9 Update Town Militia.cpp 2024-11-20 00:28:38 +02:00
Asdow 235ddfa782 Update Game Event Hook.cpp 2024-11-20 00:23:08 +02:00
Asdow a670aff29c Combine loops to check for medics and patients 2024-11-20 00:13:25 +02:00
Asdow 2a52347198 Update personnel.cpp 2024-11-20 00:04:29 +02:00
Asdow 648a50f1e8 Convert currentTeamList to SoldierID 2024-11-20 00:01:35 +02:00
Asdow 698176e841 Convert DisplayCharPersonality() to SoldierID 2024-11-19 23:33:11 +02:00
Asdow 8b90c84738 Convert DisplayCharStats() to SoldierID
Moved two repeated print calls to their own functions
Removed compiler warning about exceeding stack size
2024-11-19 23:20:45 +02:00
Asdow be5c4b1601 Convert to SoldierID 2024-11-19 21:41:07 +02:00
Asdow 534ce662f3 Convert to SoldierID 2024-11-19 01:08:26 +02:00
Asdow ff638a5473 Convert to SoldierID 2024-11-19 01:01:41 +02:00
Asdow 5b4be9bcdb Convert to SoldierID 2024-11-19 00:55:36 +02:00
Asdow 3f448a62fb Remove unused functions 2024-11-19 00:08:46 +02:00
Asdow 18673f3a29 Remove compiler warning 2024-11-18 23:58:14 +02:00
Asdow 47824c97a1 Fix UB compilation 2024-11-18 23:58:04 +02:00
Asdow 65c4cdd1d7 Suppress compiler warnings by using SoldierID::i directly 2024-11-18 23:43:13 +02:00
Asdow 191af4da49 Update SoldierID constructors 2024-11-18 23:38:43 +02:00
Asdow 94a5972a85 Perform explicit casts from UINT8 to UINT16 for SoldierID 2024-11-18 23:38:00 +02:00
Asdow 1e16de30d7 Remove wrong cast 2024-11-18 23:22:19 +02:00
Asdow b718b463c2 Use SoldierID 2024-11-18 23:22:00 +02:00
Asdow 327046925b Converto to SoldierID 2024-11-18 23:20:42 +02:00
Asdow df01708ac3 Update Soldier Control.cpp 2024-11-18 23:20:14 +02:00
Asdow 2387667a23 Initialize SOLDIERTYPE SoldierIDs to NOBODY
memset in initialize() function sets them all to zero
2024-11-18 23:20:04 +02:00
Asdow 883ceb2f6f Convert to SoldierID 2024-11-18 23:14:34 +02:00
Asdow 924ccd8815 Use ubID instead of cnt 2024-11-18 23:14:22 +02:00
Asdow 9bbec030d8 Remove unnecessary casts 2024-11-18 23:14:03 +02:00
Asdow bc01bdb56d Convert to SoldierID 2024-11-18 23:12:43 +02:00
Asdow cd83fac928 Update Air Raid.cpp 2024-11-18 23:12:27 +02:00
Asdow e9e8080077 Update merccompare.cpp 2024-11-18 23:12:17 +02:00
Asdow 9fb29cf444 Remove UINT8 conversions 2024-11-18 23:12:00 +02:00
Asdow ca1112313a Increase ubUserData2 from UINT8 to UINT16 2024-11-18 23:11:41 +02:00
Asdow dd2c6f44b2 Fix incorrect function arguments 2024-11-18 22:38:28 +02:00
Asdow 38b710343a Fix incorrect function argument 2024-11-18 22:38:09 +02:00
Asdow 3ddc4c2bbd Change to SoldierID 2024-11-18 22:24:55 +02:00
Asdow d2388c76b8 Modify SoldierID constructor to prevent invalid valuels 2024-11-18 21:43:30 +02:00
Asdow 07420ce245 Revert "Guard against out of bounds access"
This reverts commit c75f57785e.
2024-11-18 21:42:13 +02:00
Asdow e62684f0e1 Convert GetSoldierIDFromMercID() to SoldierID 2024-11-18 18:50:20 +02:00
Asdow c75f57785e Guard against out of bounds access
Can't trust a simple != check
2024-11-18 18:49:38 +02:00
Asdow 66bd1e41c2 Correct loops 2024-11-18 18:27:14 +02:00
Asdow fa56a7ad6d Update Scheduling.cpp 2024-11-18 17:34:41 +02:00
Asdow f49013307f Convert to SoldierID 2024-11-18 01:01:57 +02:00
Asdow 657097aa54 Remove unused global 2024-11-17 23:47:26 +02:00
Asdow b74ccf3ddc Convert to SoldierID 2024-11-17 23:45:48 +02:00
Asdow d149b6ffea Correct parameter order 2024-11-17 22:39:58 +02:00
Asdow ef9aa1b027 Convert to SoldierID 2024-11-17 22:29:31 +02:00
Asdow b6e8b0c5ff Convert to SoldierID 2024-11-17 21:09:13 +02:00
Asdow b9641d4c90 Convert to SoldierID 2024-11-17 20:52:12 +02:00
Asdow f50bdf99cc Convert to SoldierID 2024-11-17 20:41:09 +02:00
Asdow 9532fbfe2c Convert to SoldierID 2024-11-17 19:41:34 +02:00
Asdow 74d752d452 More conversions to SoldierID 2024-11-17 18:15:36 +02:00
Asdow 06936b71c9 Convert to SoldierID
Rearranged struct to optimize memory layout
2024-11-17 17:22:30 +02:00
Asdow e9a13e12d8 Convert to SoldierID 2024-11-17 17:11:03 +02:00
Asdow 9acf994952 Convert gusTempDragBuildSoldierID to SoldierID 2024-11-17 16:50:01 +02:00
Asdow 9d62b9a37a Remove unused function parameters 2024-11-17 16:46:57 +02:00
Asdow 2e92da4e12 Convert to SoldierID 2024-11-17 16:43:39 +02:00
Asdow f39078357b Remove unused function parameters 2024-11-17 16:39:13 +02:00
Asdow 2e147d4bd7 Convert to SoldierID 2024-11-17 16:35:26 +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 30e6b9008c SetUIBusy() & UnSetUIBusy() to SoldierID 2024-11-17 11:15:39 +02:00
Asdow ab94d33bec PlaySoldierJA2Sample() to SoldierID 2024-11-17 10:36:10 +02:00
Asdow 3fe6e4f3d8 GetSoldier() to SoldierID 2024-11-17 10:33:29 +02:00
Asdow 3e1c87f53c Remove unused global gusOldSelectedSoldier 2024-11-17 10:27:42 +02:00
Asdow cbf53f8848 TacticalStatusType::ubLastRequesterSurgeryTargetID to SoldierID 2024-11-17 10:26:01 +02:00
Asdow f0be44bb42 Convert to SoldierID
TacticalStatusType::ubEnemySightingOnTheirTurnEnemyID
TacticalStatusType::ubEnemySightingOnTheirTurnPlayerID
TacticalTeamType::ubLastMercToRadio
2024-11-17 10:23:01 +02:00
Asdow 61c5a41bea LocateSoldier() & HandleMercLeavingEquipmentInDrassen() & HandleMercLeavingEquipmentInOmerta() 2024-11-17 01:35:49 +02:00
Asdow c475f9e4e6 Convert MapScreenCharacterSt::usSolID to SoldierID 2024-11-17 01:25:00 +02:00
Asdow 2918801f75 AddSoldierToSector & OBJECTTYPE::soldierID changed to SoldierID 2024-11-16 20:55:08 +02:00
Asdow 42d5ecb923 HandleLeavingOfEquipmentInCurrentSector() to SoldierID 2024-11-16 20:09:14 +02:00
Asdow cd720a639a Fix Dismiss Merc not working after selecting several soldiers 2024-11-16 19:25:44 +02:00
Asdow d28d46d974 SOLDIERTYPE::bOverrideMoveSpeed to SoldierID 2024-11-16 16:28:48 +02:00
Asdow edb26a68fe Guard against array out of bounds access 2024-11-16 16:25:28 +02:00
AsdowandGitHub 1cd94cda23 Fix inventory cloning bug (#338)
- If we have a sector already loaded (eg. Drassen airport)
- Squad in a different sector encounters enemies and goes to autoresolve
- After pressing DONE in autoresolve screen -> we miss calling the TrashWorld() function in CheckAndHandleUnloadingOfCurrentWorld() due to battle sector not being the same as loaded sector.
- Selected sector gets reset from Drassen airport to invalid values by same function
- Now we have the loaded sector's whole inventory existing in gWorldItems
 - Enter any other sector in tactical mode and the gWorldItems gets added into its sector inventory in EnterSector()

Because the TrashItems() work in a way where it only sets gWorldItems elements to not existing if it finds them in a loaded map's structure data, we will pretty much always have that original bugged out set of items present in gWorlItems and they will constantly be added to sector inventories from then on once the bug has been triggered.
2024-11-16 16:05:14 +02:00
Asdow e7fe1d1cda Update LaptopSave.h 2024-11-16 11:55:57 +02:00
Asdow 3ff4cc0c19 GENERAL_SAVE_INFO members to SoldierID 2024-11-16 01:22:20 +02:00
Asdow 98c18495c6 Update GENERAL_SAVE_INFO::sContractRehireSoldierID to SoldierID 2024-11-16 00:58:16 +02:00
Asdow 41fc407de6 Convert TacticalRemoveSoldier to SoldierID 2024-11-16 00:55:51 +02:00
Asdow 23af6b6f3f SoldierTakeDamage & SoldierTakeDelayedDamage to SoldierID 2024-11-16 00:47:14 +02:00
Asdow b112d39fe2 Convert SOLDIERTYPE::EVENT_SoldierGotHit to SoldierID 2024-11-16 00:34:19 +02:00
Asdow 419b0c794d SOLDIERTYPE::CreateSoldierCommon to SoldierID 2024-11-16 00:18:02 +02:00
Asdow 8ef7fb5ae4 Convert SOLDIERTYPE::usDragPersonID to SoldierID 2024-11-16 00:09:48 +02:00
Asdow 153d402065 Update Soldier Control.h 2024-11-15 23:58:28 +02:00
Asdow 75deccbc44 Convert SOLDIERTYPE::ubRobotRemoteHolderID to SoldierID 2024-11-15 23:56:26 +02:00
Asdow 566ead5815 Convert SOLDIERTYPE::ubTargetID to SoldierID 2024-11-15 23:46:15 +02:00
Asdow f823cb9718 Update Soldier Control.h 2024-11-15 23:32:13 +02:00
Asdow 5de6f77f2e Convert SOLDIERTYPE::ubOppNum to SoldierID 2024-11-15 23:26:22 +02:00
Asdow 1a172427ef Update Soldier Create.cpp 2024-11-15 23:01:52 +02:00
Asdow 8346d5bfa1 Convert SOLDIERTYPE->ubNextToPreviousAttackerID to SoldierID 2024-11-15 22:58:25 +02:00
Asdow 131172e41a Convert SOLDIERTYPE->ubPreviousAttackerID to SoldierID 2024-11-15 22:54:44 +02:00
Asdow ee429fd1f4 Convert SOLDIERTYPE->ubAttackerID to SoldierID 2024-11-15 22:51:48 +02:00
Asdow 9079f2e0c1 Whitespace changes to SOLDIERTYPE 2024-11-15 21:20:49 +02:00
Asdow ecb29ae9bc Convert SOLDIERTYPE->usChatPartnerID to SoldierID 2024-11-15 21:09:17 +02:00
Asdow 83b3485e58 Convert prisonerdialoguetargetID to SoldierID 2024-11-15 21:04:05 +02:00
Asdow b98732daa7 Convert gusSelectedSoldier to SoldierID 2024-11-15 19:06:34 +02:00
Asdow e9c8124dc2 Fix UB compilation 2024-11-15 19:05:19 +02:00
Asdow cba88ab2bc Update LuaInitNPCs.cpp
convert l_ACTION_ITEM_SEX (lua_State *L) to use SoldierID properly
2024-11-15 01:34:10 +02:00
Asdow 337cf1804f Update Overhead Types.h 2024-11-15 01:32:35 +02:00
Asdow 1c631cb85f REAL_OBJECT.ubLastTargetTakenDamage -> SoldierID 2024-11-15 01:32:25 +02:00
Asdow b9deb3cc19 PossiblyStartEnemyTaunt( uiTargetId ) to SoldierID 2024-11-15 01:31:22 +02:00
Asdow d07dcf477a Update Scheduling.h 2024-11-15 01:30:28 +02:00
Asdow 0def972901 Convert SetInfoChar & DrawFace to use SoldierID 2024-11-15 01:28:06 +02:00
Asdow 735075869c Fix incorrect variables
ubImprintID uses SOLDIERTYPE->ubProfile, not SOLDIERTYPE->ubID in every other instance of the code. This one's clearly a mistake.
2024-11-15 01:14:30 +02:00
Asdow 6a0d02e9b9 Change type from BOOLEAN(!) to SoldierID 2024-11-15 01:03:21 +02:00
Asdow 568aa0a0b8 Update Item Types.cpp 2024-11-15 00:04:39 +02:00
Asdow 1327d186ed Use usSolID directly
usSolID *is* ubID from Menptr!
2024-11-14 01:08:38 +02:00
Asdow c04cc4cfcc Update Map Screen Interface.h 2024-11-14 01:00:05 +02:00
Asdow 1345d92521 Convert Soldier Find.cpp to SoldierID 2024-11-14 00:45:50 +02:00
Asdow 0103a871cc Operator overloads for accessing SOLDIERTYPE* through SoldierID 2024-11-14 00:43:48 +02:00
Asdow f5b1447646 Move MercSlots zeroing to same loop where MercPtrs are set
One less for loop that way
2024-11-13 22:12:37 +02:00
Asdow 4d740055da Provide access function to MenPtrs, MercPtrs & MercSlots
All raw array accesses should be done with these instead.
2024-11-13 01:33:32 +02:00
Asdow aad6ed8297 Implemented SoldierID type to replace SOLDIERTYPE->ubID
Goal is to convert all use of SOLDIERTYPE->ubID and any other ID fields that reference the same ID to a safer type than UINT16. Same with any function that's supposed to take ubID
2024-11-13 01:29:36 +02:00
Asdow d6370b7463 Fix invisible cows and bloodcats 2024-11-13 01:21:55 +02:00
Asdow 3c2592881f Fix ShadeMapElements function declaration 2024-11-11 11:15:36 +02:00
Asdow 6c33009fab Remove bLastKnownEnemies from SECTORINFO
As per the old comment, even though the field value is updated partially according to whether there are known enemies present or not, it's not used for anything.
2024-11-11 00:14:51 +02:00
Asdow fcf2b27d1a More UINT8 -> UINT16 changes 2024-11-11 00:08:30 +02:00
Asdow 040410b450 Whitespace formatting for SAVED_GAME_HEADER 2024-11-10 22:03:46 +02:00
Asdow 0089e0a640 Change strategic enemy amounts to UINT16 2024-11-10 22:02:46 +02:00
Asdow d9edc9362b Fix loading of tactical status
ubEnemyKilledOnAttacker is size UINT16 but loading function was reading only UINT8 worth for it
2024-11-10 22:01:17 +02:00
Asdow 508310be3e Change UINT8 to UINT16 for soldierInitLists & hostiles in sector 2024-11-10 01:19:05 +02:00
Asdow 5cf0ef4bde Correct variables from INT8 to INT16 2024-11-09 22:52:21 +02:00
Asdow fdd6859726 Implement multiselection for contract renewal 2024-11-09 20:23:38 +02:00
Asdow 2b024d63c6 Fix endless loop 2024-11-09 16:46:55 +02:00
Asdow a81820d0d7 Fix UB compilation 2024-11-09 16:46:39 +02:00
Asdow f99065d0c6 Remove unused button callback functions
Unimplemented feature of browsing 4 mercs forward/backwards in personnel page.
2024-11-09 15:30:42 +02:00
Asdow bc870123bf Implement page scrolling in Laptop Personnel page
Pressing Shift and right or left arrow buttons, 'a' or 'd' buttons, or previous or next ingame buttons now advance one whole page. Without shift pressed down, all three function as original and move one merc at a time.
2024-11-09 15:29:07 +02:00
Asdow 17875978e0 Update LOS.cpp
Fix missing variable declaration
2024-11-09 15:24:30 +02:00
Asdow 4e253d0ec0 Update Dialogue Control.cpp
Fix an access to member variable that prevented compilation
2024-11-09 15:24:10 +02:00
Asdow 10250dc035 Merge branch 'master' into ExtraMercs 2024-11-09 13:44:53 +02:00
AsdowandGitHub f48fadb802 Improve AbstractXMLParser error reporting (#330)
The more detailed error message that used to go only to Livelog.txt is now also displayed in the ingame error screen, providing more helpful error message to players when making bug reports/asking for help
2024-11-08 23:50:52 +02:00
KittyandGitHub 6497a35af9 Text EDB Pop-up Disease Protection adjusted ( #329)
- face protection had a misleading text, stating item should be worn at face
- that's no longer true, so adjusted text to avoid player confusion
- adjusted text to distinguish between both disease protections variations
2024-11-08 09:37:53 +01:00
kitty624 85ad2e5e72 Text EDB Pop-up Disease Protection adjusted
- face protection had a misleading text, stating item should be worn at face
- that's no longer true, so adjusted text to avoid player confusion
- adjusted text to distinguish between both disease protections variations
2024-11-08 09:08:38 +01:00
AsdowandGitHub 8040c5d826 Use functions for logging load & save game times (#328)
Less copy and paste. Allows these very simple timings to be logged from elsewhere as well.
2024-10-04 17:29:47 +03:00
AsdowandGitHub 93e89798ec Merc can be assigned to patient in well-fed state (#327)
Previously merc had to be in overfed state for both food and water
2024-10-02 21:24:02 +03: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
Asdow 06918d7585 Update Item Types.h
uint8 -> uint16
2023-07-29 14:43:57 +03:00
Asdow 57cc888cd7 Allow more creatures, civs and rebels 2023-07-27 21:30:03 +03:00
Asdow 9ac53cac32 Fix UINT8 references to pSoldier->ubID to UINT16 2023-07-27 21:29:37 +03:00
Asdow 9fb4ef8607 Merge branch 'master' into ExtraMercs 2023-07-27 18:38:39 +03:00
Asdow 03482ffc3d Merge branch 'master' into ExtraMercs 2023-07-26 13:17:49 +03:00
Asdow 5c13170424 Create .gitignore 2022-10-10 15:58:11 +03:00
Asdow 1f0a8f46e8 Import changes from the local SVN working copy 2022-10-10 10:08:44 +03:00
859 changed files with 137410 additions and 150354 deletions
+1 -2
View File
@@ -186,7 +186,6 @@ jobs:
merge-multiple: true
- name: Checkout Repo
if: github.ref == 'refs/heads/master'
uses: actions/checkout@v4
with:
path: source
@@ -201,6 +200,7 @@ jobs:
git push --delete origin refs/tags/latest || true
git tag latest
git push --force origin refs/tags/latest
sleep 15 # make sure github can find the tag for gh release
gh release create latest ../dist/* \
--generate-notes \
--title "Latest (unstable)" \
@@ -213,7 +213,6 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
working-directory: source
run: |
exit 0
gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+2 -2
View File
@@ -59,7 +59,7 @@ jobs:
run: |
set -eux
touch CMakeUserPresets.json
touch CMakePresets.json
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
@@ -77,7 +77,7 @@ jobs:
arch: x86
- name: Prepare build
run: |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application"
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application"
- name: Build
run: |
cmake --build build/ -- -v
+1 -1
View File
@@ -6,6 +6,6 @@
/.vs/
/build/
/out/
/CMakePresets.json
/CMakeSettings.json
/CMakeUserPresets.json
/lib/
+107 -60
View File
@@ -9,10 +9,25 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(LTO_OPTION "Enable link-time optimization if supported by compiler" OFF)
include(CheckIPOSupported)
check_ipo_supported(RESULT LinkTimeOptimization OUTPUT IpoError LANGUAGES C CXX)
if(LinkTimeOptimization AND LTO_OPTION)
message(STATUS "Configuring WITH link-time optimization")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "Configuring WITHOUT link-time optimization ${IpoError}")
endif()
option(ADDRESS_SANITIZER OFF)
if(ADDRESS_SANITIZER)
message(STATUS "AddressSanitizer ENABLED for non-Release builds")
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
message(STATUS "AddressSanitizer ENABLED for non-Release builds")
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
endif()
if(MSVC)
add_compile_options("/wd4838") # silence implicit narrowing conversion warnings
endif()
# whether we are using MSBuild as a generator
@@ -23,7 +38,23 @@ set(usingMsBuild $<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE)
include_directories(Ja2 "ext/VFS/include" Utils TileEngine TacticalAI "ModularizedTacticalAI/include" Tactical Strategic sgp "Ja2/Res" Lua Laptop Multiplayer Editor Console)
include_directories(
"${CMAKE_SOURCE_DIR}/Ja2"
"${CMAKE_SOURCE_DIR}/ext/VFS/include"
"${CMAKE_SOURCE_DIR}/Utils"
"${CMAKE_SOURCE_DIR}/TileEngine"
"${CMAKE_SOURCE_DIR}/TacticalAI"
"${CMAKE_SOURCE_DIR}/ModularizedTacticalAI/include"
"${CMAKE_SOURCE_DIR}/Tactical"
"${CMAKE_SOURCE_DIR}/Strategic"
"${CMAKE_SOURCE_DIR}/sgp"
"${CMAKE_SOURCE_DIR}/Ja2/Res"
"${CMAKE_SOURCE_DIR}/lua"
"${CMAKE_SOURCE_DIR}/Laptop"
"${CMAKE_SOURCE_DIR}/Multiplayer"
"${CMAKE_SOURCE_DIR}/Editor"
"${CMAKE_SOURCE_DIR}/i18n/include"
)
# external libraries
add_subdirectory("ext/libpng")
@@ -34,32 +65,45 @@ target_link_libraries(bfVFS PRIVATE 7z)
# ja2export utility
add_subdirectory("ext/export/src")
# static libraries whose source files, header files or header files included
# by header files do not rely on Applications or Languages preprocessor definitions,
# and therefore only need to be compiled once. Good.
add_subdirectory(Lua)
# static libraries whose translation units don't rely on Application preprocessor definitions.
add_subdirectory(lua)
add_subdirectory(Multiplayer)
add_subdirectory(wine)
# static libraries whose source files, header files or header files included
# by header files rely on Application and Language preprocessor definitions, and
# therefore need to be compiled multiple times. Very Bad.
set(Ja2_Libraries
"${CMAKE_SOURCE_DIR}/binkw32.lib"
"${CMAKE_SOURCE_DIR}/libexpatMT.lib"
"${CMAKE_SOURCE_DIR}/lua51.lib"
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
"Dbghelp.lib"
"Winmm.lib"
"ws2_32.lib"
bfVFS
Lua
Multiplayer
wine
)
# static libraries whose translation units rely on Application preprocessor definitions.
set(Ja2_Libs
TileEngine
TacticalAI
Utils
Strategic
sgp
Laptop
Editor
Console
Tactical
ModularizedTacticalAI
Editor
Ja2
Laptop
ModularizedTacticalAI
sgp
Strategic
Tactical
TacticalAI
TileEngine
Utils
)
foreach(lib IN LISTS Ja2_Libs)
add_subdirectory(${lib})
add_subdirectory(${lib})
endforeach()
add_subdirectory(Ja2)
# language library relies on Application _and_ Language preprocessor definition. very bad.
add_subdirectory(i18n)
# simple function to validate Languages and Application choices
include(cmake/ValidateOptions.cmake)
@@ -74,47 +118,50 @@ ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "Applica
# preprocessor definitions for Debug build, per the legacy MSBuild
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
# Due to widespread preprocessor definition abuse in the codebase, practically
# every library-language-executable combination is its own compilation target
# TODO: refactor preprocessor usage onto, ideally, a single translation unit
foreach(lang IN LISTS LangTargets)
foreach(exe IN LISTS ApplicationTargets)
set(Executable ${exe}_${lang})
foreach(app IN LISTS ApplicationTargets)
set(isEditor $<STREQUAL:${app},JA2MAPEDITOR>)
set(isUb $<STREQUAL:${app},JA2UB>)
set(isUbEditor $<STREQUAL:${app},JA2UBMAPEDITOR>)
set(compilationFlags
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
$<IF:${isUb},JA2UB;JA2UBMAPS,>
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
)
# executable for an application/language combination, e.g. JA2_ENGLISH.exe
add_executable(${Executable} WIN32)
target_sources(${Executable} PRIVATE ${Ja2Src})
foreach(lib IN LISTS Ja2_Libs)
# library for an application, e.g. JA2UB_sgp
set(game_library ${app}_${lib})
add_library(${game_library})
target_sources(${game_library} PRIVATE ${${lib}Src})
target_compile_definitions(${game_library} PRIVATE ${compilationFlags} ${debugFlags})
endforeach()
# Good libraries have already been built, can be simply linked here
target_link_libraries(${Executable} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
target_link_options(${Executable} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
foreach(lang IN LISTS LangTargets)
# executable for an application/language combination, e.g. JA2_ENGLISH.exe
set(exe ${app}_${lang})
add_executable(${exe} WIN32
sgp/sgp.cpp
Ja2/Res/ja2.rc
)
target_link_libraries(${exe} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
target_link_options(${exe} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
target_compile_definitions(${exe} PRIVATE ${compilationFlags} ${debugFlags})
# for each app/lang combination, the Very Bad libraries need to be built,
# with the appropriate preprocessor definitions
foreach(lib IN LISTS Ja2_Libs)
# syntactic sugar to hopefully make this more readable
set(VeryBadLib ${Executable}_${lib})
set(isEditor $<STREQUAL:${exe},JA2MAPEDITOR>)
set(isUb $<STREQUAL:${exe},JA2UB>)
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
# language library for an application, e.g. JA2MAPEDITOR_ENGLISH_i18n
set(language_library ${exe}_i18n)
add_library(${language_library})
target_sources(${language_library} PRIVATE ${i18nSrc})
target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags} ${lang})
target_link_libraries(${exe} PRIVATE ${language_library})
# static library for an app/lang combination, e.g. JA2_ENGLISH_sgp.lib
add_library(${VeryBadLib})
target_sources(${VeryBadLib} PRIVATE ${${lib}Src})
# go through all game libraries again and link them to the app/language executable
foreach(lib IN LISTS Ja2_Libs)
target_link_libraries(${exe} PRIVATE ${app}_${lib})
endforeach()
endforeach()
target_compile_definitions(${VeryBadLib} PUBLIC
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
$<IF:${isUb},JA2UB;JA2UBMAPS,>
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
${debugFlags}
${lang}
)
target_link_libraries(${Executable} PUBLIC ${VeryBadLib})
endforeach()
# for sgp only
target_link_libraries(${Executable}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
target_link_libraries(${Executable}_sgp PUBLIC libpng)
target_compile_definitions(${Executable}_sgp PRIVATE NO_ZLIB_COMPRESSION)
endforeach()
# for SGP only
target_link_libraries(${app}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
target_link_libraries(${app}_sgp PRIVATE libpng)
target_compile_definitions(${app}_sgp PRIVATE ${compilationFlags} ${debugFlags} NO_ZLIB_COMPRESSION)
endforeach()
-6
View File
@@ -1,6 +0,0 @@
set(ConsoleSrc
"${CMAKE_CURRENT_SOURCE_DIR}/Console.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Cursors.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Dialogs.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/FileStream.cpp"
PARENT_SCOPE)
-81
View File
@@ -1,81 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
#ifndef _COMBSTROUT_H_
#define _COMBSTROUT_H_
/////////////////////////////////////////////////////////////////////////////
// CComBSTROut - a class that inherits from CComBSTR and adds Out() method
// that should be used instead of & operator for 'out'
// function parameters
class CComBSTROut : public CComBSTR
{
public:
CComBSTROut()
{
}
/*explicit*/ CComBSTROut(int nSize) : CComBSTR(nSize)
{
}
/*explicit*/ CComBSTROut(int nSize, LPCOLESTR sz) : CComBSTR(nSize, sz)
{
}
/*explicit*/ CComBSTROut(LPCOLESTR pSrc) : CComBSTR(pSrc)
{
}
/*explicit*/ CComBSTROut(const CComBSTROut& src) : CComBSTR(src)
{
}
/*explicit*/ CComBSTROut(REFGUID src) : CComBSTR(src)
{
}
#ifndef OLE2ANSI
CComBSTROut(LPCSTR pSrc) : CComBSTR(pSrc)
{
}
CComBSTROut(int nSize, LPCSTR sz) : CComBSTR(nSize, sz)
{
}
#endif
~CComBSTROut()
{
CComBSTR::~CComBSTR();
}
BSTR* Out()
{
Empty();
return &m_str;
}
};
/////////////////////////////////////////////////////////////////////////////
#endif // _COMBSTROUT_H_
-109
View File
@@ -1,109 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
#ifndef _COMVARIANTOUT_H_
#define _COMVARIANTOUT_H_
/////////////////////////////////////////////////////////////////////////////
// CComVariantOut - a class that inherits from CComVariant and adds Out()
// method that should be used instead of & operator for
// 'out' function parameters
class CComVariantOut : public CComVariant
{
public:
CComVariantOut()
{
}
~CComVariantOut()
{
CComVariant::~CComVariant();
}
CComVariantOut(const VARIANT& varSrc) : CComVariant(varSrc)
{
}
CComVariantOut(const CComVariant& varSrc) : CComVariant(varSrc)
{
}
CComVariantOut(BSTR bstrSrc) : CComVariant(bstrSrc)
{
}
CComVariantOut(LPCOLESTR lpszSrc) : CComVariant(lpszSrc)
{
}
#ifndef OLE2ANSI
CComVariantOut(LPCSTR lpszSrc) : CComVariant(lpszSrc)
{
}
#endif
CComVariantOut(bool bSrc) : CComVariant(bSrc)
{
}
CComVariantOut(int nSrc) : CComVariant(nSrc)
{
}
CComVariantOut(BYTE nSrc) : CComVariant(nSrc)
{
}
CComVariantOut(short nSrc) : CComVariant(nSrc)
{
}
CComVariantOut(long nSrc, VARTYPE m_varSrc = VT_I4) : CComVariant(nSrc, m_varSrc)
{
}
CComVariantOut(float fltSrc) : CComVariant(fltSrc)
{
}
CComVariantOut(double dblSrc) : CComVariant(dblSrc)
{
}
CComVariantOut(CY cySrc) : CComVariant(cySrc)
{
}
CComVariantOut(IDispatch* pSrc) : CComVariant(pSrc)
{
}
CComVariantOut(IUnknown* pSrc) : CComVariant(pSrc)
{
}
public:
VARIANT* Out()
{
Clear();
return this;
}
};
/////////////////////////////////////////////////////////////////////////////
#endif // _COMVARIANTOUT_H_
-2876
View File
File diff suppressed because it is too large Load Diff
-746
View File
@@ -1,746 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Console.h - console class declaration
#pragma once
#include <string>
#include <vector>
using namespace std;
//#include "include/FreeImagePlus.h"
typedef basic_string<TCHAR> tstring;
#define WM_INPUTREADY WM_USER + 1
// tray icon message
#define WM_TRAY_NOTIFY WM_USER + 0x123
#define TRAY_ICON_ID 1
// timer #defines
#define TIMER_REPAINT_CHANGE 42 // timer that is started after there
// were some changes in the console
#define TIMER_REPAINT_MASTER 43 // master timer (needed to repaint
// for some DOS programs, can be
// disabled for lower CPU usage)
#define TIMER_SHOW_HIDE_CONSOLE 100 // used to hide console window when
// starting shell process after a
// defined period of time (some
// shells, like 4NT need console
// window visible during startup for
// all init options to work properly
// transparency #defines
#define TRANSPARENCY_NONE 0
#define TRANSPARENCY_ALPHA 1
#define TRANSPARENCY_COLORKEY 2
#define TRANSPARENCY_FAKE 3
// cusror style #defines
#define CURSOR_STYLE_NONE 0
#define CURSOR_STYLE_XTERM 1
#define CURSOR_STYLE_BLOCK 2
#define CURSOR_STYLE_NBBLOCK 3
#define CURSOR_STYLE_PULSEBLOCK 4
#define CURSOR_STYLE_BAR 5
#define CURSOR_STYLE_CONSOLE 6
#define CURSOR_STYLE_NBHLINE 7
#define CURSOR_STYLE_HLINE 8
#define CURSOR_STYLE_VLINE 9
#define CURSOR_STYLE_RECT 10
#define CURSOR_STYLE_NBRECT 11
#define CURSOR_STYLE_PULSERECT 12
#define CURSOR_STYLE_FADEBLOCK 13
// docking #defines
#define DOCK_NONE 0
#define DOCK_TOP_LEFT 1
#define DOCK_TOP_RIGHT 2
#define DOCK_BOTTOM_RIGHT 3
#define DOCK_BOTTOM_LEFT 4
// Z-order #defines
#define Z_ORDER_REGULAR 0
#define Z_ORDER_ONTOP 1
#define Z_ORDER_ONBOTTOM 2
// window border defines
#define BORDER_NONE 0
#define BORDER_REGULAR 1
#define BORDER_THIN 2
// window background style
#define BACKGROUND_STYLE_RESIZE 0
#define BACKGROUND_STYLE_CENTER 1
#define BACKGROUND_STYLE_TILE 2
// taskbar button defines
#define TASKBAR_BUTTON_NORMAL 0
#define TASKBAR_BUTTON_HIDE 1
#define TASKBAR_BUTTON_TRAY 2
// new configuration auto-reload defines
#define RELOAD_NEW_CONFIG_PROMPT 0
#define RELOAD_NEW_CONFIG_YES 1
#define RELOAD_NEW_CONFIG_NO 2
#define TEXT_SELECTION_NONE 0
#define TEXT_SELECTION_SELECTING 1
#define TEXT_SELECTION_SELECTED 2
/////////////////////////////////////////////////////////////////////////////
// Console class
class Console {
public: // ctor/dtor
Console(LPCTSTR szConfigFile, LPCTSTR szShellCmdLine, LPCTSTR szConsoleTitle, LPCTSTR pszReloadNewConfig);
~Console();
public:
// creates and shows Console window
BOOL Create(HWND notify);
private:
////////////////////
// message handlers
////////////////////
////////////////////////////////
// windows destruction messages
// destroys GDI stuff and posts a quit message
void OnDestroy();
// deletes Console object
void OnNcDestroy();
/////////////////////
// painting messages
// handles painting from off-screen buffers
void OnPaint();
// handles master and 'change' timers
void OnPaintTimer();
// handles cursor timer (for animated cursors)
void OnCursorTimer();
/////////////////////////
// window state messages
// handles window position changes (for snapping to desktop edges)
void OnWindowPosChanging(WINDOWPOS* lpWndPos);
// handles activation message (used for setting alpha transparency and cursor states)
void OnActivateApp(BOOL bActivate, DWORD dwFlags);
// handles vertical scrolling
void OnVScroll(WPARAM wParam);
// handles keyboard layout change, posts the same message to the windows console window
void OnInputLangChangeRequest(WPARAM wParam, LPARAM lParam);
//////////////////
// mouse messages
// handles text selection start and window mouse drag start
void OnLButtonDown(UINT uiFlags, POINTS points);
// handles text selection end, window mouse drag end and text copy
void OnLButtonUp(UINT uiFlags, POINTS points);
// toggles always on top flag
void OnLButtonDblClick(UINT uiFlags, POINTS points);
// pops up the Console menu
void OnRButtonUp(UINT uiFlags, POINTS points);
// pastes text from clipboard
void OnMButtonDown(UINT uiFlags, POINTS points);
// handles mouse movement for text selection and window mouse drag
void OnMouseMove(UINT uiFlags, POINTS points);
// handles start/stop mouse drag for window border
void OnSetCursor(WORD wHitTest, WORD wMouseMessage);
// handles text input
void OnChar(WORD mychar);
wstring Input;
//////////////////
// other messages
// called before the Console menu or system menu pops up
// (populates config files submenu with filenames)
void OnInitMenuPopup(HMENU hMenu, UINT uiPos, BOOL bSysMenu);
// handles drag-n-dropped filenames
void OnDropFiles(HDROP hDrop);
// handles commands from the Console popup menu
BOOL OnCommand(WPARAM wParam, LPARAM lParam);
// handles commands from the system popup menu
BOOL OnSysCommand(WPARAM wParam, LPARAM lParam);
// handles tray icon messages
void OnTrayNotify(WPARAM wParam, LPARAM lParam);
// handles WM_SETTINGCHANGE (we handle only wallpaper changes here)
// void OnWallpaperChanged(const TCHAR* pszFilename);
private:
///////////////////////////////////////////
// Console window creation/setup functions
///////////////////////////////////////////
// gets Console options
BOOL GetOptions();
// registers Console window classes
BOOL RegisterWindowClasses();
// adds stuff to system and popup menus
BOOL SetupMenus();
// creates Console window
BOOL CreateConsoleWindow();
// creates new Console font
void CreateNewFont();
// creates new background brush
void CreateNewBrush();
// creates the cursor
void CreateCursor();
// creates offscreen painting buffers
void CreateOffscreenBuffers();
// creates background bitmap
void CreateBackgroundBitmap();
// called by the ::EnumDisplayMonitors to create background for each display
// static BOOL CALLBACK BackgroundEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData);
// gets character width and height
void GetTextSize();
// gets window borders (X, Y and caption sizes)
void GetBordersDimensions();
// calculates window and client area sizes
void CalcWindowSize();
// sets up window transparency (alpha, color key, fake)
// void SetWindowTransparency();
// sets scrollbar stuff
void SetScrollbarStuff();
// sets default console colors
void SetDefaultConsoleColors();
// sets window size and position
void SetWindowSizeAndPosition();
// sets Console's big, small and tray icons
void SetWindowIcons();
// sets up traybar icon
BOOL SetTrayIcon(DWORD dwMessage);
// destroys Console cursor
void DestroyCursor();
// opens the configuration file in a text editor
void EditConfigFile();
// reloads Console settings
void ReloadSettings();
/////////////////////////////
// windows console functions
/////////////////////////////
// allocates the console and starts the command shell
BOOL StartShellProcess();
// refreshes m_hStdOutFresh handle
void RefreshStdOut();
// gets a fresh console output
void RefreshScreenBuffer();
// sets initial windows console size
void InitConsoleWndSize(DWORD dwColumns);
// resizes the windows console
void ResizeConsoleWindow();
// Allocates the screen buffer
void AllocateBuffer();
//////////////////////
// painting functions
//////////////////////
// repaints the memory hdc
void RepaintWindow();
// repaints the memory hdc (paint only changes)
void RepaintWindowChanges();
// draws the cursor
void DrawCursor(BOOL bOnlyCursor = FALSE);
// two helper functions for DrawCursor method
// returns cursor rectangle
inline void GetCursorRect(RECT& rectCursor);
// draws cursor background and returns the cursor rectangle
inline void DrawCursorBackground(RECT& rectCursor);
// clears text selection
void ClearSelection();
// returns the console text change rate since the last painting
// (using this value we decide whether to repaint entire window
// or just the changes)
DWORD GetChangeRate();
//////////////////////////
// window state functions
//////////////////////////
// shows/hides Console window
void ShowHideWindow();
// shows/hides windows console window
void ShowHideConsole();
// shows/hides windows console window after a timeout (used during
// shell startup)
void ShowHideConsoleTimeout();
// toggles 'always on top' status
void ToggleWindowOnTop();
//////////////////
// menu functions
//////////////////
// called by OnCommand and OnSysCommand to handle menu commands
BOOL HandleMenuCommand(DWORD dwID);
// updates popup and system menus for 'always on top' status
void UpdateOnTopMenuItem();
// updates popup and system menus for 'hide console' status
void UpdateHideConsoleMenuItem();
// updates configuration files submenu
void UpdateConfigFilesSubmenu();
///////////////////////
// clipboard functions
///////////////////////
// copies selected text to the clipboard
void CopyTextToClipboard();
// pastes text from the clipboard
void PasteClipoardText();
//////////////////
// misc functions
//////////////////
// shows Readme.txt file
void ShowReadmeFile();
// shows about dialog
void About();
// sends text to the windows console
void SendTextToConsole(const wchar_t *pszText);
// returns the full filename
tstring GetFullFilename(const tstring& strFilename);
// gets a desktop rectangle
void GetDesktopRect(RECT& rectDesktop);
// Pulls the text from the stdout or stderr handle (both are the same) and sends it to the console
void AddOutput();
///////////////////////
// 'gearbox' functions
///////////////////////
// Console window procedure
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
// shell activities monitor
static DWORD WINAPI MonitorThreadStatic(LPVOID lpParam);
DWORD MonitorThread();
// CTRL+C, CTRL+BREAK handler
static BOOL WINAPI CtrlHandler(DWORD dwCtrlType);
public: // public data
// Console window handle
HWND m_hWnd;
HWND m_notifyhWnd;
// console colors
COLORREF m_arrConsoleColors[16];
private: // private data
// readem filename
tstring m_strReadmeFile;
BOOL m_bInitializing;
BOOL m_bReloading;
tstring m_strConfigFile;
tstring m_strConfigEditor;
tstring m_strConfigEditorParams;
// one of the RELOAD_NEW_CONFIG_* constants
// - specifies relaod behaviour when a new configuration is selected
// (auto reload, don't reload, ask user)
DWORD m_dwReloadNewConfigDefault;
DWORD m_dwReloadNewConfig;
tstring m_strShell;
tstring m_strShellCmdLine;
// handle to invisible window - used for hiding the taskbar button in tray and 'hidden' modes
HWND m_hwndInvisParent;
// memory device context that holds console output image
HDC m_hdcConsole;
// memory device context for an off-screen window buffer (used to
// compose an image from m_hdcConsole and m_hdcSelection if text
// selection is active)
HDC m_hdcWindow;
// a bitmap used for drawing in the console memory DC
HBITMAP m_hbmpConsole;
HBITMAP m_hbmpConsoleOld;
// a bitmap used for drawing in the window memory DC
HBITMAP m_hbmpWindow;
HBITMAP m_hbmpWindowOld;
// brush for painting background
HBRUSH m_hBkBrush;
// master repaint timer interval (runs independent of changes in the
// console)
DWORD m_dwMasterRepaintInt;
// change repaint timer interval (when a change occurs, repainting
// will be postponed for this interval)
DWORD m_dwChangeRepaintInt;
// icon filename
tstring m_strIconFilename;
// program icons
HICON m_hSmallIcon;
HICON m_hBigIcon;
// popup menu
HMENU m_hPopupMenu;
// system (taskbar button) menu
HMENU m_hSysMenu;
// submenu for the XML (config) files
HMENU m_hConfigFilesMenu;
// set to TRUE if the popup menu is disabled
BOOL m_bPopupMenuDisabled;
// Console window title variables
// holds the default console title ("console" or the one passed in the cmdline param)
tstring m_strWindowTitleDefault;
// holds the window title (default title, or the one from the config file)
tstring m_strWindowTitle;
// holds the current window title
tstring m_strWindowTitleCurrent;
// font data
tstring m_strFontName;
DWORD m_dwFontSize;
BOOL m_bBold;
BOOL m_bItalic;
BOOL m_bUseFontColor;
COLORREF m_crFontColor;
HFONT m_hFont;
HFONT m_hFontOld;
// window X and Y positions
int m_nX;
int m_nY;
// client area inside border (gives a more 'relaxed' look to windows)
int m_nInsideBorder;
// window width and height
int m_nWindowWidth;
int m_nWindowHeight;
// window border sizes
int m_nXBorderSize;
int m_nYBorderSize;
int m_nCaptionSize;
// client area widht/height
int m_nClientWidth;
int m_nClientHeight;
// char height and width (used in window repainting)
// Note: width is used only for fixed-pitch fonts to speed up
// repainting
int m_nCharHeight;
int m_nCharWidth;
// window border type
// 0 - none
// 1 - regular window
// 2 - 1-pixel thin border
DWORD m_dwWindowBorder;
// scrollbar stuff
BOOL m_bShowScrollbar;
int m_nScrollbarStyle;
COLORREF m_crScrollbarColor;
int m_nScrollbarWidth;
int m_nScrollbarButtonHeight;
int m_nScrollbarThunmbHeight;
// what to do with the taskbar button
// if the taskbar button is hidden, or placed in the traybar, you
// can't ALT-TAB to console (take care when using with color key
// transparency :-)
// 0 - nothing
// 1 - hide it
// 2 - put icon to traybar
DWORD m_dwTaskbarButton;
// set to TRUE if the window can be dragged by left-click hold
BOOL m_bMouseDragable;
// snap distance
int m_nSnapDst;
// window docking position
// 0 - no dock
// 1 - top left
// 2 - top right
// 3 - bottom right
// 4 - bottom left
DWORD m_dwDocked;
// window Z-ordering
// 0 - regular
// 1 - always on top
// 2 - always on bottom
DWORD m_dwOriginalZOrder;
DWORD m_dwCurrentZOrder;
// Win2000/XP transparency
// 0 - none
// 1 - alpha blending
// 2 - colorkey
// 3 - fake transparency
DWORD m_dwTransparency;
// alpha value for alpha blending (Win2000 and later only!)
BYTE m_byAlpha;
// alpha value for inactive window
BYTE m_byInactiveAlpha;
COLORREF m_crBackground;
COLORREF m_crConsoleBackground;
// this is used for tinting background images and fake transparencies
BOOL m_bTintSet;
BYTE m_byTintOpacity;
BYTE m_byTintR;
BYTE m_byTintG;
BYTE m_byTintB;
// used when background is an image
BOOL m_bBitmapBackground;
tstring m_strBackgroundFile;
HDC m_hdcBackground;
HBITMAP m_hbmpBackground;
HBITMAP m_hbmpBackgroundOld;
// background attributes
// one of BACKGROUND_STYLE_ #defines
DWORD m_dwBackgroundStyle;
// set to true for relative background
BOOL m_bRelativeBackground;
// set to true to extend the background to all monitors
BOOL m_bExtendBackground;
// offsets used for multiple monitors and relative backgrounds (fake transparency, too)
int m_nBackgroundOffsetX;
int m_nBackgroundOffsetY;
// used for showing/hiding main window
BOOL m_bHideWindow;
// set to TRUE when the real console is hidden
BOOL m_bHideConsole;
// timeout used when hiding console window for the first time (some
// shells need console window visible during startup)
DWORD m_dwHideConsoleTimeout;
// if set to TRUE, Console will be started minimized
BOOL m_bStartMinimized;
// cursor style
// 0 - none
// 1 - XTerm
// 2 - block cursor
// 3 - bar cursor
// 4 - console cursor
// 5 - horizontal line
// 6 - vertical line
// 7 - pulse rect
// 8 - fading block
DWORD m_dwCursorStyle;
COLORREF m_crCursorColor;
// console screen buffer info for cursor
CONSOLE_SCREEN_BUFFER_INFO m_csbiCursor;
// wether console cursor is visible or not
BOOL m_bCursorVisible;
class Cursor* m_pCursor;
// mouse cursor offset within the window (used for moving the window)
POINT m_mouseCursorOffset;
/////////////////////
// console stuff
// console window handle
HWND m_hWndConsole;
// console screen buffer info for console repainting
CONSOLE_SCREEN_BUFFER_INFO m_csbiConsole;
// console stdouts
HANDLE m_hStdOut;
HANDLE m_hStdOutFresh;
// set when quitting the application
HANDLE m_hQuitEvent;
// set by monitor thread when detects console process exit
HANDLE m_hConsoleProcess;
// handle to monitor thread
HANDLE m_hMonitorThread;
// console rows & columns
DWORD m_dwRows;
DWORD m_dwColumns;
DWORD m_dwBufferRows;
BOOL m_bUseTextBuffer;
// set to one of TEXT_SELECTION_ #defines
int m_nTextSelection;
// X Windows style copy-on-select
BOOL m_bCopyOnSelect;
// Inverse the shift behaviour for selecting and dragging
BOOL m_bInverseShift;
COORD m_coordSelOrigin;
RECT m_rectSelection;
HDC m_hdcSelection;
HBITMAP m_hbmpSelection;
HBITMAP m_hbmpSelectionOld;
HBRUSH m_hbrushSelection;
CHAR_INFO* m_pScreenBuffer;
CHAR_INFO* m_pScreenBufferNew;
DWORD m_nTextColor;
DWORD m_nTextBgColor;
// Console window class names
static const TCHAR m_szConsoleClass[];
static const TCHAR m_szHiddenParentClass[];
// win console window title
static const tstring m_strWinConsoleTitle;
};
/////////////////////////////////////////////////////////////////////////////
-208
View File
@@ -1,208 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "res\resource.h"
#define APSTUDIO_READONLY_SYMBOLS
#define IDC_STATIC 00
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "windows.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Neutral resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
#ifdef _WIN32
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1250)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 146, 87
STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_SETFOREGROUND | DS_CENTER | WS_POPUP |
WS_CAPTION | WS_SYSMENU
CAPTION "About Console"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,48,66,50,14
LTEXT "Console v1.5",IDC_STATIC,51,11,42,8
LTEXT "Copyright© 2001-2005 Marko Bozikovic",IDC_STATIC,9,30,
127,8
LTEXT "bozho@kset.org",IDC_STATIC,46,45,53,8
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 139
TOPMARGIN, 7
BOTTOMMARGIN, 80
END
END
#endif // APSTUDIO_INVOKED
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Neutral (Default) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)
#ifdef _WIN32
LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
#pragma code_page(1250)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
//IDI_ICON2 ICON DISCARDABLE "Console.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_POPUP_MENU MENU DISCARDABLE
BEGIN
POPUP " "
BEGIN
// MENUITEM "Read&me", ID_SHOW_README_FILE
MENUITEM "&About Console", ID_ABOUT
MENUITEM SEPARATOR
MENUITEM "&Copy", ID_COPY
MENUITEM "&Paste", ID_PASTE
MENUITEM SEPARATOR
// MENUITEM "Always on &top", ID_TOGGLE_ONTOP
// MENUITEM "&Hide console", ID_HIDE_CONSOLE
// MENUITEM SEPARATOR
// MENUITEM "&Select configuration file", ID_SEL_CONFIG_FILE
// MENUITEM "&Edit configuration file", ID_EDIT_CONFIG_FILE
// MENUITEM "&Reload settings", ID_RELOAD_SETTINGS
// MENUITEM SEPARATOR
MENUITEM "E&xit", ID_EXIT_CONSOLE
END
END
#endif // Neutral (Default) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Croatian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_HRV)
#ifdef _WIN32
LANGUAGE LANG_CROATIAN, SUBLANG_DEFAULT
#pragma code_page(1250)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,5,0,351
PRODUCTVERSION 1,5,0,351
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "Comments", "A cool console window :-)\0"
VALUE "CompanyName", "Ingenuity Unlimited Ltd.\0"
VALUE "FileDescription", "Console\0"
VALUE "FileVersion", "1.5, Build 351 2005.09.22\0"
VALUE "InternalName", "Console\0"
VALUE "LegalCopyright", "Copyright © 2001-2004 Marko Bozikovic\0"
VALUE "LegalTrademarks", "Copyright © 2001-2004 Marko Bozikovic\0"
VALUE "OriginalFilename", "Console.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Console\0"
VALUE "ProductVersion", "1.5.00.351\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
END
END
#endif // !_MAC
#endif // Croatian resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-769
View File
@@ -1,769 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Cursors.h - cursor classes
//#include "stdafx.h"
#include <Windows.h>
#include <tchar.h>
#include "Cursors.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// XTermCursor
XTermCursor::XTermCursor(HWND hwndConsole, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndConsole, hdcWindow, crCursorColor)
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
, m_hInactiveBrush(::CreateSolidBrush(crCursorColor))
{
}
XTermCursor::~XTermCursor() {
::DeleteObject(m_hActiveBrush);
::DeleteObject(m_hInactiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void XTermCursor::Draw(LPRECT pRect) {
if (m_bActive) {
::FillRect(m_hdcWindow, pRect, m_hActiveBrush);
} else {
::FrameRect(m_hdcWindow, pRect, m_hInactiveBrush);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void XTermCursor::PrepareNext() {
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// BlockCursor
BlockCursor::BlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
, m_bVisible(TRUE)
{
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 750, NULL);
}
BlockCursor::~BlockCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
::DeleteObject(m_hActiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void BlockCursor::Draw(LPRECT pRect) {
if (m_bActive && m_bVisible) {
::FillRect(m_hdcWindow, pRect, m_hActiveBrush);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void BlockCursor::PrepareNext() {
m_bVisible = !m_bVisible;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// NBBlockCursor
NBBlockCursor::NBBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
{
}
NBBlockCursor::~NBBlockCursor() {
::DeleteObject(m_hActiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void NBBlockCursor::Draw(LPRECT pRect) {
::FillRect(m_hdcWindow, pRect, m_hActiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void NBBlockCursor::PrepareNext() {
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// PulseBlockCursor
PulseBlockCursor::PulseBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
, m_nSize(0)
, m_nMaxSize(0)
, m_nStep(0)
{
::ZeroMemory(&m_rect, sizeof(RECT));
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 100, NULL);
}
PulseBlockCursor::~PulseBlockCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
::DeleteObject(m_hActiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void PulseBlockCursor::Draw(LPRECT pRect) {
// this is called only once, to set the size of the cursor
if (m_nMaxSize == 0) {
if ((pRect->right - pRect->left) < (pRect->bottom - pRect->top)) {
m_nMaxSize = (pRect->right - pRect->left) >> 1;
} else {
m_nMaxSize = (pRect->bottom - pRect->top) >> 1;
}
}
if (m_bActive) {
RECT rect;
::CopyMemory(&rect, pRect, sizeof(RECT));
rect.left += m_nSize;
rect.top += m_nSize;
rect.right -= m_nSize;
rect.bottom -= m_nSize;
::FillRect(m_hdcWindow, &rect, m_hActiveBrush);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void PulseBlockCursor::PrepareNext() {
if (m_nSize == 0) {
m_nStep = 1;
} else if (m_nSize == m_nMaxSize) {
m_nStep = -1;
}
m_nSize += m_nStep;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// BarCursor
BarCursor::BarCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hPen(::CreatePen(PS_SOLID, 1, crCursorColor))
, m_bVisible(TRUE)
{
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 750, NULL);
}
BarCursor::~BarCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
::DeleteObject(m_hPen);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void BarCursor::Draw(LPRECT pRect) {
if (m_bActive && m_bVisible) {
HPEN hOldPen = (HPEN)::SelectObject(m_hdcWindow, m_hPen);
::MoveToEx(m_hdcWindow, pRect->left, pRect->top, NULL);
::LineTo(m_hdcWindow, pRect->left, pRect->bottom);
::SelectObject(m_hdcWindow, hOldPen);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void BarCursor::PrepareNext() {
m_bVisible = !m_bVisible;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// ConsoleCursor
ConsoleCursor::ConsoleCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hStdOut(::CreateFile(_T("CONOUT$"), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0))
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
, m_bVisible(TRUE)
{
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 750, NULL);
}
ConsoleCursor::~ConsoleCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
::DeleteObject(m_hActiveBrush);
::CloseHandle(m_hStdOut);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void ConsoleCursor::Draw(LPRECT pRect) {
RECT rect;
::CopyMemory(&rect, pRect, sizeof(RECT));
if (m_bActive && m_bVisible) {
rect.top += (rect.bottom - rect.top) * 80 / 100;
::FillRect(m_hdcWindow, &rect, m_hActiveBrush);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void ConsoleCursor::PrepareNext() {
m_bVisible = !m_bVisible;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// NBHLineCursor
NBHLineCursor::NBHLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hPen(::CreatePen(PS_SOLID, 1, crCursorColor))
{
}
NBHLineCursor::~NBHLineCursor() {
::DeleteObject(m_hPen);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void NBHLineCursor::Draw(LPRECT pRect) {
HPEN hOldPen = (HPEN)::SelectObject(m_hdcWindow, m_hPen);
::MoveToEx(m_hdcWindow, pRect->left, pRect->bottom-1, NULL);
::LineTo(m_hdcWindow, pRect->right, pRect->bottom-1);
::SelectObject(m_hdcWindow, hOldPen);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void NBHLineCursor::PrepareNext() {
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// HLineCursor
HLineCursor::HLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hPen(::CreatePen(PS_SOLID, 1, crCursorColor))
, m_nSize(0)
, m_nPosition(0)
, m_nStep(0)
{
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 100, NULL);
}
HLineCursor::~HLineCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
::DeleteObject(m_hPen);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void HLineCursor::Draw(LPRECT pRect) {
// this is called only once, to set the size of the cursor
if (m_nSize != (pRect->bottom - pRect->top - 1)) {
m_nSize = pRect->bottom - pRect->top - 1;
m_nPosition = 0;
m_nStep = 1;
}
if (m_bActive) {
HPEN hOldPen = (HPEN)::SelectObject(m_hdcWindow, m_hPen);
::MoveToEx(m_hdcWindow, pRect->left, pRect->top + m_nPosition, NULL);
::LineTo(m_hdcWindow, pRect->right, pRect->top + m_nPosition);
::SelectObject(m_hdcWindow, hOldPen);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void HLineCursor::PrepareNext() {
if (m_nPosition == 0) {
m_nStep = 1;
} else if (m_nPosition == m_nSize) {
m_nStep = -1;
}
m_nPosition += m_nStep;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// VLineCursor
VLineCursor::VLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hPen(::CreatePen(PS_SOLID, 1, crCursorColor))
, m_nSize(0)
, m_nPosition(0)
, m_nStep(0)
{
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 100, NULL);
}
VLineCursor::~VLineCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
::DeleteObject(m_hPen);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void VLineCursor::Draw(LPRECT pRect) {
// this is called only once, to set the size of the cursor
if (m_nSize != (pRect->right - pRect->left - 1)) {
m_nSize = pRect->right - pRect->left - 1;
m_nPosition = 0;
m_nStep = 1;
}
if (m_bActive) {
HPEN hOldPen = (HPEN)::SelectObject(m_hdcWindow, m_hPen);
::MoveToEx(m_hdcWindow, pRect->left + m_nPosition, pRect->top, NULL);
::LineTo(m_hdcWindow, pRect->left + m_nPosition, pRect->bottom);
::SelectObject(m_hdcWindow, hOldPen);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void VLineCursor::PrepareNext() {
if (m_nPosition == 0) {
m_nStep = 1;
} else if (m_nPosition == m_nSize) {
m_nStep = -1;
}
m_nPosition += m_nStep;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// RectCursor
RectCursor::RectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
, m_bVisible(TRUE)
{
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 750, NULL);
}
RectCursor::~RectCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
::DeleteObject(m_hActiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void RectCursor::Draw(LPRECT pRect) {
if (m_bActive && m_bVisible) {
::FrameRect(m_hdcWindow, pRect, m_hActiveBrush);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void RectCursor::PrepareNext() {
m_bVisible = !m_bVisible;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// NBRectCursor
NBRectCursor::NBRectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
{
}
NBRectCursor::~NBRectCursor() {
::DeleteObject(m_hActiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void NBRectCursor::Draw(LPRECT pRect) {
::FrameRect(m_hdcWindow, pRect, m_hActiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void NBRectCursor::PrepareNext() {
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// PulseRectCursor
PulseRectCursor::PulseRectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
, m_nSize(0)
, m_nMaxSize(0)
, m_nStep(0)
{
::ZeroMemory(&m_rect, sizeof(RECT));
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 100, NULL);
}
PulseRectCursor::~PulseRectCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
::DeleteObject(m_hActiveBrush);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void PulseRectCursor::Draw(LPRECT pRect) {
// this is called only once, to set the size of the cursor
if (m_nMaxSize == 0) {
if ((pRect->right - pRect->left) < (pRect->bottom - pRect->top)) {
m_nMaxSize = (pRect->right - pRect->left) >> 1;
} else {
m_nMaxSize = (pRect->bottom - pRect->top) >> 1;
}
}
if (m_bActive) {
RECT rect;
::CopyMemory(&rect, pRect, sizeof(RECT));
rect.left += m_nSize;
rect.top += m_nSize;
rect.right -= m_nSize;
rect.bottom -= m_nSize;
::FrameRect(m_hdcWindow, &rect, m_hActiveBrush);
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void PulseRectCursor::PrepareNext() {
if (m_nSize == 0) {
m_nStep = 1;
} else if (m_nSize == m_nMaxSize) {
m_nStep = -1;
}
m_nSize += m_nStep;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// FadeBlockCursor
FadeBlockCursor::FadeBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor, COLORREF crBkColor)
: Cursor(hwndParent, hdcWindow, crCursorColor)
, m_crCursorColor(crCursorColor)
, m_nStep(1)
, m_crBkColor(crBkColor)
, m_nIndex(0)
, m_hUser32(NULL)
, m_hMemDC(NULL)
{
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 35, NULL);
FakeBlend();
// }
}
FadeBlockCursor::~FadeBlockCursor() {
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void FadeBlockCursor::Draw(LPRECT pRect) {
HBRUSH hBrush = ::CreateSolidBrush(m_arrColors[m_nIndex]);
::FillRect(m_hdcWindow, pRect, hBrush);
::DeleteObject(hBrush);
// }
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void FadeBlockCursor::PrepareNext() {
if (m_nIndex == 0) {
m_nStep = 1;
} else if (m_nIndex == (FADE_STEPS)) {
m_nStep = -1;
}
m_nIndex += m_nStep;
// }
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// This function is used to create a fake blending for WinNT (uuseful only
// for solid background, though)
void FadeBlockCursor::FakeBlend() {
int nDeltaR = ((GetRValue(m_crCursorColor) - GetRValue(m_crBkColor)) << 8) / FADE_STEPS;
int nDeltaG = ((GetGValue(m_crCursorColor) - GetGValue(m_crBkColor)) << 8) / FADE_STEPS;
int nDeltaB = ((GetBValue(m_crCursorColor) - GetBValue(m_crBkColor)) << 8) / FADE_STEPS;
for (int i = 0; i < FADE_STEPS; ++i) {
m_arrColors[i] = RGB(GetRValue(m_crCursorColor) - (nDeltaR*i >> 8), GetGValue(m_crCursorColor) - (nDeltaG*i >> 8), GetBValue(m_crCursorColor) - (nDeltaB*i >> 8));
}
m_arrColors[FADE_STEPS] = m_crBkColor;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-342
View File
@@ -1,342 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Cursors.h - cursor classes
#pragma once
#define CURSOR_TIMER 45
extern BOOL g_bWin2000;
/////////////////////////////////////////////////////////////////////////////
// A base class for all the cursors
class Cursor {
public:
Cursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
: m_hwndParent(hwndParent)
, m_hdcWindow(hdcWindow)
, m_crCursorColor(crCursorColor)
, m_bActive(TRUE)
, m_uiTimer(0)
{};
virtual ~Cursor(){};
void SetState(BOOL bActive) {m_bActive = bActive;};
BOOL GetState() { return m_bActive; }
// used to draw current frame of the cursor
virtual void Draw(LPRECT pRect) = 0;
// used to prepare the next frame of cursor animation
virtual void PrepareNext() = 0;
protected:
HWND m_hwndParent;
HDC m_hdcWindow;
COLORREF m_crCursorColor;
BOOL m_bActive;
UINT m_uiTimer;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// XTermCursor
class XTermCursor : public Cursor {
public:
XTermCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~XTermCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HBRUSH m_hActiveBrush;
HBRUSH m_hInactiveBrush;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// BlockCursor
class BlockCursor : public Cursor {
public:
BlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~BlockCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HBRUSH m_hActiveBrush;
BOOL m_bVisible;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// NBBlockCursor
class NBBlockCursor : public Cursor {
public:
NBBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~NBBlockCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HBRUSH m_hActiveBrush;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// PulseBlockCursor
class PulseBlockCursor : public Cursor {
public:
PulseBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~PulseBlockCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HBRUSH m_hActiveBrush;
RECT m_rect;
int m_nSize;
int m_nMaxSize;
int m_nStep;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// BarCursor
class BarCursor : public Cursor {
public:
BarCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~BarCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HPEN m_hPen;
BOOL m_bVisible;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// ConsoleCursor
class ConsoleCursor : public Cursor {
public:
ConsoleCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~ConsoleCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HANDLE m_hStdOut;
HBRUSH m_hActiveBrush;
BOOL m_bVisible;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// NBHLineCursor
class NBHLineCursor : public Cursor {
public:
NBHLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~NBHLineCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HPEN m_hPen;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// HLineCursor
class HLineCursor : public Cursor {
public:
HLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~HLineCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HPEN m_hPen;
int m_nSize;
int m_nPosition;
int m_nStep;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// VLineCursor
class VLineCursor : public Cursor {
public:
VLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~VLineCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HPEN m_hPen;
int m_nSize;
int m_nPosition;
int m_nStep;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// RectCursor
class RectCursor : public Cursor {
public:
RectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~RectCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HBRUSH m_hActiveBrush;
BOOL m_bVisible;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// NBRectCursor
class NBRectCursor : public Cursor {
public:
NBRectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~NBRectCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HBRUSH m_hActiveBrush;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// PulseRectCursor
class PulseRectCursor : public Cursor {
public:
PulseRectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
~PulseRectCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
HBRUSH m_hActiveBrush;
RECT m_rect;
int m_nSize;
int m_nMaxSize;
int m_nStep;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// FadeBlockCursor
#define FADE_STEPS 20
#define ALPHA_STEP 12
#define BLEND_BMP_WIDTH 10
#define BLEND_BMP_HEIGHT 20
class FadeBlockCursor : public Cursor {
public:
FadeBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor, COLORREF crBkColor);
~FadeBlockCursor();
void Draw(LPRECT pRect);
void PrepareNext();
private:
void FakeBlend();
COLORREF m_crCursorColor;
int m_nStep;
// used under WinNT 4.0
COLORREF m_crBkColor;
COLORREF m_arrColors[FADE_STEPS+1];
int m_nIndex;
// these are used under Win2000 only
HMODULE m_hUser32;
BLENDFUNCTION m_bfn;
HDC m_hMemDC;
};
/////////////////////////////////////////////////////////////////////////////
-134
View File
@@ -1,134 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Dialogs.h - dialog classes
//
// About dialog class, etc...
//#include "stdafx.h"
#include <Windows.h>
#include "resource.h"
#include "Console.h"
#include "Dialogs.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern HINSTANCE ghInstance;
/////////////////////////////////////////////////////////////////////////////
// About dialog class
/////////////////////////////////////////////////////////////////////////////
// Ctor/Dtor
CAboutDlg::CAboutDlg(HWND hwndParent)
: m_hWndParent(hwndParent)
{
}
CAboutDlg::~CAboutDlg()
{
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// public methods
/////////////////////////////////////////////////////////////////////////////
// DoModal - shows About dialog
BOOL CAboutDlg::DoModal()
{
::DialogBox(
ghInstance,
MAKEINTRESOURCE(IDD_ABOUT),
m_hWndParent,
CAboutDlg::DialogProc);
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// message handlers
/////////////////////////////////////////////////////////////////////////////
// DialogProc - dialog window procedure
int CALLBACK CAboutDlg::DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDCANCEL:
if (HIWORD(wParam) == BN_CLICKED) {
::EndDialog(hwndDlg, MB_OK);
return TRUE;
}
break;
}
}
return 0;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-64
View File
@@ -1,64 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Dialogs.h - dialog classes
//
// About dialog class, etc...
#pragma once
/////////////////////////////////////////////////////////////////////////////
// About dialog class
class CAboutDlg {
public:
CAboutDlg(HWND hwndParent);
~CAboutDlg();
// public methods
public:
// shows About dialog
BOOL DoModal();
// public data
public:
// parent window handle
HWND m_hWndParent;
// private methods
private:
/////////////////////////
// message handlers
// dialog window procedure
static int CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
// private data
private:
};
/////////////////////////////////////////////////////////////////////////////
-259
View File
@@ -1,259 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// FileStream.cpp - implementation of IStream interface on any file
// (not strictly COM, I'm faking it here a bit :-)
//
#undef CINTERFACE
#include "builddefines.h"
//#include "stdafx.h"
//#include <atlbase.h>
#include <Windows.h>
#include <objidl.h>
#include "FileStream.h"
//#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
//#endif
/////////////////////////////////////////////////////////////////////////////
// CreateFileStream - opens/creates a file and returns an IStream interface
HRESULT CreateFileStream(
LPCTSTR lpFileName, // file name
DWORD dwDesiredAccess, // access mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // SD
DWORD dwCreationDisposition, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile, // handle to template file
IStream** ppStream // pointer to IStream interface
)
{
HANDLE hFile = ::CreateFile(
lpFileName,
dwDesiredAccess,
dwShareMode,
lpSecurityAttributes,
dwCreationDisposition,
dwFlagsAndAttributes,
hTemplateFile);
if (hFile == INVALID_HANDLE_VALUE) {
// DWORD a = ::GetLastError();
ppStream = NULL;
return E_FAIL;
}
FileStream* pFileStream = new FileStream(hFile);
return pFileStream->QueryInterface(IID_IStream, (void**)ppStream);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// FileStream class
/////////////////////////////////////////////////////////////////////////////
// ctor/dtor
FileStream::FileStream(HANDLE hFile)
: m_lRefCount(0)
, m_hFile(hFile)
{
}
FileStream::~FileStream()
{
if (m_hFile) ::CloseHandle(m_hFile);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// IStream methods
/////////////////////////////////////////////////////////////////////////////
// Read - reads a specified number of bytes from the stream object into memory
// starting at the current seek pointer
STDMETHODIMP FileStream::Read(void *pv, ULONG cb, ULONG *pcbRead)
{
if (!::ReadFile(m_hFile, pv, cb, pcbRead, NULL)) return S_FALSE;
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Write - writes a specified number of bytes into the stream object starting
// at the current seek pointer
STDMETHODIMP FileStream::Write(void const *pv, ULONG cb, ULONG *pcbWritten)
{
if (!::WriteFile(m_hFile, pv, cb, pcbWritten, NULL)) return S_FALSE;
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Seek - changes the seek pointer to a new location relative to the beginning
// of the stream, to the end of the stream, or to the current seek pointer
STDMETHODIMP FileStream::Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
{
DWORD dwFileOrigin;
DWORD dwMoveLow = dlibMove.LowPart;
LONG lMoveHigh = dlibMove.HighPart;
switch (dwOrigin) {
case STREAM_SEEK_SET : dwFileOrigin = FILE_BEGIN; break;
case STREAM_SEEK_CUR : dwFileOrigin = FILE_CURRENT; break;
case STREAM_SEEK_END : dwFileOrigin = FILE_END; break;
default:dwFileOrigin = FILE_BEGIN;
}
DWORD dwRet = ::SetFilePointer(m_hFile, dwMoveLow, &lMoveHigh, dwFileOrigin);
if (::GetLastError() != NO_ERROR) return STG_E_INVALIDPOINTER;
plibNewPosition->LowPart = dwRet;
plibNewPosition->HighPart = lMoveHigh;
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// SetSize - not really doing anything here
STDMETHODIMP FileStream::SetSize(ULARGE_INTEGER libNewSize)
{
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CopyTo - copies a specified number of bytes from the current seek pointer
// in the stream to the current seek pointer in another stream
STDMETHODIMP FileStream::CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
{
// later...
return E_NOTIMPL;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Commit - no work here...
STDMETHODIMP FileStream::Commit(DWORD grfCommitFlags)
{
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Revert - no work here...
STDMETHODIMP FileStream::Revert(void)
{
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// LockRegion - no work here...
STDMETHODIMP FileStream::LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
return E_NOTIMPL;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// UnlockRegion - no work here...
STDMETHODIMP FileStream::UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
return E_NOTIMPL;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Stat - no work here...
STDMETHODIMP FileStream::Stat(STATSTG *pstatstg, DWORD grfStatFlag)
{
return E_NOTIMPL;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Clone - no work here...
STDMETHODIMP FileStream::Clone(IStream **ppstm)
{
return E_NOTIMPL;
}
/////////////////////////////////////////////////////////////////////////////
-107
View File
@@ -1,107 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2004 by Marko Bozikovic
// All rights reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// marko.bozikovic@alterbox.net
// bozho@kset.org
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// FileStream.h - implementation of IStream interface on any file
// (not really COM, I'm faking it here a bit :-)
//
#pragma once
/////////////////////////////////////////////////////////////////////////////
// CreateFileStream - opens/creates a file and returns an IStream interface
HRESULT CreateFileStream(
LPCTSTR lpFileName, // file name
DWORD dwDesiredAccess, // access mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // SD
DWORD dwCreationDisposition, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile, // handle to template file
IStream** ppStream // pointer to IStream interface
);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// FileStream class
class FileStream : public IStream {
public:
FileStream(HANDLE hFile);
~FileStream();
// IUnknown methods
STDMETHOD(QueryInterface)(REFIID riid, void ** ppv) {
if (riid == IID_IUnknown) {
*ppv = static_cast<IStream*>(this);
} else if (riid == IID_IStream) {
*ppv = static_cast<IStream*>(this);
} else {
*ppv = NULL;
return E_NOINTERFACE;
}
static_cast<IUnknown*>(*ppv)->AddRef();
return S_OK;
};
STDMETHOD_(ULONG, AddRef)(void) {
return ::InterlockedIncrement(&m_lRefCount);
};
STDMETHOD_(ULONG, Release)(void) {
long l = ::InterlockedDecrement(&m_lRefCount);
if (l == 0) delete this;
return l;
};
// IStream methods
STDMETHOD(Read)(void *pv, ULONG cb, ULONG *pcbRead);
STDMETHOD(Write)(void const *pv, ULONG cb, ULONG *pcbWritten);
STDMETHOD(Seek)(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);
STDMETHOD(SetSize)(ULARGE_INTEGER libNewSize);
STDMETHOD(CopyTo)(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten);
STDMETHOD(Commit)(DWORD grfCommitFlags);
STDMETHOD(Revert)(void);
STDMETHOD(LockRegion)(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
STDMETHOD(UnlockRegion)(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
STDMETHOD(Stat)(STATSTG *pstatstg, DWORD grfStatFlag);
STDMETHOD(Clone)(IStream **ppstm);
private: // private data
// reference count
long m_lRefCount;
// file handle
HANDLE m_hFile;
};
/////////////////////////////////////////////////////////////////////////////
-1200
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __BUTTON_DEFINES_H
+1 -1
View File
@@ -7,7 +7,7 @@
#include "renderworld.h"
#include "random.h"
#include "worldman.h"
#include "interface.h"
#include "Interface.h"
#include "Isometric Utils.h"
#include "editscreen.h"
#include "EditorDefines.h"
+2 -2
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __CURSOR_MODES_H
@@ -40,4 +40,4 @@ extern BOOLEAN gfCurrentSelectionWithRightButton;
#endif
#endif
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITOR_CALLBACK_PROTOTYPES_H
+1 -1
View File
@@ -17,7 +17,7 @@
#include "environment.h"
#include "worlddef.h"
#include "Exit Grids.h"
#include "Worldman.h"
#include "worldman.h"
BOOLEAN gfShowExitGrids = FALSE;
+2 -2
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITOR_MODES_H
@@ -14,4 +14,4 @@ void ShowExitGrids();
void HideExitGrids();
#endif
#endif
#endif
+2 -2
View File
@@ -5,7 +5,7 @@
//sgp
#include "Button System.h"
#include "Font Control.h"
#include "debug.h"
#include "DEBUG.H"
//editor
#include "EditorDefines.h"
#include "Editor Callback Prototypes.h"
@@ -14,7 +14,7 @@
#include "EditorMapInfo.h"
//tactical
#include "Soldier Create.h"
#include "overhead types.h"
#include "Overhead Types.h"
#include "local.h"
#include "Text.h"
+2 -2
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITOR_TASKBAR_CREATION_H
@@ -7,4 +7,4 @@
void CreateEditorTaskbarInternal();
#endif
#endif
#endif
+2 -2
View File
@@ -11,13 +11,13 @@
#include "WorldDat.h"
#include "Render Dirty.h"
#include "sysutil.h"
#include "wordwrap.h"
#include "WordWrap.h"
#include "environment.h"
#include "Interface Items.h"
#include "Soldier Find.h"
#include "World Items.h"
#include "Text.h"
#include "Overhead map.h"
#include "overhead map.h"
#include "Cursor Modes.h"
#include "editscreen.h"
#include "EditorTerrain.h"
+2 -2
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITOR_TASKBAR_UTILS_H
@@ -67,4 +67,4 @@ extern UINT32 guiMercTempBuffer;
extern INT32 giEditMercImage[2];
#endif
#endif
#endif
+2 -2
View File
@@ -6,7 +6,7 @@
#include "worldman.h"
#include "smooth.h"
#include "input.h"
#include "debug.h"
#include "DEBUG.H"
#include "Isometric Utils.h"
#include "editscreen.h"
@@ -15,7 +15,7 @@
#include "Cursor Modes.h"
#include "Exit Grids.h"
//dnl ch86 110214
#include "keys.h"
#include "Keys.h"
#include "EditorItems.h"
#include "EditorMapInfo.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITOR_UNDO_H
+1 -1
View File
@@ -18,7 +18,7 @@
#include "Editor Modes.h"
#include "Smoothing Utils.h"
#include "Text Input.h"
#include "keys.h"
#include "Keys.h"
#include "environment.h"
#include "selectwin.h"
#include "Simple Render Utils.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITORBUILDINGS_H
+2 -2
View File
@@ -1,10 +1,10 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITORDEFINES_H
#define __EDITORDEFINES_H
#include "Types.h"
#include "types.h"
#include "Button Defines.h"
+12 -12
View File
@@ -9,34 +9,34 @@
#include "vobject.h"
#include "mousesystem.h"
#include "Button System.h"
#include "wcheck.h"
#include "WCheck.h"
#include "vsurface.h"
#include "input.h"
#include "sysutil.h"
#include "font.h"
#include "Font.h"
#include "Font Control.h"
#include "editscreen.h"
#include "selectwin.h"
#include "video.h"
#include "vobject_blitters.h"
#include "interface panels.h"
#include "interface items.h"
#include "text.h"
#include "utilities.h"
#include "Interface Panels.h"
#include "Interface Items.h"
#include "Text.h"
#include "Utilities.h"
#include "Action Items.h"
#include "World Items.h"
#include "EditorDefines.h"
#include "EditorItems.h"
#include "EditorMercs.h"
#include "weapons.h"
#include "Weapons.h"
#include "Editor Taskbar Utils.h"
#include "wordwrap.h"
#include "WordWrap.h"
#include "Item Statistics.h"
#include "Simple Render Utils.h"
#include "worldman.h"
#include "random.h"
#include "Pits.h"
#include "keys.h"
#include "pits.h"
#include "Keys.h"
#include "InterfaceItemImages.h"
#include "Editor Undo.h"//dnl ch86 220214
@@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
item = &Item[i];
//if( Item[i].fFlags & ITEM_NOT_EDITOR )
// continue;
if(item->notineditor)
if(ItemIsNotInEditor(i))
continue;
if( i == SWITCH || i == ACTION_ITEM )
{
@@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
continue;
}
item = &Item[usCounter];
if(item->notineditor)
if(ItemIsNotInEditor(usCounter))
{
usCounter++;
continue;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITORITEMS_H
+9 -9
View File
@@ -9,23 +9,23 @@
#include "vobject.h"
#include "mousesystem.h"
#include "Button System.h"
#include "wcheck.h"
#include "WCheck.h"
#include "vsurface.h"
#include "line.h"
#include "input.h"
#include "sysutil.h"
#include "font.h"
#include "Font.h"
#include "Font Control.h"
#include "editscreen.h"
#include "selectwin.h"
#include "video.h"
#include "vobject_blitters.h"
#include "interface panels.h"
#include "interface items.h"
#include "utilities.h"
#include "Interface Panels.h"
#include "Interface Items.h"
#include "Utilities.h"
#include "World Items.h"
#include "worldman.h"
#include "overhead.h" //GetSoldier
#include "Overhead.h" //GetSoldier
#include "renderworld.h"
#include "Animation Data.h"
#include "Animation Control.h"
@@ -37,11 +37,11 @@
#include "Soldier Init List.h"
#include "strategicmap.h"
#include "Soldier Add.h"
#include "Soldier Profile Type.h"
#include "soldier profile type.h"
#include "Soldier Profile.h"
#include "Text Input.h"
#include "Random.h"
#include "wordwrap.h"
#include "random.h"
#include "WordWrap.h"
#include "EditorItems.h"
#include "Editor Taskbar Utils.h"
#include "Exit Grids.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITORMAPINFO_H
+15 -15
View File
@@ -9,24 +9,24 @@
#include "vobject.h"
#include "mousesystem.h"
#include "Button System.h"
#include "wcheck.h"
#include "WCheck.h"
#include "vsurface.h"
#include "line.h"
#include "input.h"
#include "sysutil.h"
#include "font.h"
#include "Font.h"
#include "Font Control.h"
#include "editscreen.h"
#include "selectwin.h"
#include "video.h"
#include "vobject_blitters.h"
#include "interface panels.h"
#include "interface items.h"
#include "text.h"
#include "utilities.h"
#include "Interface Panels.h"
#include "Interface Items.h"
#include "Text.h"
#include "Utilities.h"
#include "World Items.h"
#include "worldman.h"
#include "overhead.h" //GetSoldier
#include "Overhead.h" //GetSoldier
#include "renderworld.h"
#include "Animation Data.h"
#include "Animation Control.h"
@@ -39,11 +39,11 @@
#include "Soldier Init List.h"
#include "strategicmap.h"
#include "Soldier Add.h"
#include "Soldier Profile Type.h"
#include "soldier profile type.h"
#include "Soldier Profile.h"
#include "Text Input.h"
#include "Random.h"
#include "wordwrap.h"
#include "random.h"
#include "WordWrap.h"
#include "EditorItems.h"
#include "Editor Taskbar Utils.h"
#include "Exit Grids.h"
@@ -162,7 +162,7 @@ void AddNewItemToSelectedMercsInventory( BOOLEAN fCreate );
void RenderMercInventoryPanel();
void SetDroppableCheckboxesBasedOnMercsInventory();
extern BOOLEAN InternalAddSoldierToSector( UINT8 ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode );
extern BOOLEAN InternalAddSoldierToSector( SoldierID ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode );
//array which keeps track of which item is in which slot. This is dependant on the selected merc, so
//these temp values must be updated when different mercs are selected, and reset when a merc detailed
@@ -559,7 +559,7 @@ void AddMercToWorld( INT32 iMapIndex )
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
{
UINT8 ubID;
SoldierID ubID;
INT16 sSectorX, sSectorY;
SOLDIERINITNODE *pNode;
@@ -629,7 +629,7 @@ void HandleRightClickOnMerc( INT32 iMapIndex )
if ( gsSelectedMercID != sThisMercID )
{ // We want to edit a new merc (or different merc)
//We need to avoid the editing of player mercs.
pNode = FindSoldierInitNodeWithID( (UINT8)sThisMercID );
pNode = FindSoldierInitNodeWithID( sThisMercID );
if( !pNode )
return; //this is a player merc (which isn't in the list), or an error in logic.
IndicateSelectedMerc( sThisMercID );
@@ -1634,7 +1634,7 @@ void IndicateSelectedMerc( INT16 sID )
break;
default:
//search for the merc with the specific ID.
gpSelected = FindSoldierInitNodeWithID( (UINT8)sID );
gpSelected = FindSoldierInitNodeWithID( sID );
if( !gpSelected )
{
gsSelectedMercID = -1;
@@ -3783,7 +3783,7 @@ void PasteMercPlacement( INT32 iMapIndex )
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
{
UINT8 ubID;
SoldierID ubID;
INT16 sSectorX, sSectorY;
SOLDIERINITNODE *pNode;
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "BuildDefines.h"
#include "builddefines.h"
//-----------------------------------------------
//
+4 -4
View File
@@ -9,18 +9,18 @@
#include "vobject.h"
#include "mousesystem.h"
#include "Button System.h"
#include "wcheck.h"
#include "WCheck.h"
#include "vsurface.h"
#include "input.h"
#include "sysutil.h"
#include "font.h"
#include "Font.h"
#include "Font Control.h"
#include "editscreen.h"
#include "selectwin.h"
#include "video.h"
#include "vobject_blitters.h"
#include "interface panels.h"
#include "utilities.h"
#include "Interface Panels.h"
#include "Utilities.h"
#include "World Items.h"
#include "EditorDefines.h"
#include "EditorTerrain.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDITORTERRAIN_H
+3 -3
View File
@@ -7,7 +7,7 @@
#include "types.h"
#include "mousesystem.h"
#include "Button System.h"
#include "font control.h"
#include "Font Control.h"
#include "EditorDefines.h"
#include "Editor Taskbar Utils.h"
#include "EditorMercs.h"
@@ -20,10 +20,10 @@
#include "Weapons.h"
#include "Items.h"
#include "editscreen.h"
#include "Random.h"
#include "random.h"
#include "Handle Items.h"
#include "World Items.h"
#include "PopupMenu.h"
#include "popupmenu.h"
#include "pits.h"
#include "Text.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifndef __ITEM_STATISTICS_H
#define __ITEM_STATISTICS_H
+11 -3
View File
@@ -5,8 +5,8 @@
#include <stdio.h>
#include "Font Control.h"
#include "renderworld.h"
#include "render dirty.h"
#include "loadscreen.h"
#include "Render Dirty.h"
#include "LoadScreen.h"
#include "selectwin.h"
#include "EditorDefines.h"
#include "messagebox.h"
@@ -173,7 +173,15 @@ void LoadSaveScreenEntry()
vfs::CVirtualProfile* prof = it.value();
memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
strcpy(FileInfo.zFileName, "< ");
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
// Cut filename off if it's too long for the buffer
if (strlen(prof->cName.utf8().c_str()) > FILENAME_BUFLEN-4)
{
strncpy(FileInfo.zFileName+1, prof->cName.utf8().c_str(), FILENAME_BUFLEN-4);
}
else
{
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
}
strcat(FileInfo.zFileName, " >");
FileInfo.zFileName[FILENAME_BUFLEN] = 0;
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
+3 -3
View File
@@ -1,7 +1,7 @@
#include "BuildDefines.h"
#include "Fileman.h"
#include "builddefines.h"
#include "FileMan.h"
#define FILENAME_BUFLEN (20 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
#define FILENAME_BUFLEN (30 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
#ifdef JA2EDITOR
+35 -7
View File
@@ -4,7 +4,7 @@
#include "types.h"
#include "Road Smoothing.h"
#include "tiledat.h"
#include "TileDat.h"
#include "worlddef.h"
#include "worldman.h"
#include "Editor Undo.h"
@@ -403,14 +403,42 @@ void PlaceRoadMacroAtGridNo( INT32 iMapIndex, INT32 iMacroID )
while( gRoadMacros[ i ].sMacroID == iMacroID )
{
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
INT32 sdX = gRoadMacros[ i ].sOffset % OLD_WORLD_COLS;
INT32 sdY = gRoadMacros[ i ].sOffset / OLD_WORLD_COLS;
INT32 sOffset = sdY*WORLD_COLS + sdX;
INT32 sdY = gRoadMacros[ i ].sOffset / (OLD_WORLD_COLS);
INT32 sdX = gRoadMacros[ i ].sOffset - (sdY*OLD_WORLD_COLS);
// Take into account the dfference between old and new row size for tiles that are shifted
// by one row due to X offset
// For example:
// {RBR, 159},
//{ RBR, -159 },
//
// Offsets for 160x160 map
// [] [] [-159]
// [] [0] []
// [159] [] []
//
AddToUndoList( iMapIndex + sOffset );
RemoveAllObjectsOfTypeRange( iMapIndex + sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
// Converted to 200x200 map
// [] [] [-199]
// [] [0] []
// [199] [] []
//
// Without this the original conversion would output 159 and -159 for X coordinate
if (sdX < -OLD_WORLD_COLS/2)
{
sdX -= WORLD_COLS - OLD_WORLD_COLS;
}
else if (sdX > OLD_WORLD_COLS / 2)
{
sdX += WORLD_COLS - OLD_WORLD_COLS;
}
INT32 sOffset = sdY*WORLD_COLS + sdX;
INT32 newGridNo = iMapIndex + sOffset;
AddToUndoList( newGridNo );
RemoveAllObjectsOfTypeRange( newGridNo, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
AddObjectToHead( iMapIndex + sOffset, usTileIndex );
AddObjectToHead( newGridNo, usTileIndex );
i++;
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
@@ -61,4 +61,4 @@ void InitializeRoadMacros();
#endif
#endif
#endif
+4 -4
View File
@@ -15,22 +15,22 @@
#include "line.h"
#include "input.h"
#include "vobject_blitters.h"
#include "loadscreen.h"
#include "LoadScreen.h"
#include "Text Input.h"
#include "mousesystem.h"
#include "strategicmap.h"
#include "Fileman.h"
#include "FileMan.h"
#include "Exit Grids.h"
#include "Map Information.h"
#include "Summary Info.h"
#include "Animated ProgressBar.h"
#include "worlddef.h"
#include "worlddat.h"
#include "WorldDat.h"
#include "EditorDefines.h"
#include "editscreen.h"
#include "english.h"
#include "World Items.h"
#include "text.h"
#include "Text.h"
#include "Soldier Create.h"
#include "GameVersion.h"
#include "Campaign Types.h"
+2 -2
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __SECTOR_SUMMARY_H
@@ -35,4 +35,4 @@ void GetSectorFromFileName(STR16 szFileName, INT16& sSectorX, INT16& sSectorY, I
void ResetCustomFileSectorSummary(void);//dnl ch30 150909
#endif
#endif
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __SMARTMETHOD_H
+2 -2
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __SMOOTHING_UTILS_H
@@ -62,4 +62,4 @@ UINT16 GetHorizontalWallClass( INT32 iMapIndex );
BOOLEAN ValidDecalPlacement( INT32 iMapIndex );
#endif
#endif
#endif
+2 -2
View File
@@ -1,10 +1,10 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __SUMMARY_INFO_H
#define __SUMMARY_INFO_H
#include "Types.h"
#include "types.h"
//dnl ch28
#define GLOBAL_SUMMARY_VERSION 15
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __EDIT_SYS_H
+28 -14
View File
@@ -1,4 +1,4 @@
#include "builddefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
@@ -12,22 +12,22 @@
#include "edit_sys.h"
#include "screenids.h"
#include "editscreen.h"
#include "sys globals.h"
#include "Sys Globals.h"
#include "SmartMethod.h"
#include "selectwin.h"
#include "Interface.h"
#include "lighting.h"
#include "Interactive Tiles.h"
#include "overhead types.h"
#include "Overhead Types.h"
#include "Overhead.h"
#include "Handle UI.h"
#include "Event Pump.h"
#include "world items.h"
#include "loadscreen.h"
#include "render dirty.h"
#include "isometric utils.h"
#include "LoadScreen.h"
#include "Render Dirty.h"
#include "Isometric Utils.h"
#include "message.h"
#include "render fun.h"
#include "Render Fun.h"
#include "popupmenu.h"
#include "overhead map.h"
#include "EditorDefines.h"
@@ -39,7 +39,7 @@
#include "newsmooth.h"
#include "Smoothing Utils.h"
#include "messagebox.h"
#include "messageboxscreen.h"
#include "MessageBoxScreen.h"
#include "Soldier Create.h"
#include "Soldier Init List.h"
#include "Text Input.h"
@@ -59,7 +59,7 @@
#include "line.h"
#include "english.h"
#include "random.h"
#include "scheduling.h"
#include "Scheduling.h"
#include "Road Smoothing.h"
#include "strategicmap.h"
#include "message.h"
@@ -70,7 +70,7 @@
#include "GameSettings.h"
#include "Summary Info.h"
#include "connect.h"//dnl
#include "cursors.h"//dnl ch2 210909
#include "Cursors.h"//dnl ch2 210909
#include "Cursor Control.h"//dnl ch2 210909
#include "maputility.h"//dnl ch49 061009
#include "Text.h"
@@ -1069,10 +1069,7 @@ void ShowCurrentDrawingMode( void )
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
usFillColor = GenericButtonFillColors[0];
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
if(gbPixelDepth==16)
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
else if(gbPixelDepth==8)
RectangleDraw8( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
UnLockVideoSurface( FRAME_BUFFER );
@@ -2954,6 +2951,23 @@ UINT32 WaitForSelectionWindowResponse( void )
}
}
// Mousewheel scroll
if (_WheelValue > 0)
{
while (_WheelValue--)
{
ScrollSelWinUp();
}
}
else
{
while (_WheelValue++)
{
ScrollSelWinDown();
}
}
_WheelValue = 0;
if ( DoWindowSelection( ) )
{
fSelectionWindow = FALSE;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef EDITSCREEN_H
+1 -1
View File
@@ -4,7 +4,7 @@
#include "vobject.h"
#include "video.h"
#include "font.h"
#include "Font.h"
#include "Font Control.h"
#include "messagebox.h"
#include "input.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __MESSAGEBOX_H
+1 -1
View File
@@ -14,7 +14,7 @@
#include "Editor Undo.h"
#include "Structure Internals.h"
#include "environment.h"
#include "Random.h"
#include "random.h"
#include "Render Fun.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __NEWSMOOTH_H
+6 -6
View File
@@ -16,18 +16,18 @@
#include "tiledef.h"
#include "sysutil.h"
#include "font.h"
#include "Font.h"
#include "Font Control.h"
#include "line.h"
#include "worlddat.h"
#include "WorldDat.h"
#include "selectwin.h"
#include "popupmenu.h"
#include "EditorDefines.h"
#include "render dirty.h"
#include "debug.h"
#include "Render Dirty.h"
#include "DEBUG.H"
#include "mousesystem.h"
#include "cursors.h"
#include "overhead types.h"
#include "Cursors.h"
#include "Overhead Types.h"
#include "EditorMercs.h"
#include "Scheduling.h"
#include "english.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
//popupmenu.h
+61 -37
View File
@@ -6,7 +6,7 @@
#include "tiledef.h"
#include "vsurface.h"
#include "worlddat.h"
#include "WorldDat.h"
#include "random.h"
#include "sysutil.h"
#include "Font Control.h"
@@ -29,6 +29,16 @@ extern BOOLEAN fDontUseRandom;
extern UINT16 GenericButtonFillColors[40];
struct SelectionWindow
{
SGPRect window;
SGPPoint displayAreaStart; // Area where selectable items are drawn
SGPPoint displayAreaEnd;
SGPPoint spacing; // For displayed items
};
SelectionWindow gSelection;
BOOLEAN gfRenderSquareArea = FALSE;
INT16 iStartClickX,iStartClickY;
INT16 iEndClickX,iEndClickY;
@@ -40,7 +50,6 @@ INT32 iSelectWin,iCancelWin,iScrollUp,iScrollDown,iOkWin;
BOOLEAN fAllDone=FALSE;
BOOLEAN fButtonsPresent=FALSE;
SGPPoint SelWinSpacing, SelWinStartPoint, SelWinEndPoint;
//These definitions help define the start and end of the various wall indices.
//This needs to be maintained if the walls change.
@@ -172,6 +181,30 @@ UINT16 SelWinHilightFillColor = 0x23BA; //blue, formerly 0x000d a kind of mediu
//
void CreateJA2SelectionWindow( INT16 sWhat )
{
auto selectWinWidth = 600;
const auto selectWinHeight = SCREEN_HEIGHT - 120; // From top edge to taskbar
if (iResolution > _800x600)
{
selectWinWidth = 900;
}
auto tlX = 0;
auto tlY = 0;
auto brX = tlX + selectWinWidth;
auto brY = tlY + selectWinHeight;
gSelection.window.iLeft = tlX;
gSelection.window.iTop = tlY;
gSelection.window.iRight = brX;
gSelection.window.iBottom = brY;
gSelection.displayAreaStart.iX = tlX + 1;
gSelection.displayAreaStart.iY = tlY + 15;
gSelection.displayAreaEnd.iX = brX - 1;
gSelection.displayAreaEnd.iY= brY - 1;
gSelection.spacing.iX = 2;
gSelection.spacing.iY = 2;
iTopWinCutOff = gSelection.displayAreaStart.iY;
iBotWinCutOff = gSelection.displayAreaEnd.iY;
DisplaySpec *pDSpec;
UINT16 usNSpecs;
@@ -185,32 +218,33 @@ void CreateJA2SelectionWindow( INT16 sWhat )
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" );
iSelectWin = CreateHotSpot(0, 0, 600, 360, MSYS_PRIORITY_HIGH,
iSelectWin = CreateHotSpot(0, 0, selectWinWidth, selectWinHeight, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
BUTTON_USE_DEFAULT, 600, 0,
BUTTON_USE_DEFAULT, selectWinWidth, 0,
40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, OkClkCallback);
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
BUTTON_USE_DEFAULT, 600, 40,
BUTTON_USE_DEFAULT, selectWinWidth, 40,
40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, CnclClkCallback);
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
BUTTON_USE_DEFAULT, 600, 80,
BUTTON_USE_DEFAULT, selectWinWidth, 80,
40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, UpClkCallback);
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
BUTTON_USE_DEFAULT, 600, 240,
BUTTON_USE_DEFAULT, selectWinWidth, 240,
40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, DwnClkCallback);
@@ -218,18 +252,6 @@ void CreateJA2SelectionWindow( INT16 sWhat )
fButtonsPresent = TRUE;
SelWinSpacing.iX = 2;
SelWinSpacing.iY = 2;
SelWinStartPoint.iX = 1;
SelWinStartPoint.iY = 15;
iTopWinCutOff = 15;
SelWinEndPoint.iX = 599;
SelWinEndPoint.iY = 359;
iBotWinCutOff = 359;
switch( sWhat )
{
@@ -347,8 +369,8 @@ void CreateJA2SelectionWindow( INT16 sWhat )
return;
}
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &SelWinStartPoint, &SelWinEndPoint,
&SelWinSpacing, CLEAR_BACKGROUND);
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &gSelection.displayAreaStart , &gSelection.displayAreaEnd,
&gSelection.spacing, CLEAR_BACKGROUND);
}
@@ -849,12 +871,14 @@ void RenderSelectionWindow( void )
return;
ColorFillVideoSurfaceArea(FRAME_BUFFER,
0, 0, 600, 400,
GenericButtonFillColors[0]);
gSelection.window.iLeft, gSelection.window.iTop, gSelection.window.iRight, gSelection.window.iBottom,
GenericButtonFillColors[0]
);
DrawSelections( );
MarkButtonsDirty();
RenderButtons( );
// Draw selection rectangle
if ( gfRenderSquareArea )
{
button = ButtonList[iSelectWin];
@@ -862,7 +886,7 @@ void RenderSelectionWindow( void )
return;
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) ||
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY)) > 9) )
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY)) > 9) )
{
// iSX = (INT32)iStartClickX;
// iEX = (INT32)button->Area.MouseXPos;
@@ -870,7 +894,7 @@ void RenderSelectionWindow( void )
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
iSX = iStartClickX;
iSY = iStartClickY - iTopWinCutOff + SelWinStartPoint.iY;
iSY = iStartClickY - iTopWinCutOff + gSelection.displayAreaStart.iY;
iEX = gusMouseXPos;
iEY = gusMouseYPos;
@@ -889,10 +913,10 @@ void RenderSelectionWindow( void )
iEY ^= iSY;
}
iEX = min( iEX, 600 );
iSY = max( SelWinStartPoint.iY, iSY );
iEY = min( 359, iEY );
iEY = max( SelWinStartPoint.iY, iEY );
iEX = min( gSelection.displayAreaEnd.iX, iEX);
iSY = max( gSelection.displayAreaStart.iY, iSY );
iEY = min( gSelection.displayAreaEnd.iY, iEY );
iEY = max( gSelection.displayAreaStart.iY, iEY );
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
usFillGreen += usDir;
@@ -928,7 +952,7 @@ void SelWinClkCallback( GUI_BUTTON *button, INT32 reason )
return;
iClickX = button->Area.MouseXPos;
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY;
if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
{
@@ -1035,9 +1059,9 @@ void DisplaySelectionWindowGraphicalInformation()
UINT16 y;
//Determine if there is a valid picture at cursor position.
//iRelX = gusMouseXPos;
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY;
y = gusMouseYPos + iTopWinCutOff - (UINT16)SelWinStartPoint.iY;
y = gusMouseYPos + iTopWinCutOff - (UINT16)gSelection.displayAreaStart.iY;
pNode = pDispList;
fDone = FALSE;
while( (pNode != NULL) && !fDone )
@@ -1470,10 +1494,10 @@ void DrawSelections( void )
{
SGPRect ClipRect, NewRect;
NewRect.iLeft = SelWinStartPoint.iX;
NewRect.iTop = SelWinStartPoint.iY;
NewRect.iRight = SelWinEndPoint.iX;
NewRect.iBottom = SelWinEndPoint.iY;
NewRect.iLeft = gSelection.displayAreaStart.iX;
NewRect.iTop = gSelection.displayAreaStart.iY;
NewRect.iRight = gSelection.displayAreaEnd.iX;
NewRect.iBottom = gSelection.displayAreaEnd.iY;
GetClippingRect(&ClipRect);
SetClippingRect(&NewRect);
@@ -1483,7 +1507,7 @@ void DrawSelections( void )
SetObjectShade( gvoLargeFontType1, 0 );
// SetObjectShade( gvoLargeFont, 0 );
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &SelWinStartPoint, CLEAR_BACKGROUND );
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &gSelection.displayAreaStart, CLEAR_BACKGROUND );
SetObjectShade( gvoLargeFontType1, 4 );
+2 -2
View File
@@ -1,10 +1,10 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef _SELECTION_WIN_H_
#define _SELECTION_WIN_H_
#include "Types.h"
#include "types.h"
#include "vobject.h"
#include "mousesystem.h"
+3 -3
View File
@@ -5,15 +5,15 @@
#include "stdlib.h"
#include "FileMan.h"
#include "time.h"
#include "debug.h"
#include "DEBUG.H"
#include "tiledef.h"
#include "worlddef.h"
#include "worldman.h"
#include "smooth.h"
#include "editscreen.h"
#include "selectwin.h"
#include "isometric utils.h"
#include "structure wrap.h"
#include "Isometric Utils.h"
#include "Structure Wrap.h"
#include "Exit Grids.h"
#include "Editor Undo.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BuildDefines.h"
#include "builddefines.h"
#ifdef JA2EDITOR
#ifndef __SMOOTH_H
+2 -17
View File
@@ -14,7 +14,6 @@ set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/jascreens.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Language Defines.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Loading Screen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp"
@@ -28,25 +27,11 @@ set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SCREENS.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Screens.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Sys Globals.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TimeLogging.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp"
${CMAKE_CURRENT_SOURCE_DIR}/Res/ja2.rc
PARENT_SCOPE)
set(Ja2_Libraries
"${CMAKE_SOURCE_DIR}/libexpatMT.lib"
"Dbghelp.lib"
Lua
"${CMAKE_SOURCE_DIR}/lua51.lib"
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
"Winmm.lib"
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
"${CMAKE_SOURCE_DIR}/binkw32.lib"
bfVFS
"ws2_32.lib"
Multiplayer
PARENT_SCOPE)
+1 -2
View File
@@ -1,7 +1,6 @@
#ifndef _CHEATS__H_
#define _CHEATS__H_
#include "Language Defines.h"
extern UINT8 gubCheatLevel;
@@ -22,4 +21,4 @@ extern UINT8 gubCheatLevel;
#define RESET_CHEAT_LEVEL( ) ( gubCheatLevel = 0 )
#define ACTIVATE_CHEAT_LEVEL() ( gubCheatLevel = 6 )
#endif
#endif
+10 -12
View File
@@ -1,25 +1,23 @@
#include "Types.h"
#include "types.h"
#include "Credits.h"
#include "Language Defines.h"
#include "vsurface.h"
#include "mousesystem.h"
#include "Text.h"
#include "wordwrap.h"
#include "Video.h"
#include "render dirty.h"
#include "WordWrap.h"
#include "video.h"
#include "Render Dirty.h"
#include "local.h"
#include "utilities.h"
#include "Utilities.h"
#include "WCheck.h"
#include "screenids.h"
#include "Font Control.h"
#include "cursors.h"
#include "font.h"
#include "wordwrap.h"
#include "Cursors.h"
#include "Font.h"
#include "sysutil.h"
#include "Input.h"
#include "input.h"
#include "english.h"
#include "encrypted file.h"
#include "Random.h"
#include "Encrypted File.h"
#include "random.h"
//externals
extern HVSURFACE ghFrameBuffer;
+7 -11
View File
@@ -1,12 +1,12 @@
#include "sgp.h"
#include "screenids.h"
#include "Timer Control.h"
#include "sys globals.h"
#include "fade screen.h"
#include "Sys Globals.h"
#include "Fade Screen.h"
#include "sysutil.h"
#include "vobject_blitters.h"
#include "cursor control.h"
#include "music control.h"
#include "Cursor Control.h"
#include "Music Control.h"
#include "Render Dirty.h"
#include "gameloop.h"
@@ -681,13 +681,9 @@ BOOLEAN UpdateSaveBufferWithBackbuffer(void)
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
if(gbPixelDepth==16)
{
// BLIT HERE
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
UnLockVideoSurface(FRAME_BUFFER);
UnLockVideoSurface(guiSAVEBUFFER);
+1 -1
View File
@@ -37,4 +37,4 @@ BOOLEAN HandleFadeInCallback( );
void FadeInNextFrame( );
void FadeOutNextFrame( );
#endif
#endif
+24 -38
View File
@@ -1,41 +1,27 @@
#include "Types.h"
#include "FeaturesScreen.h"
#include "Video.h"
#include "Font Control.h"
#include "Game Clock.h"
#include "Text Input.h"
#include "WordWrap.h"
#include "SaveLoadScreen.h"
#include "Render Dirty.h"
#include "WordWrap.h"
#include "WCheck.h"
#include "Utilities.h"
#include "Debug.h"
#include "Sound Control.h"
#include "Ambient Control.h"
#include "Worlddat.h"
#include "Worlddef.h"
#include "GameSettings.h"
#include "Game Init.h"
#include "English.h"
#include "Overhead.h"
#include "Gap.h"
#include "Cursors.h"
#include "SysUtil.h"
#include "Exit Grids.h"
#include "Text.h"
#include "Interface Control.h"
#include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h"
#include "Map Information.h"
#include "Sys Globals.h"
#include "insurance.h"
#include "connect.h"
#include "WorldMan.h"
#include "Init.h"
#include "Game Events.h"
#include "types.h"
#include "FeaturesScreen.h"
#include "video.h"
#include "Font Control.h"
#include "Game Clock.h"
#include "Text Input.h"
#include "WordWrap.h"
#include "SaveLoadScreen.h"
#include "Render Dirty.h"
#include "WCheck.h"
#include "Utilities.h"
#include "Sound Control.h"
#include "Ambient Control.h"
#include "GameSettings.h"
#include "Game Init.h"
#include "english.h"
#include "Cursors.h"
#include "sysutil.h"
#include "Text.h"
#include "Interface Control.h"
#include "message.h"
#include "Multi Language Graphic Utils.h"
#include "connect.h"
#include "mainmenuscreen.h"
extern UINT32 guiDoneButton; // symbol already declared globally in AimArchives.cpp (jonathanl)
+25 -33
View File
@@ -1,38 +1,30 @@
#include "Types.h"
#include "GameInitOptionsScreen.h"
#include "GameSettings.h"
#include "Utilities.h"
#include "wCheck.h"
#include "Font Control.h"
#include "WordWrap.h"
#include "Render Dirty.h"
#include "Input.h"
#include "Options Screen.h"
#include "English.h"
#include "Sysutil.h"
#include "Fade Screen.h"
#include "Cursor Control.h"
#include "Music Control.h"
#include "cursors.h"
#include "Intro.h"
#include "Text.h"
#include "_Ja25EnglishText.h"
#include "Soldier Profile.h"
#include "gameloop.h"
#include "connect.h"
#include "saveloadscreen.h"
#ifdef JA2UB
#include "ub_config.h"
#endif
#include "types.h"
#include "GameInitOptionsScreen.h"
#include "GameSettings.h"
#include "Utilities.h"
#include "WCheck.h"
#include "Font Control.h"
#include "WordWrap.h"
#include "Render Dirty.h"
#include "input.h"
#include "Options Screen.h"
#include "english.h"
#include "sysutil.h"
#include "Fade Screen.h"
#include "Cursor Control.h"
#include "Music Control.h"
#include "Cursors.h"
#include "Intro.h"
#include "Text.h"
#include "_Ja25EnglishText.h"
#include "Soldier Profile.h"
#include "SaveLoadScreen.h"
#include <vfs/Core/vfs.h>
#include <vfs/Core/vfs_init.h>
#include <vfs/Tools/vfs_property_container.h>
#include <vfs/Core/vfs_os_functions.h>
#ifdef JA2UB
#include "ub_config.h"
// *********************************
// Unfinished Business: Initial Game Screen
@@ -1830,7 +1822,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1024x768)
if (iResolution >= _800x600 && iResolution < _1280x720)
maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize )
@@ -1850,7 +1842,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
btn->uiFlags|=(BUTTON_CLICKED_ON);
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1024x768)
if (iResolution >= _800x600 && iResolution < _1280x720 )
maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize )
+1 -1
View File
@@ -85,7 +85,7 @@ typedef struct
UINT8 usLevelModifierLowLimit;
UINT8 usLevelModifierHighLimit;
BOOLEAN bAllowUnrestrictedXPLevels;
BOOLEAN bQueenLosingControlOfSector;
UINT8 bQueenLosingControlOfSector;
BOOLEAN bBloodcatAmbush;
BOOLEAN bAirRaidLookForDive;
UINT32 iGetNumberOfTurnsPowerGenFanWillBeStoppedFor; //UB
+39 -40
View File
@@ -1,7 +1,7 @@
#include "Types.h"
#include "types.h"
#include "GameSettings.h"
#include "FileMan.h"
#include "String.h"
#include "string.h"
#include "Sound Control.h"
#include "SaveLoadScreen.h"
#include "Music Control.h"
@@ -9,20 +9,18 @@
#include "Overhead.h"
#include "GameVersion.h"
#include "LibraryDataBase.h"
#include "Debug.h"
#include "Language Defines.h"
#include "DEBUG.H"
#include "HelpScreen.h"
#include "INIReader.h"
#include "Shade Table Util.h"
#include "soldier profile type.h"
#include "Random.h"
#include "random.h"
#include "SaveLoadGame.h"
#include "sgp.h"
#include "screenids.h"
#include "Font Control.h"
#include "message.h"
#include "Campaign.h"
#include "meanwhile.h"
#include "Meanwhile.h"
#include "strategicmap.h"
#include "Queen Command.h"
#include "Game Clock.h"
@@ -37,7 +35,6 @@
#include "connect.h"
#include "sgp_logger.h"
#include "Map Information.h"
#include "GameInitOptionsScreen.h"
@@ -45,7 +42,7 @@
#include <vfs/Core/vfs_file_raii.h>
#include <vfs/Core/File/vfs_file.h>
#define GAME_SETTINGS_FILE "Ja2_Settings.INI"
#define GAME_SETTINGS_FILE "Ja2_Settings.ini"
#define FEATURE_FLAGS_FILE "Ja2_Features.ini"
@@ -157,7 +154,7 @@ BOOLEAN UsingInventoryCostsAPSystem()
return ( gGameExternalOptions.fInventoryCostsAP );
}
std::string StringToLower(std::string strToConvert)
static std::string StringToLower(std::string strToConvert)
{//change each element of the string to lower case
for(unsigned int i=0;i<strToConvert.length();i++)
{
@@ -186,7 +183,7 @@ BOOLEAN IsNIVModeValid(bool checkRes)
return isValid;
}
void UpdateFeatureFlags()
static void UpdateFeatureFlags()
{
// do we need to override some ini settings?
if (gGameSettings.fFeatures[FF_FEATURES_SCREEN])
@@ -280,23 +277,23 @@ BOOLEAN LoadGameSettings()
gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_BLOOD_N_GORE" , TRUE );
gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DONT_MOVE_MOUSE" , FALSE );
gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_OLD_SELECTION_METHOD" , FALSE );
gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALWAYS_SHOW_MOVEMENT_PATH" , FALSE );
gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALWAYS_SHOW_MOVEMENT_PATH" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_MISSES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MISSES" , FALSE );
gGameSettings.fOptions[TOPTION_RTCONFIRM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RTCONFIRM" , FALSE );
gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SLEEPWAKE_NOTIFICATION" , TRUE );
gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SLEEPWAKE_NOTIFICATION" , FALSE );
gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_METRIC_SYSTEM" , TRUE );
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_MERC_CASTS_LIGHT" , FALSE);
gGameSettings.fOptions[TOPTION_SMART_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SMART_CURSOR" , FALSE );
gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SNAP_CURSOR_TO_DOOR" , TRUE );
gGameSettings.fOptions[TOPTION_GLOW_ITEMS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GLOW_ITEMS" , TRUE );
gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_TREE_TOPS" , TRUE );
gGameSettings.fOptions[TOPTION_SMART_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_SMART_TREE_TOPS" , FALSE );
gGameSettings.fOptions[TOPTION_SMART_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_SMART_TREE_TOPS" , TRUE );
gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_WIREFRAME" , TRUE );
gGameSettings.fOptions[TOPTION_3D_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_3D_CURSOR" , FALSE );
gGameSettings.fOptions[TOPTION_CTH_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CTH_CURSOR" , TRUE );
gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_BURST_CURSOR" , TRUE );
gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_TAUNTS" , TRUE ); // changed from drop all - SANDRO
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_HIGH_ANGLE" , FALSE );
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_HIGH_ANGLE" , TRUE );
if (!is_networked)
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_REAL_TIME_SNEAK" , FALSE ); // Changed from aim levels restriction - SANDRO
@@ -306,7 +303,7 @@ BOOLEAN LoadGameSettings()
gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SPACE_SELECTS_NEXT_SQUAD" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ITEM_SHADOW" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_WEAPON_RANGE_IN_TILES" , TRUE );
gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACERS_FOR_SINGLE_FIRE" , FALSE );
gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACERS_FOR_SINGLE_FIRE" , TRUE );
gGameSettings.fOptions[TOPTION_RAIN_SOUND] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RAIN_SOUND" , TRUE );
if (!is_networked)
@@ -333,12 +330,12 @@ BOOLEAN LoadGameSettings()
else
gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] = FALSE;
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_START_AIM" , FALSE); // Start at max aiming level instead of default no aiming
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_START_AIM" , TRUE); // Start at max aiming level instead of default no aiming
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_PATHFINDING" , FALSE); // A* pathfinding
gGameSettings.fOptions[TOPTION_MERCENARY_FORMATIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_MERCENARY_FORMATIONS" , TRUE ); // Flugente: mercenary formations
gGameSettings.fOptions[TOPTION_MERCENARY_FORMATIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_MERCENARY_FORMATIONS" , FALSE ); // Flugente: mercenary formations
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ENEMY_LOCATION" , FALSE); // sevenfm: show locations of known enemies
gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_REPORT_MISS_MARGIN" , FALSE ); // HEADROCK HAM 4: Shot offset report
gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_LOGICAL_BODYTYPES" , FALSE );
gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_LOGICAL_BODYTYPES" , TRUE );
gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALT_MAP_COLOR" , FALSE ); // HEADROCK HAM 4: Strategic Map Colors
gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALTERNATE_BULLET_GRAPHICS" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MERC_RANKS" , FALSE );
@@ -358,13 +355,13 @@ BOOLEAN LoadGameSettings()
gGameSettings.fOptions[NUM_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_GAME_OPTIONS" , FALSE );
gGameSettings.fOptions[TOPTION_HIDE_BULLETS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_HIDE_BULLETS" , FALSE );
gGameSettings.fOptions[TOPTION_TRACKING_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACKING_MODE" , TRUE );
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , FALSE );
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , TRUE );
gGameSettings.fOptions[TOPTION_QUIET_TRAINING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_TRAINING" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE );
if (!is_networked)
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , FALSE );
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , TRUE );
else
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
@@ -777,17 +774,17 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_BLOOD_N_GORE ] = TRUE;
gGameSettings.fOptions[ TOPTION_DONT_MOVE_MOUSE ] = FALSE;
gGameSettings.fOptions[ TOPTION_OLD_SELECTION_METHOD ] = FALSE;
gGameSettings.fOptions[ TOPTION_ALWAYS_SHOW_MOVEMENT_PATH ] = FALSE;
gGameSettings.fOptions[ TOPTION_ALWAYS_SHOW_MOVEMENT_PATH ] = TRUE;
gGameSettings.fOptions[ TOPTION_SHOW_MISSES ] = FALSE;
gGameSettings.fOptions[ TOPTION_RTCONFIRM ] = FALSE;
gGameSettings.fOptions[ TOPTION_SLEEPWAKE_NOTIFICATION ] = TRUE;
gGameSettings.fOptions[ TOPTION_SLEEPWAKE_NOTIFICATION ] = FALSE;
gGameSettings.fOptions[ TOPTION_USE_METRIC_SYSTEM ] = TRUE;
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = FALSE;
gGameSettings.fOptions[ TOPTION_SMART_CURSOR ] = FALSE;
gGameSettings.fOptions[ TOPTION_SNAP_CURSOR_TO_DOOR ] = TRUE;
gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ] = TRUE;
gGameSettings.fOptions[ TOPTION_TOGGLE_TREE_TOPS ] = TRUE;
gGameSettings.fOptions[ TOPTION_SMART_TREE_TOPS ] = FALSE;
gGameSettings.fOptions[ TOPTION_SMART_TREE_TOPS ] = TRUE;
gGameSettings.fOptions[ TOPTION_TOGGLE_WIREFRAME ] = TRUE;
gGameSettings.fOptions[ TOPTION_3D_CURSOR ] = FALSE;
gGameSettings.fOptions[ TOPTION_CTH_CURSOR ] = TRUE;
@@ -795,14 +792,14 @@ void InitGameSettings()
//Madd:
gGameSettings.fOptions[ TOPTION_GL_BURST_CURSOR ] = TRUE;
gGameSettings.fOptions[ TOPTION_ALLOW_TAUNTS ] = TRUE; // changed - SANDRO
gGameSettings.fOptions[ TOPTION_GL_HIGH_ANGLE ] = FALSE;
gGameSettings.fOptions[ TOPTION_GL_HIGH_ANGLE ] = TRUE;
gGameSettings.fOptions[ TOPTION_ALLOW_REAL_TIME_SNEAK ] = FALSE; // changed - SANDRO
//lalien
gGameSettings.fOptions[ TOPTION_SPACE_SELECTS_NEXT_SQUAD ] = TRUE;
gGameSettings.fOptions[ TOPTION_SHOW_ITEM_SHADOW ] = TRUE;
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] = TRUE;
gGameSettings.fOptions[ TOPTION_TRACERS_FOR_SINGLE_FIRE ] = FALSE;
gGameSettings.fOptions[ TOPTION_TRACERS_FOR_SINGLE_FIRE ] = TRUE;
gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE;
gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE;
gGameSettings.fOptions[ TOPTION_ALLOW_SOLDIER_TOOLTIPS ] = TRUE;
@@ -828,14 +825,14 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_REPORT_MISS_MARGIN ] = FALSE;
// BIO
gGameSettings.fOptions[ TOPTION_USE_LOGICAL_BODYTYPES ] = FALSE;
gGameSettings.fOptions[ TOPTION_USE_LOGICAL_BODYTYPES ] = TRUE;
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = FALSE;
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = TRUE;
gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE;
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = FALSE;
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = TRUE;
gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies
@@ -847,7 +844,7 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_MERCENARY_FORMATIONS ] = FALSE; // Flugente: mercenary formations
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = FALSE; // sevenfm: show locations of known enemies
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = FALSE;
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = TRUE;
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = FALSE;
// arynn: Cheat/Debug Menu
@@ -1680,6 +1677,9 @@ void LoadGameExternalOptions()
//JMich.BackpackClimb
gGameExternalOptions.sBackpackWeightToClimb = iniReader.ReadInteger("Tactical Gameplay Settings", "MAX_BACKPACK_WEIGHT_TO_CLIMB", -1);
gGameExternalOptions.fUseGlobalBackpackSettings = iniReader.ReadBoolean("Tactical Gameplay Settings", "USE_GLOBAL_BACKPACK_SETTINGS", TRUE);
// Buscher
gGameExternalOptions.ubBackPackWeightFactorForAPPenalty = iniReader.ReadInteger("Tactical Gameplay Settings", "BACKPACK_WEIGHT_FACTOR", 50, 1, 250);
// sevenfm
gGameExternalOptions.fShowEnemyWeapon = iniReader.ReadBoolean("Tactical Gameplay Settings","SHOW_ENEMY_WEAPON", FALSE);
@@ -1999,6 +1999,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
gGameExternalOptions.fAlwaysFood = iniReader.ReadBoolean("Tactical Food Settings", "ALWAYS_FOOD", FALSE);
//################# Disease Settings ##################
gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE );
@@ -2098,9 +2099,6 @@ void LoadGameExternalOptions()
//################# Strategic Gameplay Settings ##################
// Allow enemy and militia Strategic Groups to reinforce one another for battles?
// silversurfer: Obsolete. This is now in DifficultySettings.xml and will be set during InitNewGame().
gGameExternalOptions.gfAllowReinforcements = TRUE;
// Allow reinforcements only between City sectors?
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE);
@@ -2602,7 +2600,7 @@ void LoadSkillTraitsExternalSettings()
gSkillTraitValues.ubNumberOfMajorTraitsAllowed = iniReader.ReadInteger( "Generic Traits Settings", "NUMBER_OF_MAJOR_TRAITS_ALLOWED", 3, 2, gSkillTraitValues.ubMaxNumberOfTraits - 1);
gSkillTraitValues.ubMaxNumberOfTraitsForIMP = iniReader.ReadInteger("Generic Traits Settings","MAX_NUMBER_OF_TRAITS_FOR_IMP", 3, 2, 30);
gSkillTraitValues.ubNumberOfMajorTraitsAllowedForIMP = iniReader.ReadInteger( "Generic Traits Settings", "NUMBER_OF_MAJOR_TRAITS_ALLOWED_FOR_IMP", 2, 2, min( gSkillTraitValues.ubNumberOfMajorTraitsAllowed, gSkillTraitValues.ubMaxNumberOfTraitsForIMP - 1 ) );
gSkillTraitValues.ubNumberOfMajorTraitsAllowedForIMP = iniReader.ReadInteger( "Generic Traits Settings", "NUMBER_OF_MAJOR_TRAITS_ALLOWED_FOR_IMP", 2, 2, min( gSkillTraitValues.ubNumberOfMajorTraitsAllowed, gSkillTraitValues.ubMaxNumberOfTraitsForIMP ) );
// Allow an exception in number of traits for Special Merc?
//gSkillTraitValues.fAllowSpecialMercTraitsException = iniReader.ReadBoolean("Generic Traits Settings","ALLOW_EXCEPTION_FOR_SPECIAL_MERC", TRUE);
@@ -2751,6 +2749,7 @@ void LoadSkillTraitsExternalSettings()
gSkillTraitValues.ubTERepairRobotPenaltyReduction = iniReader.ReadInteger("Technician","REPAIR_SPEED_ROBOT_PENALTY_REDUCTION", 30, 0, 100);
if (gSkillTraitValues.ubTETraitsNumToRepairRobot == 2) {gSkillTraitValues.ubTERepairRobotPenaltyReduction /= 2; }
gSkillTraitValues.fTETraitsCanRestoreItemThreshold = iniReader.ReadBoolean( "Technician", "MERCS_CAN_DO_ADVANCED_REPAIRS", FALSE );
gSkillTraitValues.ubTechLevelNeededForAdvancedRepair = iniReader.ReadInteger("Technician", "TECH_LEVEL_NEEDED_FOR_ADVANCED_REPAIR", 2, 1, 2);
// DOCTOR
gSkillTraitValues.ubDONumberTraitsNeededForSurgery = iniReader.ReadInteger("Doctor","NUMBER_OF_TRAITS_NEEDED_FOR_SURGERY", 1, 0, 2);
@@ -2895,7 +2894,7 @@ void LoadSkillTraitsExternalSettings()
gSkillTraitValues.fSNTSnitchLeadershipBonusModifer = iniReader.ReadFloat("Snitch","SNITCH_LEADERSHIP_BONUS_MODIFIER", 0.5, 0.0, 10.0);
gSkillTraitValues.bSNTSociableMercBonus = iniReader.ReadInteger("Snitch","SOCIABLE_MERC_BONUS", 10, -100, 100);
gSkillTraitValues.bSNTLonerMercBonus = iniReader.ReadInteger("Snitch","LONER_MERC_BONUS", -10, -100, 100);
gSkillTraitValues.bSNTSameAssignmentBonus = iniReader.ReadInteger("Snitch","LONER_MERC_BONUS", -20, -100, 100);
gSkillTraitValues.bSNTSameAssignmentBonus = iniReader.ReadInteger("Snitch","SAME_ASSIGNMENT_BONUS", -20, -100, 100);
gSkillTraitValues.bSNTMercOpinionAboutMercTreshold = iniReader.ReadInteger("Snitch","MERC_OPINION_ABOUT_MERC_TRESHOLD", -10, -25, 25);
gSkillTraitValues.ubSNTPassiveReputationGain = iniReader.ReadInteger("Snitch","PASSIVE_REPUTATION_GAIN", 3, 0, 100);
@@ -3611,10 +3610,10 @@ void LoadGameAPBPConstants()
APBPConstants[BP_CRAWL_ENERGYCOSTFACTOR] = iniReader.ReadInteger("BPConstants","BP_CRAWL_ENERGYCOSTFACTOR",4);
APBPConstants[BP_RADIO] = iniReader.ReadInteger("BPConstants","BP_RADIO",0);
APBPConstants[BP_USE_DETONATOR] = iniReader.ReadInteger("BPConstants","BP_USE_DETONATOR",0);
APBPConstants[BP_PER_AP_NO_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_NO_EFFORT",-50),-50, TRUE);
APBPConstants[BP_PER_AP_MIN_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_MIN_EFFORT",-25),-25, TRUE);
APBPConstants[BP_PER_AP_LT_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_LT_EFFORT",-12),-12, TRUE);
APBPConstants[BP_PER_AP_MOD_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_MOD_EFFORT",0),0, TRUE);
APBPConstants[BP_PER_AP_NO_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_NO_EFFORT",-50),-50, TRUE);
APBPConstants[BP_PER_AP_MIN_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_MIN_EFFORT",-25),-25, TRUE);
APBPConstants[BP_PER_AP_LT_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_LT_EFFORT",-12),-12, TRUE);
APBPConstants[BP_PER_AP_MOD_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_MOD_EFFORT",0),0, TRUE);
APBPConstants[BP_MOVEMENT_FLAT] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_FLAT",5);
APBPConstants[BP_MOVEMENT_GRASS] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_GRASS",10);
APBPConstants[BP_MOVEMENT_BUSH] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_BUSH",20);
@@ -3794,7 +3793,7 @@ void LoadCTHConstants()
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0);
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
+6 -1
View File
@@ -1,7 +1,7 @@
#ifndef _GAME_SETTINGS__H_
#define _GAME_SETTINGS__H_
#include "Types.h"
#include "types.h"
#include "Strategic Status.h"
#include "Morale.h"
#include "GameInitOptionsScreen.h"
@@ -506,6 +506,7 @@ typedef struct
FLOAT sFoodDecayModificator;
BOOLEAN fFoodEatingSounds;
BOOLEAN fAlwaysFood;
// Flugente: disease settings
BOOLEAN fDisease;
@@ -1360,6 +1361,9 @@ typedef struct
INT16 sBackpackWeightToClimb;
BOOLEAN fUseGlobalBackpackSettings;
// Buscher
UINT8 ubBackPackWeightFactorForAPPenalty;
// sevenfm: show enemy weapon above soldier in tactical
BOOLEAN fShowEnemyWeapon;
BOOLEAN fShowEnemyExtendedInfo;
@@ -2141,6 +2145,7 @@ typedef struct
UINT8 ubTERepairRobotPenaltyReduction;
UINT8 ubTETraitsNumToRepairRobot;
BOOLEAN fTETraitsCanRestoreItemThreshold;
UINT8 ubTechLevelNeededForAdvancedRepair; // if we have a high enough technician level, we can repair items above the normal threshold (1 for technician, 2 for engineer)
// DOCTOR
UINT8 ubDONumberTraitsNeededForSurgery;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Types.h"
#include "types.h"
#include "GameVersion.h"
//
+3 -1
View File
@@ -23,6 +23,8 @@ extern CHAR16 zBuildInformation[256];
// Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file
#define INCREASED_TEAMSIZES 186 // Asdow: SOLDIERTYPE ubID changed from UINT8 -> UINT16
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
#define GROWTH_MODIFIERS 184
#define REBELCOMMAND 183
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
@@ -105,7 +107,7 @@ extern CHAR16 zBuildInformation[256];
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
#define SAVE_GAME_VERSION GROWTH_MODIFIERS
#define SAVE_GAME_VERSION INCREASED_TEAMSIZES
//#define RUSSIANGOLD
#ifdef __cplusplus
+20 -25
View File
@@ -1,27 +1,23 @@
#include "sgp.h"
#include "sysutil.h"
#include "vobject_blitters.h"
#include "wcheck.h"
#include "cursors.h"
#include "font control.h"
#include "cursor control.h"
#include "render dirty.h"
#include "Text.h"
#include "Utilities.h"
#include "WordWrap.h"
#include "Font Control.h"
#include "text.h"
#include "HelpScreen.h"
#include "HelpScreenText.h"
#include "Line.h"
#include "Game Clock.h"
#include "GameSettings.h"
#include "laptop.h"
#include "Text Input.h"
#include "english.h"
#include "renderworld.h"
#include "Game Init.h"
#include "Overhead.h"
#include "sgp.h"
#include "sysutil.h"
#include "WCheck.h"
#include "Cursors.h"
#include "Font Control.h"
#include "Render Dirty.h"
#include "Text.h"
#include "Utilities.h"
#include "WordWrap.h"
#include "HelpScreen.h"
#include "HelpScreenText.h"
#include "line.h"
#include "Game Clock.h"
#include "GameSettings.h"
#include "laptop.h"
#include "Text Input.h"
#include "english.h"
#include "renderworld.h"
#include "Game Init.h"
#include "Overhead.h"
extern INT16 gsVIEWPORT_END_Y;
extern void PrintDate( void );
@@ -308,7 +304,6 @@ void SelectHelpScrollAreaCallBack( MOUSE_REGION * pRegion, INT32 iReason );
// region to mask the background
MOUSE_REGION gHelpScreenScrollAreaArrows;
void SelectHelpScrollAreaArrowsCallBack( MOUSE_REGION * pRegion, INT32 iReason );
//checkbox to toggle show help again toggle
+1 -1
View File
@@ -72,4 +72,4 @@ void NewScreenSoResetHelpScreen( );
INT8 HelpScreenDetermineWhichMapScreenHelpToShow();
#endif
#endif
+184 -276
View File
@@ -1,64 +1,54 @@
#include "builddefines.h"
#include <stdio.h>
#include "sgp.h"
#include "Gameloop.h"
#include "Screens.h"
#include "INIReader.h"
#include "vobject_blitters.h"
#include "renderworld.h"
#include "mousesystem.h"
#include "sysutil.h"
#include "worlddef.h"
#include "Animation Data.h"
#include "overhead.h"
#include "Font Control.h"
#include "Button System.h"
#include "Timer Control.h"
#include "Utilities.h"
#include "Radar Screen.h"
#include "Render Dirty.h"
#include "Sound Control.h"
#include "Event Pump.h"
#include "lighting.h"
#include "Cursor Control.h"
#include "music control.h"
#include "video.h"
#include "mapscreen.h"
#include "interface items.h"
#include "Maputility.h"
#include "strategic.h"
#include "dialogue control.h"
#include "Text.h"
#include "laptop.h"
#include "NPC.h"
#include "MercTextBox.h"
#include "tile cache.h"
#include "strategicmap.h"
#include "Map Information.h"
#include "laptop.h"
#include "Shade Table Util.h"
#include "Exit Grids.h"
#include "Summary Info.h"
#include "GameSettings.h"
#include "Game Init.h"
#include "Init.h"
#include "jascreens.h"
#include "XML.h"
#include "SaveLoadGame.h"
#include "weapons.h"
#include "Strategic Movement.h"
#include "Vehicles.h"
#include "Multilingual Text Code Generator.h"
#include "editscreen.h"
#include "Arms Dealer Init.h"
#include "builddefines.h"
#include <stdio.h>
#include "sgp.h"
#include "Screens.h"
#include "vobject_blitters.h"
#include "sysutil.h"
#include "worlddef.h"
#include "Animation Data.h"
#include "Overhead.h"
#include "Font Control.h"
#include <himage.h>
#include <vobject.h>
#include "Timer Control.h"
#include "Utilities.h"
#include "Render Dirty.h"
#include "Sound Control.h"
#include "lighting.h"
#include "Cursor Control.h"
#include "Music Control.h"
#include "video.h"
#include "maputility.h"
#include "strategic.h"
#include "Dialogue Control.h"
#include "Text.h"
#include "laptop.h"
#include "MercTextBox.h"
#include "Tile Cache.h"
#include "strategicmap.h"
#include "Map Information.h"
#include "Shade Table Util.h"
#include "Exit Grids.h"
#include "Summary Info.h"
#include "GameSettings.h"
#include "Game Init.h"
#include "Init.h"
#include "jascreens.h"
#include "XML.h"
#include "SaveLoadGame.h"
#include "Weapons.h"
#include "Strategic Movement.h"
#include "Vehicles.h"
#include "Multilingual Text Code Generator.h"
#include "editscreen.h"
#include "Arms Dealer Init.h"
#include "Map Screen Interface Bottom.h"
#include "MPXmlTeams.hpp"
#include "Strategic Mines LUA.h"
#include "UndergroundInit.h"
#include "lua_state.h"
#include "Interface.h"
#include "Strategic Town Loyalty.h"
#include "Soldier Profile.h"
#include "aim.h"
#include "mainmenuscreen.h"
#include "email.h"
@@ -70,13 +60,13 @@
#include "ub_config.h"
#include "Civ Quotes.h"
#include "LuaInitNPCs.h"
#include "BriefingRoom_Data.h"
#include "AimArchives.h"
#include "connect.h"
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes()
#include "Animation Data.h" // added by Flugente
#include <language.hpp>
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
@@ -95,20 +85,6 @@ extern BOOLEAN GetCDromDriveLetter( STR8 pString );
extern BOOLEAN gfUseConsecutiveQuickSaveSlots;
#endif
#if defined( GERMAN ) && !defined( _DEBUG )
//#define LASERLOCK_ENABLED
#endif
#ifdef LASERLOCK_ENABLED
int LASERLOK_Init( HINSTANCE hInstance );
int LASERLOK_Run();
int LASERLOK_Check();
BOOLEAN PrepareLaserLockSystem();
void HandleLaserLockResult( BOOLEAN fSuccess );
// int TestCall( int n);
#endif
extern HINSTANCE ghInstance;
@@ -134,40 +110,12 @@ static void AddLanguagePrefix(STR fileName, const STR language)
memmove( fileComponent, language, strlen( language) );
}
static const STR GetLanguagePrefix()
{
#ifdef ENGLISH
return "";
#endif
#ifdef GERMAN
return GERMAN_PREFIX;
#endif
#ifdef RUSSIAN
return RUSSIAN_PREFIX;
#endif
#ifdef DUTCH
return DUTCH_PREFIX;
#endif
#ifdef POLISH
return POLISH_PREFIX;
#endif
#ifdef FRENCH
return FRENCH_PREFIX;
#endif
#ifdef ITALIAN
return ITALIAN_PREFIX;
#endif
#ifdef CHINESE
return CHINESE_PREFIX;
#endif
}
static void AddLanguagePrefix(STR fileName)
{
AddLanguagePrefix( fileName, GetLanguagePrefix());
}
void ResetEmptyRPCFaceSlots()
static void ResetEmptyRPCFaceSlots()
{
//legion by jazz (load small faces from rpcs)
// reset empty slots with "-1"
@@ -254,7 +202,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, AMMOFILENAME);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
@@ -268,9 +216,9 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, AMMOFILENAME);
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
}
#else
} else {
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
#endif
}
// Lesh: added this, begin
strcpy(fileName, directoryName);
@@ -294,14 +242,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
}
#endif
}
//if(!WriteItemStats())
// return FALSE;
@@ -366,14 +314,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat( fileName, DISEASEFILENAME );
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
}
#endif
}
strcpy(fileName, directoryName);
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
@@ -411,14 +359,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LOADSCREENHINTSFILENAME);
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
}
#endif
}
strcpy(fileName, directoryName);
strcat(fileName, ARMOURSFILENAME);
@@ -438,22 +386,24 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if (isMultiplayer == false)
{
using namespace LogicalBodyTypes;
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME), LBT_LAYERSFILENAME);
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME), LBT_PALETTESFILENAME);
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME), LBT_ANIMSURFACESFILENAME);
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME), LBT_FILTERSFILENAME);
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME), LBT_BODYTYPESFILENAME);
CHAR8 errorBuf[512]{"Failed loading LogicalBodyTypes external data!"};
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME, errorBuf), errorBuf);
}
}
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
}
#endif
}
// THE_BOB : added for pocket popup definitions
LBEPocketPopup.clear();
@@ -461,7 +411,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if (FileExists(fileName))
@@ -476,10 +426,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
}
#else
} else {
// WANNE: Load english file
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
#endif
}
#ifdef JA2UB
@@ -495,14 +445,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, MERCSTARTINGGEARFILENAME);
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
}
#endif
}
#endif
@@ -519,14 +469,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, ATTACHMENTSLOTSFILENAME);
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
}
#endif
}
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls
strcpy(fileName, directoryName);
@@ -700,14 +650,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, CITYTABLEFILENAME);
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
}
#endif
}
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
// function BOOLEAN InitStrategicMovementCosts();
@@ -758,14 +708,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
}
#endif
}
strcpy(fileName, directoryName);
strcat(fileName, DELIVERYMETHODSFILENAME);
@@ -778,14 +728,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
}
#endif
}
// HEADROCK HAM 3.4: Read in facility locations
strcpy(fileName, directoryName);
@@ -799,14 +749,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
}
#endif
}
// HEADROCK HAM 5: Read in Coolness by Sector
strcpy(fileName, directoryName);
@@ -828,7 +778,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
@@ -836,7 +786,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if(!ReadInMercProfiles(fileName,TRUE))
return FALSE;
}
#endif
}
}
strcpy(fileName, directoryName);
@@ -854,14 +804,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
}
#endif
}
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
strcpy(fileName, directoryName);
@@ -924,14 +874,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
}
#endif
}
}
@@ -943,14 +893,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
}
#endif
}
}
@@ -960,14 +910,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
}
#endif
}
if (gGameExternalOptions.fEnemyRank == TRUE)
{
@@ -977,14 +927,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
}
#endif
}
}
// Flugente: backgrounds
@@ -993,14 +943,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
}
#endif
}
// Flugente: individual militia
strcpy( fileName, directoryName );
@@ -1014,14 +964,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
}
#endif
}
// WANNE: Only in a singleplayer game...
// Externalised taunts
@@ -1042,14 +992,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
}
#endif
}
while( GetFileNext(&FileInfo) )
{
strcpy(fileName, directoryName);
@@ -1057,14 +1007,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
}
#endif
}
}
GetFileClose(&FileInfo);
}
@@ -1076,14 +1026,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
}
#endif
}
// IMP Portraits List by Jazz
strcpy(fileName, directoryName);
@@ -1091,14 +1041,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
}
#endif
}
LoadIMPPortraitsTEMP( );
@@ -1183,14 +1133,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
//WriteFaceGear();
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
}
#endif
}
UINT32 i;
for(i=0; i<NUM_PROFILES; i++)
{
@@ -1204,14 +1154,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
}
#endif
}
//Main Menu by Jazz
strcpy(fileName, directoryName);
@@ -1224,7 +1174,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
@@ -1232,42 +1182,63 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if(!ReadInActionItems(fileName,TRUE))
return FALSE;
}
#endif
}
if ( ReadXMLEmail == TRUE )
{
// Externalized emails
strcpy(fileName, directoryName);
strcat(fileName, EMAILSFILENAME);
// Only load external emails if we find the file
if ( FileExists(fileName) )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInExternalizedEmails(fileName, FALSE), EMAILSFILENAME);
if ( g_lang != i18n::Lang::en )
{
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
if ( !ReadInExternalizedEmails(fileName, TRUE) )
return FALSE;
}
}
}
if ( ReadXMLEmail == TRUE )
{
// EMAIL MERC AVAILABLE by Jazz
strcpy(fileName, directoryName);
strcat(fileName, EMAILMERCAVAILABLE);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName, FALSE), EMAILMERCAVAILABLE);
#ifndef ENGLISH
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
if ( g_lang != i18n::Lang::en )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInEmailMercAvailable(fileName,TRUE))
return FALSE;
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
if ( !ReadInEmailMercAvailable(fileName, TRUE) )
return FALSE;
}
}
#endif
// EMAIL MERC LEVEL UP by Jazz
strcpy(fileName, directoryName);
strcat(fileName, EMAILMERCLEVELUP);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName, FALSE), EMAILMERCLEVELUP);
#ifndef ENGLISH
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInEmailMercLevelUp(fileName,TRUE))
return FALSE;
if ( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
if ( !ReadInEmailMercLevelUp(fileName, TRUE) )
return FALSE;
}
}
#endif
}
/*
// EMAIL OTHER by Jazz
strcpy(fileName, directoryName);
@@ -1275,16 +1246,18 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
#ifndef ENGLISH
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInEmailOther(fileName,TRUE))
return FALSE;
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInEmailOther(fileName,TRUE))
return FALSE;
}
}
#endif
*/
}
//new vehicles by Jazz
InitNewVehicles ();
@@ -1294,7 +1267,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
@@ -1302,9 +1275,9 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInNewVehicles(fileName,TRUE))
return FALSE;
}
#endif
}
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
@@ -1312,7 +1285,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
return FALSE;
}
#endif
}
#ifdef ENABLE_BRIEFINGROOM
strcpy(fileName, directoryName);
@@ -1320,14 +1293,14 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
}
#endif
}
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
@@ -1339,14 +1312,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
}
#endif
}
// Old AIM Archive
UINT8 p;
@@ -1360,14 +1333,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
}
#endif
}
UINT8 emptyslotsinarchives = 0;
for (p=0;p<NUM_PROFILES;p++)
{
@@ -1417,14 +1390,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
#ifndef ENGLISH
if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
}
#endif
}
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
g_luaUnderground.LoadScript(GetLanguagePrefix());
@@ -1437,11 +1410,7 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
UINT32 InitializeJA2(void)
{
#ifdef LASERLOCK_ENABLED
HandleLaserLockResult( PrepareLaserLockSystem() );
#endif
HandleJA2CDCheck( );
gfWorldLoaded = FALSE;
@@ -1471,6 +1440,9 @@ UINT32 InitializeJA2(void)
//gsRenderCenterX = 805;
//gsRenderCenterY = 805;
// Init data
InitializeSystemVideoObjects( );
// Init animation system
if ( !InitAnimationSystem( ) )
{
@@ -1494,6 +1466,10 @@ UINT32 InitializeJA2(void)
return( ERROR_SCREEN );
}
// InitRadarScreenCoords() depend on Mapscreen Interface Bottom coordinates -> need to initiate them first
// before calling InitTacticalEngine()
InitMapScreenInterfaceBottomCoords();
// Init tactical engine
if ( !InitTacticalEngine( ) )
{
@@ -1697,74 +1673,6 @@ void ShutdownJA2(void)
}
#ifdef LASERLOCK_ENABLED
BOOLEAN PrepareLaserLockSystem()
{
INT32 iInitRetVal=0;
INT32 iRunRetVal=0;
INT32 iCheckRetVal=0;
CHAR8 zDirectory[512];
CHAR8 zCdLocation[ SGPFILENAME_LEN ];
CHAR8 zCdFile[ SGPFILENAME_LEN ];
//Get the "current" file directory
GetFileManCurrentDirectory( zDirectory );
if( GetCDromDriveLetter( zCdLocation ) )
{
// OK, build filename
sprintf( zCdFile, "%s%s", zCdLocation, "Data" );
}
else
{
goto FAILED_LASERLOK;
}
//Go back to the root directory
SetFileManCurrentDirectory( zCdFile );
//Init the laser lock system
iInitRetVal = LASERLOK_Init( ghInstance );
if( iInitRetVal != 0 )
goto FAILED_LASERLOK;
//makes the verification of the laserlok system
iRunRetVal = LASERLOK_Run();
if( iRunRetVal != 0 )
goto FAILED_LASERLOK;
//checks the result of the laserlok run function
iCheckRetVal = LASERLOK_Check();
if( iCheckRetVal != 0 )
goto FAILED_LASERLOK;
//Restore back to the proper directory
SetFileManCurrentDirectory( zDirectory );
return( TRUE );
FAILED_LASERLOK:
//Restore back to the proper directory
SetFileManCurrentDirectory( zDirectory );
return( FALSE );
}
void HandleLaserLockResult( BOOLEAN fSuccess )
{
if( !fSuccess )
{
CHAR8 zString[512];
sprintf( zString, "%S", gzLateLocalizedString[56] );
// ShowCursor(TRUE);
// ShowCursor(TRUE);
ShutdownWithErrorBox( zString );
}
}
#endif
void SetupMaxActionPointsAnimation()
{
gubMaxActionPoints[REGMALE] = APBPConstants[AP_MAXIMUM];
-1
View File
@@ -7,7 +7,6 @@
#include "LogicalBodyTypes/SurfaceDB.h"
#include "LogicalBodyTypes/FilterDB.h"
#include "LogicalBodyTypes/EnumeratorDB.h"
#include "LogicalBodyTypes/BodyTypeDB.h"
#include "LogicalBodyTypes/PaletteDB.h"
#include <iostream>
+17 -39
View File
@@ -1,41 +1,19 @@
#include "sgp.h"
#include "sysutil.h"
#include "vobject_blitters.h"
#include "font control.h"
#include "cursor control.h"
#include "render dirty.h"
#include "Text.h"
#include "Utilities.h"
#include "WordWrap.h"
#include "text.h"
#include "Line.h"
#include "Intro.h"
#include "Cinematics.h"
#include "Cinematics Bink.h"
#include "mainmenuscreen.h"
#include "Music Control.h"
#include "LibraryDataBase.h"
#include "english.h"
#include "soldier profile type.h"
#include "MessageBoxScreen.h"
#include "sgp_logger.h"
#include "Soldier Profile.h"
#include "Game Init.h"
#include "INIReader.h"
#include <vfs/Core/vfs.h>
#include "Luaglobal.h"
#ifdef JA2UB
#include "strategicmap.h"
#include "Map Screen Interface Map.h"
#include "Map Screen Interface.h"
#include "End Game.h"
#include "sgp.h"
#include "sysutil.h"
#include "Cursor Control.h"
#include "Render Dirty.h"
#include "Utilities.h"
#include "Intro.h"
#include "Cinematics.h"
#include "Cinematics Bink.h"
#endif
#include "mainmenuscreen.h"
#include "Music Control.h"
#include "english.h"
#include "sgp_logger.h"
#include "INIReader.h"
#include "Luaglobal.h"
#include "LuaInitNPCs.h"
#include "XML.h"
#include <language.hpp>
BOOLEAN Style_JA = TRUE;
extern INT8 Test = 0;
@@ -726,11 +704,11 @@ void DisplaySirtechSplashScreen()
* (2006-10-10, Sergeant_Kolja)
*/
#ifdef _DEBUG
# if defined(ENGLISH)
if( g_lang == i18n::Lang::en ) {
AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) );
# elif defined(GERMAN)
} else if( g_lang == i18n::Lang::de ) {
AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
# endif
}
#endif
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
return;
+3 -5
View File
@@ -12,13 +12,11 @@ void StopIntroVideo();
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
enum EIntroType
{
#ifdef JA2UB
INTRO_HELI_CRASH,
#endif
INTRO_BEGINNING, //set when viewing the intro at the begining of the game
INTRO_ENDING, //set when viewing the end game video.
INTRO_SPLASH,
// Unfinished Business
INTRO_HELI_CRASH
};
@@ -42,4 +40,4 @@ typedef struct
extern INTRO_NAMES_VALUES zVideoFile[255];
#endif
#endif
+6 -5
View File
@@ -1,10 +1,11 @@
#include "Types.h"
#include "types.h"
#include "vsurface.h"
#include "mainmenuscreen.h"
#include "Video.h"
#include "video.h"
#include "Timer Control.h"
#include "Multi Language Graphic Utils.h"
#include <stdio.h>
#include <language.hpp>
UINT32 guiSplashFrameFade = 10;
UINT32 guiSplashStartTime = 0;
@@ -13,10 +14,10 @@ extern HVSURFACE ghFrameBuffer;
//Simply create videosurface, load image, and draw it to the screen.
void InitJA2SplashScreen()
{
#ifdef ENGLISH
if( g_lang == i18n::Lang::en ) {
ClearMainMenu();
#else
} else {
UINT32 uiLogoID = 0;
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
@@ -69,7 +70,7 @@ void InitJA2SplashScreen()
GetVideoSurface( &hVSurface, uiLogoID );
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
DeleteVideoSurfaceFromIndex( uiLogoID );
#endif // ENGLISH
} // ENGLISH
InvalidateScreen();
RefreshScreen( NULL );
+1 -1
View File
@@ -6,4 +6,4 @@ void InitJA2SplashScreen();
extern UINT32 guiSplashFrameFade;
extern UINT32 guiSplashStartTime;
#endif
#endif
+1 -62
View File
@@ -1,72 +1,11 @@
#include "builddefines.h"
#include <wchar.h>
#include <stdio.h>
#include <string.h>
#include "Render Fun.h"
#include "stdlib.h"
#include "debug.h"
#include "MemMan.h"
#include "Overhead Types.h"
//#include "Soldier Control.h"
#include "Animation Cache.h"
#include "Animation Data.h"
#include "Animation Control.h"
#include <math.h>
#include "pathai.h"
#include "Random.h"
#include "Isometric Utils.h"
#include "renderworld.h"
#include "video.h"
#include "weapons.h"
#include "vobject_blitters.h"
#include "Handle UI.h"
#include "Event pump.h"
#include "ai.h"
#include "interface.h"
#include "lighting.h"
#include "faces.h"
#include "Soldier Profile.h"
#include "soldier macros.h"
#include "english.h"
#include "Squads.h"
#include <types.h>
#ifdef NETWORKED
#include "Networking.h"
#include "NetworkEvent.h"
#endif
#include "items.h"
#include "Soundman.h"
#include "utilities.h"
#include "Strategic.h"
#include "soldier tile.h"
#include "Smell.h"
#include "Keys.h"
#include "dialogue control.h"
#include "soldier functions.h"
#include "Exit Grids.h"
#include "Quests.h"
#include "message.h"
#include "SkillCheck.h"
#include "interface dialogue.h"
#include "GameSettings.h"
#include "ShopKeeper Interface.h"
#include "vehicles.h"
#include "strategicmap.h"
#include "morale.h"
#include "drugs and alcohol.h"
#include "SkillCheck.h"
#include "Map Information.h"
#include "Buildings.h"
#include "Text.h"
#include "Campaign Types.h"
#include "Strategic Status.h"
#include "civ quotes.h"
#include "Debug Control.h"
#ifdef JA2UB
#include "Ja25_Tactical.h"
#include "Ja25 Strategic Ai.h"
INT16 JA2_5_START_SECTOR_X;
INT16 JA2_5_START_SECTOR_Y;
+1 -6
View File
@@ -1,15 +1,10 @@
#ifndef JA25UPDATE__C_
#define JA25UPDATE__C_
#include "Types.h"
#include "types.h"
#ifdef JA2UB
//Used in the editor to compensate for the 2_<map name>
#define JA25_EXP_MAP_NAME_PREFIX L""
#define JA25_EXP_MAP_NAME_SIZE_OFFSET 0
//The starting sector of the Expanion pack
extern INT16 JA2_5_START_SECTOR_X;
extern INT16 JA2_5_START_SECTOR_Y;
-21
View File
@@ -1,21 +0,0 @@
#include "Language Defines.h"
#if defined(ENGLISH)
# pragma message(" (Language set to ENGLISH, You'll need english CDs)")
#elif defined(GERMAN)
# pragma message(" (Language set to GERMAN, You'll need Topware/german CDs)")
#elif defined(RUSSIAN)
# pragma message(" (Language set to RUSSIAN, You'll need russian CDs)")
#elif defined(DUTCH)
# pragma message(" (Language set to DUTCH, You'll need dutch CDs)")
#elif defined(POLISH)
# pragma message(" (Language set to POLISH, You'll need polish CDs)")
#elif defined(FRENCH)
# pragma message(" (Language set to FRENCH, You'll need french CDs)")
#elif defined(ITALIAN)
# pragma message(" (Language set to ITALIAN, You'll need italian CDs)")
#elif defined(CHINESE)
# pragma message(" (Language set to CHINESE, You'll need chinese CDs)")
#else
# error "At least You have to specify a Language somewhere. See comments above."
#endif
-119
View File
@@ -1,119 +0,0 @@
#ifndef __LANGUAGE_DEFINES_H
#define __LANGUAGE_DEFINES_H
#pragma once
/* ============================================================================
* ONLY ONE OF THESE LANGUAGES CAN BE DEFINED AT A TIME!
* BUT now You can define it _here_ by uncommenting one _or_ (better):
* You can comment them all out and then set it _global_ in "Preprocessor
* options" (do it for ALL projects in the workspace and both debug & release)
* _or_
* give it do Your MAKEFILE, f.i. make ENGLISH, but keep in mind that some
* weird make tools will require 'make ENGLISH=1' instead
*
* using one of the two later methods will keep this SVN file unchanged for the
* future, only Your private project files (workspace/solution) will differ
* from the SVN stuff.
* (2006-10-10, Sergeant_Kolja)
*/
/* The recommend approach for VS2010 multi-language builds is to use the command line or the ja2.props file.
By default the language is ENGLISH and the Language Prefix is EN.
There are 3 ways you can build the JA2 1.13 executable file:
// -------------------------------------------------------
// 1. Using the command line
// -------------------------------------------------------
For example, where msbuild is located in %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ if not on your path
msbuild.exe /p:Configuration=Release ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=PL /p:JA2Language=POLISH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=RU /p:JA2Language=RUSSIAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=NL /p:JA2Language=DUTCH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=FR /p:JA2Language=FRENCH ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=IT /p:JA2Language=ITALIAN ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=CN /p:JA2Language=CHINESE ja2_VS2010.sln
Note: If you want to build "Unfinished Business" version, just append the /p:JA2Config=JA2UB in the command line
msbuild.exe /p:Configuration=Release /p:JA2Config=JA2UB ja2_VS2010.sln
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB ja2_VS2010.sln
Note2: You can also specify the target output name with the parameter /p:TargetName
msbuild.exe /p:Configuration=Release /p:JA2LangPrefix=DE /p:JA2Language=GERMAN /p:JA2Config=JA2UB /p:TargetName="JA2UB_113" ja2_VS2010.sln
// --------------------------------------------------------
// 2. Editing the ja2.props file and then build in VS 2010
// -------------------------------------------------------
1. Open the "ja2.props" file in a text editor and set the <BuildMacro> tags to your likeing.
For example: If you want to build Russian Version (normal JA2, not UB) then set the following:
<BuildMacro Include="JA2Config">
<Value></Value>
</BuildMacro>
<BuildMacro Include="JA2LangPrefix">
<Value>RU</Value>
</BuildMacro>
<BuildMacro Include="JA2Language">
<Value>RUSSIAN</Value>
</BuildMacro>
2. Save the file
3. Build the project in Visual Studio 2010
// --------------------------------------------------------
// 3. The "old" way for building the executable
// -------------------------------------------------------
1. Enable the "#undef ENGLISH" define below, so English will not be used anymore
2. Set the desired language below
3. If you want to build "Unfinished Business" version, enable "#define JA2UB" and "#define JA2UBMAPS" in builddefines.h"
4. Build the executable in VS 2005 / 2008 / 2010
5. The output will be placed in the "Build\bin\" folder
*/
// Only enable this "undef", if you use the 3. way of building the executable!
#undef ENGLISH
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
/* please set one manually here (by uncommenting) if not willingly to set Workspace wide */
#define ENGLISH
//#define GERMAN
//#define RUSSIAN
//#define DUTCH
//#define FRENCH
//#define ITALIAN
//#define POLISH
// INFO: For Chinese 1.13 version, you also have to set USE_WINFONTS = 1 in ja2.ini inside your JA2 installation directory!
//#define CHINESE
#endif
//**ddd direct link libraries
#pragma comment (lib, "user32.lib")
#pragma comment (lib, "gdi32.lib")
#pragma comment (lib, "advapi32.lib")
#pragma comment (lib, "shell32.lib")
/* ====================================================================
* Regardless of if we did it Workspace wide or by uncommenting above,
* HERE we must see, what language was selected. If one, we
*/
#if !defined(ENGLISH) && !defined(GERMAN) && !defined(RUSSIAN) && !defined(DUTCH) && !defined(POLISH) && !defined(FRENCH) && !defined(ITALIAN) && !defined(CHINESE)
# error "At least You have to specify a Language somewhere. See comments above."
#endif
//if the language represents words as single chars
/*#ifdef TAIWAN
#define SINGLE_CHAR_WORDS
#endif*/
#endif
+6 -7
View File
@@ -4,12 +4,12 @@
#include "Campaign Types.h"
#include "Game Clock.h"
#include "GameSettings.h"
#include "Random.h"
#include "Debug.h"
#include "random.h"
#include "DEBUG.H"
#include "local.h"
#include "Font Control.h"
#include "font.h"
#include "render dirty.h"
#include "Font.h"
#include "Render Dirty.h"
#include "Strategic Movement.h"
#include "UndergroundInit.h"
#include <string>
@@ -19,7 +19,6 @@ extern HVSURFACE ghFrameBuffer;
extern BOOLEAN gfSchedulesHosed;
#ifdef JA2UB
#include "Ja25_Tactical.h"
#include "Ja25 Strategic Ai.h"
#endif
UINT8 gubLastLoadingScreenID = LOADINGSCREEN_NOTHING;
@@ -344,7 +343,7 @@ static void BuildLoadscreenFilename(std::string& dst, const char* path, int reso
dst.append(".sti");
}
std::string GetResolutionSuffix(SCREEN_RESOLUTION resolution)
static std::string GetResolutionSuffix(SCREEN_RESOLUTION resolution)
{
switch (resolution)
{
@@ -376,7 +375,7 @@ std::string GetResolutionSuffix(SCREEN_RESOLUTION resolution)
}
}
std::string FindBestFittingLoadscreenFilename(const std::string& baseName, SCREEN_RESOLUTION resolution)
static std::string FindBestFittingLoadscreenFilename(const std::string& baseName, SCREEN_RESOLUTION resolution)
{
for (SCREEN_RESOLUTION res = resolution; res <= _2560x1600; res = (SCREEN_RESOLUTION)(res + 1))
{
+21 -22
View File
@@ -1,26 +1,25 @@
#include "sgp.h"
#include "screenids.h"
#include "Timer Control.h"
#include "fade screen.h"
#include "sysutil.h"
#include "vobject_blitters.h"
#include "MercTextBox.h"
#include "cursors.h"
#include "font control.h"
#include "Map Screen Interface.h"
#include "renderworld.h"
#include "gameloop.h"
#include "english.h"
#include "GameSettings.h"
#include "cursor control.h"
#include "laptop.h"
#include "text.h"
#include "Text Input.h"
#include "overhead map.h"
#include "MPChatScreen.h"
#include "WordWrap.h"
#include "sgp.h"
#include "screenids.h"
#include "Timer Control.h"
#include "Fade Screen.h"
#include "sysutil.h"
#include "vobject_blitters.h"
#include "MercTextBox.h"
#include "Cursors.h"
#include "Font Control.h"
#include "Map Screen Interface.h"
#include "renderworld.h"
#include "gameloop.h"
#include "english.h"
#include "GameSettings.h"
#include "Cursor Control.h"
#include "Text.h"
#include "Text Input.h"
#include "overhead map.h"
#include "MPChatScreen.h"
#include "WordWrap.h"
#include "message.h"
#include "utilities.h"
#include "Utilities.h"
#include "connect.h"
#define CHATBOX_WIDTH 310 // 350 is the max size, the PrepareMercPopupBox will add the X_MARGIN to both sides
+1 -1
View File
@@ -26,4 +26,4 @@ extern BOOLEAN gfInChatBox;
INT32 DoChatBox( bool bIncludeChatLog, const STR16 zString, UINT32 uiExitScreen, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
void ChatLogMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ...);
#endif
#endif
+8 -8
View File
@@ -1,19 +1,19 @@
#include "Types.h"
#include "types.h"
#include "MPConnectScreen.h"
#include "GameSettings.h"
#include "Utilities.h"
#include "wCheck.h"
#include "WCheck.h"
#include "Font Control.h"
#include "WordWrap.h"
#include "Render Dirty.h"
#include "Input.h"
#include "input.h"
#include "Options Screen.h"
#include "English.h"
#include "Sysutil.h"
#include "english.h"
#include "sysutil.h"
#include "Fade Screen.h"
#include "Cursor Control.h"
#include "Music Control.h"
#include "cursors.h"
#include "Cursors.h"
#include "Text.h"
#include "Text Input.h"
#include "Soldier Profile.h"
@@ -25,8 +25,8 @@
#include "connect.h"
#include "network.h" // for client name
#include "message.h"
#include "init.h"
#include "xml.h"
#include "Init.h"
#include "XML.h"
////////////////////////////////////////////
+1 -1
View File
@@ -11,4 +11,4 @@ void SetConnectScreenHeadingA( const char* cmsg );
void SetConnectScreenSubMessageW( STR16 cmsg );
void SetConnectScreenSubMessageA( const char* cmsg );
#endif
#endif
+9 -9
View File
@@ -1,18 +1,18 @@
#include "Types.h"
#include "types.h"
#include "MPHostScreen.h"
#include "GameSettings.h"
#include "Utilities.h"
#include "wCheck.h"
#include "WCheck.h"
#include "Font Control.h"
#include "WordWrap.h"
#include "Render Dirty.h"
#include "Input.h"
#include "input.h"
#include "Options Screen.h"
#include "English.h"
#include "Sysutil.h"
#include "english.h"
#include "sysutil.h"
#include "Fade Screen.h"
#include "Cursor Control.h"
#include "cursors.h"
#include "Cursors.h"
#include "Intro.h"
#include "Text.h"
#include "Text Input.h"
@@ -22,7 +22,7 @@
#include "gameloop.h"
#include "connect.h"
#include "network.h"
#include "saveloadscreen.h"
#include "SaveLoadScreen.h"
#include "GameInitOptionsScreen.h"
@@ -31,9 +31,9 @@
#include <vfs/Tools/vfs_property_container.h>
#include <vfs/Core/vfs_os_functions.h>
#include "MPJoinScreen.h"
#include "MainMenuScreen.h"
#include "mainmenuscreen.h"
#include "Init.h"
#include "xml.h"
#include "XML.h"
////////////////////////////////////////////
//
+1 -1
View File
@@ -9,4 +9,4 @@ UINT32 MPHostScreenShutdown( void );
#endif
#endif
+9 -9
View File
@@ -1,18 +1,18 @@
#include "Types.h"
#include "types.h"
#include "MPJoinScreen.h"
#include "GameSettings.h"
#include "Utilities.h"
#include "wCheck.h"
#include "WCheck.h"
#include "Font Control.h"
#include "WordWrap.h"
#include "Render Dirty.h"
#include "Input.h"
#include "input.h"
#include "Options Screen.h"
#include "English.h"
#include "Sysutil.h"
#include "english.h"
#include "sysutil.h"
#include "Fade Screen.h"
#include "Cursor Control.h"
#include "cursors.h"
#include "Cursors.h"
#include "Text.h"
#include "Text Input.h"
#include "Soldier Profile.h"
@@ -20,15 +20,15 @@
#include "gameloop.h"
#include "connect.h"
#include "network.h" // for client name
#include "saveloadscreen.h"
#include "game init.h"
#include "SaveLoadScreen.h"
#include "Game Init.h"
#include <vfs/Core/vfs.h>
#include <vfs/Core/vfs_init.h>
#include <vfs/Tools/vfs_property_container.h>
#include <vfs/Core/vfs_os_functions.h>
#include "Random.h"
#include "random.h"
////////////////////////////////////////////
//
+6 -6
View File
@@ -1,19 +1,19 @@
#include "Types.h"
#include "types.h"
#include "MPScoreScreen.h"
#include "GameSettings.h"
#include "Utilities.h"
#include "wCheck.h"
#include "WCheck.h"
#include "Font Control.h"
#include "WordWrap.h"
#include "Render Dirty.h"
#include "Input.h"
#include "input.h"
#include "Options Screen.h"
#include "English.h"
#include "Sysutil.h"
#include "english.h"
#include "sysutil.h"
#include "Fade Screen.h"
#include "Cursor Control.h"
#include "Music Control.h"
#include "cursors.h"
#include "Cursors.h"
#include "Intro.h"
#include "Text.h"
#include "Text Input.h"
+1 -1
View File
@@ -9,4 +9,4 @@ UINT32 MPScoreScreenShutdown( void );
#endif
#endif
+24 -35
View File
@@ -1,38 +1,28 @@
#include "sgp.h"
#include "screenids.h"
#include "Timer Control.h"
#include "sysutil.h"
#include "vobject_blitters.h"
#include "MercTextBox.h"
#include "cursors.h"
#include "font control.h"
#include "mainmenuscreen.h"
#include "cursor control.h"
#include "render dirty.h"
#include "music control.h"
#include "GameSettings.h"
#include "SaveLoadScreen.h"
#include "SaveLoadGame.h"
#include "Options Screen.h"
#include "English.h"
#include "Gameloop.h"
#include "Game Init.h"
#include "Utilities.h"
#include "WordWrap.h"
#include "Font Control.h"
#include "text.h"
#include "Multi Language Graphic Utils.h"
#include "Encrypted File.h"
#include "ja2 splash.h"
#include "GameVersion.h"
#include "gamesettings.h"
#include "sgp.h"
#include "screenids.h"
#include "Timer Control.h"
#include "sysutil.h"
#include "Cursors.h"
#include "Font Control.h"
#include "mainmenuscreen.h"
#include "Cursor Control.h"
#include "Render Dirty.h"
#include "Music Control.h"
#include "GameSettings.h"
#include "SaveLoadScreen.h"
#include "SaveLoadGame.h"
#include "Options Screen.h"
#include "english.h"
#include "gameloop.h"
#include "Game Init.h"
#include "WordWrap.h"
#include "Text.h"
#include "Multi Language Graphic Utils.h"
#include "JA2 Splash.h"
#include "GameVersion.h"
#include "connect.h"
#include "strategic.h"
#include "strategic movement.h"
#include "overhead.h"
#include "init.h"
#include "xml.h"
#include "Strategic Movement.h"
#include <vfs/Core/vfs.h>
#include <vfs/Core/vfs_profile.h>
@@ -83,7 +73,6 @@ void MenuButtonCallback(GUI_BUTTON *btn, INT32 reason);
void HandleMainMenuKeyboardInput();
void HandleMainMenuInput();
void HandleMainMenuScreen();
void DisplayAssignmentText();
void ClearMainMenu();
void SelectMainMenuBackGroundRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SetMainMenuExitScreen( UINT32 uiNewScreen );
@@ -428,7 +417,7 @@ void MenuButtonCallback(GUI_BUTTON *btn,INT32 reason)
}
}
void MenuButtonMoveCallback(GUI_BUTTON *btn,INT32 reason)
static void MenuButtonMoveCallback(GUI_BUTTON *btn,INT32 reason)
{
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
{

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