Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
6a42fef
Visibility modifier tweaks for PixmapPacker
Anuken May 26, 2026
8186d87
Misc minor chnages
Anuken May 26, 2026
f5a6dc4
Target Java 17
Anuken May 28, 2026
c5139df
Apparently this breaks RoboVM
Anuken May 28, 2026
a046279
File name utilities
Anuken May 29, 2026
9979f6e
WIP sound refactoring
Anuken May 29, 2026
a4f1529
More minor fixes
Anuken May 30, 2026
3888f3b
Misc utility function things
Anuken Jun 1, 2026
0451762
More utilities
Anuken Jun 2, 2026
3893c9b
Faster TCP idle sending
Anuken Jun 3, 2026
7c7c92f
Strange formatting fixed
Anuken Jun 3, 2026
b1991c0
Removed unused audio methods
Anuken Jun 8, 2026
aaa6d75
Audio utils
Anuken Jun 10, 2026
62887bd
File chooser linux support fixed (needs rebuild)
Anuken Jun 11, 2026
c30960f
Update natives.yml
Anuken Jun 12, 2026
3bfd74e
Misc utilities and natives fixes
Anuken Jun 12, 2026
6d00d12
oh no
Anuken Jun 12, 2026
57c733c
oh no
Anuken Jun 12, 2026
2272d2e
.
Anuken Jun 12, 2026
b0d427e
native build
Anuken Jun 12, 2026
0caff60
native build
Anuken Jun 12, 2026
f598366
native build
Anuken Jun 12, 2026
733e223
native build
Anuken Jun 12, 2026
1e14122
fixed mac build script
Anuken Jun 12, 2026
de361a3
Merge remote-tracking branch 'origin/master'
Anuken Jun 12, 2026
50e29b1
Updated natives
Anuken Jun 12, 2026
b889edb
Merge remote-tracking branch 'origin/master'
Anuken Jun 12, 2026
3348a71
the mysterious iOS disappearance
Anuken Jun 12, 2026
45a81cd
Fixed iOS build
Anuken Jun 13, 2026
6460f9d
Possible iOS fix
Anuken Jun 13, 2026
36a2e9f
SpriteCache tweaks
Anuken Jun 14, 2026
382d703
Merge branch 'master' of https://github.com/Anuken/Arc
Anuken Jun 14, 2026
95cc77d
Fixed spurious shader disposal
Anuken Jun 14, 2026
6ea6355
SpriteCache fix
Anuken Jun 14, 2026
d08408f
Lazy sound loading system
Anuken Jun 14, 2026
6e3c0bb
Cleanup
Anuken Jun 14, 2026
2b0a95e
Misc utils
Anuken Jun 15, 2026
abb6cc1
SpriteBatch count stat
Anuken Jun 15, 2026
9a0fdca
Fixed AA shaders
Anuken Jun 19, 2026
8245c98
Updated soloud
Anuken Jun 21, 2026
a39129e
Pixmap packer page limit
Anuken Jun 21, 2026
9d27030
Fixed incorrect defaults for PixmapPacker
Anuken Jun 21, 2026
5b2c857
Rect contains util
Anuken Jun 22, 2026
f30acd2
Time manipulation methods
Anuken Jun 22, 2026
cd4e413
Synced collections with upstream
Anuken Jun 26, 2026
ca207c9
arc
Anuken Jun 26, 2026
ba33c36
Fixed inconsistent map behavior
Anuken Jun 26, 2026
09e1e41
ObjectSet crash fix
Anuken Jun 27, 2026
f96ada3
Server cleanup
Anuken Jun 30, 2026
22a9911
Removed redundant keepAlive call
Anuken Jun 30, 2026
41219a4
Caught keys fix
Anuken Jul 2, 2026
da9887f
Minor optimization
Anuken Jul 4, 2026
f229d1f
Arcnet bulk-serialization sending
Anuken Jul 4, 2026
b558339
Don't crash when unloading
Anuken Jul 5, 2026
6aee8e7
Asset utils
Anuken Jul 5, 2026
87465b8
Fixed collections infinite loop
Anuken Jul 7, 2026
231e4df
Reverted file optimization, apparently it's broken for no reason
Anuken Jul 7, 2026
c01e276
Attempt the fast path in file copies
Anuken Jul 7, 2026
2324db6
nevermind
Anuken Jul 7, 2026
ac4f459
Fix ObjectMap.entries().toArray() (#203)
BalaM314 Jul 7, 2026
c674a57
Native utils setenv
Anuken Jul 7, 2026
ddf3bb6
Native utils setenv 2
Anuken Jul 8, 2026
6b5db45
Native utils setenv 3
Anuken Jul 8, 2026
12840e4
More pointless attempts at fixing file dialog
Anuken Jul 8, 2026
1a92634
Added missing HTTP status codes
Anuken Jul 9, 2026
7f0bc38
Version utils
Anuken Jul 9, 2026
95bc064
Fixed condition invert
Anuken Jul 9, 2026
6a97615
Map utility
Anuken Jul 9, 2026
57002b1
Testing Linux ARM
Anuken Jul 10, 2026
ea0cd9a
ARM tests (2)
Anuken Jul 10, 2026
f40f5d6
More build script fixes
Anuken Jul 10, 2026
ca3e827
ARM natives
Anuken Jul 10, 2026
a0fc357
Fixed version parsing
Anuken Jul 10, 2026
c039e0f
Fixed ObjectSet null add
Anuken Jul 11, 2026
7637600
Settings JS compatibility for numbers
Anuken Jul 12, 2026
e0ebbbb
Public tcp/udp connection
Anuken Jul 13, 2026
7b92242
Bus parameter for sounds
Anuken Jul 13, 2026
3985431
Workflow update
Anuken Jul 14, 2026
d72b192
Fixed isValid call spam for text fields
Anuken Jul 14, 2026
0137716
Pixmap crop with padding
Anuken Jul 15, 2026
208a754
Antialiasing cleanup
Anuken Jul 15, 2026
91c2b59
Unset key bindings (#205)
cardillan Jul 17, 2026
61e261c
SpriteBatch sorting optimization
Anuken Jul 17, 2026
24e32bf
Merge remote-tracking branch 'origin/master'
Anuken Jul 17, 2026
dc67fb1
Multithreading detection fix
Anuken Jul 17, 2026
18fd1e1
Cast check for Boolean
Anuken Jul 19, 2026
d825843
Autowrapped table impl
Anuken Jul 23, 2026
fee7da3
Line miter limit fix
Anuken Jul 24, 2026
8fe6402
Cell tooltip utility
Anuken Jul 27, 2026
55891b9
Update jnigen-gradle to 3.1.2 (#206)
MarcelCoding Jul 27, 2026
1774425
Fixed Jval not quoting brackets/commas
Anuken Jul 29, 2026
1358e7a
Merge remote-tracking branch 'origin/master'
Anuken Jul 29, 2026
e98cf2d
Jval read optimization
Anuken Jul 29, 2026
33e0222
Cleanup
Anuken Jul 29, 2026
24e94ac
More Jval perf improvements
Anuken Jul 29, 2026
24135dd
More Jval optimizations + tests
Anuken Jul 29, 2026
c2e2d47
MinAPI Android cleanup
Anuken Jul 30, 2026
2611abd
Jval parsing fix
Anuken Jul 30, 2026
e176f0d
Jval write optimized
Anuken Jul 31, 2026
c0f7099
Physics refactor
Anuken Aug 1, 2026
b0880b1
misc fixes
Anuken Aug 1, 2026
048e662
Fixed parseDouble/parseFloat, added more tests
Anuken Aug 3, 2026
0412789
parseLong fix
Anuken Aug 3, 2026
3ff071c
Tighter JSON serialization
Anuken Aug 5, 2026
6579348
Stricter JSON allow-list
Anuken Aug 5, 2026
beed632
parseColor
Anuken Aug 5, 2026
6e8f4eb
Fixed color parsing error
Anuken Aug 5, 2026
f3260c9
Updated soloud target version
Anuken Aug 5, 2026
50ae285
Updated soloud target version
Anuken Aug 5, 2026
bd04d32
Updated natives
Anuken Aug 6, 2026
33cbf63
TextureAtlas getDrawable
Anuken Aug 6, 2026
36ff525
Updated actions
Anuken Aug 7, 2026
e0b1b97
Updated actions 2
Anuken Aug 7, 2026
f6b568b
Minor cleanup & JSON mod folder loading fix
Anuken Aug 8, 2026
c38f8f5
Fixed text buttons with no size having broken wrapping
Anuken Aug 8, 2026
aaaa7df
Updated iOS backend to new scene-based lifecycle
Anuken Aug 8, 2026
f137581
UI text input fix
Anuken Aug 8, 2026
d6dbf68
Another attempt
Anuken Aug 8, 2026
239eb93
Finally fixed iOS multiline text input
Anuken Aug 8, 2026
6b6b816
Fixed multithreaded blend
Anuken Aug 10, 2026
c47b701
String deflate
Anuken Aug 12, 2026
05ecc2c
Arg for method param generation
Anuken Aug 12, 2026
55553d1
RoboVM update
Anuken Aug 13, 2026
70e8ffa
Removed outdated TextField docs
Anuken Aug 14, 2026
911e251
Add net listeners to the back of the listen queue. (#208)
buthed010203 Aug 19, 2026
42010d0
Fix table rounding issues when row/col heights are not integers (most…
buthed010203 Aug 20, 2026
f2398c0
Label wrapFit
Anuken Sep 1, 2026
4a8284b
Defensively copy text button style to fix mod mutation bugs
Anuken Sep 4, 2026
765d68f
Crash fix
Anuken Sep 5, 2026
c4c3707
Fixed quadtree StackOverflow
Anuken Sep 6, 2026
b71cff8
Updated soloud
Anuken Sep 7, 2026
3eb7d63
Updated soloud
Anuken Sep 7, 2026
e38155d
Soloud update
Anuken Sep 7, 2026
eb4003e
Updated natives
Anuken Sep 7, 2026
889dd88
Update README.md
Anuken Sep 8, 2026
ae321d0
Revert "Fix table rounding issues when row/col heights are not intege…
Anuken Sep 11, 2026
2271e60
updated soloud
Anuken Sep 11, 2026
f00162e
Updated natives
Anuken Sep 11, 2026
5a9696f
Updated soloud
Anuken Sep 11, 2026
1ba7e0c
Merge tag 'v160.1' into claude-6941a9be
RE-AST Sep 11, 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
8 changes: 2 additions & 6 deletions .github/workflows/build-linux-natives/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ curl -s https://repos.azul.com/azul-repo.key | gpg --dearmor -o /usr/share/keyri
echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | tee /etc/apt/sources.list.d/zulu.list
apt-get -q update
# install zulu JDK and Java build tools
apt-get -yq install zulu17-jdk-headless maven ant
apt-get -yq install zulu17-jdk-headless

# Install cross-compilation toolchains
apt-get -yq --force-yes install gcc g++
Expand All @@ -37,8 +37,4 @@ apt-get -yq --force-yes install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
apt-get -yq --force-yes install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross

# Build Linux natives
./gradlew arc-core:jnigenBuildLinux64 --no-daemon

# Pack artifacts
find . -name "*.so" | grep "arc-core/libs" > native-files-list
zip natives-linux -@ < native-files-list
./gradlew arc-core:jnigenBuildAllLinux extensions:filedialogs:jnigenBuildAllLinux extensions:freetype:jnigenBuildAllLinux --no-daemon
5 changes: 3 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Run unit tests with gradle
run: ./gradlew test
67 changes: 27 additions & 40 deletions .github/workflows/natives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,49 @@ jobs:
uses: ./.github/workflows/build-linux-natives
id: docker

- name: Upload artifacts
uses: actions/upload-artifact@v5
- name: Upload natives
uses: actions/upload-artifact@v7
with:
name: natives-linux.zip
path: natives-linux.zip
name: Linux natives
path: |
arc-core/build/natives
extensions/filedialogs/build/natives
extensions/freetype/build/natives

natives-windows:
natives-windows-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Install dependencies
run: sudo apt install g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64
- name: Set env
run: echo "NDK_HOME=$ANDROID_NDK_HOME" >> $GITHUB_ENV
- name: Build natives
run: |
./gradlew arc-core:jnigenBuildWindows64
./gradlew backends:backend-sdl:jnigenBuildWindows64
./gradlew extensions:freetype:jnigenBuildWindows64
- name: Upload natives
uses: actions/upload-artifact@v5
./gradlew arc-core:jnigenBuildAllWindows arc-core:jnigenBuildAllAndroid extensions:filedialogs:jnigenBuildAllWindows extensions:freetype:jnigenBuildAllWindows extensions:freetype:jnigenBuildAllAndroid
# the SDL2 backend is being phased out
# ./gradlew backends:backend-sdl:jnigenBuildAllWindows
- name: Upload arc-core natives
uses: actions/upload-artifact@v7
with:
name: Arc-core desktop natives
name: Windows and Android natives
path: |
backends/backend-sdl/libs/windows64/sdl-arc64.dll
natives/natives-desktop/libs/arc64.dll
natives/natives-freetype-desktop/libs/arc-freetype64.dll
- name: Upload Android natives
uses: actions/upload-artifact@v5
with:
name: Arc-core android natives
path: |
natives/natives-android/libs
arc-core/build/natives
extensions/filedialogs/build/natives
extensions/freetype/build/natives
natives-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Install dependencies
run: |
Expand All @@ -68,24 +67,12 @@ jobs:
env:
MACOSX_DEPLOYMENT_TARGET: '10.9'
run: |
./gradlew arc-core:jnigenBuild
# ./gradlew extensions:freetype:jnigenBuild
./gradlew backends:backend-sdl:jnigenBuildAllWindows
./gradlew arc-core:jnigenBuildAllMacOsX extensions:filedialogs:jnigenBuildAllMacOsX extensions:freetype:jnigenBuildAllMacOsX
- name: Upload natives
uses: actions/upload-artifact@v5
with:
name: Arc-core MacOS natives
path: |
natives/natives-desktop/libs/libarc64.dylib
natives/natives-desktop/libs/libarcarm64.dylib
# natives/natives-freetype-desktop/libs/libarc-freetype64.dylib
# natives/natives-freetype-desktop/libs/libarc-freetypearm64.dylib
# backends/backend-sdl/libs/macosx64/libsdl-arc64.dylib
# backends/backend-sdl/libs/macosx64/libsdl-arcarm64.dylib
- name: Upload iOS natives
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v7
with:
name: Arc-core iOS natives
name: MacOS natives
path: |
natives/natives-ios/libs/libarc.a
natives/natives-freetype-ios/libs/libarc-freetype.a
arc-core/build/natives
extensions/freetype/build/natives
extensions/filedialogs/build/natives
4 changes: 2 additions & 2 deletions .github/workflows/verify-gradle-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ jobs:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/checkout@v7
- uses: gradle/actions/wrapper-validation@v3
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ Please don't. While there is nothing stopping you from making other games with t
There are too many things to list, but here are some highlights:

- Soloud used as the audio engine across all platforms - faster, more consistent and more capable than libGDX's per-platform abstraction
- SDL used as the desktop backend library instead of LWJGL+GLFW bindings - comes with its own benefits and drawbacks
- SDL used as the desktop backend library instead of GLFW - comes with its own benefits and drawbacks
- Removal of GWT module and all workarounds associated with it
- Proper methods for drawing lines, polygons, etc in one sprite batch
- Global sprite batch, texture atlas, asset manager, etc
- Thin GL abstraction layer, state is cached to prevent unnecessary API calls
- All APIs deal with 2D coordinates instead of attempting to share 2D and 3D classes (cameras, matrices, etc)
- 3D package removed, some small parts moved to an extension
- 3D rendering abstractions mostly removed
- Simplification of most graphics abstractions (Framebuffer, Texture, Mesh, etc.)
- OpenGL ES 3.0 as a minimum target
- Java 8 target, heavy usage of lambdas in Scene2D code
- Massive amount of refactored, merged, deleted classes (*especially* deleted)
- Massive amount of refactored, merged, deleted classes
30 changes: 17 additions & 13 deletions arc-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,34 +77,38 @@ jnigen{
cppFlags += ["-flto"]
linkerFlags += ["-flto"]
}
addLinux(x64, x86){
addLinux(x64, x86)
addLinux(x64, ARM)
each({it.os == Linux}){
headerDirs += (String[])["$root/soloud/src/backend/miniaudio/"]
cppIncludes += (String[])["$root/soloud/src/backend/miniaudio/*.cpp"]
cppFlags += "-DWITH_MINIAUDIO"
libraries += "-lpthread -lrt -lm -ldl".split(" ")
}
addWindows(x64, x86){
headerDirs += (String[])["$root/soloud/src/backend/miniaudio/"]
cppIncludes += (String[])["$root/soloud/src/backend/miniaudio/*.cpp"]
cppFlags += ["-msse", "-DWITH_MINIAUDIO"]
}
addAndroid(){
linkerFlags += "-llog -lOpenSLES".split(" ")
cppIncludes += (String[])["$root/soloud/src/backend/opensles/*.cpp"]
cppFlags += ["-DWITH_OPENSLES"]
androidApplicationMk += ["APP_STL := c++_static"]
}
addMac(x64, x86){
addMac(x64, x86)
addMac(x64, ARM)
each({it.os == MacOsX}){
cppIncludes += (String[])["$root/soloud/src/backend/coreaudio/*.mm"]
cppFlags = ["-std=c++11", "-DWITH_COREAUDIO"]
cppFlags += (String[])["-std=c++11", "-DWITH_COREAUDIO"]
libraries += "-Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox".split(" ")
}
addMac(x64, ARM){
cppIncludes += (String[])["$root/soloud/src/backend/coreaudio/*.mm"]
cppFlags = ["-std=c++11", "-DWITH_COREAUDIO"]
libraries += "-Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox".split(" ")
}
addIOS(){
addIOS{
headerDirs += (String[])["$root/iosgl"]
cppIncludes += (String[])["$root/soloud/src/backend/coreaudio/*.mm", "$root/iosgl/**"]
cppFlags += ["-stdlib=libc+", "-std=c++11", "-DWITH_COREAUDIO"]
libraries += "-Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox".split(" ")
linkerFlags += "-undefined dynamic_lookup"
cppIncludes += (String[])["$root/soloud/src/backend/coreaudio/*.mm", "$root/iosgl/**.cpp"]
cppFlags += (String[])["-stdlib=libc++", "-std=c++11", "-DWITH_COREAUDIO"]
libraries += "-Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AVFoundation -Wl,-framework,Foundation".split(" ")
linkerFlags += (String[])["-undefined", "dynamic_lookup"]
}
}

Expand Down
5 changes: 4 additions & 1 deletion arc-core/src/arc/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import arc.graphics.g2d.Batch;
import arc.graphics.g2d.TextureAtlas;
import arc.scene.Scene;
import arc.util.I18NBundle;
import arc.util.*;

import java.util.concurrent.*;

/**
* Global references to all of Arc's core modules.
Expand All @@ -27,6 +29,7 @@ public class Core{
public static Scene scene;
public static AssetManager assets;
public static TextureAtlas atlas;
public static ExecutorService executor = Threads.executor("Main Executor", OS.cores);

public static GL20 gl;
public static GL20 gl20;
Expand Down
18 changes: 17 additions & 1 deletion arc-core/src/arc/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ public int getInt(String name, int def){
}

public boolean getBool(String name, boolean def){
return (boolean)get(name, def);
Object val = get(name, def);
return val instanceof Boolean ? (Boolean)val : def;
}

public byte[] getBytes(String name, byte[] def){
Expand Down Expand Up @@ -423,6 +424,21 @@ public void putAll(ObjectMap<String, Object> map){
}
}

/** Toggles a boolean value. */
public void toggle(String name){
put(name, !getBool(name));
}

/** JS compatibility method. */
public void putInt(String name, int value){
put(name, value);
}

/** JS compatibility method. */
public void putFloat(String name, float value){
put(name, value);
}

/** Stores an object in the preference map. */
public synchronized void put(String name, Object object){
if(object instanceof Float || object instanceof Integer || object instanceof Boolean || object instanceof Long
Expand Down
40 changes: 36 additions & 4 deletions arc-core/src/arc/assets/AssetManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import arc.graphics.g2d.*;
import arc.graphics.gl.*;
import arc.struct.*;
import arc.struct.ObjectMap.*;
import arc.util.*;

import java.util.concurrent.*;
Expand Down Expand Up @@ -104,6 +105,19 @@ public synchronized <T> T get(String fileName, Class<T> type){
return asset;
}

/**
* @param fileName the asset file name
* @param type the asset type
* @return the asset, or null if not found
*/
public synchronized <T> T getOrNull(String fileName, Class<T> type){
ObjectMap<String, RefCountedContainer> assetsByType = assets.get(type);
if(assetsByType == null) return null;
RefCountedContainer assetContainer = assetsByType.get(fileName);
if(assetContainer == null) return null;
return (T)assetContainer.object;
}

/**
* @param type the asset type
* @return all the assets matching the specified type
Expand All @@ -118,6 +132,23 @@ public synchronized <T> Seq<T> getAll(Class<T> type, Seq<T> out){
return out;
}

/**
* @param type the asset type
* @return all the assets matching the specified type as entries by file name
*/
public synchronized <T> Seq<Entry<String, T>> getAllEntries(Class<T> type, Seq<Entry<String, T>> out){
ObjectMap<String, RefCountedContainer> assetsByType = assets.get(type);
if(assetsByType != null){
for(ObjectMap.Entry<String, RefCountedContainer> asset : assetsByType.entries()){
Entry<String, T> entry = new Entry<>();
entry.key = asset.key;
entry.value = (T)asset.value.object;
out.add(entry);
}
}
return out;
}

/**
* @param assetDescriptor the asset descriptor
* @return the asset
Expand Down Expand Up @@ -156,8 +187,7 @@ public synchronized boolean contains(String fileName, Class type){
* @param fileName the file name
*/
public synchronized void unload(String fileName){
// check if it's currently processed (and the first element in the stack, thus not a dependency)
// and cancel if necessary
// check if it's currently processed (and the first element in the stack, thus not a dependency) and cancel if necessary
if(tasks.size > 0){
AssetLoadingTask currAsset = tasks.first();
if(currAsset.assetDesc.fileName.equals(fileName)){
Expand All @@ -182,10 +212,12 @@ public synchronized void unload(String fileName){

// get the asset and its type
Class type = assetTypes.get(fileName);
if(type == null) throw new ArcRuntimeException("Asset not loaded: " + fileName);
if(type == null) return;

RefCountedContainer assetRef = assets.get(type).get(fileName);

if(assetRef == null) return;

// if it is reference counted, decrement ref count and check if we can really get rid of it.
assetRef.count--;
if(assetRef.count <= 0){
Expand Down Expand Up @@ -565,7 +597,7 @@ private void addTask(AssetDescriptor assetDesc){
}

/** Adds an asset to this AssetManager */
protected <T> void addAsset(final String fileName, Class<T> type, T asset){
public <T> void addAsset(final String fileName, Class<T> type, T asset){
// add the asset to the filename lookup
assetTypes.put(fileName, type);

Expand Down
6 changes: 6 additions & 0 deletions arc-core/src/arc/audio/AudioBus.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ public void play(){
id = sourcePlay(handle);
}

@Override
public void stop(){
Core.audio.stop(id);
id = 0;
}

@Override
public float getLength(){
return 0;
}

public void fadeFilterParam(int filter, int attribute, float value, float timeSec){
Core.audio.fadeFilterParam(id, filter, attribute, value, timeSec);
}
Expand Down
Loading