Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7650fc6
Add vector-math
BenCheung0422 Apr 28, 2026
de98c65
Simplify usages of math vectors
BenCheung0422 Apr 28, 2026
8509452
Project: Solve configuration cache issue
BenCheung0422 Apr 28, 2026
4aac1d3
Project: Substitute dep for vector-math
BenCheung0422 Apr 28, 2026
177050f
Update codeql-analysis.yml
BenCheung0422 Apr 28, 2026
2dedf60
MUI: WIP: Restruct and impl MUI as per EFP 9
BenCheung0422 Apr 30, 2026
323bf34
Project: Make Ferricia build task more elegant
BenCheung0422 May 3, 2026
7126aa6
MUI: Try impl more MUI
BenCheung0422 May 7, 2026
bd22476
MUI: Updating structures
BenCheung0422 Aug 11, 2026
84fb0c3
MUI: Updating structures
BenCheung0422 Aug 16, 2026
5c4c705
MUI: Restructuring AGIMO/Layout & ASD
BenCheung0422 Aug 18, 2026
b0ceba1
MUI: Restructuring AGIMO/Layout & ASD
BenCheung0422 Aug 20, 2026
1a07204
MUI: Restructuring AGIMO/Layout & ASD
BenCheung0422 Aug 21, 2026
81c7811
MUI: Restructuring AGIMO/Layout & ASD
BenCheung0422 Aug 22, 2026
8198dbe
MUI: Restructuring AGIMO/Layout & ASD
BenCheung0422 Aug 23, 2026
4a63571
Project: Fix cargo build errors
BenCheung0422 Aug 23, 2026
fea6157
Fix errors
BenCheung0422 Aug 24, 2026
0b2644a
MUI: Optimize world object creations
BenCheung0422 Aug 25, 2026
653f170
MUI: Add basic text rendering
BenCheung0422 Sep 3, 2026
11e0350
Render: Tweak text rendering
BenCheung0422 Sep 3, 2026
a3b61e2
MUI: Updating structures
BenCheung0422 Sep 4, 2026
8552dcd
MUI: Restructuring KUI/UID
BenCheung0422 Sep 5, 2026
4e3d510
MUI: Implementing inputs to AGIM System
BenCheung0422 Sep 8, 2026
3b9bc97
GUI: Fix deadlock of layout computation
BenCheung0422 Sep 9, 2026
d243579
MUI: Add basic Button & Checkbox & mouse tracking
BenCheung0422 Sep 9, 2026
806ea35
MUI: Add FPS counter display
BenCheung0422 Sep 11, 2026
66b73a2
GUI: Add basic track bar + slider + scale bar
BenCheung0422 Sep 14, 2026
8c2f782
MUI: Fix button and certain layouts
BenCheung0422 Sep 15, 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
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "ferricia"]
path = ferricia
url = https://github.com/bitsusei/TerraModulus-Ferricia-Engine
[submodule "vector-math"]
path = vector-math
url = https://github.com/bitsusei/kotlin-vector-math
20 changes: 10 additions & 10 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 84 additions & 40 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,64 @@ plugins {
kotlin("jvm") version "2.3.21"
kotlin("plugin.serialization") version "2.1.20"
id("org.jetbrains.kotlinx.atomicfu") version "0.27.0"
id("net.terramodulus.plugins.cargo") apply false
// id("fr.stardustenterprises.rust.wrapper") version "3.2.4" apply false
application
kotlin("kapt") version "2.3.21"
}

allprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
version = "0.0.1"

version = "0.0.1"
repositories {
mavenCentral()
}

