Commit Graph
515 Commits
Author SHA1 Message Date
fd2c74727e Make LANGUAGE switchable in runtime (#653)
squashed into a single commit because doing it in steps that all
compiled involved a lot of boilerplate that is pointless to commit to
the repository. GH still has the PR for reference.

g_lang, MAX_MESSAGES_ON_MAP_BOTTOM, and GetLanguagePrefix() were
compile-time constants selected by the ENGLISH/GERMAN/... build
define. They're now runtime, defaulting to the same per-exe value the
define used to pick, and overridable at startup from [Ja2 Settings]
LANGUAGE in Ja2.ini.

-

XMLTacticalMessages is filled at runtime from NewTacticalMessages.xml,
never from compiled-in per-language data: all 8 per-language definitions
were the identical all-zero { L"" }. Delete them and define one shared
buffer in Utils/XML_Language.cpp (the loader) instead of pointer-rebinding
it like the static tables — this drops 9 dead 800KB zero-buffers (8
namespaced copies in LanguageStrings.cpp plus the standalone one) and
leaves no bind-ordering hazard for the XML load path.

-

ExportStrings.cpp privately recompiled one language's full text table
by #including the raw _<LANG>Text.cpp inside namespace Loc, keyed off
the exe-level ENGLISH/GERMAN/... compile macro (whichever the build
happened to select). That's redundant with the pointer globals every
other subsystem already uses (Text.h / LanguageStrings.cpp).

Drop the private copy; the unqualified table names in Loc::ExportStrings
now resolve to the global pointer externs, which BindLanguageStrings has
already rebound to the runtime g_lang by the time this runs (EXPORT_STRINGS
ini flag, checked after GetRuntimeSettings in sgp.cpp). gs_Lang (used only
by Loc::Translate for the Polish/Russian byte remap on raw .edt exports) is
now derived from g_lang via ToLocLanguage, so the export always matches
whatever language is actually active instead of a compile-time pick.

-

Editor/popupmenu.cpp and Strategic/Scheduling.cpp kept their own
call-site extern of gszScheduleActions as CHAR16[NUM_SCHEDULE_ACTIONS][20]
after the real definition changed into a rebindable pointer
(CHAR16 (*)[20], LanguageStrings.cpp). MSVC decays the outer array
dimension when mangling globals, so both declarations produce the same
symbol (?gszScheduleActions@@3PAY0BE@_WA) and the mismatch linked
silently -- but the array-typed TUs then indexed the 4-byte pointer
slot itself as string data, so the editor schedule popup and the map
schedule message text read garbage.

-

add text.def to be single-source of truth on symbol names and use it
 .much simpler, less error prone if adding more strings

-

add pseudo interface for language state. MAX_SAGES_ON_BOTTOM must always
 change in lockstep with g_lang. this isn't foolproof but better

---------

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-07-21 05:33:03 -03:00
Asdow c61f57bd9b Whitespace adjustment 2026-06-22 00:21:31 +03:00
Asdow 4d5593ebcb Fix render misalignment at 960x540 resolution
Should also work for any custom resolution that suffers from the same issue
2026-06-22 00:21:31 +03:00
Asdow 601fabf401 Fix tile rendering misalignment at 1440x900 and 1600x900 resolutions
Shamelessly stolen from Stracciatella code
2026-06-22 00:21:31 +03:00
Asdow 9e0105caec Add function for choosing random gridno in an unloaded sector 2026-06-15 22:01:07 +03:00
Asdow 0cc7fb4e39 Add function for loading world height data 2026-06-15 22:01:07 +03:00
Asdow 09197e421c Add a function for finding last matching structure 2026-05-06 11:28:11 +03:00
Asdow 4fcf03d31a Include cleanup Tactical/.*cpp 2025-12-09 00:35:18 +02:00
Asdow 4a43b7704e Set functions static 2025-11-23 18:28:17 +02:00
Asdow 4a813e567a Remove unused includes 2025-11-23 18:28:17 +02:00
Asdow ea4cea2231 Set functions static 2025-11-23 18:28:17 +02:00
Asdow f263c7270f Remouve unused function declarations 2025-11-23 18:28:17 +02:00
Asdow 4b38f56d1f Set functions static 2025-11-23 18:28:17 +02:00
Asdow 9bf289561b Move includes to top of file 2025-11-23 18:28:17 +02:00
Asdow 10fa5f37d6 Formatting 2025-11-23 18:28:17 +02:00
Asdow 0d8873d2c0 Remove unused includes 2025-11-23 18:28:17 +02:00
Asdow f2b88ef080 Remove duplicate include 2025-11-23 18:28:17 +02:00
Asdow 677b320534 Set functions static 2025-11-23 18:28:17 +02:00
Asdow 265a7c0af7 Remove unused function declaration 2025-11-23 18:28:17 +02:00
Asdow 04b1937caa Fix function definition 2025-11-23 18:28:17 +02:00
Asdow 8fe051dc8d Declare functions static 2025-11-19 21:11:19 +02:00
Asdow da83c6a557 Fix power gen fan sound
* Stop fan sound when switching sector
* Start fan sound when loading a save where current sector is power gen sector
2025-10-06 22:09:39 +03:00
Asdow d21b487884 Fix include filenames 2025-09-25 13:06:18 +03:00
Asdow 82aca548f5 Merge branch 'master' into ExtraMercs 2025-09-24 16:14:10 +03:00
BeatAroundTheBuscherandGitHub ed00830202 Fixes Upper/Lower Casing for include paths (#487)
* Fixing upper/lower case for includes

types.h, zconf.h and zlib.h were renamed so that global includes like Types.h
are not used.
2025-08-16 22:01:12 -03:00
Asdow fd9611ae04 Remove compiler warnings 2025-08-08 18:38:53 +03:00
Asdow c62d767622 Update to Master 2025-08-08 18:00:31 +03:00
Asdow 872a356e82 Correct column size check 2025-07-23 15:11:03 +03:00
Asdow 1a8db5d15b More conversions to SoldierID 2025-06-27 19:58:20 +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 f21cb38647 Increase TileNo to UINT32
Bigmap grid number values go over uint16 max
2025-04-05 16:20:37 +03:00
Asdow fffb3a45fb Remove 8bit mode
Obsolete and doesn't work

* Remove gbPixelDepth
* Remove 8-bit to 8-bit blitters
* FileNameForBPP now only calls strcopy
2025-02-24 21:42:36 +02:00
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
Asdow ffccdfa654 Fix Tactical Placement GUI for increased teamsizes
Requires new file OverheadInterface_scrollarea.sti in Gamedir/Data/Interface/
2024-12-04 00:18:22 +02:00
Asdow bfb724eab9 Use SoldierID 2024-12-01 18:23:52 +02:00
Asdow 4e8c5fa9ab Remove unused function & globals 2024-11-30 23:50:17 +02:00
Asdow 4645a09722 Use SoldierID 2024-11-30 16:07:36 +02:00
Asdow 18673f3a29 Remove compiler warning 2024-11-18 23:58:14 +02:00
Asdow 94a5972a85 Perform explicit casts from UINT8 to UINT16 for SoldierID 2024-11-18 23:38:00 +02:00
Asdow 9fb29cf444 Remove UINT8 conversions 2024-11-18 23:12:00 +02:00
Asdow ca1112313a Increase ubUserData2 from UINT8 to UINT16 2024-11-18 23:11:41 +02:00
Asdow dd2c6f44b2 Fix incorrect function arguments 2024-11-18 22:38:28 +02:00
Asdow f49013307f Convert to SoldierID 2024-11-18 01:01:57 +02:00
Asdow b74ccf3ddc Convert to SoldierID 2024-11-17 23:45:48 +02:00
Asdow d149b6ffea Correct parameter order 2024-11-17 22:39:58 +02:00
Asdow ef9aa1b027 Convert to SoldierID 2024-11-17 22:29:31 +02:00
Asdow b6e8b0c5ff Convert to SoldierID 2024-11-17 21:09:13 +02:00
Asdow 74d752d452 More conversions to SoldierID 2024-11-17 18:15:36 +02:00
Asdow 9acf994952 Convert gusTempDragBuildSoldierID to SoldierID 2024-11-17 16:50:01 +02:00
Asdow 274be524e6 More functions converted to SoldierID 2024-11-17 16:25:12 +02:00