Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
crykn committed Oct 15, 2020
0 parents commit 4145c3c
Show file tree
Hide file tree
Showing 19 changed files with 2,053 additions and 0 deletions.
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Pancake

Pancake is the basis for all libGDX games developed by eskalon.

## Technical

Pancake uses the following libraries and frameworks :

- [libGDX](https://github.com/libgdx/libgdx)
- [libgdx-screenmanager](https://github.com/crykn/libgdx-screenmanager)
- [guacamole](https://github.com/crykn/guacamole)
- [guava](https://github.com/google/guava) (for its EventBus) and [reflections](https://github.com/ronmamo/reflections) (for the classpath scanning in AbstractAssetLoadingScreen)

## Content
A selection of what Pancake offers:

### <u>core:</u>
- **AnnotationAssetManager**
- `@Asset("cool_texture.jpg")`, `@Asset(value = "ui/skin/skin.json", params = "ui/skin/skin.atlas")`
- `#loadAnnotatedAssets(Class<T> clazz)`
- `#injectAssets(Class<T> clazz, @Nullable T instance)`
- `#registerAssetLoaderParametersFactory(Class<T> clazz, AssetLoaderParametersFactory<T> factory)`
- **DefaultSoundManager & Playlist**
- `#playSoundEffect(String name)`
- `#playMusic(String playlistName)`
- Playlist files:
```java
{
name: "best_playlist_ever",
shuffle: true,
repeat: true,
music: [
[
"My favourite song",
"my_favourite_song.mp3"
],
]
}
```
- **EskalonApplication:** the core application, which keeps a sprite batch, an asset manager, a sound manager, etc.
- **PostProcessingPipeline:** A simple post processing pipeline [WIP]
- **Lang, ILocalizable & ILocalized**
- `Lang#get(String key, Object... args)`
- **DebugInfoRenderer:** renders some debug information, including a fps graph
- **AbstractAssetLoadingScreen:** a screen loading all assets annotated with `@Asset` in a specified package
- **AbstractEskalonUIScreen:** a screen rendering a background image & a stage
- **AbstractImageScreen:** a simple screen rendering one image
- **EskalonSplashScreen:** a splash screen showing the eskalon logo as well as loading some internal assets
- **EskalonSettings & KeyBinding:** provides settings for different sound volumes & makes handling changeable key bindings very simple
- **RandomUtils:** contains various methods dealing with random values
- **GL32CMacIssueHandler:** provides updated versions of the default shaders that are compatible with OpenGL 3.2

### desktop
- Audio implementations that support spatial audio

### g3d:
- A **deferred renderer** [WIP]


## Collaboration
A list of all of our current contributors and the used external assets can be found in [CONTRIBUTORS.md](https://github.com/eskalon/pancake/blob/master/CONTRIBUTORS.md).
81 changes: 81 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
}
}

allprojects {
apply plugin: "eclipse"
apply plugin: "idea"

version = "0.1.0"
ext {
appName = "pancake"
gdxVersion = "1.9.11"
guavaVersion = "29.0-jre" // is used for the EventBus
junitVersion = "5.6.0"
mockitoVersion = "3.4.4"
reflectionsVersion = "0.9.11" //0.9.12 doesn't work, see https://github.com/ronmamo/reflections/issues/273
screenmanagerVersion = "0.6.2"
}

repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
maven { url "https://jitpack.io" }
jcenter()
}
}

project(":core") {
apply plugin: "java-library"

dependencies {
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
implementation "com.google.guava:guava:$guavaVersion"
implementation "org.reflections:reflections:$reflectionsVersion"
api "com.github.crykn:libgdx-screenmanager:$screenmanagerVersion"

testImplementation "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion"
testImplementation "com.badlogicgames.gdx:gdx:$gdxVersion"
testImplementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
testImplementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
testImplementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
}

sourceSets.main {
resources.srcDirs = ["src/main/assets"]
}

sourceSets.test {
resources.srcDirs = ["src/test/assets"]
}
}

project(":g3d") {
apply plugin: "java-library"

dependencies {
api project(":core")
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
}
}

project(":desktop") {
apply plugin: "java-library"

dependencies {
api project(":core")
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.badlogic.gdx.utils.reflect;

import javax.annotation.Nullable;

/**
* Reflection utils for fields.
*
* @author damios
*/
public class ReflectionUtils {

private ReflectionUtils() {
throw new UnsupportedOperationException();
}

public static Field convertFieldObject(java.lang.reflect.Field field) {
return new Field(field);
}

/**
* Creates a class via libGDX reflection by using its name. Returns null, if the
* reflection or instantiation fails.
*
* @param <T>
* @param className
* @param clazz
* @return
*/
@SuppressWarnings("unchecked")
@Nullable
public static <T> T newInstance(String className, Class<T> clazz) {
try {
return (T) ClassReflection.newInstance(ClassReflection.forName(className));
} catch (ReflectionException e) {
return null;
}
}

}
Loading

0 comments on commit 4145c3c

Please sign in to comment.