Skip to content

Commit

Permalink
Fix an issue when creating database and trying to load assets.
Browse files Browse the repository at this point in the history
  • Loading branch information
xpenatan committed Jul 10, 2024
1 parent eeb8953 commit ac59316
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit ac59316

Please sign in to comment.