Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into refactor/settler-image-map
Browse files Browse the repository at this point in the history
  • Loading branch information
ewaldbenes authored Aug 1, 2018
2 parents 26ef90e + b51b35a commit a91311e
Show file tree
Hide file tree
Showing 257 changed files with 6,600 additions and 4,537 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bin
gen

# JSettlers folders and files
release
/release
save
logs
/replayForSavegame.log
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ before_cache:
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.gradle/wrapper/
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ext {
androidBuildToolsVersion = '27.0.3'
androidCompileSdkVersion = 27
androidMinSdkVersion = 19
androidTargetSdkVersion = 25
androidTargetSdkVersion = 26
}

buildscript {
Expand All @@ -22,7 +22,7 @@ buildscript {
dependencies {
classpath 'org.eclipse.jgit:org.eclipse.jgit:3.1.0.201310021548-r'
if (findProject(':jsettlers.main.android')) {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
}
Expand All @@ -33,6 +33,8 @@ allprojects {
jcenter()
google()
maven { url "https://raw.github.com/laenger/maven-releases/master/releases" }
maven { url "https://maven.google.com" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
*******************************************************************************/
package go.graphics.android;

import android.content.Context;
import android.opengl.GLES10;
import android.opengl.GLES11;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;

import android.content.Context;
import android.opengl.GLES10;
import android.opengl.GLES11;
import go.graphics.GLDrawContext;
import go.graphics.GeometryHandle;
import go.graphics.TextureHandle;
Expand Down Expand Up @@ -264,8 +265,7 @@ public TextureHandle generateTexture(int width, int height, ShortBuffer data) {

glBindTexture(texture);
GLES10.glTexImage2D(GLES10.GL_TEXTURE_2D, 0, GLES10.GL_RGBA, width,
height, 0, GLES10.GL_RGBA, GLES10.GL_UNSIGNED_SHORT_5_5_5_1,
data);
height, 0, GLES10.GL_RGBA, GLES10.GL_UNSIGNED_SHORT_4_4_4_4, data);

setTextureParameters();
return texture;
Expand All @@ -289,14 +289,16 @@ private static void setTextureParameters() {
GLES10.GL_REPEAT);
GLES10.glTexParameterf(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_WRAP_T,
GLES10.GL_REPEAT);

GLES10.glAlphaFunc(GLES10.GL_GREATER, 0.5f) ; // prevent writing of transparent pixels to z buffer
}

@Override
public void updateTexture(TextureHandle textureIndex, int left, int bottom,
int width, int height, ShortBuffer data) {
glBindTexture(textureIndex);
GLES10.glTexSubImage2D(GLES10.GL_TEXTURE_2D, 0, left, bottom, width,
height, GLES10.GL_RGBA, GLES10.GL_UNSIGNED_SHORT_5_5_5_1, data);
height, GLES10.GL_RGBA, GLES10.GL_UNSIGNED_SHORT_4_4_4_4, data);
}

public TextureHandle generateTextureAlpha(int width, int height) {
Expand Down Expand Up @@ -330,8 +332,8 @@ public void updateTextureAlpha(TextureHandle textureIndex, int left, int bottom,
}

@Override
public void glMultMatrixf(float[] matrix, int offset) {
GLES10.glMultMatrixf(matrix, offset);
public void glMultMatrixf(float[] matrix) {
GLES10.glMultMatrixf(matrix, 0);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
*******************************************************************************/
package go.graphics.android;

import android.content.Context;
import android.opengl.GLES10;
import android.opengl.GLSurfaceView;
import android.os.Vibrator;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;

import java.lang.reflect.Method;

import javax.microedition.khronos.egl.EGL10;
Expand All @@ -30,15 +39,6 @@
import go.graphics.event.GOEventHandlerProvider;
import go.graphics.event.interpreter.AbstractEventConverter;

import android.content.Context;
import android.opengl.GLES10;
import android.opengl.GLSurfaceView;
import android.os.Vibrator;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;

public class GOSurfaceView extends GLSurfaceView implements RedrawListener, GOEventHandlerProvider {

private final Area area;
Expand Down Expand Up @@ -218,6 +218,9 @@ private class Renderer implements GLSurfaceView.Renderer {

private Renderer(Context aContext) {
drawcontext = new AndroidDrawContext(aContext);

GLES10.glBlendFunc(GLES10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
GLES10.glEnable(GLES10.GL_BLEND);
}

@Override
Expand Down
46 changes: 23 additions & 23 deletions go.graphics.swing/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
apply plugin: 'java'

def lwjgl_version="3.1.6"

dependencies {
implementation project(':go.graphics')

implementation "org.jogamp.gluegen:gluegen-rt:2.3.2"
implementation "org.jogamp.jogl:jogl-all:2.3.2"
compile "org.lwjgl:lwjgl:"+lwjgl_version
compile "org.lwjgl:lwjgl-opengl:"+lwjgl_version
compile "org.lwjgl:lwjgl-glfw:"+lwjgl_version
compile "org.lwjgl:lwjgl-egl:"+lwjgl_version
compile "org.lwjgl:lwjgl-jawt:"+lwjgl_version

compile "org.lwjgl:lwjgl:"+lwjgl_version+":natives-linux"
compile "org.lwjgl:lwjgl:"+lwjgl_version+":natives-macos"
compile "org.lwjgl:lwjgl:"+lwjgl_version+":natives-windows"

compile "org.lwjgl:lwjgl-opengl:"+lwjgl_version+":natives-linux"
compile "org.lwjgl:lwjgl-opengl:"+lwjgl_version+":natives-macos"
compile "org.lwjgl:lwjgl-opengl:"+lwjgl_version+":natives-windows"

compile "org.lwjgl:lwjgl-glfw:"+lwjgl_version+":natives-linux"
compile "org.lwjgl:lwjgl-glfw:"+lwjgl_version+":natives-macos"
compile "org.lwjgl:lwjgl-glfw:"+lwjgl_version+":natives-windows"


runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-android-aarch64"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-android-armv6"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-amd64"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-armv6"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-armv6hf"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-i586"
// macos support
compile "org.jogamp.gluegen:gluegen-rt:2.3.2"
compile "org.jogamp.jogl:jogl-all:2.3.2"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-macosx-universal"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-solaris-amd64"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-solaris-i586"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-windows-amd64"
runtime "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-windows-i586"

runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-android-aarch64"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-android-armv6"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-linux-amd64"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-linux-armv6"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-linux-armv6hf"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-linux-i586"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-macosx-universal"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-solaris-amd64"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-solaris-i586"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-windows-amd64"
runtime "org.jogamp.jogl:jogl-all:2.3.2:natives-windows-i586"
}
Loading

0 comments on commit a91311e

Please sign in to comment.