0

Merge commit '662170dcd682' into dev-logger

This commit is contained in:
2018-12-18 13:02:58 +03:00
238 changed files with 1284 additions and 1439 deletions

8
.gitignore vendored
View File

@@ -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

View File

27
README.MD Normal file
View 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
```

View File

@@ -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
targetCompatibility = 1.8
options.encoding = 'UTF-8'
}
def lwjgl_ver = '2.9.3' ext {
def platform = '' 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()) { if (OperatingSystem.current().isWindows()) {
platform = 'windows' platform = 'windows'
} else if (OperatingSystem.current().isMacOsX()) { } else if (OperatingSystem.current().isMacOsX()) {
platform = 'osx' 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 { 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

File diff suppressed because it is too large Load Diff

View File

@@ -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