project(":ferricia") {
// Candidates: fr.stardustenterprises.rust.wrapper
apply(plugin = "net.terramodulus.plugins.cargo")

repositories {
mavenCentral()
if (providers.gradleProperty("release").isPresent) configure<CargoExtension> {
release = true // use `-Prelease=true`
}
configure<CargoExtension> {
outputFile = release.map {
projectDir.resolve("target/${if (it) "release" else "debug"}/${System.mapLibraryName("ferricia")}")
}
}
// somehow, .cargo extension is unusable
tasks.register<CargoTask>("buildClient") {
args = listOf("-F", "client")
println(outputFile.get())
}
tasks.register<CargoTask>("buildServer") {
args = listOf("-F", "server")
}
configurations {
create("client") {
isCanBeConsumed = true
isCanBeResolved = false
}
create("server") {
isCanBeConsumed = true
isCanBeResolved = false
}
}
artifacts {
add("client", tasks.named("buildClient"))
add("server", tasks.named("buildServer"))
}
}

configure(listOf(project(":kernel"), project(":internal"))) {
configure(listOf(project("common"), project("client"), project("server"))) {
apply(plugin = "org.jetbrains.kotlin.jvm")

version = rootProject.version

repositories {
mavenCentral()
}

sourceSets.main {
kotlin.srcDir("kotlin")
resources.srcDir("resources")
Expand Down Expand Up @@ -61,7 +104,26 @@ project(":kernel") {
}
}

project(":kernel:client") {
dependencies {
implementation(project(":ferricia", "client"))
}
}
project(":kernel:server") {
dependencies {
implementation(project(":ferricia", "server"))
}
}

configure(listOf(project(":internal:common"), project(":kernel:common"))) {
dependencies {
api("com.cout970:kotlin-vector-math:0.1.0")
}
}

project(":kernel:common") {
apply(plugin = "org.jetbrains.kotlin.kapt")

dependencies {
api("org.jetbrains:annotations:26.1.0")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1")
Expand All @@ -77,7 +139,7 @@ project(":kernel:common") {
implementation("org.apache.logging.log4j:log4j-api:2.24.3")
implementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.24.3")
implementation(platform("org.apache.logging.log4j:log4j-bom:2.24.3"))
annotationProcessor("org.apache.logging.log4j:log4j-core:2.24.3")
kapt("org.apache.logging.log4j:log4j-core:2.24.3")
runtimeOnly("com.lmax:disruptor:4.0.0")
api("io.github.oshai:kotlin-logging-jvm:7.0.3")
implementation("net.sf.jopt-simple:jopt-simple:5.0.4")
Expand All @@ -86,10 +148,12 @@ project(":kernel:common") {

project(":kernel:client").dependencies {
implementation("net.sf.jopt-simple:jopt-simple:5.0.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.11.0")
}

project(":kernel:server").dependencies {
implementation("net.sf.jopt-simple:jopt-simple:5.0.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.11.0")
}

project(":internal:common").dependencies {
Expand All @@ -112,28 +176,6 @@ configure(listOf(project(":kernel:server"), project(":kernel:client"))) {
}
}

/** Build Ferricia Engine with Cargo */
tasks.register<Exec>("cargoBuildClient") {
onlyIf {
!gradle.taskGraph.hasTask(":kernel:server:jar")
}
workingDir = rootProject.file("ferricia")
commandLine("cargo", "build")
if (project.hasProperty("release")) args("--release") // use `-Prelease=true`
args("-F", "client")
}
tasks.register<Exec>("cargoBuildServer") {
onlyIf {
!gradle.taskGraph.hasTask(":kernel:client:jar")
}
workingDir = rootProject.file("ferricia")
commandLine("cargo", "build")
if (project.hasProperty("release")) args("--release") // use `-Prelease=true`
args("-F", "server")
}
project(":kernel:client").tasks.named("jar") { dependsOn(tasks.named("cargoBuildClient")) }
project(":kernel:server").tasks.named("jar") { dependsOn(tasks.named("cargoBuildServer")) }

tasks.register("buildClient") {
group = "build"
description = "Build client"
Expand All @@ -151,17 +193,13 @@ tasks.named("run") {
tasks.register("runClient") {
group = "application"
description = "Run client"
dependsOn("cargoBuildClient")
dependsOn(":kernel:client:run")
}
project(":kernel:client").tasks.named("run").get().mustRunAfter(tasks.named("cargoBuildClient"))
tasks.register("runServer") {
group = "application"
description = "Run server"
dependsOn("cargoBuildServer")
dependsOn(":kernel:server:run")
}
project(":kernel:server").tasks.named("run").get().mustRunAfter(tasks.named("cargoBuildServer"))

configure(listOf(project(":kernel:server"), project(":kernel:client"))) {
distributions {
Expand All @@ -170,15 +208,12 @@ configure(listOf(project(":kernel:server"), project(":kernel:client"))) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
into("lib") {
val dir = if (project.hasProperty("release")) "release" else "debug"
from("$rootDir/ferricia/target/$dir/${System.mapLibraryName("ferricia")}")
if (OperatingSystem.current().isWindows) from(
"$rootDir/ferricia/target/$dir/ferricia.dll",
"$rootDir/ferricia/target/$dir/oded.dll",
"$rootDir/ferricia/target/$dir/OpenAL32.dll",
"$rootDir/ferricia/target/$dir/SDL3.dll",
) else { // suppose UNIX
// other libs should be installed on user's end directly
from("$rootDir/ferricia/target/$dir/libferricia.so")
}
) // for UNIX, other libs should have been installed on user's end directly
}
}
}
Expand All @@ -197,9 +232,18 @@ configure(listOf(project(":kernel:server"), project(":kernel:client"))) {
}

tasks.named<JavaExec>("run") {
jvmArgs("-Djava.library.path=${rootProject.file("ferricia/target/${
if (project.hasProperty("release")) "release" else "debug"
}").path}")
jvmArgs(
"-Djava.library.path=${
rootProject.file(
"ferricia/target/${
if (project.hasProperty("release")) "release" else "debug"
}"
).path
}"
)
args("--screen-size", "800x500")
}
}
dependencies {
testImplementation(kotlin("test"))
}
22 changes: 22 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* SPDX-FileCopyrightText: 2026 TerraModulus Team and Contributors
* SPDX-License-Identifier: LGPL-3.0-only
*/

plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
gradlePluginPortal()
}

gradlePlugin {
plugins {
register("cargoPlugin") {
id = "net.terramodulus.plugins.cargo"
implementationClass = "CargoPlugin"
}
}
}
12 changes: 12 additions & 0 deletions buildSrc/src/main/kotlin/CargoExtension.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* SPDX-FileCopyrightText: 2026 TerraModulus Team and Contributors
* SPDX-License-Identifier: LGPL-3.0-only
*/

import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property

interface CargoExtension {
val release: Property<Boolean>
val outputFile: RegularFileProperty
}
21 changes: 21 additions & 0 deletions buildSrc/src/main/kotlin/CargoPlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2026 TerraModulus Team and Contributors
* SPDX-License-Identifier: LGPL-3.0-only
*/

import org.gradle.api.Plugin
import org.gradle.api.Project

class CargoPlugin : Plugin<Project> {
override fun apply(target: Project) {
val extension = target.extensions.create("cargoConfig", CargoExtension::class.java)

extension.release.convention(false)

target.tasks.withType(CargoTask::class.java).configureEach {
release.convention(extension.release)
outputFile.convention(extension.outputFile)
inputs.dir(project.projectDir)
}
}
}
Loading
Loading