updated Android to 11.3i

This commit is contained in:
Zeno Rogue 2020-04-07 22:46:45 +02:00
parent 5dbbf233fa
commit 348f1afcb0
6 changed files with 52 additions and 26 deletions

View File

@ -13,8 +13,8 @@
#define _HYPER_H_
// version numbers
#define VER "11.3h"
#define VERNUM_HEX 0xA828
#define VER "11.3i"
#define VERNUM_HEX 0xA829
#include "sysconfig.h"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.roguetemple.hyperroid"
android:versionCode="11308" android:versionName="11.3h"
android:versionCode="11309" android:versionName="11.3i"
android:installLocation="auto">
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
<!-- <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9" /> -->

View File

@ -36,7 +36,7 @@ public class GLText {
allchars = new StringBuffer();
for(char c=32; c<=126; c++)
allchars.append(c);
allchars.append("°²´½ÁÄÇÈÉÍÎÖÚÜßàáâãäçèéêìíîïòóôõöøùúüýąćČčĎďĘęĚěğİıŁłńňŘřŚśŞşŠšŤťůŹźŻżŽžδϕЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяёᵈ∞");
allchars.append("°²´½ÁÄÇÈÉÍÎÖÚÜßàáâãäçèéêìíîïòóôõöøùúüýąćČčĎďĘęĚěğİıŁłńňŘřŚśŞşŠšŤťůŹźŻżŽžΘδλπϕЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяёᵈ←→⌫⏎");
}
int numChars() {

View File

@ -635,8 +635,8 @@ public class HyperRogue extends Activity implements SensorEventListener {
Sensor mRotation; // mAccelerometer, mMagneticField;
final int[] msgn = {1, 1, -1};
final int[] msgnl = {1, -1, 1};
final int[] msgn = {1, 1, 1};
final int[] msgnl = {1, 1, -1};
final int[] lsc = {1, 0, 2};
double getOrientation(int i, int j) {
@ -656,11 +656,23 @@ public class HyperRogue extends Activity implements SensorEventListener {
}});
}
int rotation = getWindowManager().getDefaultDisplay().getRotation();
if((rotation & 1) == 1)
return mRotationMatrix[lsc[j]+3*lsc[i]]*msgnl[i]*msgnl[j];
switch(rotation) {
case android.view.Surface.ROTATION_0:
return mRotationMatrix[j+3*i];
return mRotationMatrix[j+3*i]*msgn[i]*msgn[j];
case android.view.Surface.ROTATION_90:
return mRotationMatrix[lsc[j]+3*i] * (j==0?-1:1);
case android.view.Surface.ROTATION_270:
return mRotationMatrix[lsc[j]+3*i]*(j==1?-1:1);
case android.view.Surface.ROTATION_180:
return mRotationMatrix[j+3*i]*(j<2?-1:1);
default:
return mRotationMatrix[j+3*i];
}
}
@Override
@ -705,6 +717,7 @@ class HRConfigChooser implements EGLConfigChooser {
EGL10.EGL_GREEN_SIZE, 6,
EGL10.EGL_BLUE_SIZE, 5,
EGL10.EGL_STENCIL_SIZE, 1,
EGL10.EGL_DEPTH_SIZE, 8,
EGL10.EGL_NONE
};
@ -730,9 +743,10 @@ class HRConfigChooser implements EGLConfigChooser {
int b = getValue(egl, display, config, EGL10.EGL_BLUE_SIZE);
int a = getValue(egl, display, config, EGL10.EGL_ALPHA_SIZE);
int score = 10000;
if (s == 0) score -= 1000;
if (s == 0) score -= 2000;
score -= s;
score -= d;
if (d < 8) score -= 1000;
score += d;
score -= a;
int all = r + g + b;
if (all < 24) score -= 10 * (24 - all);

View File

@ -35,18 +35,11 @@
char android_log_buf[1000000];
int android_log_bufpos = 0;
FILE *slog;
#define SPECIAL_LOGGER
void special_log(char c) {
if(c == 10 || android_log_bufpos == 999999) {
android_log_buf[android_log_bufpos] = 0;
__android_log_print(ANDROID_LOG_VERBOSE, "HRLOG", "%s", android_log_buf);
android_log_bufpos = 0;
}
else {
android_log_buf[android_log_bufpos++] = c;
}
}
void special_log(char c);
#include <jni.h>
#include <string>
@ -56,15 +49,28 @@ void gdpush(int t);
void shareScore(MOBPAR_FORMAL);
bool settingsChanged = false;
const char *scorefile;
bool settingsChanged = false;
struct transmatrix getOrientation();
}
#include "../../../../../hyper.cpp"
void special_log(char c) {
if(slog) fprintf(slog, "%c", c), fflush(slog); /*
if(c == 10 || android_log_bufpos == 999999) {
android_log_buf[android_log_bufpos] = 0;
__android_log_print(ANDROID_LOG_VERBOSE, "HRLOG", "%s", android_log_buf);
android_log_bufpos = 0;
}
else {
android_log_buf[android_log_bufpos++] = c;
} */
}
namespace hr {
// #define delref env->DeleteLocalRef(_thiz)
@ -204,6 +210,7 @@ Java_com_roguetemple_hyperroid_HyperRogue_setFilesDir(MOBPAR_FORMAL, jstring dir
chmod(scorefile, 0777);
chmod(conffile, 0777);
chmod(nativeString, 0777);
chmod((string(nativeString)+"/..").c_str(), 0777);
env->ReleaseStringUTFChars(dir, nativeString);
}
@ -301,7 +308,9 @@ extern "C" void Java_com_roguetemple_hyperroid_HyperRogue_draw(MOBPAR_FORMAL) {
#if HNEW
// text is drawn with 'textured'
glhr::be_textured();
dynamicval<eModel> p(pmodel, mdManual);
current_display->next_shader_flags = GF_TEXTURE;
current_display->set_all(0);
glhr::set_depthtest(false);
current_display->set_viewport(0);
current_display->set_mask(0);
@ -344,7 +353,6 @@ extern "C" void Java_com_roguetemple_hyperroid_HyperRogue_update
mousex = _mousex;
mousey = _mousey;
clicked = _clicked;
// ticks = _ticks;
uploadAll(MOBPAR_ACTUAL);
UNLOCK
// delref;
@ -358,7 +366,7 @@ void playSound(cell *c, const string& fname, int vol) {
soundsToPlay.push_back(make_pair(fname, vol));
}
transmatrix orientation;
transmatrix orientation = Id;
bool orientation_requested;
transmatrix getOrientation() {
@ -375,6 +383,9 @@ void uploadAll(JNIEnv *env, jobject thiz) {
for(int i=0; i<3; i++)
for(int j=0; j<3; j++)
orientation[i][j] = env->CallDoubleMethod(thiz, mid, i, j);
for(int i=0; i<3; i++)
orientation[i][3] = orientation[3][i] = 0;
orientation[3][3] = 1;
orientation_requested = false;
}

View File

@ -163,6 +163,7 @@ void snow_slide(vector<tour::slide>& v, string title, string desc, reaction_t t)
tour::slide_backup<ld>(snow_lambda, 1);
tour::slide_backup(snow_color, 0xC0C0C0FF);
tour::slide_backup(snow_intense, true);
tour::slide_backup(smooth_scrolling, true);
t();
start_game();
playermoved = false;