Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
240407d
Fix OutOfBounds exceptions
tdauth May 13, 2026
4ca9472
War3MapW3i for version 33 and unit test
tdauth May 14, 2026
f1ce2e8
War3MapW3e for version 12 and unit test
tdauth May 14, 2026
b9755c3
War3MapW3e for version 12 and unit test
tdauth May 14, 2026
e69d79d
War3MapW3e for version 12 and unit test
tdauth May 14, 2026
2c6ed5f
Fix IndexOutOfBoundsException
tdauth May 14, 2026
1a93d29
Make sure defaultRace is never null
tdauth May 14, 2026
72ee6fe
War3ObjectDataChangeset support version 3 sets on loading files
tdauth May 14, 2026
b298a08
fromId
tdauth May 14, 2026
b2c3918
WarcraftIIICASC.main to extract Reforged into a local directory
tdauth May 14, 2026
ffb782d
getPortraitModel fix StringIndexOutOfBoundsException
tdauth May 14, 2026
67522da
ModelViewer.load
tdauth May 14, 2026
c90f20d
Do not load abilities_main #70
tdauth May 14, 2026
932c163
War3ObjectDataChangesetTest
tdauth May 14, 2026
0ce626d
unit tests
tdauth May 14, 2026
2b6ebfb
War3ObjectDataChangeset
tdauth May 14, 2026
c0c8050
War3ObjectDataChangeset fix writing the object count
tdauth May 15, 2026
9363894
War3ObjectDataChangesetTest
tdauth May 15, 2026
e59ce68
Check string length
tdauth May 15, 2026
a394f44
MdxModel simple overloading of load instead of instanceof for type sa…
tdauth May 15, 2026
b7c46c1
Check if resource files exist before loading them to avoid exceptions
tdauth May 15, 2026
1161466
nullable
tdauth May 15, 2026
9e191fe
Native UnitInventorySize
tdauth May 15, 2026
9e9cbd7
Native KillDestructable nullable
tdauth May 15, 2026
65242ce
Native BlzCreateDestructableZWithSkin
tdauth May 15, 2026
689800e
Native Player checks playerIndex boundaries, GetPlayerController and …
tdauth May 15, 2026
6bb3377
Native TriggerRegisterEnterRegion allows null parameters
tdauth May 15, 2026
3158f6a
JASS type region supports handle ID
tdauth May 15, 2026
ba96034
getNullValue
tdauth May 15, 2026
9dcc1e6
Make JASS native GetHandleId more stable since many types do not impl…
tdauth May 15, 2026
3a722dc
Make JASS native GetHandleId more stable since many types do not impl…
tdauth May 15, 2026
be46273
Support native JASS function BlzSetUnitName and avoid ConcurrentModif…
tdauth May 15, 2026
1a6b50f
Support native JASS function GetHeroLevel
tdauth May 15, 2026
57a0e79
Support native JASS functions GetHeroProperName and BlzSetHeroProperName
tdauth May 15, 2026
3c50511
handleId for CHashtable
tdauth May 15, 2026
dfd2a41
BlzSetUnitName use empty string instead of null to avoid exceptions, …
tdauth May 15, 2026
a5428d2
CRect which supports handleId
tdauth May 15, 2026
012ff44
nullableWithWarning to show warnings in log for null parameters
tdauth May 15, 2026
35c18c8
JASS native GetDestructableTypeId
tdauth May 17, 2026
ced72e8
nullableWithWarning
tdauth May 17, 2026
3d063db
JASS native TimerDialogDisplay
tdauth May 17, 2026
10ef110
JASS native TimerDialogSetTitle
tdauth May 17, 2026
e0824f1
JASS native IsTimerDialogDisplayed
tdauth May 17, 2026
15f367e
JASS native TimerDialogSetTitleColor and native TimerDialogSetTimeColor
tdauth May 17, 2026
43fffc7
DisabledPathingProcessor to avoid "OutOfMemoryError: Java heap space"…
tdauth May 18, 2026
9ed1acd
Fix null pointer exception in RenderItem if model has not been found …
tdauth May 18, 2026
d4d63f1
More detailed exception message
tdauth May 18, 2026
85c1a67
More detailed exception message
tdauth May 18, 2026
a984fe5
GetUnitUserData and SetUnitUserData more stable with unit = null
tdauth May 18, 2026
858442d
Preloader check if file does actually exist to avoid NullPointerExcep…
tdauth May 18, 2026
e3ca61a
null check for StringLength
tdauth May 21, 2026
dc414ef
null check for CreateCorpse
tdauth May 21, 2026
5aa8b76
null checks for SetUnitBlendTime
tdauth May 21, 2026
b8d5b69
null checks for trigger natives
tdauth May 21, 2026
bb8dbf1
null checks for DisplayTextToPlayer
tdauth May 21, 2026
277326e
null checks for minimap icons
tdauth May 21, 2026
b23b586
getAnyExtensionTexture
tdauth May 21, 2026
3eb0d21
loadTOCFile logging
tdauth May 21, 2026
0a5a0a4
JASS native BlzLoadTOCFile
tdauth May 21, 2026
9e2b135
loadTOCFile checks for file existence to avoid null pointer exception
tdauth May 21, 2026
c416645
loadTOCFile ignore empty lines
tdauth May 21, 2026
873c5a8
Fix ArrayIndexOutOfBoundsException: Index -30 out of bounds for leng…
tdauth May 22, 2026
202724f
FDFParserBuilder.build checks for file existance and returns null on …
tdauth May 22, 2026
6f8f1df
null checks and stack traces for GetLocalizedString and GetLocalizedH…
tdauth May 22, 2026
6cc4678
No IndexOutOfBounds exception for JASS array access
tdauth May 22, 2026
4fdcd44
loadTOCFile checks for file existance
tdauth May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ project(":core") {
api "org.apache.commons:commons-compress:1.20"
api "net.nikr:dds:1.0.0"
api files(fileTree(dir:'../jars', includes: ['*.jar']))

testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.2"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.2"
}

