Skip to content

Commit

Permalink
Merge pull request #125 from xpenatan/master
Browse files Browse the repository at this point in the history
Release v1.0.1
  • Loading branch information
xpenatan authored Jul 10, 2024
2 parents 41943bb + a63dcd3 commit 3ce4e2f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 50 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/tag.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[-SNAPSHOT]

[1.0.1]
- Fix an issue when creating database and trying to load assets.
- Quick fix to filter out assets.txt file and to delete it before adding new files

[1.0.0]
- Update teavm to 0.10.0
- Pixmap now use Gdx2DPixmap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ public void handleEvent(EventWrapper evt) {
});
}

assetLoader.preload(config, "assets.txt");

window.requestAnimationFrame(this);
}

Expand All @@ -218,10 +216,14 @@ public void run() {
switch(state) {
case INIT:
if(delayInitCount == 0) {
initState = AppState.LOAD_ASSETS;
initState = AppState.PRELOAD_ASSETS;
}
break;
case LOAD_ASSETS:
case PRELOAD_ASSETS:
assetLoader.preload(config, "assets.txt");
initState = AppState.DOWNLOAD_ASSETS;
break;
case DOWNLOAD_ASSETS:
int queue = AssetDownloader.getInstance().getQueue();
if(queue == 0) {
initState = AppState.APP_LOOP;
Expand Down Expand Up @@ -469,7 +471,8 @@ public static boolean isMobileDevice () {

public enum AppState {
INIT,
LOAD_ASSETS,
PRELOAD_ASSETS,
DOWNLOAD_ASSETS,
APP_CREATE,
APP_LOOP
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class DefaultAssetFilter implements AssetFilter {
public boolean accept(String file, boolean isDirectory) {
if(isDirectory && file.endsWith(".svn")) return false;
if(file.endsWith(".jar")) return false;
if(file.endsWith("assets.txt")) return false;
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -503,20 +503,25 @@ public static void configAssets(TeaClassLoader classLoader, TeaBuildConfiguratio
useDefaultHTMLIndexFile(classLoader, configuration, webappDistFolder, webappName, webappFolder);
}

if(assetFile.exists()) {
assetFile.delete();
}

boolean generateAssetPaths = configuration.shouldGenerateAssetFile();

ArrayList<AssetsCopy.Asset> alLAssets = new ArrayList<>();
// Copy Assets files
ArrayList<AssetFileHandle> assetsPaths = configuration.assetsPath();
for(int i = 0; i < assetsPaths.size(); i++) {
AssetFileHandle assetFileHandle = assetsPaths.get(i);
ArrayList<AssetsCopy.Asset> assets = AssetsCopy.copyAssets(assetFileHandle, filter, assetsFolder);
if(generateAssetPaths) {
AssetsCopy.generateAssetsFile(assets, assetsFolder, assetFile);
}
alLAssets.addAll(assets);
}

if(assetFile.exists()) {
// Delete assets.txt before adding the updated list.
assetFile.delete();
}

if(generateAssetPaths) {
AssetsCopy.generateAssetsFile(alLAssets, assetsFolder, assetFile);
}

// Copy assets from resources
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=1.0.0
version=1.0.1
gdxSourcePath = E:/Dev/Projects/java/libgdx
teavmPath = E:/Dev/Projects/java/teavm
includeLibgdxSource = false
Expand Down

0 comments on commit 3ce4e2f

Please sign in to comment.