Merge commit '662170dcd682' into dev-logger
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -19,12 +19,6 @@ gradle/
|
|||||||
gradlew
|
gradlew
|
||||||
gradlew.bat
|
gradlew.bat
|
||||||
|
|
||||||
## MAVEN ##
|
|
||||||
target/
|
|
||||||
|
|
||||||
## OTHER ##
|
## OTHER ##
|
||||||
lib/
|
|
||||||
baseq2/
|
baseq2/
|
||||||
baseq2.rar
|
*.log
|
||||||
TODO.txt
|
|
||||||
qconsole.log
|
|
||||||
27
README.MD
Normal file
27
README.MD
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# LWJake2
|
||||||
|
|
||||||
|
Порт игры Quake2 с `C++` на `Java` + `lwjgl2`.
|
||||||
|
|
||||||
|
Оригинальный порт: [github.com/flibitijibibo](https://github.com/flibitijibibo/LWJake2)
|
||||||
|
|
||||||
|
Оригинальный "ридми": README-OLD
|
||||||
|
|
||||||
|
## Сборка и запуск
|
||||||
|
|
||||||
|
Для сборки необходим `gradle` версии `4.x`.
|
||||||
|
|
||||||
|
Для запуска понадобятся оригинальные файлы игры `baseq2`, размещенные в корне проекта.
|
||||||
|
|
||||||
|
```
|
||||||
|
...
|
||||||
|
* baseq2/
|
||||||
|
* licenses/
|
||||||
|
* src/
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
### Запуск через Gradle
|
||||||
|
|
||||||
|
```
|
||||||
|
gradle run
|
||||||
|
```
|
||||||
78
build.gradle
78
build.gradle
@@ -1,54 +1,56 @@
|
|||||||
plugins {
|
group = 'lwjake2'
|
||||||
id 'net.ltgt.apt' version '0.10'
|
version = '1.1-SNAPSHOT'
|
||||||
}
|
|
||||||
|
import org.gradle.internal.os.OperatingSystem
|
||||||
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'application'
|
apply plugin: 'application'
|
||||||
apply plugin: 'idea'
|
|
||||||
apply plugin: 'eclipse'
|
|
||||||
apply plugin: 'findbugs'
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
import org.gradle.internal.os.OperatingSystem;
|
compileJava {
|
||||||
|
sourceCompatibility = 1.8
|
||||||
def lwjgl_ver = '2.9.3'
|
targetCompatibility = 1.8
|
||||||
def platform = ''
|
options.encoding = 'UTF-8'
|
||||||
if (OperatingSystem.current().isWindows()) {
|
}
|
||||||
platform = 'windows'
|
|
||||||
} else if (OperatingSystem.current().isMacOsX()) {
|
ext {
|
||||||
platform = 'osx'
|
slf4j_version = '1.7.25'
|
||||||
} else if (OperatingSystem.current().isLinux()) {
|
log4j_version = '2.11.1'
|
||||||
platform = 'linux'
|
lwjgl_version = '2.9.3'
|
||||||
|
lombok_version = '1.18.2'
|
||||||
|
|
||||||
|
platform = 'linux'
|
||||||
|
dependencies_dir = 'libs'
|
||||||
}
|
}
|
||||||
def slf4jVersion = '1.7.21'
|
|
||||||
def log4jVersion = '2.5'
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile (['org.lwjgl.lwjgl:lwjgl:' + lwjgl_ver],
|
/* LOGGER */
|
||||||
['org.lwjgl.lwjgl:lwjgl_util:' + lwjgl_ver])
|
compile (group: 'org.slf4j', name: 'slf4j-api', version: slf4j_version)
|
||||||
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
|
compile (group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4j_version)
|
||||||
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4jVersion
|
compile (group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4j_version)
|
||||||
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4jVersion
|
|
||||||
|
|
||||||
compileOnly 'org.projectlombok:lombok:1.16.20'
|
/* LOMBOK */
|
||||||
apt "org.projectlombok:lombok:1.16.20"
|
annotationProcessor (group: 'org.projectlombok', name: 'lombok', version: lombok_version)
|
||||||
compileOnly 'com.google.code.findbugs:annotations:3.0.1'
|
compileOnly (group: 'org.projectlombok', name: 'lombok', version: lombok_version)
|
||||||
|
|
||||||
|
/* LWJGL */
|
||||||
|
compile (group: 'org.lwjgl.lwjgl', name: 'lwjgl', version: lwjgl_version)
|
||||||
|
compile (group: 'org.lwjgl.lwjgl', name: 'lwjgl_util', version: lwjgl_version)
|
||||||
|
|
||||||
|
/* COMPONENTS */
|
||||||
|
compileOnly (group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1')
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
task unpackNatibeLibraries(type: Copy) {
|
||||||
main {
|
if (OperatingSystem.current().isWindows()) {
|
||||||
java.srcDirs = ['src']
|
platform = 'windows'
|
||||||
resources.srcDirs = ['resources']
|
} else if (OperatingSystem.current().isMacOsX()) {
|
||||||
|
platform = 'osx'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
mainClassName = 'lwjake2.LWJake2'
|
|
||||||
applicationDefaultJvmArgs = ["-Djava.library.path=$buildDir/natives/$platform"]
|
|
||||||
|
|
||||||
task t1(type: Copy) {
|
|
||||||
configurations.compile.filter {
|
configurations.compile.filter {
|
||||||
(it.getName().indexOf("lwjgl-platform-") >= 0) &&
|
(it.getName().indexOf("lwjgl-platform-") >= 0) &&
|
||||||
(it.getName().indexOf("$platform") >= 0)
|
(it.getName().indexOf("$platform") >= 0)
|
||||||
@@ -59,5 +61,9 @@ task t1(type: Copy) {
|
|||||||
}
|
}
|
||||||
into "$buildDir/natives/$platform"
|
into "$buildDir/natives/$platform"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.run.doFirst {
|
||||||
|
mainClassName = 'lwjake2.LWJake2'
|
||||||
|
applicationDefaultJvmArgs = ["-Djava.library.path=$buildDir/natives/$platform"]
|
||||||
|
}.dependsOn(unpackNatibeLibraries)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
1183
src/main/java/lwjake2/Defines.java
Normal file
1183
src/main/java/lwjake2/Defines.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -156,14 +156,14 @@ public class Globals extends Defines {
|
|||||||
public static client_static_t cls = new client_static_t();
|
public static client_static_t cls = new client_static_t();
|
||||||
public static client_state_t cl = new client_state_t();
|
public static client_state_t cl = new client_state_t();
|
||||||
|
|
||||||
public static centity_t cl_entities[] = new centity_t[Defines.MAX_EDICTS];
|
public static centity_t cl_entities[] = new centity_t[MAX_EDICTS];
|
||||||
static {
|
static {
|
||||||
for (int i = 0; i < cl_entities.length; i++) {
|
for (int i = 0; i < cl_entities.length; i++) {
|
||||||
cl_entities[i] = new centity_t();
|
cl_entities[i] = new centity_t();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static entity_state_t cl_parse_entities[] = new entity_state_t[Defines.MAX_PARSE_ENTITIES];
|
public static entity_state_t cl_parse_entities[] = new entity_state_t[MAX_PARSE_ENTITIES];
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for (int i = 0; i < cl_parse_entities.length; i++)
|
for (int i = 0; i < cl_parse_entities.length; i++)
|
||||||
@@ -365,7 +365,7 @@ public class Globals extends Defines {
|
|||||||
public static int key_linepos;
|
public static int key_linepos;
|
||||||
static {
|
static {
|
||||||
for (int i = 0; i < key_lines.length; i++)
|
for (int i = 0; i < key_lines.length; i++)
|
||||||
key_lines[i] = new byte[Defines.MAXCMDLINE];
|
key_lines[i] = new byte[MAXCMDLINE];
|
||||||
};
|
};
|
||||||
public static int edit_line;
|
public static int edit_line;
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user