Skip to content

Commit

Permalink
revert 3D levels
Browse files Browse the repository at this point in the history
  • Loading branch information
codex128 committed Dec 15, 2024
1 parent 6e3b45d commit 92bdb46
Show file tree
Hide file tree
Showing 91 changed files with 7,899 additions and 6,721 deletions.
Binary file added assets/Models/units/brick.bin
Binary file not shown.
Binary file modified assets/Models/units/brick.j3o
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/Models/units/brick.j3odata
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#
#Thu Jan 19 12:30:56 EST 2023
#Sun Dec 15 08:08:37 EST 2024
ORIGINAL_PATH=Models/units/brick.gltf
Binary file added assets/Models/units/bricks.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Models/units/bricks_normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Scenes/lagoon-probe.j3o
Binary file not shown.
Binary file modified assets/Textures/bricks_normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 58 additions & 46 deletions src/codex/goldrunner/AudioLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
* @author gary 
*/
public class AudioLibrary extends BaseAppState {
HashMap<String, Audio> audio = new HashMap<>();
LinkedList<Audio> loadbucket = new LinkedList<>();

HashMap<String, Audio> audio = new HashMap<>();
LinkedList<Audio> loadbucket = new LinkedList<>();

@Override
protected void initialize(Application app) {
//It is technically safe to do all initialization and cleanup in the        
Expand All @@ -32,65 +32,77 @@ protected void initialize(Application app) {
//implementor.       
//TODO: initialize your AppState, e.g. attach spatials to rootNode   
}

@Override
protected void cleanup(Application app) {
//TODO: clean up what you initialized in the initialize method,       
//e.g. remove all spatials from rootNode   
}
}

@Override
protected void onEnable() {
//Called when the state is fully enabled, ie: is attached and        
//isEnabled() is true or when the setEnabled() status changes after the        
//state is attached.   
}
}

@Override
protected void onDisable() {
//Called when the state was previously enabled but is now disabled        
//either because setEnabled(false) was called or the state is being        
//cleaned up.
}

@Override
public void update(float tpf) {
//TODO: implement behavior during runtime   
}

public void addAudio(String name, String source) {
Audio aud = new Audio(source);
audio.put(name, aud);
loadbucket.add(aud);
}
public AudioData getAudioData(String name) {
return audio.get(name).data;
}
public AudioNode createAudioNode(String name) {
return new AudioNode(audio.get(name).data, new AudioKey());
}

public void loadAudioBucket() {
for (Audio aud : loadbucket) {
aud.load(getApplication().getAssetManager());
}
loadbucket.clear();
}
public void loadNext() {
if (loadbucket.isEmpty()) return;
loadbucket.getFirst().load(getApplication().getAssetManager());
loadbucket.removeFirst();
}
public boolean audioInBucket() {
return !loadbucket.isEmpty();
}


private static class Audio {
String source;
AudioData data;
Audio(String source) {
this.source = source;
}
void load(AssetManager assets) {
data = assets.loadAudio(source);
}
}


public void addAudio(String name, String source) {
Audio aud = new Audio(source);
audio.put(name, aud);
loadbucket.add(aud);
}

public AudioData getAudioData(String name) {
return audio.get(name).data;
}

public AudioNode createAudioNode(String name) {
return new AudioNode(audio.get(name).data, new AudioKey());
}

public void loadAudioBucket() {
for (Audio aud : loadbucket) {
aud.load(getApplication().getAssetManager());
}
loadbucket.clear();
}

public void loadNext() {
if (loadbucket.isEmpty()) {
return;
}
loadbucket.getFirst().load(getApplication().getAssetManager());
loadbucket.removeFirst();
}

public boolean audioInBucket() {
return !loadbucket.isEmpty();
}

private static class Audio {

String source;
AudioData data;

Audio(String source) {
this.source = source;
}

void load(AssetManager assets) {
data = assets.loadAudio(source);
}
}

}
Loading

0 comments on commit 92bdb46

Please sign in to comment.