Merge commit '662170dcd682' into dev-logger
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -19,12 +19,6 @@ gradle/
|
||||
gradlew
|
||||
gradlew.bat
|
||||
|
||||
## MAVEN ##
|
||||
target/
|
||||
|
||||
## OTHER ##
|
||||
lib/
|
||||
baseq2/
|
||||
baseq2.rar
|
||||
TODO.txt
|
||||
qconsole.log
|
||||
*.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
|
||||
```
|
||||
80
build.gradle
80
build.gradle
@@ -1,54 +1,56 @@
|
||||
plugins {
|
||||
id 'net.ltgt.apt' version '0.10'
|
||||
}
|
||||
group = 'lwjake2'
|
||||
version = '1.1-SNAPSHOT'
|
||||
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'findbugs'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
import org.gradle.internal.os.OperatingSystem;
|
||||
compileJava {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
def lwjgl_ver = '2.9.3'
|
||||
def platform = ''
|
||||
ext {
|
||||
slf4j_version = '1.7.25'
|
||||
log4j_version = '2.11.1'
|
||||
lwjgl_version = '2.9.3'
|
||||
lombok_version = '1.18.2'
|
||||
|
||||
platform = 'linux'
|
||||
dependencies_dir = 'libs'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
/* LOGGER */
|
||||
compile (group: 'org.slf4j', name: 'slf4j-api', version: slf4j_version)
|
||||
compile (group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4j_version)
|
||||
compile (group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4j_version)
|
||||
|
||||
/* LOMBOK */
|
||||
annotationProcessor (group: 'org.projectlombok', name: 'lombok', version: lombok_version)
|
||||
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')
|
||||
}
|
||||
|
||||
task unpackNatibeLibraries(type: Copy) {
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
platform = 'windows'
|
||||
} else if (OperatingSystem.current().isMacOsX()) {
|
||||
platform = 'osx'
|
||||
} else if (OperatingSystem.current().isLinux()) {
|
||||
platform = 'linux'
|
||||
}
|
||||
def slf4jVersion = '1.7.21'
|
||||
def log4jVersion = '2.5'
|
||||
|
||||
dependencies {
|
||||
compile (['org.lwjgl.lwjgl:lwjgl:' + lwjgl_ver],
|
||||
['org.lwjgl.lwjgl:lwjgl_util:' + lwjgl_ver])
|
||||
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
|
||||
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4jVersion
|
||||
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4jVersion
|
||||
|
||||
compileOnly 'org.projectlombok:lombok:1.16.20'
|
||||
apt "org.projectlombok:lombok:1.16.20"
|
||||
compileOnly 'com.google.code.findbugs:annotations:3.0.1'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs = ['src']
|
||||
resources.srcDirs = ['resources']
|
||||
}
|
||||
}
|
||||
|
||||
mainClassName = 'lwjake2.LWJake2'
|
||||
applicationDefaultJvmArgs = ["-Djava.library.path=$buildDir/natives/$platform"]
|
||||
|
||||
task t1(type: Copy) {
|
||||
configurations.compile.filter {
|
||||
(it.getName().indexOf("lwjgl-platform-") >= 0) &&
|
||||
(it.getName().indexOf("$platform") >= 0)
|
||||
@@ -59,5 +61,9 @@ task t1(type: Copy) {
|
||||
}
|
||||
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_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 {
|
||||
for (int i = 0; i < cl_entities.length; i++) {
|
||||
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 {
|
||||
for (int i = 0; i < cl_parse_entities.length; i++)
|
||||
@@ -365,7 +365,7 @@ public class Globals extends Defines {
|
||||
public static int key_linepos;
|
||||
static {
|
||||
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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user