Skip to content
Open
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
11 changes: 0 additions & 11 deletions .run/Lwjgl3GameLauncher (MacOS).run.xml

This file was deleted.

1 change: 0 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
- The codebase mixes legacy C-inspired naming; keep existing patterns in touched files for consistency.
- When renaming critical functions, keep the old C name in a brief comment for traceability.
- Use `*Test` suffixes for test classes (for example `Vector3fTest.kt`).
- Do not delete existing comments if they are not addressed in the change.

## Testing Guidelines
- Primary test framework is JUnit 4 (see root `build.gradle`); Kotlin tests live alongside Java tests.
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ Requirements:

Documentation & Info
--------------------
The `info` folder contains documentation and other useful information:

* [Project Overview](info/Overview.md)
* [Overview](info/Overview.md)
* [BSP file format](info/BSP.md)
* [Networking](info/Networking.md)

What is Cake? Important note about client side code
Expand Down
10 changes: 5 additions & 5 deletions assets/shaders/vat.glsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
in float a_vat_index;
in vec2 a_texCoord1; // Diffuse Texture coordinates
attribute float a_vat_index;
attribute vec2 a_texCoord1; // Diffuse Texture coordinates

uniform mat4 u_worldTrans; // World transformation matrix
uniform mat4 u_projViewTrans; // View transformation matrix
Expand All @@ -11,7 +11,7 @@ uniform int u_frame1; // Index of the first frame in the animation texture
uniform int u_frame2; // Index of the second frame in the animation texture
uniform float u_interpolation; // Interpolation factor between two animation frames (0.0 to 1.0)

out vec2 v_diffuseUV;
varying vec2 v_diffuseUV;

void main() {
vec2 texelSize = vec2(1.0 / u_textureWidth, 1.0 / u_textureHeight);
Expand All @@ -20,8 +20,8 @@ void main() {

// Sample the vertex texture to get the animated positions for the two frames
// The texture stores vec3 positions in RGB channels (assuming float texture)
vec3 animatedPosition1 = texture(u_vertexAnimationTexture, vertexTextureCoord1).rgb;
vec3 animatedPosition2 = texture(u_vertexAnimationTexture, vertexTextureCoord2).rgb;
vec3 animatedPosition1 = texture2D(u_vertexAnimationTexture, vertexTextureCoord1).rgb;
vec3 animatedPosition2 = texture2D(u_vertexAnimationTexture, vertexTextureCoord2).rgb;

// Interpolate between the two animated positions
vec3 finalPosition = mix(animatedPosition1, animatedPosition2, u_interpolation);
Expand Down
38 changes: 10 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,50 +1,32 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

buildscript {
repositories {
mavenCentral()
maven { url 'https://s01.oss.sonatype.org' }
gradlePluginPortal()
mavenLocal()
google()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.badass.runtime) apply false
alias(libs.plugins.graalvm.native) apply false
}

configure(subprojects) {
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.kotlin.jvm'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
compileJava {
options.incremental = true
}

compileKotlin.compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
compileTestKotlin.compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
compileKotlin.compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
compileTestKotlin.compilerOptions.jvmTarget.set(JvmTarget.JVM_21)

}

subprojects {
group = 'org.demoth'
version = '1.0.0'
ext.appName = 'cake'
repositories {
mavenCentral()
maven { url 'https://s01.oss.sonatype.org' }
// You may want to remove the following line if you have errors downloading dependencies.
mavenLocal()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://jitpack.io' }
}
dependencies {
testImplementation('junit:junit:4.12')
testImplementation(libs.junit)
}
}
23 changes: 0 additions & 23 deletions cake/core/build.gradle

This file was deleted.

20 changes: 20 additions & 0 deletions cake/core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
dependencies {
api(libs.gdx.controllers.core)
api(libs.gdx.freetype)
api(libs.gdx)
// api(libs.gdx.scene2d.ui)
api(libs.ktx.actors)
api(libs.ktx.app)
api(libs.ktx.assets.async)
api(libs.ktx.assets)
api(libs.ktx.async)
api(libs.ktx.collections)
api(libs.ktx.freetype.async)
api(libs.ktx.freetype)
api(libs.ktx.graphics)
api(libs.ktx.log)
api(libs.ktx.scene2d)
api(libs.kotlinx.coroutines.core)

implementation(project(":qcommon"))
}
28 changes: 0 additions & 28 deletions cake/core/src/main/kotlin/org/demoth/cake/Cake.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import com.badlogic.gdx.InputProcessor
import com.badlogic.gdx.assets.AssetManager
import com.badlogic.gdx.assets.loaders.SoundLoader
import com.badlogic.gdx.audio.Sound
import com.badlogic.gdx.graphics.glutils.ShaderProgram
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g3d.Model
import com.badlogic.gdx.scenes.scene2d.ui.Skin
import com.badlogic.gdx.utils.ScreenUtils
import com.badlogic.gdx.utils.viewport.StretchViewport
Expand All @@ -35,13 +33,8 @@ import ktx.assets.TextAssetLoader
import ktx.scene2d.Scene2DSkin
import org.demoth.cake.ClientNetworkState.*
import org.demoth.cake.assets.CakeFileResolver
import org.demoth.cake.assets.BspLoader
import org.demoth.cake.assets.BspMapAsset
import org.demoth.cake.assets.Md2Asset
import org.demoth.cake.assets.Md2Loader
import org.demoth.cake.assets.ObjectLoader
import org.demoth.cake.assets.PcxLoader
import org.demoth.cake.assets.SkyLoader
import org.demoth.cake.assets.WalLoader
import org.demoth.cake.stages.ConsoleStage
import org.demoth.cake.stages.Game3dScreen
Expand Down Expand Up @@ -102,9 +95,6 @@ class Cake : KtxApplicationAdapter, KtxInputAdapter {
setLoader(Sound::class.java, SoundLoader(fileResolver))
setLoader(Texture::class.java, "pcx", PcxLoader(fileResolver))
setLoader(Texture::class.java, "wal", WalLoader(fileResolver))
setLoader(BspMapAsset::class.java, "bsp", BspLoader(fileResolver))
setLoader(Md2Asset::class.java, "md2", Md2Loader(fileResolver))
setLoader(Model::class.java, "sky", SkyLoader(fileResolver))

}

Expand All @@ -117,24 +107,6 @@ class Cake : KtxApplicationAdapter, KtxInputAdapter {
}

override fun create() {
ShaderProgram.prependVertexCode = """
#version 150
#define GLSL3
#define attribute in
#define varying out
#define texture2D texture
#define textureCube texture
""".trimIndent() + "\n"
ShaderProgram.prependFragmentCode = """
#version 150
#define GLSL3
#define varying in
#define texture2D texture
#define textureCube texture
out vec4 fragColor;
#define gl_FragColor fragColor
""".trimIndent() + "\n"

// load sync resources - required immediately
assetManager.load(cakeSkin, Skin::class.java)

Expand Down
Loading