Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.0.1 #125

Merged
merged 5 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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