mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-26 00:47:00 +00:00
more Android fixes
This commit is contained in:
parent
c7109fe521
commit
3726a896e2
@ -21,7 +21,7 @@ android {
|
|||||||
// Provides a relative path to your CMake build script.
|
// Provides a relative path to your CMake build script.
|
||||||
// ldLibs "-lGLESv1_CM -llog"
|
// ldLibs "-lGLESv1_CM -llog"
|
||||||
|
|
||||||
cFlags "-no-integrated-as"
|
cFlags "-integrated-as"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,10 +88,10 @@ dependencies {
|
|||||||
//
|
//
|
||||||
// IDE setting pulls in the specific version of v4 support you have installed:
|
// IDE setting pulls in the specific version of v4 support you have installed:
|
||||||
//
|
//
|
||||||
//compile 'com.android.support:support-v4:21.0.3'
|
compile 'com.android.support:support-v4:21.0.3'
|
||||||
|
|
||||||
//
|
//
|
||||||
// generic directive pulls in any available version of v4 support:
|
// generic directive pulls in any available version of v4 support:
|
||||||
//
|
//
|
||||||
compile 'com.android.support:support-v4:+'
|
// compile 'com.android.support:support-v4:+'
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.roguetemple.hyperroid"
|
package="com.roguetemple.hyperroid"
|
||||||
android:versionCode="10017" android:versionName="10.0g"
|
android:versionCode="10041" android:versionName="10.4a"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
|
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
|
||||||
<!-- <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9" /> -->
|
<!-- <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9" /> -->
|
||||||
|
@ -7,12 +7,12 @@ import javax.microedition.khronos.opengles.GL10;
|
|||||||
// import android.graphics.Path;
|
// import android.graphics.Path;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
|
import android.opengl.GLES20;
|
||||||
import android.opengl.GLSurfaceView;
|
import android.opengl.GLSurfaceView;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
// bimport android.widget.Toast;
|
// bimport android.widget.Toast;
|
||||||
|
|
||||||
import android.opengl.GLES20;
|
|
||||||
import com.android.texample.GLText;
|
import com.android.texample.GLText;
|
||||||
import com.android.texample.Shader;
|
import com.android.texample.Shader;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ public class HyperRenderer implements GLSurfaceView.Renderer {
|
|||||||
int [] graphdata;
|
int [] graphdata;
|
||||||
int gdpos;
|
int gdpos;
|
||||||
int gdpop() { return graphdata[gdpos++]; }
|
int gdpop() { return graphdata[gdpos++]; }
|
||||||
boolean initialized;
|
boolean initialized;
|
||||||
|
|
||||||
public void onDrawFrame(GL10 unused) {
|
public void onDrawFrame(GL10 unused) {
|
||||||
if(game.forceCanvas) return;
|
if(game.forceCanvas) return;
|
||||||
@ -39,10 +39,10 @@ public class HyperRenderer implements GLSurfaceView.Renderer {
|
|||||||
|
|
||||||
GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT);
|
GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT);
|
||||||
synchronized(game) {
|
synchronized(game) {
|
||||||
if(!initialized) { game.glhrinit(); initialized = true; }
|
if(!initialized) { game.glhrinit(); initialized = true; }
|
||||||
game.hv.updateGame();
|
game.hv.updateGame();
|
||||||
game.draw();
|
game.draw();
|
||||||
graphdata = game.loadMap();
|
graphdata = game.loadMap();
|
||||||
glText.shader.aPosition = game.getaPosition();
|
glText.shader.aPosition = game.getaPosition();
|
||||||
glText.shader.aTexture = game.getaTexture();
|
glText.shader.aTexture = game.getaTexture();
|
||||||
glText.shader.uColor = game.getuColor();
|
glText.shader.uColor = game.getuColor();
|
||||||
@ -50,26 +50,7 @@ public class HyperRenderer implements GLSurfaceView.Renderer {
|
|||||||
|
|
||||||
if(graphdata == null) return;
|
if(graphdata == null) return;
|
||||||
|
|
||||||
// Set to ModelView mode
|
gdpos = 0;
|
||||||
gl.glMatrixMode( GL10.GL_MODELVIEW ); // Activate Model View Matrix
|
|
||||||
gl.glLoadIdentity(); // Load Identity Matrix
|
|
||||||
|
|
||||||
// enable texture + alpha blending
|
|
||||||
// NOTE: this is required for text rendering! we could incorporate it into
|
|
||||||
// the GLText class, but then it would be called multiple times (which impacts performance).
|
|
||||||
gl.glEnable( GL10.GL_TEXTURE_2D ); // Enable Texture Mapping
|
|
||||||
gl.glEnable( GL10.GL_BLEND ); // Enable Alpha Blend
|
|
||||||
gl.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA ); // Set Alpha Blend Function
|
|
||||||
|
|
||||||
gl.glMatrixMode( GL10.GL_PROJECTION ); // Activate Projection Matrix
|
|
||||||
gl.glLoadIdentity(); // Load Identity Matrix
|
|
||||||
gl.glOrthof( // Set Ortho Projection (Left,Right,Bottom,Top,Front,Back)
|
|
||||||
0, width,
|
|
||||||
0, height,
|
|
||||||
1.0f, -1.0f
|
|
||||||
);
|
|
||||||
|
|
||||||
gdpos = 0;
|
|
||||||
while(gdpos < graphdata.length) {
|
while(gdpos < graphdata.length) {
|
||||||
switch(gdpop()) {
|
switch(gdpop()) {
|
||||||
case 2: {
|
case 2: {
|
||||||
@ -117,8 +98,8 @@ public class HyperRenderer implements GLSurfaceView.Renderer {
|
|||||||
GLES20.glViewport(0, 0, width, height);
|
GLES20.glViewport(0, 0, width, height);
|
||||||
|
|
||||||
// Save width and height
|
// Save width and height
|
||||||
this.width = width; // Save Current Width
|
this.width = width; // Save Current Width
|
||||||
this.height = height; // Save Current Height
|
this.height = height; // Save Current Height
|
||||||
initialized = false;
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +108,7 @@ public class HyperRenderer implements GLSurfaceView.Renderer {
|
|||||||
|
|
||||||
glText = new GLText( new Shader() );
|
glText = new GLText( new Shader() );
|
||||||
glText.load(Typeface.DEFAULT_BOLD, 48, 2, 2 ); // Create Font (Height: 48 Pixels / X+Y Padding 2 Pixels)
|
glText.load(Typeface.DEFAULT_BOLD, 48, 2, 2 ); // Create Font (Height: 48 Pixels / X+Y Padding 2 Pixels)
|
||||||
initialized = false;
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -243,8 +243,6 @@ int textwidth(int siz, const string &str) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void achievement_init() {}
|
|
||||||
|
|
||||||
bool achievementsConnected = false;
|
bool achievementsConnected = false;
|
||||||
string doViewLeaderboard;
|
string doViewLeaderboard;
|
||||||
bool doViewAchievements;
|
bool doViewAchievements;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
mkdir app/src/main/assets/sounds
|
mkdir -p app/src/main/assets/sounds
|
||||||
cp ../sounds/* app/src/main/assets/sounds/
|
cp ../sounds/* app/src/main/assets/sounds/
|
||||||
mkdir app/src/main/res/raw/
|
mkdir -p app/src/main/res/raw/
|
||||||
#for x in caves crossroads desert graveyard hell icyland jungle laboratory mirror rlyeh
|
#for x in caves crossroads desert graveyard hell icyland jungle laboratory mirror rlyeh
|
||||||
#do cp ../music/hr3-$x.ogg app/src/main/res/raw/$x.ogg
|
#do cp ../music/hr3-$x.ogg app/src/main/res/raw/$x.ogg
|
||||||
#done
|
#done
|
||||||
|
Loading…
Reference in New Issue
Block a user