test {
useJUnitPlatform()
}
}

Expand Down
11 changes: 9 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

sourceCompatibility = 1.17

sourceSets.main.java.srcDirs = [ "src/" ]

sourceSets {
main {
java.srcDirs = [ "src/" ]
}
test {
java.srcDirs = [ "test/" ]
resources.srcDirs = [ "test/resources" ]
}
}

eclipse.project {
name = appName + "-core"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,32 @@ public DataSourceFDFParserBuilder(final DataSource dataSource) {

@Override
public FDFParser build(final String path) {
FDFLexer lexer;
try {
lexer = new FDFLexer(CharStreams.fromStream(this.dataSource.getResourceAsStream(path)));
}
catch (final IOException e) {
throw new RuntimeException(e);
}
final FDFParser fdfParser = new FDFParser(new CommonTokenStream(lexer));
final BaseErrorListener errorListener = new BaseErrorListener() {
@Override
public void syntaxError(final Recognizer<?, ?> recognizer, final Object offendingSymbol, final int line,
final int charPositionInLine, final String msg, final RecognitionException e) {
String sourceName = path;
if (!sourceName.isEmpty()) {
sourceName = String.format("%s:%d:%d: ", sourceName, line, charPositionInLine);
}

System.err.println(sourceName + "line " + line + ":" + charPositionInLine + " " + msg);
if (this.dataSource.has(path)) {
System.out.println("Loading FDF file: " + path);
FDFLexer lexer;
try {
lexer = new FDFLexer(CharStreams.fromStream(this.dataSource.getResourceAsStream(path)));
} catch (final IOException e) {
throw new RuntimeException(e);
}
};
fdfParser.addErrorListener(errorListener);
return fdfParser;
final FDFParser fdfParser = new FDFParser(new CommonTokenStream(lexer));
final BaseErrorListener errorListener = new BaseErrorListener() {
@Override
public void syntaxError(final Recognizer<?, ?> recognizer, final Object offendingSymbol, final int line,
final int charPositionInLine, final String msg, final RecognitionException e) {
String sourceName = path;
if (!sourceName.isEmpty()) {
sourceName = String.format("%s:%d:%d: ", sourceName, line, charPositionInLine);
}

System.err.println(sourceName + "line " + line + ":" + charPositionInLine + " " + msg);
}
};
fdfParser.addErrorListener(errorListener);
return fdfParser;
} else {
System.err.println("Missing FDF file: " + path);
return null;
}
}
}
32 changes: 19 additions & 13 deletions core/src/com/etheller/warsmash/parsers/fdf/GameUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,26 @@ public static GameSkin loadSkin(final DataSource dataSource, final int skinIndex
}

public void loadTOCFile(final String tocFilePath) throws IOException {
final DataSourceFDFParserBuilder dataSourceFDFParserBuilder = new DataSourceFDFParserBuilder(this.dataSource);
final FrameDefinitionVisitor fdfVisitor = new FrameDefinitionVisitor(this.templates,
dataSourceFDFParserBuilder);
System.err.println("Loading TOC file: " + tocFilePath);
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(this.dataSource.getResourceAsStream(tocFilePath)))) {
String line;
int tocLines = 0;
while ((line = reader.readLine()) != null) {
final FDFParser firstFileParser = dataSourceFDFParserBuilder.build(line);
fdfVisitor.visit(firstFileParser.program());
tocLines++;
if (this.dataSource.has(tocFilePath)) {
final DataSourceFDFParserBuilder dataSourceFDFParserBuilder = new DataSourceFDFParserBuilder(this.dataSource);
final FrameDefinitionVisitor fdfVisitor = new FrameDefinitionVisitor(this.templates,
dataSourceFDFParserBuilder);
System.out.println("Loading TOC file: " + tocFilePath);
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(this.dataSource.getResourceAsStream(tocFilePath)))) {
String line;
int tocLines = 0;
while ((line = reader.readLine()) != null) {
final FDFParser firstFileParser = dataSourceFDFParserBuilder.build(line);
if (firstFileParser != null) {
fdfVisitor.visit(firstFileParser.program());
}
tocLines++;
}
System.out.println("TOC file loaded " + tocLines + " lines");
}
System.out.println("TOC file loaded " + tocLines + " lines");
} else {
System.err.println("TOC file not found: " + tocFilePath);
}
}

Expand Down
4 changes: 3 additions & 1 deletion core/src/com/etheller/warsmash/parsers/fdf/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public static void main(final String[] args) {
String line;
while ((line = reader.readLine()) != null) {
final FDFParser firstFileParser = dataSourceFDFParserBuilder.build(line);
fdfVisitor.visit(firstFileParser.program());
if (firstFileParser != null) {
fdfVisitor.visit(firstFileParser.program());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.EnumMap;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
Expand Down Expand Up @@ -399,4 +400,8 @@ public String getName() {
public Rectangle getRenderBounds() {
return this.renderBounds;
}

public static Color createColor8888(int r, int g, int b, int a) {
return new Color(r / 255f, g / 255f, b / 255f, a / 255f);
}
}
Loading