129 Commits
Author SHA1 Message Date
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 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 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
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
CptMoore 9df885a264 Fixed tagged releases #2 2025-04-09 20:33:32 +02: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
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
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
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
419 changed files with 4777 additions and 9953 deletions
+1 -2
View File
@@ -186,7 +186,6 @@ jobs:
merge-multiple: true merge-multiple: true
- name: Checkout Repo - name: Checkout Repo
if: github.ref == 'refs/heads/master'
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: source path: source
@@ -201,6 +200,7 @@ jobs:
git push --delete origin refs/tags/latest || true git push --delete origin refs/tags/latest || true
git tag latest git tag latest
git push --force origin refs/tags/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/* \ gh release create latest ../dist/* \
--generate-notes \ --generate-notes \
--title "Latest (unstable)" \ --title "Latest (unstable)" \
@@ -213,7 +213,6 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
working-directory: source working-directory: source
run: | run: |
exit 0
gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+12 -2
View File
@@ -54,12 +54,22 @@ jobs:
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
cat Ja2/GameVersion.cpp cat Ja2/GameVersion.cpp
- name: Turn on link-time optimization?
if: fromJSON(inputs.assemble)
shell: bash
run: |
set -eux
echo "
LTO=ON
" >> $GITHUB_ENV
- name: Prepare build properties - name: Prepare build properties
shell: bash shell: bash
run: | run: |
set -eux set -eux
touch CMakeUserPresets.json touch CMakePresets.json
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]') JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]') JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
@@ -77,7 +87,7 @@ jobs:
arch: x86 arch: x86
- name: Prepare build - name: Prepare build
run: | run: |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application" cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application" -DLTO_OPTION="$Env:LTO"
- name: Build - name: Build
run: | run: |
cmake --build build/ -- -v cmake --build build/ -- -v
+1 -1
View File
@@ -6,6 +6,6 @@
/.vs/ /.vs/
/build/ /build/
/out/ /out/
/CMakePresets.json
/CMakeSettings.json /CMakeSettings.json
/CMakeUserPresets.json
/lib/ /lib/
+109 -60
View File
@@ -9,10 +9,25 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) 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) option(ADDRESS_SANITIZER OFF)
if(ADDRESS_SANITIZER) if(ADDRESS_SANITIZER)
message(STATUS "AddressSanitizer ENABLED for non-Release builds") message(STATUS "AddressSanitizer ENABLED for non-Release builds")
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>) add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
endif()
if(MSVC)
add_compile_options("/wd4838")
endif() endif()
# whether we are using MSBuild as a generator # whether we are using MSBuild as a generator
@@ -23,7 +38,24 @@ set(usingMsBuild $<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") 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) 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}/Console"
"${CMAKE_SOURCE_DIR}/i18n/include"
)
# external libraries # external libraries
add_subdirectory("ext/libpng") add_subdirectory("ext/libpng")
@@ -34,32 +66,46 @@ target_link_libraries(bfVFS PRIVATE 7z)
# ja2export utility # ja2export utility
add_subdirectory("ext/export/src") add_subdirectory("ext/export/src")
# static libraries whose source files, header files or header files included # static libraries whose translation units don't rely on Application preprocessor definitions.
# by header files do not rely on Applications or Languages preprocessor definitions, add_subdirectory(lua)
# and therefore only need to be compiled once. Good.
add_subdirectory(Lua)
add_subdirectory(Multiplayer) add_subdirectory(Multiplayer)
add_subdirectory(wine)
# static libraries whose source files, header files or header files included set(Ja2_Libraries
# by header files rely on Application and Language preprocessor definitions, and "${CMAKE_SOURCE_DIR}/binkw32.lib"
# therefore need to be compiled multiple times. Very Bad. "${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 set(Ja2_Libs
TileEngine Console
TacticalAI Editor
Utils Ja2
Strategic Laptop
sgp ModularizedTacticalAI
Laptop sgp
Editor Strategic
Console Tactical
Tactical TacticalAI
ModularizedTacticalAI TileEngine
Utils
) )
foreach(lib IN LISTS Ja2_Libs) foreach(lib IN LISTS Ja2_Libs)
add_subdirectory(${lib}) add_subdirectory(${lib})
endforeach() 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 # simple function to validate Languages and Application choices
include(cmake/ValidateOptions.cmake) include(cmake/ValidateOptions.cmake)
@@ -74,47 +120,50 @@ ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "Applica
# preprocessor definitions for Debug build, per the legacy MSBuild # preprocessor definitions for Debug build, per the legacy MSBuild
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>) set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
# Due to widespread preprocessor definition abuse in the codebase, practically foreach(app IN LISTS ApplicationTargets)
# every library-language-executable combination is its own compilation target set(isEditor $<STREQUAL:${app},JA2MAPEDITOR>)
# TODO: refactor preprocessor usage onto, ideally, a single translation unit set(isUb $<STREQUAL:${app},JA2UB>)
foreach(lang IN LISTS LangTargets) set(isUbEditor $<STREQUAL:${app},JA2UBMAPEDITOR>)
foreach(exe IN LISTS ApplicationTargets) set(compilationFlags
set(Executable ${exe}_${lang}) $<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 foreach(lib IN LISTS Ja2_Libs)
add_executable(${Executable} WIN32) # library for an application, e.g. JA2UB_sgp
target_sources(${Executable} PRIVATE ${Ja2Src}) 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 foreach(lang IN LISTS LangTargets)
target_link_libraries(${Executable} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>) # executable for an application/language combination, e.g. JA2_ENGLISH.exe
target_link_options(${Executable} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>) 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, # language library for an application, e.g. JA2MAPEDITOR_ENGLISH_i18n
# with the appropriate preprocessor definitions set(language_library ${exe}_i18n)
foreach(lib IN LISTS Ja2_Libs) add_library(${language_library})
# syntactic sugar to hopefully make this more readable target_sources(${language_library} PRIVATE ${i18nSrc})
set(VeryBadLib ${Executable}_${lib}) target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags} ${lang})
set(isEditor $<STREQUAL:${exe},JA2MAPEDITOR>) target_link_libraries(${exe} PRIVATE ${language_library})
set(isUb $<STREQUAL:${exe},JA2UB>)
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
# static library for an app/lang combination, e.g. JA2_ENGLISH_sgp.lib # go through all game libraries again and link them to the app/language executable
add_library(${VeryBadLib}) foreach(lib IN LISTS Ja2_Libs)
target_sources(${VeryBadLib} PRIVATE ${${lib}Src}) target_link_libraries(${exe} PRIVATE ${app}_${lib})
endforeach()
endforeach()
target_compile_definitions(${VeryBadLib} PUBLIC # for SGP only
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,> target_link_libraries(${app}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
$<IF:${isUb},JA2UB;JA2UBMAPS,> target_link_libraries(${app}_sgp PRIVATE libpng)
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,> target_compile_definitions(${app}_sgp PRIVATE NO_ZLIB_COMPRESSION)
${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()
endforeach() endforeach()
+1 -1
View File
@@ -78,4 +78,4 @@ public:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // _COMBSTROUT_H_ #endif // _COMBSTROUT_H_
+1 -1
View File
@@ -106,4 +106,4 @@ public:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // _COMVARIANTOUT_H_ #endif // _COMVARIANTOUT_H_
+1 -1
View File
@@ -40,4 +40,4 @@ extern BOOLEAN gfCurrentSelectionWithRightButton;
#endif #endif
#endif #endif
+1 -1
View File
@@ -14,4 +14,4 @@ void ShowExitGrids();
void HideExitGrids(); void HideExitGrids();
#endif #endif
#endif #endif
+1 -1
View File
@@ -7,4 +7,4 @@
void CreateEditorTaskbarInternal(); void CreateEditorTaskbarInternal();
#endif #endif
#endif #endif
+1 -1
View File
@@ -67,4 +67,4 @@ extern UINT32 guiMercTempBuffer;
extern INT32 giEditMercImage[2]; extern INT32 giEditMercImage[2];
#endif #endif
#endif #endif
+2 -2
View File
@@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
item = &Item[i]; item = &Item[i];
//if( Item[i].fFlags & ITEM_NOT_EDITOR ) //if( Item[i].fFlags & ITEM_NOT_EDITOR )
// continue; // continue;
if(item->notineditor) if(ItemIsNotInEditor(i))
continue; continue;
if( i == SWITCH || i == ACTION_ITEM ) if( i == SWITCH || i == ACTION_ITEM )
{ {
@@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
continue; continue;
} }
item = &Item[usCounter]; item = &Item[usCounter];
if(item->notineditor) if(ItemIsNotInEditor(usCounter))
{ {
usCounter++; usCounter++;
continue; continue;
+9 -1
View File
@@ -173,7 +173,15 @@ void LoadSaveScreenEntry()
vfs::CVirtualProfile* prof = it.value(); vfs::CVirtualProfile* prof = it.value();
memset(&FileInfo, 0, sizeof(GETFILESTRUCT)); memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
strcpy(FileInfo.zFileName, "< "); 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, " >"); strcat(FileInfo.zFileName, " >");
FileInfo.zFileName[FILENAME_BUFLEN] = 0; FileInfo.zFileName[FILENAME_BUFLEN] = 0;
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY; FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
+1 -1
View File
@@ -1,7 +1,7 @@
#include "BuildDefines.h" #include "BuildDefines.h"
#include "Fileman.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 #ifdef JA2EDITOR
+34 -6
View File
@@ -403,14 +403,42 @@ void PlaceRoadMacroAtGridNo( INT32 iMapIndex, INT32 iMacroID )
while( gRoadMacros[ i ].sMacroID == iMacroID ) while( gRoadMacros[ i ].sMacroID == iMacroID )
{ {
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size // 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 sdY = gRoadMacros[ i ].sOffset / OLD_WORLD_COLS; INT32 sdX = gRoadMacros[ i ].sOffset - (sdY*OLD_WORLD_COLS);
INT32 sOffset = sdY*WORLD_COLS + sdX;
// 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 ); // Converted to 200x200 map
RemoveAllObjectsOfTypeRange( iMapIndex + sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES ); // [] [] [-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 ); GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
AddObjectToHead( iMapIndex + sOffset, usTileIndex ); AddObjectToHead( newGridNo, usTileIndex );
i++; i++;
} }
} }
+1 -1
View File
@@ -61,4 +61,4 @@ void InitializeRoadMacros();
#endif #endif
#endif #endif
+1 -1
View File
@@ -35,4 +35,4 @@ void GetSectorFromFileName(STR16 szFileName, INT16& sSectorX, INT16& sSectorY, I
void ResetCustomFileSectorSummary(void);//dnl ch30 150909 void ResetCustomFileSectorSummary(void);//dnl ch30 150909
#endif #endif
#endif #endif
+1 -1
View File
@@ -62,4 +62,4 @@ UINT16 GetHorizontalWallClass( INT32 iMapIndex );
BOOLEAN ValidDecalPlacement( INT32 iMapIndex ); BOOLEAN ValidDecalPlacement( INT32 iMapIndex );
#endif #endif
#endif #endif
+19 -5
View File
@@ -1,4 +1,4 @@
#include "builddefines.h" #include "builddefines.h"
#ifdef JA2EDITOR #ifdef JA2EDITOR
@@ -1069,10 +1069,7 @@ void ShowCurrentDrawingMode( void )
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on // Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
usFillColor = GenericButtonFillColors[0]; usFillColor = GenericButtonFillColors[0];
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES ); pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
if(gbPixelDepth==16) RectangleDraw( 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 );
else if(gbPixelDepth==8)
RectangleDraw8( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
UnLockVideoSurface( FRAME_BUFFER ); 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( ) ) if ( DoWindowSelection( ) )
{ {
fSelectionWindow = FALSE; fSelectionWindow = FALSE;
+60 -36
View File
@@ -29,6 +29,16 @@ extern BOOLEAN fDontUseRandom;
extern UINT16 GenericButtonFillColors[40]; 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; BOOLEAN gfRenderSquareArea = FALSE;
INT16 iStartClickX,iStartClickY; INT16 iStartClickX,iStartClickY;
INT16 iEndClickX,iEndClickY; INT16 iEndClickX,iEndClickY;
@@ -40,7 +50,6 @@ INT32 iSelectWin,iCancelWin,iScrollUp,iScrollDown,iOkWin;
BOOLEAN fAllDone=FALSE; BOOLEAN fAllDone=FALSE;
BOOLEAN fButtonsPresent=FALSE; BOOLEAN fButtonsPresent=FALSE;
SGPPoint SelWinSpacing, SelWinStartPoint, SelWinEndPoint;
//These definitions help define the start and end of the various wall indices. //These definitions help define the start and end of the various wall indices.
//This needs to be maintained if the walls change. //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 ) 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; DisplaySpec *pDSpec;
UINT16 usNSpecs; UINT16 usNSpecs;
@@ -185,32 +218,33 @@ void CreateJA2SelectionWindow( INT16 sWhat )
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" ); iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.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); DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0, iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
BUTTON_USE_DEFAULT, 600, 0, BUTTON_USE_DEFAULT, selectWinWidth, 0,
40, 40, BUTTON_TOGGLE, 40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, OkClkCallback); DEFAULT_MOVE_CALLBACK, OkClkCallback);
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]); SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0, iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
BUTTON_USE_DEFAULT, 600, 40, BUTTON_USE_DEFAULT, selectWinWidth, 40,
40, 40, BUTTON_TOGGLE, 40, 40, BUTTON_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, CnclClkCallback); DEFAULT_MOVE_CALLBACK, CnclClkCallback);
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]); SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0, iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
BUTTON_USE_DEFAULT, 600, 80, BUTTON_USE_DEFAULT, selectWinWidth, 80,
40, 160, BUTTON_NO_TOGGLE, 40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, UpClkCallback); DEFAULT_MOVE_CALLBACK, UpClkCallback);
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]); SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0, iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
BUTTON_USE_DEFAULT, 600, 240, BUTTON_USE_DEFAULT, selectWinWidth, 240,
40, 160, BUTTON_NO_TOGGLE, 40, 160, BUTTON_NO_TOGGLE,
MSYS_PRIORITY_HIGH, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, DwnClkCallback); DEFAULT_MOVE_CALLBACK, DwnClkCallback);
@@ -218,18 +252,6 @@ void CreateJA2SelectionWindow( INT16 sWhat )
fButtonsPresent = TRUE; 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 ) switch( sWhat )
{ {
@@ -347,8 +369,8 @@ void CreateJA2SelectionWindow( INT16 sWhat )
return; return;
} }
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &SelWinStartPoint, &SelWinEndPoint, BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &gSelection.displayAreaStart , &gSelection.displayAreaEnd,
&SelWinSpacing, CLEAR_BACKGROUND); &gSelection.spacing, CLEAR_BACKGROUND);
} }
@@ -849,12 +871,14 @@ void RenderSelectionWindow( void )
return; return;
ColorFillVideoSurfaceArea(FRAME_BUFFER, ColorFillVideoSurfaceArea(FRAME_BUFFER,
0, 0, 600, 400, gSelection.window.iLeft, gSelection.window.iTop, gSelection.window.iRight, gSelection.window.iBottom,
GenericButtonFillColors[0]); GenericButtonFillColors[0]
);
DrawSelections( ); DrawSelections( );
MarkButtonsDirty(); MarkButtonsDirty();
RenderButtons( ); RenderButtons( );
// Draw selection rectangle
if ( gfRenderSquareArea ) if ( gfRenderSquareArea )
{ {
button = ButtonList[iSelectWin]; button = ButtonList[iSelectWin];
@@ -862,7 +886,7 @@ void RenderSelectionWindow( void )
return; return;
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) || 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; // iSX = (INT32)iStartClickX;
// iEX = (INT32)button->Area.MouseXPos; // iEX = (INT32)button->Area.MouseXPos;
@@ -870,7 +894,7 @@ void RenderSelectionWindow( void )
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY); // iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
iSX = iStartClickX; iSX = iStartClickX;
iSY = iStartClickY - iTopWinCutOff + SelWinStartPoint.iY; iSY = iStartClickY - iTopWinCutOff + gSelection.displayAreaStart.iY;
iEX = gusMouseXPos; iEX = gusMouseXPos;
iEY = gusMouseYPos; iEY = gusMouseYPos;
@@ -889,10 +913,10 @@ void RenderSelectionWindow( void )
iEY ^= iSY; iEY ^= iSY;
} }
iEX = min( iEX, 600 ); iEX = min( gSelection.displayAreaEnd.iX, iEX);
iSY = max( SelWinStartPoint.iY, iSY ); iSY = max( gSelection.displayAreaStart.iY, iSY );
iEY = min( 359, iEY ); iEY = min( gSelection.displayAreaEnd.iY, iEY );
iEY = max( SelWinStartPoint.iY, iEY ); iEY = max( gSelection.displayAreaStart.iY, iEY );
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0)); usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
usFillGreen += usDir; usFillGreen += usDir;
@@ -928,7 +952,7 @@ void SelWinClkCallback( GUI_BUTTON *button, INT32 reason )
return; return;
iClickX = button->Area.MouseXPos; 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) if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
{ {
@@ -1035,9 +1059,9 @@ void DisplaySelectionWindowGraphicalInformation()
UINT16 y; UINT16 y;
//Determine if there is a valid picture at cursor position. //Determine if there is a valid picture at cursor position.
//iRelX = gusMouseXPos; //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; pNode = pDispList;
fDone = FALSE; fDone = FALSE;
while( (pNode != NULL) && !fDone ) while( (pNode != NULL) && !fDone )
@@ -1470,10 +1494,10 @@ void DrawSelections( void )
{ {
SGPRect ClipRect, NewRect; SGPRect ClipRect, NewRect;
NewRect.iLeft = SelWinStartPoint.iX; NewRect.iLeft = gSelection.displayAreaStart.iX;
NewRect.iTop = SelWinStartPoint.iY; NewRect.iTop = gSelection.displayAreaStart.iY;
NewRect.iRight = SelWinEndPoint.iX; NewRect.iRight = gSelection.displayAreaEnd.iX;
NewRect.iBottom = SelWinEndPoint.iY; NewRect.iBottom = gSelection.displayAreaEnd.iY;
GetClippingRect(&ClipRect); GetClippingRect(&ClipRect);
SetClippingRect(&NewRect); SetClippingRect(&NewRect);
@@ -1483,7 +1507,7 @@ void DrawSelections( void )
SetObjectShade( gvoLargeFontType1, 0 ); SetObjectShade( gvoLargeFontType1, 0 );
// SetObjectShade( gvoLargeFont, 0 ); // SetObjectShade( gvoLargeFont, 0 );
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &SelWinStartPoint, CLEAR_BACKGROUND ); DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &gSelection.displayAreaStart, CLEAR_BACKGROUND );
SetObjectShade( gvoLargeFontType1, 4 ); SetObjectShade( gvoLargeFontType1, 4 );
+2 -17
View File
@@ -14,7 +14,6 @@ set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/jascreens.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}/Loading Screen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp"
@@ -28,25 +27,11 @@ set(Ja2Src
"${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.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}/Sys Globals.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TimeLogging.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.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) PARENT_SCOPE)
+1 -2
View File
@@ -1,7 +1,6 @@
#ifndef _CHEATS__H_ #ifndef _CHEATS__H_
#define _CHEATS__H_ #define _CHEATS__H_
#include "Language Defines.h"
extern UINT8 gubCheatLevel; extern UINT8 gubCheatLevel;
@@ -22,4 +21,4 @@ extern UINT8 gubCheatLevel;
#define RESET_CHEAT_LEVEL( ) ( gubCheatLevel = 0 ) #define RESET_CHEAT_LEVEL( ) ( gubCheatLevel = 0 )
#define ACTIVATE_CHEAT_LEVEL() ( gubCheatLevel = 6 ) #define ACTIVATE_CHEAT_LEVEL() ( gubCheatLevel = 6 )
#endif #endif
-1
View File
@@ -1,6 +1,5 @@
#include "Types.h" #include "Types.h"
#include "Credits.h" #include "Credits.h"
#include "Language Defines.h"
#include "vsurface.h" #include "vsurface.h"
#include "mousesystem.h" #include "mousesystem.h"
#include "Text.h" #include "Text.h"
+3 -7
View File
@@ -681,13 +681,9 @@ BOOLEAN UpdateSaveBufferWithBackbuffer(void)
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES); pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES); pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
if(gbPixelDepth==16) Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
{ (UINT16 *)pSrcBuf, uiSrcPitchBYTES,
// BLIT HERE 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(FRAME_BUFFER);
UnLockVideoSurface(guiSAVEBUFFER); UnLockVideoSurface(guiSAVEBUFFER);
+1 -1
View File
@@ -37,4 +37,4 @@ BOOLEAN HandleFadeInCallback( );
void FadeInNextFrame( ); void FadeInNextFrame( );
void FadeOutNextFrame( ); void FadeOutNextFrame( );
#endif #endif
-1
View File
@@ -26,7 +26,6 @@
#include "Text.h" #include "Text.h"
#include "Interface Control.h" #include "Interface Control.h"
#include "Message.h" #include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include "Map Information.h" #include "Map Information.h"
#include "Sys Globals.h" #include "Sys Globals.h"
+2 -2
View File
@@ -1830,7 +1830,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT ) if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{ {
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10; UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1024x768) if (iResolution >= _800x600 && iResolution < _1280x720)
maxSquadSize = GIO_SQUAD_SIZE_8; maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize ) if ( iCurrentSquadSize < maxSquadSize )
@@ -1850,7 +1850,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
btn->uiFlags|=(BUTTON_CLICKED_ON); btn->uiFlags|=(BUTTON_CLICKED_ON);
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10; UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1024x768) if (iResolution >= _800x600 && iResolution < _1280x720 )
maxSquadSize = GIO_SQUAD_SIZE_8; maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize ) if ( iCurrentSquadSize < maxSquadSize )
+3 -3
View File
@@ -10,7 +10,6 @@
#include "GameVersion.h" #include "GameVersion.h"
#include "LibraryDataBase.h" #include "LibraryDataBase.h"
#include "Debug.h" #include "Debug.h"
#include "Language Defines.h"
#include "HelpScreen.h" #include "HelpScreen.h"
#include "INIReader.h" #include "INIReader.h"
#include "Shade Table Util.h" #include "Shade Table Util.h"
@@ -45,7 +44,7 @@
#include <vfs/Core/vfs_file_raii.h> #include <vfs/Core/vfs_file_raii.h>
#include <vfs/Core/File/vfs_file.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" #define FEATURE_FLAGS_FILE "Ja2_Features.ini"
@@ -1999,6 +1998,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE); 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.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.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
gGameExternalOptions.fAlwaysFood = iniReader.ReadBoolean("Tactical Food Settings", "ALWAYS_FOOD", FALSE);
//################# Disease Settings ################## //################# Disease Settings ##################
gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE ); gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE );
@@ -3794,7 +3794,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_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_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_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_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_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); gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
+1
View File
@@ -506,6 +506,7 @@ typedef struct
FLOAT sFoodDecayModificator; FLOAT sFoodDecayModificator;
BOOLEAN fFoodEatingSounds; BOOLEAN fFoodEatingSounds;
BOOLEAN fAlwaysFood;
// Flugente: disease settings // Flugente: disease settings
BOOLEAN fDisease; BOOLEAN fDisease;
+2 -2
View File
@@ -22,7 +22,7 @@ extern CHAR16 zBuildInformation[256];
// //
// Keeps track of the saved game version. Increment the saved game version whenever // Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file // you will invalidate the saved game file
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
#define GROWTH_MODIFIERS 184 #define GROWTH_MODIFIERS 184
#define REBELCOMMAND 183 #define REBELCOMMAND 183
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us #define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
@@ -105,7 +105,7 @@ extern CHAR16 zBuildInformation[256];
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes #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 NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
#define SAVE_GAME_VERSION GROWTH_MODIFIERS #define SAVE_GAME_VERSION MERC_PROFILE_INSERTION_DATA
//#define RUSSIANGOLD //#define RUSSIANGOLD
#ifdef __cplusplus #ifdef __cplusplus
+1 -1
View File
@@ -72,4 +72,4 @@ void NewScreenSoResetHelpScreen( );
INT8 HelpScreenDetermineWhichMapScreenHelpToShow(); INT8 HelpScreenDetermineWhichMapScreenHelpToShow();
#endif #endif
+88 -109
View File
@@ -35,7 +35,6 @@
#include "tile cache.h" #include "tile cache.h"
#include "strategicmap.h" #include "strategicmap.h"
#include "Map Information.h" #include "Map Information.h"
#include "laptop.h"
#include "Shade Table Util.h" #include "Shade Table Util.h"
#include "Exit Grids.h" #include "Exit Grids.h"
#include "Summary Info.h" #include "Summary Info.h"
@@ -51,6 +50,7 @@
#include "Multilingual Text Code Generator.h" #include "Multilingual Text Code Generator.h"
#include "editscreen.h" #include "editscreen.h"
#include "Arms Dealer Init.h" #include "Arms Dealer Init.h"
#include "Map Screen Interface Bottom.h"
#include "MPXmlTeams.hpp" #include "MPXmlTeams.hpp"
#include "Strategic Mines LUA.h" #include "Strategic Mines LUA.h"
#include "UndergroundInit.h" #include "UndergroundInit.h"
@@ -76,7 +76,8 @@
#include "AimArchives.h" #include "AimArchives.h"
#include "connect.h" #include "connect.h"
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes() #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 APBPConstants[TOTAL_APBP_VALUES] = {0};
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08 extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
@@ -134,34 +135,6 @@ static void AddLanguagePrefix(STR fileName, const STR language)
memmove( fileComponent, language, strlen( 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) static void AddLanguagePrefix(STR fileName)
{ {
AddLanguagePrefix( fileName, GetLanguagePrefix()); AddLanguagePrefix( fileName, GetLanguagePrefix());
@@ -254,7 +227,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, AMMOFILENAME); strcat(fileName, AMMOFILENAME);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
@@ -268,9 +241,9 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, AMMOFILENAME); strcat(fileName, AMMOFILENAME);
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
} }
#else } else {
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME); SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
#endif }
// Lesh: added this, begin // Lesh: added this, begin
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -294,14 +267,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags // the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
} }
#endif }
//if(!WriteItemStats()) //if(!WriteItemStats())
// return FALSE; // return FALSE;
@@ -366,14 +339,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat( fileName, DISEASEFILENAME ); strcat( fileName, DISEASEFILENAME );
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME ); SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME); SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
} }
#endif }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME); strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
@@ -411,14 +384,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LOADSCREENHINTSFILENAME); strcat(fileName, LOADSCREENHINTSFILENAME);
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
} }
#endif }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, ARMOURSFILENAME); strcat(fileName, ARMOURSFILENAME);
@@ -438,22 +411,24 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if (isMultiplayer == false) if (isMultiplayer == false)
{ {
using namespace LogicalBodyTypes; using namespace LogicalBodyTypes;
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME), LBT_LAYERSFILENAME); CHAR8 errorBuf[512]{"Failed loading LogicalBodyTypes external data!"};
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(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME), LBT_FILTERSFILENAME); SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME, errorBuf), errorBuf);
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME), LBT_BODYTYPESFILENAME); 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); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
} }
#endif }
// THE_BOB : added for pocket popup definitions // THE_BOB : added for pocket popup definitions
LBEPocketPopup.clear(); LBEPocketPopup.clear();
@@ -461,7 +436,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LBEPOCKETPOPUPFILENAME); strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if (FileExists(fileName)) if (FileExists(fileName))
@@ -476,10 +451,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, LBEPOCKETPOPUPFILENAME); strcat(fileName, LBEPOCKETPOPUPFILENAME);
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
} }
#else } else {
// WANNE: Load english file // WANNE: Load english file
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME); SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
#endif }
#ifdef JA2UB #ifdef JA2UB
@@ -495,14 +470,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, MERCSTARTINGGEARFILENAME); strcat(fileName, MERCSTARTINGGEARFILENAME);
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
} }
#endif }
#endif #endif
@@ -519,14 +494,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, ATTACHMENTSLOTSFILENAME); strcat(fileName, ATTACHMENTSLOTSFILENAME);
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
} }
#endif }
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls // Flugente: created separate gun and item choices for different soldier classes - read in different xmls
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -700,14 +675,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, CITYTABLEFILENAME); strcat(fileName, CITYTABLEFILENAME);
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME); SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
} }
#endif }
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp, // Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
// function BOOLEAN InitStrategicMovementCosts(); // function BOOLEAN InitStrategicMovementCosts();
@@ -758,14 +733,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName); SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
} }
#endif }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, DELIVERYMETHODSFILENAME); strcat(fileName, DELIVERYMETHODSFILENAME);
@@ -778,14 +753,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
} }
#endif }
// HEADROCK HAM 3.4: Read in facility locations // HEADROCK HAM 3.4: Read in facility locations
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -799,14 +774,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName); SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
} }
#endif }
// HEADROCK HAM 5: Read in Coolness by Sector // HEADROCK HAM 5: Read in Coolness by Sector
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -828,7 +803,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -836,7 +811,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if(!ReadInMercProfiles(fileName,TRUE)) if(!ReadInMercProfiles(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
} }
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -854,14 +829,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
} }
#endif }
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data // HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -924,14 +899,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
} }
#endif }
} }
@@ -943,14 +918,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
} }
#endif }
} }
@@ -960,14 +935,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
} }
#endif }
if (gGameExternalOptions.fEnemyRank == TRUE) if (gGameExternalOptions.fEnemyRank == TRUE)
{ {
@@ -977,14 +952,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
} }
#endif }
} }
// Flugente: backgrounds // Flugente: backgrounds
@@ -993,14 +968,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME); SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
} }
#endif }
// Flugente: individual militia // Flugente: individual militia
strcpy( fileName, directoryName ); strcpy( fileName, directoryName );
@@ -1014,14 +989,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME); SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
} }
#endif }
// WANNE: Only in a singleplayer game... // WANNE: Only in a singleplayer game...
// Externalised taunts // Externalised taunts
@@ -1042,14 +1017,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, FileInfo.zFileName); strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
} }
#endif }
while( GetFileNext(&FileInfo) ) while( GetFileNext(&FileInfo) )
{ {
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1057,14 +1032,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
strcat(fileName, FileInfo.zFileName); strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
} }
#endif }
} }
GetFileClose(&FileInfo); GetFileClose(&FileInfo);
} }
@@ -1076,14 +1051,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME); SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
} }
#endif }
// IMP Portraits List by Jazz // IMP Portraits List by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1091,14 +1066,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
} }
#endif }
LoadIMPPortraitsTEMP( ); LoadIMPPortraitsTEMP( );
@@ -1183,14 +1158,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME); SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
//WriteFaceGear(); //WriteFaceGear();
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
} }
#endif }
UINT32 i; UINT32 i;
for(i=0; i<NUM_PROFILES; i++) for(i=0; i<NUM_PROFILES; i++)
{ {
@@ -1204,14 +1179,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY); SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
} }
#endif }
//Main Menu by Jazz //Main Menu by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1224,7 +1199,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME); SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1232,7 +1207,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
if(!ReadInActionItems(fileName,TRUE)) if(!ReadInActionItems(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
if ( ReadXMLEmail == TRUE ) if ( ReadXMLEmail == TRUE )
{ {
@@ -1242,7 +1217,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE); SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1250,7 +1225,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInEmailMercAvailable(fileName,TRUE)) if(!ReadInEmailMercAvailable(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
// EMAIL MERC LEVEL UP by Jazz // EMAIL MERC LEVEL UP by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1258,7 +1233,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP); SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1266,7 +1241,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInEmailMercLevelUp(fileName,TRUE)) if(!ReadInEmailMercLevelUp(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
} }
/* /*
// EMAIL OTHER by Jazz // EMAIL OTHER by Jazz
@@ -1275,7 +1250,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER); SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1283,7 +1258,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInEmailOther(fileName,TRUE)) if(!ReadInEmailOther(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
*/ */
//new vehicles by Jazz //new vehicles by Jazz
@@ -1294,7 +1269,7 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME); SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1302,9 +1277,9 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInNewVehicles(fileName,TRUE)) if(!ReadInNewVehicles(fileName,TRUE))
return FALSE; return FALSE;
} }
#endif }
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
@@ -1312,7 +1287,7 @@ if ( ReadXMLEmail == TRUE )
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0)) if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
return FALSE; return FALSE;
} }
#endif }
#ifdef ENABLE_BRIEFINGROOM #ifdef ENABLE_BRIEFINGROOM
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
@@ -1320,14 +1295,14 @@ if ( ReadXMLEmail == TRUE )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME); SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName); SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
} }
#endif }
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0); BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
@@ -1339,14 +1314,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME); SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
} }
#endif }
// Old AIM Archive // Old AIM Archive
UINT8 p; UINT8 p;
@@ -1360,14 +1335,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME); SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
} }
#endif }
UINT8 emptyslotsinarchives = 0; UINT8 emptyslotsinarchives = 0;
for (p=0;p<NUM_PROFILES;p++) for (p=0;p<NUM_PROFILES;p++)
{ {
@@ -1417,14 +1392,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME); SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
#ifndef ENGLISH if( g_lang != i18n::Lang::en ) {
AddLanguagePrefix(fileName); AddLanguagePrefix(fileName);
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName); SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
} }
#endif }
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true); LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
g_luaUnderground.LoadScript(GetLanguagePrefix()); g_luaUnderground.LoadScript(GetLanguagePrefix());
@@ -1498,6 +1473,10 @@ UINT32 InitializeJA2(void)
return( ERROR_SCREEN ); return( ERROR_SCREEN );
} }
// InitRadarScreenCoords() depend on Mapscreen Interface Bottom coordinates -> need to initiate them first
// before calling InitTacticalEngine()
InitMapScreenInterfaceBottomCoords();
// Init tactical engine // Init tactical engine
if ( !InitTacticalEngine( ) ) if ( !InitTacticalEngine( ) )
{ {
+4 -3
View File
@@ -36,6 +36,7 @@
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include "XML.h" #include "XML.h"
#include <language.hpp>
BOOLEAN Style_JA = TRUE; BOOLEAN Style_JA = TRUE;
extern INT8 Test = 0; extern INT8 Test = 0;
@@ -726,11 +727,11 @@ void DisplaySirtechSplashScreen()
* (2006-10-10, Sergeant_Kolja) * (2006-10-10, Sergeant_Kolja)
*/ */
#ifdef _DEBUG #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?" ) ); 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!" ) ); AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
# endif }
#endif #endif
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) ); AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
return; return;
+3 -5
View File
@@ -12,13 +12,11 @@ void StopIntroVideo();
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode' //enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
enum EIntroType enum EIntroType
{ {
#ifdef JA2UB
INTRO_HELI_CRASH,
#endif
INTRO_BEGINNING, //set when viewing the intro at the begining of the game INTRO_BEGINNING, //set when viewing the intro at the begining of the game
INTRO_ENDING, //set when viewing the end game video. INTRO_ENDING, //set when viewing the end game video.
INTRO_SPLASH, INTRO_SPLASH,
// Unfinished Business
INTRO_HELI_CRASH
}; };
@@ -42,4 +40,4 @@ typedef struct
extern INTRO_NAMES_VALUES zVideoFile[255]; extern INTRO_NAMES_VALUES zVideoFile[255];
#endif #endif
+4 -3
View File
@@ -5,6 +5,7 @@
#include "Timer Control.h" #include "Timer Control.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include <stdio.h> #include <stdio.h>
#include <language.hpp>
UINT32 guiSplashFrameFade = 10; UINT32 guiSplashFrameFade = 10;
UINT32 guiSplashStartTime = 0; UINT32 guiSplashStartTime = 0;
@@ -13,10 +14,10 @@ extern HVSURFACE ghFrameBuffer;
//Simply create videosurface, load image, and draw it to the screen. //Simply create videosurface, load image, and draw it to the screen.
void InitJA2SplashScreen() void InitJA2SplashScreen()
{ {
#ifdef ENGLISH if( g_lang == i18n::Lang::en ) {
ClearMainMenu(); ClearMainMenu();
#else } else {
UINT32 uiLogoID = 0; UINT32 uiLogoID = 0;
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
VSURFACE_DESC VSurfaceDesc; //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 ); GetVideoSurface( &hVSurface, uiLogoID );
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL ); BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
DeleteVideoSurfaceFromIndex( uiLogoID ); DeleteVideoSurfaceFromIndex( uiLogoID );
#endif // ENGLISH } // ENGLISH
InvalidateScreen(); InvalidateScreen();
RefreshScreen( NULL ); RefreshScreen( NULL );
+1 -1
View File
@@ -6,4 +6,4 @@ void InitJA2SplashScreen();
extern UINT32 guiSplashFrameFade; extern UINT32 guiSplashFrameFade;
extern UINT32 guiSplashStartTime; extern UINT32 guiSplashStartTime;
#endif #endif
-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
+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 ); INT32 DoChatBox( bool bIncludeChatLog, const STR16 zString, UINT32 uiExitScreen, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
void ChatLogMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ...); void ChatLogMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ...);
#endif #endif
+1 -1
View File
@@ -11,4 +11,4 @@ void SetConnectScreenHeadingA( const char* cmsg );
void SetConnectScreenSubMessageW( STR16 cmsg ); void SetConnectScreenSubMessageW( STR16 cmsg );
void SetConnectScreenSubMessageA( const char* cmsg ); void SetConnectScreenSubMessageA( const char* cmsg );
#endif #endif
+1 -1
View File
@@ -9,4 +9,4 @@ UINT32 MPHostScreenShutdown( void );
#endif #endif
+1 -1
View File
@@ -9,4 +9,4 @@ UINT32 MPScoreScreenShutdown( void );
#endif #endif
+1 -1
View File
@@ -152,4 +152,4 @@ BOOLEAN DoOptionsMessageBoxWithRect( UINT8 ubStyle, const STR16 zString, UINT32
BOOLEAN DoSaveLoadMessageBoxWithRect( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT32 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); BOOLEAN DoSaveLoadMessageBoxWithRect( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT32 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
#endif #endif
-1
View File
@@ -29,7 +29,6 @@
#include "Text.h" #include "Text.h"
#include "Interface Control.h" #include "Interface Control.h"
#include "Message.h" #include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h" #include "Multi Language Graphic Utils.h"
#include "Map Information.h" #include "Map Information.h"
#include "SmokeEffects.h" #include "SmokeEffects.h"
+57 -179
View File
@@ -138,7 +138,6 @@
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009 #include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
#include "Sys Globals.h"//dnl ch74 201013 #include "Sys Globals.h"//dnl ch74 201013
#include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...) #include "Ambient Control.h" // added by Flugente for HandleNewSectorAmbience(...)
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
// //
// Local Defines // Local Defines
@@ -153,6 +152,7 @@
#endif #endif
#include "LuaInitNPCs.h" #include "LuaInitNPCs.h"
#include <language.hpp>
#ifdef JA2UB #ifdef JA2UB
@@ -177,7 +177,11 @@ extern void initMapViewAndBorderCoordinates(void);
UINT32 guiNumberOfMapTempFiles; //Test purposes UINT32 guiNumberOfMapTempFiles; //Test purposes
UINT32 guiSizeOfTempFiles; UINT32 guiSizeOfTempFiles;
CHAR gzNameOfMapTempFile[128]; CHAR gzNameOfMapTempFile[128];
#endif
//#define LOADSAVEGAME_LOGTIME 1 //#define LOADSAVEGAME_LOGTIME 1
#ifdef LOADSAVEGAME_LOGTIME
#include "TimeLogging.h"
#endif #endif
extern SOLDIERTYPE *gpSMCurrentMerc; extern SOLDIERTYPE *gpSMCurrentMerc;
@@ -1463,7 +1467,17 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
numBytesRead = ReadFieldByField( hFile, &this->ubLastDateSpokenTo, sizeof(this->ubLastDateSpokenTo), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->ubLastDateSpokenTo, sizeof(this->ubLastDateSpokenTo), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bLastQuoteSaidWasSpecial, sizeof(this->bLastQuoteSaidWasSpecial), sizeof(UINT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bLastQuoteSaidWasSpecial, sizeof(this->bLastQuoteSaidWasSpecial), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bSectorZ, sizeof(this->bSectorZ), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bSectorZ, sizeof(this->bSectorZ), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(this->usStrategicInsertionData), sizeof(UINT16), numBytesRead);
if ( guiCurrentSaveGameVersion >= MERC_PROFILE_INSERTION_DATA )
{
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof( this->usStrategicInsertionData ), sizeof( UINT32 ), numBytesRead );
}
else
{
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(UINT16), sizeof(UINT16), numBytesRead);
buffer += 4; // To make numBytesRead check match the struct size. 2 bytes from uint32 - uint16 and 2 bytes due to struct memory layout change when usStrategicInsertionData was increased to uint32
}
numBytesRead = ReadFieldByField( hFile, &this->bFriendlyOrDirectDefaultResponseUsedRecently, sizeof(this->bFriendlyOrDirectDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bFriendlyOrDirectDefaultResponseUsedRecently, sizeof(this->bFriendlyOrDirectDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bRecruitDefaultResponseUsedRecently, sizeof(this->bRecruitDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bRecruitDefaultResponseUsedRecently, sizeof(this->bRecruitDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
numBytesRead = ReadFieldByField( hFile, &this->bThreatenDefaultResponseUsedRecently, sizeof(this->bThreatenDefaultResponseUsedRecently), sizeof(INT8), numBytesRead); numBytesRead = ReadFieldByField( hFile, &this->bThreatenDefaultResponseUsedRecently, sizeof(this->bThreatenDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
@@ -3588,14 +3602,8 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
alreadySaving = true; alreadySaving = true;
#ifdef LOADSAVEGAME_LOGTIME #ifdef LOADSAVEGAME_LOGTIME
// Flugente: log how long this takes TimingLogInitialize("TimeLog_LoadSavedGame.txt");
clock_t starttime = clock();
clock_t t0;
clock_t t1 = starttime;
FILE* fp_timelog = fopen("LoadSavedGame_TimeLog.txt", "a");
#endif #endif
//clear out the save game header //clear out the save game header
memset( &SaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) ); memset( &SaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) );
@@ -3775,14 +3783,9 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
//Create the name of the file //Create the name of the file
CreateSavedGameFileNameFromNumber( ubSaveGameID, zSaveGameName ); CreateSavedGameFileNameFromNumber( ubSaveGameID, zSaveGameName );
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLogWrite("Save ");
{ TimingLogWrite(zSaveGameName);
fprintf(fp_timelog, "Save savegame: %s\n", zSaveGameName); TimingLog("\nShutdown stuff", 10);
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "Shutdown stuff\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
//if the file already exists, delete it //if the file already exists, delete it
@@ -3919,12 +3922,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Tactical Status" ); SaveGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveTacticalStatusToSavedGame", 6);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveTacticalStatusFromSavedGame done\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -3966,12 +3964,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Laptop Info" ); SaveGameFilePosition( FileGetPos( hFile ), "Laptop Info" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveLaptopInfoToSavedGame", 7);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveLaptopInfoFromSavedGame done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
// //
@@ -4003,12 +3996,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Soldier Structure" ); SaveGameFilePosition( FileGetPos( hFile ), "Soldier Structure" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveSoldierStructure", 8);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveSoldierStructure done\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -4071,12 +4059,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Information" ); SaveGameFilePosition( FileGetPos( hFile ), "Strategic Information" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveStrategicInfoToSavedFile", 6);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveStrategicInfoFromSavedFile done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
/*// Flugente: Save the strategic supply /*// Flugente: Save the strategic supply
@@ -4126,12 +4109,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Strategic Movement Groups" ); SaveGameFilePosition( FileGetPos( hFile ), "Strategic Movement Groups" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveStrategicMovementGroupsToSaveGameFile", 3);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveStrategicMovementGroupsFromSavedGameFile done\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
@@ -4148,12 +4126,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "All the Map Temp files" ); SaveGameFilePosition( FileGetPos( hFile ), "All the Map Temp files" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveMapTempFilesToSavedGameFile", 6);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveMapTempFilesFromSavedGameFile done\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveQuestInfoToSavedGameFile( hFile ) ) if( !SaveQuestInfoToSavedGameFile( hFile ) )
@@ -4319,12 +4292,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Militia Movement" ); SaveGameFilePosition( FileGetPos( hFile ), "Militia Movement" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveMilitiaMovementInformationToSaveGameFile", 2);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveMilitiaMovementInformationFromSavedGameFile done\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveBulletStructureToSaveGameFile( hFile ) ) if( !SaveBulletStructureToSaveGameFile( hFile ) )
@@ -4564,12 +4532,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" ); SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("SaveLuaGlobalToSaveGameFile", 7);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "SaveLuaGlobalFromLoadGameFile done\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
if( !SaveDataSaveToSaveGameFile( hFile ) ) if( !SaveDataSaveToSaveGameFile( hFile ) )
@@ -4669,12 +4632,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
goto FAILED_TO_SAVE; goto FAILED_TO_SAVE;
} }
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("File read done", 10);
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "File read done\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
#endif #endif
//Close the saved game file //Close the saved game file
@@ -4755,22 +4713,9 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
alreadySaving = false; alreadySaving = false;
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if (fp_timelog) TimingLog("Update functions", 9);
{ TimingLogTotalTime("SaveSavedGame total", 9);
t0 = t1; TimingLogStop();
t1 = clock();
fprintf(fp_timelog, "Update functions\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
if (fp_timelog)
{
t0 = starttime;
t1 = clock();
fprintf(fp_timelog, "SaveSavedGame total\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
if (fp_timelog)
fclose(fp_timelog);
#endif #endif
return( TRUE ); return( TRUE );
@@ -4780,6 +4725,9 @@ FAILED_TO_SAVE:
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
SaveGameFilePosition( FileGetPos( hFile ), "Failed to Save!!!" ); SaveGameFilePosition( FileGetPos( hFile ), "Failed to Save!!!" );
#endif #endif
#if LOADSAVEGAME_LOGTIME
TimingLogStop();
#endif
FileClose( hFile ); FileClose( hFile );
@@ -4825,8 +4773,6 @@ extern int gEnemyPreservedTempFileVersion[256];
extern int gCivPreservedTempFileVersion[256]; extern int gCivPreservedTempFileVersion[256];
#include "time.h"
BOOLEAN LoadSavedGame( int ubSavedGameID ) BOOLEAN LoadSavedGame( int ubSavedGameID )
{ {
HWFILE hFile; HWFILE hFile;
@@ -4845,12 +4791,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#ifdef LOADSAVEGAME_LOGTIME #ifdef LOADSAVEGAME_LOGTIME
// Flugente: log how long this takes TimingLogInitialize("TimeLog_LoadSavedGame.txt");
clock_t starttime = clock();
clock_t t0;
clock_t t1 = starttime;
FILE *fp_timelog = fopen( "LoadSavedGame_TimeLog.txt", "a" );
#endif #endif
uiRelStartPerc = uiRelEndPerc =0; uiRelStartPerc = uiRelEndPerc =0;
@@ -4933,14 +4874,9 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
CreateSavedGameFileNameFromNumber( ubSavedGameID, zSaveGameName ); CreateSavedGameFileNameFromNumber( ubSavedGameID, zSaveGameName );
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLogWrite("Load ");
{ TimingLogWrite(zSaveGameName);
fprintf( fp_timelog, "Load savegame: %s\n", zSaveGameName ); TimingLog("\nShutdown stuff", 10);
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "Shutdown stuff\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
// open the save game file // open the save game file
@@ -5061,19 +4997,14 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
LoadGameFilePosition( FileGetPos( hFile ), "Tactical Status" ); LoadGameFilePosition( FileGetPos( hFile ), "Tactical Status" );
#endif #endif
#if LOADSAVEGAME_LOGTIME
TimingLog("LoadTacticalStatusFromSavedGame", 6);
#endif
//This gets reset by the above function //This gets reset by the above function
gTacticalStatus.uiFlags |= LOADING_SAVED_GAME; gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;
#if LOADSAVEGAME_LOGTIME
if ( fp_timelog )
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadTacticalStatusFromSavedGame done\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif
//Load the game clock ingo //Load the game clock ingo
if( !LoadGameClock( hFile ) ) if( !LoadGameClock( hFile ) )
@@ -5194,12 +5125,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadLaptopInfoFromSavedGame", 7);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadLaptopInfoFromSavedGame done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 0; uiRelEndPerc += 0;
@@ -5242,12 +5168,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadSoldierStructure", 8);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadSoldierStructure done\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5376,12 +5297,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadStrategicInfoFromSavedFile", 6);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadStrategicInfoFromSavedFile done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5442,12 +5358,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
ValidateStrategicGroups(); ValidateStrategicGroups();
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadStrategicMovementGroupsFromSavedGameFile", 2);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadStrategicMovementGroupsFromSavedGameFile done\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 30; uiRelEndPerc += 30;
@@ -5467,12 +5378,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadMapTempFilesFromSavedGameFile", 5);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadMapTempFilesFromSavedGameFile done\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -5771,12 +5677,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadMilitiaMovementInformationFromSavedGameFile", 2);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadMilitiaMovementInformationFromSavedGameFile done\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
uiRelEndPerc += 1; uiRelEndPerc += 1;
@@ -6336,12 +6237,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
#endif #endif
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("LoadLuaGlobalFromLoadGameFile", 6);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "LoadLuaGlobalFromLoadGameFile done\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE) if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE)
@@ -6573,12 +6469,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
} }
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("File read done", 10);
{
t0 = t1;
t1 = clock();
fprintf( fp_timelog, "File read done\t\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
#endif #endif
// //
@@ -7023,22 +6914,9 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
gGameExternalOptions.gfAllowReinforcements = zDiffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements; gGameExternalOptions.gfAllowReinforcements = zDiffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements;
#if LOADSAVEGAME_LOGTIME #if LOADSAVEGAME_LOGTIME
if ( fp_timelog ) TimingLog("Update functions", 9);
{ TimingLogTotalTime("LoadSavedGame total", 9);
t0 = t1; TimingLogStop();
t1 = clock();
fprintf( fp_timelog, "Update functions\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
if ( fp_timelog )
{
t0 = starttime;
t1 = clock();
fprintf( fp_timelog, "LoadSavedGame total\t\t\t\t\t\t\t\t\t\t\t\t: %fs\n\n", ( (float)( t1 - t0 ) / CLOCKS_PER_SEC ) );
}
if ( fp_timelog )
fclose( fp_timelog );
#endif #endif
DebugQuestInfo("\n--------- Game loaded ---------"); DebugQuestInfo("\n--------- Game loaded ---------");
@@ -7338,7 +7216,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
} }
} }
#ifdef GERMAN if( g_lang == i18n::Lang::de ) {
// Fix neutral flags // Fix neutral flags
if ( guiCurrentSaveGameVersion < 94 ) if ( guiCurrentSaveGameVersion < 94 )
{ {
@@ -7348,7 +7226,7 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
Menptr[ cnt].aiData.bNeutral = FALSE; Menptr[ cnt].aiData.bNeutral = FALSE;
} }
} }
#endif }
//#ifdef JA2UB //#ifdef JA2UB
//if the soldier has the NON weapon version of the merc knofe or merc umbrella //if the soldier has the NON weapon version of the merc knofe or merc umbrella
//ConvertWeapons( &Menptr[ cnt ] ); //ConvertWeapons( &Menptr[ cnt ] );
@@ -10029,9 +9907,9 @@ UINT32 CalcJA2EncryptionSet( SAVED_GAME_HEADER * pSaveGameHeader )
} }
} }
#ifdef GERMAN if( g_lang == i18n::Lang::de ) {
uiEncryptionSet *= 11; uiEncryptionSet *= 11;
#endif }
uiEncryptionSet = uiEncryptionSet % 10; uiEncryptionSet = uiEncryptionSet % 10;
+1 -1
View File
@@ -34,4 +34,4 @@ extern Screens GameScreens[MAX_SCREENS];
#include "jascreens.h" #include "jascreens.h"
#endif #endif
+72
View File
@@ -0,0 +1,72 @@
#include "TimeLogging.h"
#include "time.h"
#include <stdio.h>
clock_t starttime;
clock_t t0;
clock_t t1;
FILE* fp_timelog = nullptr;
static void indent(int n)
{
for (int i = 0; i < n; i++)
fputc('\t', fp_timelog);
}
void TimingLogInitialize(const CHAR8* filename)
{
starttime = clock();
t1 = starttime;
if (!fp_timelog)
{
fp_timelog = fopen(filename, "a");
}
}
void TimingLog(const CHAR8* logEvent, int n)
{
if (fp_timelog)
{
t0 = t1;
t1 = clock();
fprintf(fp_timelog, "%s", logEvent);
indent(n);
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - t0) / CLOCKS_PER_SEC));
}
}
void TimingLogTotalTime(const CHAR8* logEvent, int n)
{
if (fp_timelog)
{
t1 = clock();
fprintf(fp_timelog, "%s", logEvent);
indent(n);
fprintf(fp_timelog, ": %f s\n", ((float)(t1 - starttime) / CLOCKS_PER_SEC));
}
}
void TimingLogWrite(const CHAR8* text)
{
if (fp_timelog)
{
fprintf(fp_timelog, text);
}
}
void TimingLogStop()
{
if (fp_timelog)
{
fprintf(fp_timelog, "\n");
fclose(fp_timelog);
fp_timelog = nullptr;
}
}
+8
View File
@@ -0,0 +1,8 @@
#pragma once
#include "Types.h"
void TimingLogInitialize(const CHAR8* filename);
void TimingLog(const CHAR8* logEvent, int n);
void TimingLogTotalTime(const CHAR8* logEvent, int n);
void TimingLogWrite(const CHAR8* text);
void TimingLogStop();
-2
View File
@@ -1,8 +1,6 @@
#ifndef _BUILDDEFINES_H #ifndef _BUILDDEFINES_H
#define _BUILDDEFINES_H #define _BUILDDEFINES_H
#include "Language Defines.h"
//----- Briefing Room (Mission based JA2 like in JA/DG) - by Jazz ----- //----- Briefing Room (Mission based JA2 like in JA/DG) - by Jazz -----
// Once enabled here and also enabled in the ja2_options.ini (BRIEFING_ROOM), // Once enabled here and also enabled in the ja2_options.ini (BRIEFING_ROOM),
// you can access the briefing room feature from the laptop // you can access the briefing room feature from the laptop
+1 -1
View File
@@ -41,4 +41,4 @@ void InitHelicopterEntranceByMercs( void );
void InternalLeaveTacticalScreen( UINT32 uiNewScreen ); void InternalLeaveTacticalScreen( UINT32 uiNewScreen );
#endif #endif
+6 -8
View File
@@ -45,10 +45,10 @@
#include "Sound Control.h" #include "Sound Control.h"
#include "WordWrap.h" #include "WordWrap.h"
#include "text.h" #include "text.h"
#include "Language Defines.h"
#include "IniReader.h" #include "IniReader.h"
#include "sgp_logger.h" #include "sgp_logger.h"
#include <language.hpp>
#define _UNICODE #define _UNICODE
// Networking Stuff // Networking Stuff
@@ -332,7 +332,7 @@ UINT32 InitScreenHandle(void)
if ( ubCurrentScreen == 255 ) if ( ubCurrentScreen == 255 )
{ {
#ifdef ENGLISH if( g_lang == i18n::Lang::en ) {
if( gfDoneWithSplashScreen ) if( gfDoneWithSplashScreen )
{ {
ubCurrentScreen = 0; ubCurrentScreen = 0;
@@ -342,9 +342,9 @@ UINT32 InitScreenHandle(void)
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR ); SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
return( INTRO_SCREEN ); return( INTRO_SCREEN );
} }
#else } else {
ubCurrentScreen = 0; ubCurrentScreen = 0;
#endif }
} }
if ( ubCurrentScreen == 0 ) if ( ubCurrentScreen == 0 )
@@ -397,7 +397,7 @@ UINT32 InitScreenHandle(void)
// Handle queued .ini file error messages // Handle queued .ini file error messages
int y = 40; int y = 40;
sgp::Logger_ID ini_id = sgp::Logger::instance().createLogger(); sgp::Logger_ID ini_id = sgp::Logger::instance().createLogger();
sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.txt", false, sgp::Logger::FLUSH_ON_DELETE); sgp::Logger::instance().connectFile(ini_id, L"iniErrorReport.log", false, sgp::Logger::FLUSH_ON_DELETE);
sgp::Logger::LogInstance logger = sgp::Logger::instance().logger(ini_id); sgp::Logger::LogInstance logger = sgp::Logger::instance().logger(ini_id);
while (! iniErrorMessages.empty()) { while (! iniErrorMessages.empty()) {
static BOOL iniErrorMessage_create_out_file = TRUE; static BOOL iniErrorMessage_create_out_file = TRUE;
@@ -407,7 +407,7 @@ UINT32 InitScreenHandle(void)
if (iniErrorMessage_create_out_file) if (iniErrorMessage_create_out_file)
{ {
y += 25; y += 25;
swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.txt has been created." ); swprintf( str, L"%S", "Warning: found the following ini errors. iniErrorReport.log has been created." );
DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED ); DisplayWrappedString( 10, y, 560, 2, FONT12ARIAL, FONT_ORANGE, str, FONT_BLACK, TRUE, LEFT_JUSTIFIED );
iniErrorMessage_create_out_file = FALSE; iniErrorMessage_create_out_file = FALSE;
} }
@@ -959,7 +959,6 @@ void DoneFadeOutForDemoExitScreen( void )
// unused // unused
//extern INT8 gbFadeSpeed; //extern INT8 gbFadeSpeed;
#ifdef GERMAN
void DisplayTopwareGermanyAddress() void DisplayTopwareGermanyAddress()
{ {
VOBJECT_DESC vo_desc; VOBJECT_DESC vo_desc;
@@ -994,7 +993,6 @@ void DisplayTopwareGermanyAddress()
ExecuteBaseDirtyRectQueue(); ExecuteBaseDirtyRectQueue();
EndFrameBufferRender(); EndFrameBufferRender();
} }
#endif
UINT32 DemoExitScreenHandle(void) UINT32 DemoExitScreenHandle(void)
{ {
+1 -1
View File
@@ -184,4 +184,4 @@ extern std::list<SExceptionData> g_ExceptionList;
void PrintExceptionList(); void PrintExceptionList();
#endif #endif
+1 -1
View File
@@ -102,4 +102,4 @@ extern void RandomStats ();
#endif #endif
extern void RandomStats (); extern void RandomStats ();
#endif #endif
+1 -1
View File
@@ -37,4 +37,4 @@ void ClearMainMenu( );
void InitDependingGameStyleOptions(); void InitDependingGameStyleOptions();
#endif #endif
+1 -1
View File
@@ -47,4 +47,4 @@ enum ScreenTypes
MAX_SCREENS MAX_SCREENS
}; };
#endif #endif
+7 -1
View File
@@ -238,7 +238,8 @@ void LoadGameUBOptions()
gGameUBOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155); gGameUBOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155);
gGameUBOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980); gGameUBOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980);
gGameUBOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749); gGameUBOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger( "Unfinished Business Settings", "POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749 );
gGameUBOptions.PowergenSectorExitgridSrcGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_SRC_GRIDNO", 10979 );
gGameUBOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979); gGameUBOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979);
gGameUBOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749); gGameUBOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749);
gGameUBOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980); gGameUBOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980);
@@ -356,6 +357,11 @@ void LoadGameUBOptions()
gGameUBOptions.H10SectorPlayerQuoteZ = iniReader.ReadInteger("Unfinished Business Settings","H10_SECTOR_PLAYER_QUOTE_Z", 0); gGameUBOptions.H10SectorPlayerQuoteZ = iniReader.ReadInteger("Unfinished Business Settings","H10_SECTOR_PLAYER_QUOTE_Z", 0);
gGameUBOptions.BettyBloodCatSectorX = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_X", 10 );
gGameUBOptions.BettyBloodCatSectorY = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_Y", 9 );
gGameUBOptions.BettyBloodCatSectorZ = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_Z", 0 );
if ( gGameUBOptions.InGameHeli == TRUE ) if ( gGameUBOptions.InGameHeli == TRUE )
gGameUBOptions.InGameHeliCrash = FALSE; gGameUBOptions.InGameHeliCrash = FALSE;
+6 -2
View File
@@ -67,6 +67,7 @@ typedef struct
UINT32 PowergenSectorGridNo3; UINT32 PowergenSectorGridNo3;
UINT32 PowergenSectorGridNo4; UINT32 PowergenSectorGridNo4;
UINT32 PowergenSectorExitgridGridNo; UINT32 PowergenSectorExitgridGridNo;
UINT32 PowergenSectorExitgridSrcGridNo;
UINT32 PowergenFanSoundGridNo1; UINT32 PowergenFanSoundGridNo1;
UINT32 PowergenFanSoundGridNo2; UINT32 PowergenFanSoundGridNo2;
UINT32 StartFanbackupAgainGridNo; UINT32 StartFanbackupAgainGridNo;
@@ -219,7 +220,10 @@ typedef struct
UINT32 SectorDoorInTunnelGridNo; UINT32 SectorDoorInTunnelGridNo;
UINT8 MaxNumberOfMercs; UINT8 MaxNumberOfMercs;
INT16 BettyBloodCatSectorX;
INT16 BettyBloodCatSectorY;
INT8 BettyBloodCatSectorZ;
} GAME_UB_OPTIONS; } GAME_UB_OPTIONS;
extern GAME_UB_OPTIONS gGameUBOptions; extern GAME_UB_OPTIONS gGameUBOptions;
@@ -230,4 +234,4 @@ extern void RandomStats ();
#endif #endif
extern void RandomStats (); extern void RandomStats ();
#endif #endif
+98 -22
View File
@@ -36,7 +36,6 @@
#include "Strategic Status.h" #include "Strategic Status.h"
#include "Merc Contract.h" #include "Merc Contract.h"
#include "Strategic Merc Handler.h" #include "Strategic Merc Handler.h"
#include "Language Defines.h"
#include "Assignments.h" #include "Assignments.h"
#include "Sound Control.h" #include "Sound Control.h"
#include "Quests.h" #include "Quests.h"
@@ -50,6 +49,7 @@
#include "Encrypted File.h" #include "Encrypted File.h"
#include "InterfaceItemImages.h" #include "InterfaceItemImages.h"
#include <sstream> #include <sstream>
#include <language.hpp>
// //
//****** Defines ****** //****** Defines ******
@@ -148,10 +148,16 @@
#define FEE_X PRICE_X + 7 #define FEE_X PRICE_X + 7
#define FEE_Y NAME_Y #define FEE_Y NAME_Y
#define FEE_WIDTH 37 #define FEE_WIDTH 37
#define FEE_X_UB PRICE_X + 40
#define FEE_Y_UB STATS_Y + 28
#define FEE_Y_UB_NSGI STATS_Y
#define AIM_CONTRACT_X PRICE_X + 51 #define AIM_CONTRACT_X PRICE_X + 51
#define AIM_CONTRACT_Y FEE_Y #define AIM_CONTRACT_Y FEE_Y
#define AIM_CONTRACT_WIDTH 59 #define AIM_CONTRACT_WIDTH 59
#define AIM_CONTRACT_X_UB PRICE_X + 19
#define AIM_OFFER_X PRICE_X + 3
#define AIM_OFFER_WIDTH 110
#define ONEDAY_X AIM_CONTRACT_X #define ONEDAY_X AIM_CONTRACT_X
#define ONEWEEK_X AIM_CONTRACT_X #define ONEWEEK_X AIM_CONTRACT_X
@@ -1120,7 +1126,13 @@ BOOLEAN RenderAIMMembers()
UpdateMercInfo(); UpdateMercInfo();
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
//Draw fee & contract //Draw fee & contract
#ifdef JA2UB
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#else
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X_NSGI, FEE_Y_NSGI, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X_NSGI, AIM_CONTRACT_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1129,9 +1141,6 @@ BOOLEAN RenderAIMMembers()
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X_NSGI, MARKSMAN_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X_NSGI, MECHANAICAL_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X_NSGI, AIM_MEMBER_ACTIVE_TEXT_Y_NSGI, AIM_MEMBER_ACTIVE_TEXT_WIDTH_NSGI, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1140,6 +1149,7 @@ BOOLEAN RenderAIMMembers()
InsertDollarSignInToString( wTemp ); InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
#endif // JA2UB
} }
else else
{ {
@@ -1163,6 +1173,12 @@ BOOLEAN RenderAIMMembers()
UpdateMercInfo(); UpdateMercInfo();
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#ifdef JA2UB
DrawTextToScreen(CharacterInfo[AIM_MEMBER_UB_MISSION_FEE], AIM_CONTRACT_X_UB, AIM_CONTRACT_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#else
//Draw fee & contract //Draw fee & contract
DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_FEE], FEE_X, FEE_Y, 0, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_CONTRACT], AIM_CONTRACT_X, AIM_CONTRACT_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_PREV_NEXT_CONTACT, AIM_M_FEE_CONTRACT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
@@ -1172,9 +1188,6 @@ BOOLEAN RenderAIMMembers()
DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_1_WEEK], ONEWEEK_X, MARKSMAN_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_2_WEEKS], TWOWEEK_X, MECHANAICAL_Y, AIM_CONTRACT_WIDTH, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//Display AIM Member text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_ACTIVE_MEMBERS], AIM_MEMBER_ACTIVE_TEXT_X, AIM_MEMBER_ACTIVE_TEXT_Y, AIM_MEMBER_ACTIVE_TEXT_WIDTH, AIM_MAINTITLE_FONT, AIM_M_ACTIVE_MEMBER_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
@@ -1183,6 +1196,7 @@ BOOLEAN RenderAIMMembers()
InsertDollarSignInToString( wTemp ); InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
#endif
} }
DisableAimButton(); DisableAimButton();
@@ -1309,6 +1323,10 @@ BOOLEAN UpdateMercInfo(void)
if(gGameExternalOptions.gfUseNewStartingGearInterface) if(gGameExternalOptions.gfUseNewStartingGearInterface)
{ {
#ifdef JA2UB
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y_NSGI, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
//Display the salaries //Display the salaries
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH_NSGI, FEE_X_NSGI, HEALTH_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH_NSGI, FEE_X_NSGI, AGILITY_Y_NSGI, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
@@ -1335,6 +1353,8 @@ BOOLEAN UpdateMercInfo(void)
else else
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X_NSGI, AIM_MEDICAL_DEPOSIT_Y_NSGI, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
} }
#endif // JA2UB
if(!g_bUseXML_Strings) if(!g_bUseXML_Strings)
{ {
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString); // LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
@@ -1363,6 +1383,10 @@ BOOLEAN UpdateMercInfo(void)
} }
else else
{ {
#ifdef JA2UB
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X_UB, FEE_Y_UB, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT);
DisplayWrappedString(AIM_OFFER_X, AGILITY_Y, AIM_OFFER_WIDTH, 2, AIM_M_FONT_DYNAMIC_TEXT, AIM_FONT_MCOLOR_WHITE, zNewTacticalMessages[TACT_MSG__AIMMEMBER_FEE_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
//Display the salaries //Display the salaries
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].sSalary, FEE_WIDTH, FEE_X, HEALTH_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT ); DrawMoneyToScreen(gMercProfiles[gbCurrentSoldier].uiWeeklySalary, FEE_WIDTH, FEE_X, AGILITY_Y, AIM_M_NUMBER_FONT, AIM_M_COLOR_DYNAMIC_TEXT );
@@ -1389,6 +1413,7 @@ BOOLEAN UpdateMercInfo(void)
else else
DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); DisplayWrappedString(AIM_MEDICAL_DEPOSIT_X, AIM_MEDICAL_DEPOSIT_Y, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
} }
#endif
if(!g_bUseXML_Strings) if(!g_bUseXML_Strings)
{ {
// LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString); // LoadMercBioInfo( gbCurrentSoldier, MercInfoString, AdditionalInfoString);
@@ -2528,6 +2553,21 @@ BOOLEAN DisplayVideoConferencingDisplay()
DisplayMercChargeAmount(); DisplayMercChargeAmount();
#ifdef JA2UB
if (gubVideoConferencingMode == AIM_VIDEO_HIRE_MERC_MODE)
{
CHAR16 offerText[190];
swprintf(offerText, zNewTacticalMessages[TACT_MSG__AIMMEMBER_ONE_TIME_FEE], gMercProfiles[gbCurrentSoldier].zNickname);
const auto xCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_X + 115;
const auto yCoord = AIM_MEMBER_VIDEO_CONF_TERMINAL_Y + 45;
const auto textAreaWidth = 245;
SetFontShadow(AIM_M_VIDEO_NAME_SHADOWCOLOR);
DisplayWrappedString(xCoord, yCoord, textAreaWidth, 2, AIM_M_FONT_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, offerText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
SetFontShadow(DEFAULT_SHADOW);
}
#endif // JA2UB
// if( gfMercIsTalking && !gfIsAnsweringMachineActive) // if( gfMercIsTalking && !gfIsAnsweringMachineActive)
if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] ) if( gfMercIsTalking && gGameSettings.fOptions[ TOPTION_SUBTITLES ] )
{ {
@@ -2577,6 +2617,9 @@ BOOLEAN DisplayMercsVideoFace()
void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown) void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
{ {
#ifdef JA2UB
return;
#else
UINT16 i, usPosY, usPosX; UINT16 i, usPosY, usPosX;
//First draw the select light for the contract length buttons //First draw the select light for the contract length buttons
@@ -2630,6 +2673,8 @@ void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP; usPosY += AIM_MEMBER_BUY_EQUIPMENT_GAP;
} }
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
#endif // JA2UB
} }
@@ -2653,7 +2698,10 @@ UINT32 DisplayMercChargeAmount()
giContractAmount = 0; giContractAmount = 0;
//the contract charge amount //the contract charge amount
#ifdef JA2UB
// Special offer for a limited time! Act fast!
giContractAmount = gMercProfiles[gbCurrentSoldier].uiWeeklySalary;
#else
// Get the salary rate // Get the salary rate
if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY) if( gubContractLength == AIM_CONTRACT_LENGTH_ONE_DAY)
giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary; giContractAmount = gMercProfiles[gbCurrentSoldier].sSalary;
@@ -2675,6 +2723,7 @@ UINT32 DisplayMercChargeAmount()
{ {
giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost; giContractAmount += gMercProfiles[gbCurrentSoldier].usOptionalGearCost;
} }
#endif
} }
@@ -2685,10 +2734,15 @@ UINT32 DisplayMercChargeAmount()
//if the merc hasnt just been hired //if the merc hasnt just been hired
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL ) // if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
{ {
#ifdef JA2UB
// Don't even have to pay for medical insurance! What a DEAL!
swprintf(wTemp, L"%s", wDollarTemp);
#else
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit ) if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] ); swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] );
else else
swprintf(wTemp, L"%s", wDollarTemp ); swprintf(wTemp, L"%s", wDollarTemp );
#endif // JA2UB
DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
@@ -3887,14 +3941,14 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
MSYS_DisableRegion(&gSelectedShutUpMercRegion); MSYS_DisableRegion(&gSelectedShutUpMercRegion);
//Enable the ability to click on the BIG face to go to different screen //Enable the ability to click on the BIG face to go to different screen
MSYS_EnableRegion(&gSelectedFaceRegion); MSYS_EnableRegion(&gSelectedFaceRegion);
// EnableDisableCurrentVideoConferenceButtons(FALSE); // EnableDisableCurrentVideoConferenceButtons(FALSE);
if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE ) if( gubVideoConferencingPreviousMode == AIM_VIDEO_HIRE_MERC_MODE )
{ {
// Enable the current video conference buttons // Enable the current video conference buttons
EnableDisableCurrentVideoConferenceButtons(FALSE); EnableDisableCurrentVideoConferenceButtons(FALSE);
} }
fVideoConferenceCreated = FALSE; fVideoConferenceCreated = FALSE;
@@ -4085,6 +4139,22 @@ BOOLEAN InitDeleteVideoConferencePopUp( )
// InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT); // InitVideoFaceTalking(gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT);
DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE ); DelayMercSpeech( gbCurrentSoldier, QUOTE_LENGTH_OF_CONTRACT, 750, TRUE, FALSE );
#ifdef JA2UB
// Disable and hide contract length & gear purchase buttons
gfBuyEquipment = TRUE;
for (size_t i = 0; i < 3; i++)
{
DisableButton(giContractLengthButton[i]);
HideButton(giContractLengthButton[i]);
if (i < 2)
{
DisableButton(giBuyEquipmentButton[i]);
HideButton(giBuyEquipmentButton[i]);
}
}
#endif // JA2UB
} }
@@ -5297,11 +5367,17 @@ BOOLEAN DisplayShadedStretchedMercFace( UINT8 ubMercID, UINT16 usPosX, UINT16 us
void DemoHiringOfMercs( ) void DemoHiringOfMercs( )
{ {
INT16 i; INT16 i;
#ifdef GERMAN UINT8 MercID[5];
UINT8 MercID[]={ 7, 10, 4, 14, 50 }; MercID[0] = 7;
#else MercID[1] = 10;
UINT8 MercID[]={ 7, 10, 4, 42, 33 }; MercID[2] = 4;
#endif if( g_lang == i18n::Lang::de ) {
MercID[3] = 14;
MercID[4] = 50;
} else {
MercID[3] = 42;
MercID[4] = 33;
}
MERC_HIRE_STRUCT HireMercStruct; MERC_HIRE_STRUCT HireMercStruct;
static BOOLEAN fHaveCalledBefore=FALSE; static BOOLEAN fHaveCalledBefore=FALSE;
@@ -5392,20 +5468,20 @@ void DisplayPopUpBoxExplainingMercArrivalLocationAndTime( )
//create the string to display to the user, looks like.... //create the string to display to the user, looks like....
// L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival // L"%s should arrive at the designated drop-off point ( sector %d:%d %s ) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival
#ifdef GERMAN if( g_lang == i18n::Lang::de ) {
//Germans version has a different argument order //Germans version has a different argument order
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
gMercProfiles[ pSoldier->ubProfile ].zNickname, gMercProfiles[ pSoldier->ubProfile ].zNickname,
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
zTimeString, zTimeString,
zSectorIDString ); zSectorIDString );
#else } else {
swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ], swprintf( szLocAndTime, pMessageStrings[ MSG_JUST_HIRED_MERC_ARRIVAL_LOCATION_POPUP ],
gMercProfiles[ pSoldier->ubProfile ].zNickname, gMercProfiles[ pSoldier->ubProfile ].zNickname,
zSectorIDString, zSectorIDString,
LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440, LaptopSaveInfo.sLastHiredMerc.uiArrivalTime / 1440,
zTimeString ); zTimeString );
#endif }
+1 -1
View File
@@ -627,7 +627,7 @@ TestTable::Display( )
{ {
MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown], MSYS_DefineRegion( &it->mMouseRegion[i - mFirstEntryShown],
usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow, usPosX, usPosY, usPosX + it->GetRequiredLength(), usPosY + heightperrow,
MSYS_PRIORITY_HIGHEST, CURSOR_WWW, MSYS_PRIORITY_HIGHEST-3, CURSOR_WWW,
MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack ); MSYS_NO_CALLBACK, ( *it ).RegionClickCallBack );
MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] ); MSYS_AddRegion( &it->mMouseRegion[i - mFirstEntryShown] );
+21 -20
View File
@@ -20,6 +20,7 @@
// HEADROCK HAM 4 // HEADROCK HAM 4
#include "input.h" #include "input.h"
#include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item #include "Encyclopedia_new.h" //update encyclopedia item visibility when viewing that item
#include <language.hpp>
#define BOBBYR_DEFAULT_MENU_COLOR 255 #define BOBBYR_DEFAULT_MENU_COLOR 255
@@ -115,11 +116,7 @@
#define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1 #define BOBBYR_ITEM_QTY_NUM_X BOBBYR_GRIDLOC_X + 105//BOBBYR_ITEM_COST_TEXT_X + 1
#define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40 #define BOBBYR_ITEM_QTY_NUM_Y BOBBYR_ITEM_QTY_TEXT_Y//BOBBYR_ITEM_COST_TEXT_Y + 40
#ifdef CHINESE #define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH - 10 //BOBBYR_ITEM_QTY_NUM_X
#else
#define BOBBYR_ITEMS_BOUGHT_X BOBBYR_GRIDLOC_X + 105 - BOBBYR_ORDER_NUM_WIDTH//BOBBYR_ITEM_QTY_NUM_X
#endif
#define BOBBY_RAY_NOT_PURCHASED 255 #define BOBBY_RAY_NOT_PURCHASED 255
#define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200 #define BOBBY_RAY_MAX_AMOUNT_OF_ITEMS_TO_PURCHASE 200
@@ -1765,11 +1762,11 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
{ {
if ( iSubFilter > -1 ) // Madd: new BR filters if ( iSubFilter > -1 ) // Madd: new BR filters
{ {
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter ) if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter )
bAddItem = TRUE; bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment) else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bAddItem = TRUE; bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment) else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bAddItem = TRUE; bAddItem = TRUE;
} }
else else
@@ -2506,7 +2503,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED) if( ubPurchaseNumber != BOBBY_RAY_NOT_PURCHASED)
{ {
swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased); swprintf(sTemp, L"% 4d", BobbyRayPurchases[ ubPurchaseNumber ].ubNumberPurchased);
DrawTextToScreen(sTemp, BOBBYR_ITEMS_BOUGHT_X, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); auto bobbyRItemsBoughtX{ BOBBYR_ITEMS_BOUGHT_X };
if (g_lang == i18n::Lang::zh) {
bobbyRItemsBoughtX -= 10;
}
DrawTextToScreen(sTemp, bobbyRItemsBoughtX, (UINT16)usPosY, 0, FONT14ARIAL, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
} }
@@ -2516,11 +2517,11 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
//if it's a used item, display how damaged the item is //if it's a used item, display how damaged the item is
if( fUsed ) if( fUsed )
{ {
#ifdef CHINESE if ( g_lang == i18n::Lang::zh ) {
swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww swprintf( sTemp, ChineseSpecString2, LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );//zww
#else } else {
swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality ); swprintf( sTemp, L"*%3d%%%%", LaptopSaveInfo.BobbyRayUsedInventory[ usBobbyIndex ].ubItemQuality );
#endif }
DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(sTemp, (UINT16)(BOBBYR_ITEM_NAME_X-2), (UINT16)(usPosY - BOBBYR_ORDER_NUM_Y_OFFSET), BOBBYR_ORDER_NUM_WIDTH, BOBBYR_ITEM_NAME_TEXT_FONT, BOBBYR_ITEM_NAME_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
@@ -2653,11 +2654,11 @@ void SetFirstLastPagesForNew( UINT32 uiClassMask, INT32 iFilter, INT32 iSubFilte
{ {
if (iSubFilter > -1 ) if (iSubFilter > -1 )
{ {
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter) if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter)
bCntNumItems = TRUE; bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment) else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bCntNumItems = TRUE; bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment ) else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bCntNumItems = TRUE; bCntNumItems = TRUE;
} }
else else
@@ -3641,11 +3642,11 @@ void CalcFirstIndexForPage( STORE_INVENTORY *pInv, UINT32 uiItemClass )
{ {
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
{ {
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode) if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
bCntItem = TRUE; bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment) else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bCntItem = TRUE; bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment) else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bCntItem = TRUE; bCntItem = TRUE;
} }
else else
@@ -4181,7 +4182,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (it = range.first; it != range.second; it++) for (it = range.first; it != range.second; it++)
{ {
UINT16 attachmentId = it->second.attachmentIndex; UINT16 attachmentId = it->second.attachmentIndex;
if (!Item[attachmentId].hiddenaddon && !Item[attachmentId].hiddenattachment && ItemIsLegal(attachmentId, TRUE)) if (!ItemIsHiddenAddon(attachmentId) && !ItemIsHiddenAttachment(attachmentId) && ItemIsLegal(attachmentId, TRUE))
{ {
fAttachmentsFound = TRUE; fAttachmentsFound = TRUE;
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE) if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE)
@@ -4194,7 +4195,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++) for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++)
{ {
// If the attachment is not hidden and attachable to the gun (usItemNumber) // If the attachment is not hidden and attachable to the gun (usItemNumber)
if (!Item[itemId].hiddenaddon && !Item[itemId].hiddenattachment && if (!ItemIsHiddenAddon(itemId) && !ItemIsHiddenAttachment(itemId) &&
ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId)) ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId))
{ {
fAttachmentsFound = TRUE; fAttachmentsFound = TRUE;
+7 -6
View File
@@ -30,6 +30,7 @@
#include "GameSettings.h" #include "GameSettings.h"
#include <vfs/Core/vfs.h> #include <vfs/Core/vfs.h>
#include <vfs/Core/File/vfs_file.h> #include <vfs/Core/File/vfs_file.h>
#include <language.hpp>
/* /*
typedef struct typedef struct
@@ -488,11 +489,11 @@ BOOLEAN EnterBobbyRMailOrder()
SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN); SetButtonCursor(guiBobbyRClearOrder, CURSOR_LAPTOP_SCREEN);
SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE ); SpecifyDisabledButtonStyle( guiBobbyRClearOrder, DISABLED_STYLE_NONE );
//inshy: fix position of text for buttons //inshy: fix position of text for buttons
#ifdef FRENCH if(g_lang == i18n::Lang::fr) {
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE ); SpecifyButtonTextOffsets( guiBobbyRClearOrder, 13, 10, TRUE );
#else } else {
SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE ); SpecifyButtonTextOffsets( guiBobbyRClearOrder, 39, 10, TRUE );
#endif }
// Accept Order button // Accept Order button
guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 ); guiBobbyRAcceptOrderImage = LoadButtonImage("LAPTOP\\AcceptOrderButton.sti", 2,0,-1,1,-1 );
@@ -504,11 +505,11 @@ BOOLEAN EnterBobbyRMailOrder()
DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback); DEFAULT_MOVE_CALLBACK, BtnBobbyRAcceptOrderCallback);
SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN); SetButtonCursor( guiBobbyRAcceptOrder, CURSOR_LAPTOP_SCREEN);
//inshy: fix position of text for buttons //inshy: fix position of text for buttons
#ifdef FRENCH if(g_lang == i18n::Lang::fr) {
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE ); SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 15, 24, TRUE );
#else } else {
SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE ); SpecifyButtonTextOffsets( guiBobbyRAcceptOrder, 43, 24, TRUE );
#endif }
SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED ); SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED );
if( gbSelectedCity == -1 ) if( gbSelectedCity == -1 )
+1 -1
View File
@@ -17,4 +17,4 @@ BOOLEAN DrawBriefingRoomDefaults();
BOOLEAN DisplayBriefingRoomSlogan(); BOOLEAN DisplayBriefingRoomSlogan();
BOOLEAN DisplayBriefingRoomCopyright(); BOOLEAN DisplayBriefingRoomCopyright();
#endif #endif
+1 -1
View File
@@ -17,4 +17,4 @@ BOOLEAN DrawBriefingRoomEnterDefaults();
BOOLEAN DisplayBriefingRoomEnterSlogan(); BOOLEAN DisplayBriefingRoomEnterSlogan();
BOOLEAN DisplayBriefingRoomEnterCopyright(); BOOLEAN DisplayBriefingRoomEnterCopyright();
#endif #endif
+1 -1
View File
@@ -133,4 +133,4 @@ extern BOOLEAN SaveBriefingRoomToSaveGameFile( HWFILE hFile );
#endif #endif
+1 -1
View File
@@ -3,4 +3,4 @@
#endif // __CAMPAIGNHISTORY_DATA_H #endif // __CAMPAIGNHISTORY_DATA_H
+1 -1
View File
@@ -27,4 +27,4 @@ void ExitCampaignHistory_News();
void HandleCampaignHistory_News(); void HandleCampaignHistory_News();
void RenderCampaignHistory_News(); void RenderCampaignHistory_News();
#endif // __CAMPAIGNHISTORY_SUMMARY_H #endif // __CAMPAIGNHISTORY_SUMMARY_H
+1 -1
View File
@@ -332,4 +332,4 @@ STR16 GetIncidentName( UINT32 aIncidentId );
UINT32 GetIdOfCurrentlyOngoingIncident(); UINT32 GetIdOfCurrentlyOngoingIncident();
#endif // __CAMPAIGNSTATS_H #endif // __CAMPAIGNSTATS_H
+1 -1
View File
@@ -7,4 +7,4 @@ void ExitIMPAboutUs( void );
void EnterIMPAboutUs( void ); void EnterIMPAboutUs( void );
void HandleIMPAboutUs( void ); void HandleIMPAboutUs( void );
#endif #endif
+1 -1
View File
@@ -8,4 +8,4 @@ void HandleIMPAttributeEntrance( void );
#endif #endif
+1 -1
View File
@@ -7,4 +7,4 @@ void RenderIMPAttributeFinish( void );
void ExitIMPAttributeFinish( void ); void ExitIMPAttributeFinish( void );
void HandleIMPAttributeFinish( void ); void HandleIMPAttributeFinish( void );
#endif #endif
+1 -1
View File
@@ -22,4 +22,4 @@ extern BOOLEAN fReturnStatus;
INT8 StartingLevelChosen(); // added - SANDRO INT8 StartingLevelChosen(); // added - SANDRO
#endif #endif
+9 -13
View File
@@ -24,6 +24,7 @@
#include "text.h" #include "text.h"
#include "LaptopSave.h" #include "LaptopSave.h"
#include <language.hpp>
#define FULL_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 138 #define FULL_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 138
#define NICK_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 195 #define NICK_NAME_CURSOR_Y LAPTOP_SCREEN_WEB_UL_Y + 195
@@ -552,14 +553,14 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
//Heinz (18.01.2009): Russian layout //Heinz (18.01.2009): Russian layout
// ViSoR (07.01.2012) : Russian and Belarussian layouts // ViSoR (07.01.2012) : Russian and Belarussian layouts
// //
#if defined(RUSSIAN) || defined(BELARUSSIAN) if(g_lang == i18n::Lang::ru) {
// ViSoR (02.02.2013): Fix for Cyrillic layouts // ViSoR (02.02.2013): Fix for Cyrillic layouts
DWORD threadId = GetWindowThreadProcessId( ghWindow, 0 ); DWORD threadId = GetWindowThreadProcessId( ghWindow, 0 );
DWORD layout = (DWORD)GetKeyboardLayout( threadId ) & 0xFFFF; DWORD layout = (DWORD)GetKeyboardLayout( threadId ) & 0xFFFF;
if( layout == 0x419 ) // Russian if( layout == 0x419 ) // Russian
{ {
unsigned char TranslationTable[] = unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨"; " #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨ ";
uiKey = TranslateKey( uiKey, TranslationTable ); uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey ); uiKey = GetCyrillicUnicodeChar( uiKey );
@@ -567,28 +568,23 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
else if( layout == 0x423 ) // Belarussian else if( layout == 0x423 ) // Belarussian
{ {
unsigned char TranslationTable[] = unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨"; " #Ý####ý####á-þ.0123456789ÆæÁ#Þ,#Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨ ";
uiKey = TranslateKey( uiKey, TranslationTable ); uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey ); uiKey = GetCyrillicUnicodeChar( uiKey );
} }
else if( !CheckIsKeyValid( uiKey ) ) else if( !CheckIsKeyValid( uiKey ) )
uiKey = '#'; uiKey = '#';
}
if( uiKey != '#') if( (g_lang != i18n::Lang::ru &&
#else uiKey >= 'A' && uiKey <= 'Z' ||
#ifndef USE_CODE_PAGE
if( uiKey >= 'A' && uiKey <= 'Z' ||
uiKey >= 'a' && uiKey <= 'z' || uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' || uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' || uiKey == '_' || uiKey == '.' ||
uiKey == ' ' || uiKey == '"' || uiKey == ' ' || uiKey == '"' ||
uiKey == 39 // This is ' which cannot be written explicitly here of course uiKey == 39 // This is ' which cannot be written explicitly here of course
) ) ||
#else uiKey != '#')
if( charSet::IsFromSet( uiKey, charSet::CS_SPACE|charSet::CS_ALPHA_NUM|charSet::CS_SPECIAL_ALPHA ) )
#endif
#endif
{ {
// if the current string position is at max or great, do nothing // if the current string position is at max or great, do nothing
switch( ubTextEnterMode ) switch( ubTextEnterMode )
+1 -1
View File
@@ -9,4 +9,4 @@ void HandleIMPBeginScreen( void );
#endif #endif
@@ -7,4 +7,4 @@ void RenderIMPCharacterAndDisabilityEntrance( void );
void ExitIMPCharacterAndDisabilityEntrance( void ); void ExitIMPCharacterAndDisabilityEntrance( void );
void HandleIMPCharacterAndDisabilityEntrance( void ); void HandleIMPCharacterAndDisabilityEntrance( void );
#endif #endif
+1 -1
View File
@@ -20,4 +20,4 @@ void ClearAllSkillsList( void );
extern STR8 pPlayerSelectedFaceFileNames[ NUMBER_OF_PLAYER_PORTRAITS ]; extern STR8 pPlayerSelectedFaceFileNames[ NUMBER_OF_PLAYER_PORTRAITS ];
extern STR8 pPlayerSelectedBigFaceFileNames[ NUMBER_OF_PLAYER_PORTRAITS ]; extern STR8 pPlayerSelectedBigFaceFileNames[ NUMBER_OF_PLAYER_PORTRAITS ];
#endif #endif
+5 -5
View File
@@ -526,7 +526,7 @@ void DistributeInitialGear(MERCPROFILESTRUCT *pProfile)
if(iOrder[i]!=-1) if(iOrder[i]!=-1)
{ {
// skip if this item is an attachment // skip if this item is an attachment
if(Item[tInv[iOrder[i]].inv].attachment) if(ItemIsAttachment(tInv[iOrder[i]].inv))
continue; continue;
iSet = FALSE; iSet = FALSE;
number = tInv[iOrder[i]].iNumber; number = tInv[iOrder[i]].iNumber;
@@ -1103,7 +1103,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
return HELMETPOS; return HELMETPOS;
if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST ) if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST )
return VESTPOS; return VESTPOS;
if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !(Item[usItem].attachment)) if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !ItemIsAttachment(usItem) )
return LEGPOS; return LEGPOS;
break; break;
case IC_BLADE: case IC_BLADE:
@@ -1132,7 +1132,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
case IC_GUN: case IC_GUN:
if ( pProfile->inv[HANDPOS] == NONE ) if ( pProfile->inv[HANDPOS] == NONE )
return HANDPOS; return HANDPOS;
if ( pProfile->inv[SECONDHANDPOS] == NONE && !(Item[pProfile->inv[HANDPOS]].twohanded)) if ( pProfile->inv[SECONDHANDPOS] == NONE && !(ItemIsTwoHanded(pProfile->inv[HANDPOS])))
return SECONDHANDPOS; return SECONDHANDPOS;
if((UsingNewInventorySystem() == true)) if((UsingNewInventorySystem() == true))
if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0) if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0)
@@ -1681,7 +1681,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
// give ammo for guns // give ammo for guns
Assert( usItem < gMAXITEMS_READ ); Assert( usItem < gMAXITEMS_READ );
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher ) if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{ {
usItem = DefaultMagazine(usItem); usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem )); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem ));
@@ -1726,7 +1726,7 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
MakeProfileInvItemAnySlot(pProfile,usItem,100,1); MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
// give ammo for guns // give ammo for guns
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher ) if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{ {
usItem = DefaultMagazine(usItem); usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem )); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
+1 -1
View File
@@ -10,4 +10,4 @@ void HandleIMPFinish( void );
extern BOOLEAN fFinishedCharGeneration; extern BOOLEAN fFinishedCharGeneration;
#endif #endif
+1 -1
View File
@@ -1285,7 +1285,7 @@ void DistributePossibleItemsToVectors(void)
{ {
gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName)); gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
if (Item[usItem].twohanded) { if (ItemIsTwoHanded(usItem)) {
gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName)); gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
} }
else { else {
+1 -1
View File
@@ -15,4 +15,4 @@ void HandleImpHomePage( void );
#define IMP_MERC_FILENAME "IMP" #define IMP_MERC_FILENAME "IMP"
extern INT32 GlowColorsList[][3]; extern INT32 GlowColorsList[][3];
#endif #endif
+1 -1
View File
@@ -29,4 +29,4 @@ enum
IMP__FINISH, IMP__FINISH,
}; };
#endif #endif
+1 -1
View File
@@ -9,4 +9,4 @@ void HandleIMPPersonalityEntrance( void );
STR16 pSkillTraitBeginIMPStrings[]; STR16 pSkillTraitBeginIMPStrings[];
#endif #endif
+1 -1
View File
@@ -9,4 +9,4 @@ void HandleIMPPersonalityFinish( void );
extern UINT8 bPersonalityEndState; extern UINT8 bPersonalityEndState;
#endif #endif
+1 -1
View File
@@ -12,4 +12,4 @@ void BltAnswerIndents( INT32 iNumberOfIndents );
extern INT32 giCurrentPersonalityQuizQuestion; extern INT32 giCurrentPersonalityQuizQuestion;
extern INT32 iCurrentAnswer; extern INT32 iCurrentAnswer;
#endif #endif
+1 -1
View File
@@ -10,4 +10,4 @@ BOOLEAN RenderPortrait( INT16 sX, INT16 sY );
extern INT32 iPortraitNumber; extern INT32 iPortraitNumber;
#endif #endif
+4 -3
View File
@@ -38,6 +38,7 @@
#include "GameSettings.h" #include "GameSettings.h"
#endif #endif
#include <language.hpp>
#define IMP_SEEK_AMOUNT 5 * 80 * 2 #define IMP_SEEK_AMOUNT 5 * 80 * 2
@@ -204,18 +205,18 @@ void PrintImpText( void )
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 81, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_6, FONT14ARIAL, FONT_BLACK, FALSE, 0);
//inshy (18.01.2009): fix position for russian text //inshy (18.01.2009): fix position for russian text
#ifdef RUSSIAN if( g_lang == i18n::Lang::ru ) {
// male // male
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 225, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0);
// female // female
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 335, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0);
#else } else {
// male // male
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 240, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_10, FONT14ARIAL, FONT_BLACK, FALSE, 0);
// female // female
LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0); LoadAndDisplayIMPText( LAPTOP_SCREEN_UL_X + 360, LAPTOP_SCREEN_WEB_UL_Y + 259, ( 640 ), IMP_BEGIN_11, FONT14ARIAL, FONT_BLACK, FALSE, 0);
#endif }
break; break;
case ( IMP_PERSONALITY ): case ( IMP_PERSONALITY ):
+1 -1
View File
@@ -145,4 +145,4 @@ enum{
}; };
#endif #endif
+1 -1
View File
@@ -9,4 +9,4 @@ UINT32 PlayVoice( void );
extern UINT32 iSelectedIMPVoiceSet; extern UINT32 iSelectedIMPVoiceSet;
#endif #endif
+1 -1
View File
@@ -835,4 +835,4 @@ template<> void TestTableTemplate<3>::Init( UINT16 sX, UINT16 sY, UINT16 sX_End
AddColumnDataProvider( itemnamecol );*/ AddColumnDataProvider( itemnamecol );*/
TestTable::Init( sX, sY, sX_End, sY_End ); TestTable::Init( sX, sY, sX_End, sY_End );
} }
+1 -1
View File
@@ -851,4 +851,4 @@ BOOLEAN LoadPMC( HWFILE hwFile )
} }
return TRUE; return TRUE;
} }
+1 -1
View File
@@ -254,4 +254,4 @@ private:
protected: protected:
}; };
#endif #endif
+1 -1
View File
@@ -305,4 +305,4 @@ enum{
}; };
#endif #endif
#endif #endif
+1 -1
View File
@@ -227,4 +227,4 @@ BOOLEAN WriteAimAvailability(STR fileName)
FileClose( hFile ); FileClose( hFile );
return( TRUE ); return( TRUE );
} }
+1 -1
View File
@@ -287,4 +287,4 @@ BOOLEAN WriteMercAvailability(STR fileName)
FileClose( hFile ); FileClose( hFile );
return( TRUE ); return( TRUE );
} }
+1 -1
View File
@@ -268,4 +268,4 @@ BOOLEAN ReadInDeliveryMethods(STR fileName)
return( TRUE ); return( TRUE );
} }
+1 -1
View File
@@ -236,4 +236,4 @@ BOOLEAN ReadInShippingDestinations(STR fileName, BOOLEAN localizedVersion)
XML_ParserFree(parser); XML_ParserFree(parser);
return( TRUE ); return( TRUE );
} }
+1 -1
View File
@@ -16,4 +16,4 @@ void RenderFloristCards();
extern INT8 gbCurrentlySelectedCard; extern INT8 gbCurrentlySelectedCard;
#endif #endif
+1 -1
View File
@@ -21,4 +21,4 @@ extern UINT32 guiCurrentlySelectedFlower;
extern UINT8 gubCurFlowerIndex; extern UINT8 gubCurFlowerIndex;
#endif #endif
+1 -1
View File
@@ -12,4 +12,4 @@ void InitFloristOrderForm();
void InitFloristOrderFormVariables(); void InitFloristOrderFormVariables();
#endif #endif
+1 -1
View File
@@ -7,4 +7,4 @@ void ExitInsuranceComments();
void HandleInsuranceComments(); void HandleInsuranceComments();
void RenderInsuranceComments(); void RenderInsuranceComments();
#endif #endif
+1 -1
View File
@@ -28,4 +28,4 @@ void InsuranceContractEndGameShutDown();
void PurchaseOrExtendInsuranceForSoldier( SOLDIERTYPE *pSoldier, UINT32 uiInsuranceLength ); void PurchaseOrExtendInsuranceForSoldier( SOLDIERTYPE *pSoldier, UINT32 uiInsuranceLength );
#endif #endif
+1 -1
View File
@@ -9,4 +9,4 @@ void RenderInsuranceInfo();
void EnterInitInsuranceInfo(); void EnterInitInsuranceInfo();
#endif #endif

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