Commit Graph
4226 Commits
Author SHA1 Message Date
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