mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Merge remote-tracking branch 'sandstranger/fixes-for-android'
This commit is contained in:
commit
44d1f43b2b
6 changed files with 34 additions and 14 deletions
|
@ -120,14 +120,12 @@ RenderingManager::RenderingManager(OEngine::Render::OgreRenderer& _rend, const b
|
||||||
// Set default texture filtering options
|
// Set default texture filtering options
|
||||||
TextureFilterOptions tfo;
|
TextureFilterOptions tfo;
|
||||||
std::string filter = Settings::Manager::getString("texture filtering", "General");
|
std::string filter = Settings::Manager::getString("texture filtering", "General");
|
||||||
#ifndef ANDROID
|
|
||||||
if (filter == "anisotropic") tfo = TFO_ANISOTROPIC;
|
if (filter == "anisotropic") tfo = TFO_ANISOTROPIC;
|
||||||
else if (filter == "trilinear") tfo = TFO_TRILINEAR;
|
else if (filter == "trilinear") tfo = TFO_TRILINEAR;
|
||||||
else if (filter == "bilinear") tfo = TFO_BILINEAR;
|
else if (filter == "bilinear") tfo = TFO_BILINEAR;
|
||||||
else /*if (filter == "none")*/ tfo = TFO_NONE;
|
else /*if (filter == "none")*/ tfo = TFO_NONE;
|
||||||
#else
|
|
||||||
tfo = TFO_NONE;
|
|
||||||
#endif
|
|
||||||
MaterialManager::getSingleton().setDefaultTextureFiltering(tfo);
|
MaterialManager::getSingleton().setDefaultTextureFiltering(tfo);
|
||||||
MaterialManager::getSingleton().setDefaultAnisotropy( (filter == "anisotropic") ? Settings::Manager::getInt("anisotropy", "General") : 1 );
|
MaterialManager::getSingleton().setDefaultAnisotropy( (filter == "anisotropic") ? Settings::Manager::getInt("anisotropy", "General") : 1 );
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@ namespace MWWorld
|
||||||
MWScript::Locals mLocals; // if we find the overhead of heaving a locals
|
MWScript::Locals mLocals; // if we find the overhead of heaving a locals
|
||||||
// object in the refdata of refs without a script,
|
// object in the refdata of refs without a script,
|
||||||
// we can make this a pointer later.
|
// we can make this a pointer later.
|
||||||
|
bool mDeleted; // separate delete flag used for deletion by a content file
|
||||||
bool mHasLocals;
|
bool mHasLocals;
|
||||||
bool mEnabled;
|
bool mEnabled;
|
||||||
int mCount; // 0: deleted
|
int mCount; // 0: deleted
|
||||||
|
|
||||||
bool mDeleted; // separate delete flag used for deletion by a content file
|
|
||||||
|
|
||||||
ESM::Position mPosition;
|
ESM::Position mPosition;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ char const * Buffer::getData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_getPathToJni(JNIEnv *env, jobject obj, jstring prompt)
|
JNIEXPORT void JNICALL Java_ui_activity_GameActivity_getPathToJni(JNIEnv *env, jobject obj, jstring prompt)
|
||||||
{
|
{
|
||||||
jboolean iscopy;
|
jboolean iscopy;
|
||||||
Buffer::setData((env)->GetStringUTFChars(prompt, &iscopy));
|
Buffer::setData((env)->GetStringUTFChars(prompt, &iscopy));
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
#ifndef _Included_org_libsdl_app_SDLActivity_getPathToJni
|
#ifndef _Included_ui_activity_GameActivity_getPathToJni
|
||||||
#define _Included_org_libsdl_app_SDLActivity_getPathToJni
|
#define _Included_ui_activity_GameActivity_getPathToJni
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -11,7 +11,7 @@ extern "C" {
|
||||||
* Method: getPathToJni
|
* Method: getPathToJni
|
||||||
* Signature: (I)I
|
* Signature: (I)I
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_getPathToJni(JNIEnv *env, jobject obj, jstring prompt);
|
JNIEXPORT void JNICALL Java_ui_activity_GameActivity_getPathToJni(JNIEnv *env, jobject obj, jstring prompt);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
#if NORMAL_MAP && SH_GLSLES
|
||||||
|
mat3 transpose( mat3 m);
|
||||||
|
#endif
|
||||||
// ----------------------------------- FRAGMENT ------------------------------------------
|
// ----------------------------------- FRAGMENT ------------------------------------------
|
||||||
|
|
||||||
#if UNDERWATER
|
#if UNDERWATER
|
||||||
|
@ -376,13 +378,13 @@
|
||||||
float3 binormal = cross(tangentPassthrough.xyz, normal.xyz);
|
float3 binormal = cross(tangentPassthrough.xyz, normal.xyz);
|
||||||
float3x3 tbn = float3x3(tangentPassthrough.xyz, binormal, normal.xyz);
|
float3x3 tbn = float3x3(tangentPassthrough.xyz, binormal, normal.xyz);
|
||||||
|
|
||||||
#if SH_GLSL
|
#if SH_GLSL || SH_GLSLES
|
||||||
tbn = transpose(tbn);
|
tbn = transpose(tbn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float4 normalTex = shSample(normalMap, UV.xy);
|
float4 normalTex = shSample(normalMap, UV.xy);
|
||||||
|
|
||||||
normal = normalize (shMatrixMult( transpose(tbn), normalTex.xyz * 2 - 1 ));
|
normal = normalize (shMatrixMult( transpose(tbn), normalTex.xyz * 2.0 - float3 (1.0,1.0,1.0) ));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENV_MAP || SPECULAR || PARALLAX
|
#if ENV_MAP || SPECULAR || PARALLAX
|
||||||
|
@ -576,5 +578,14 @@
|
||||||
// prevent negative colour output (for example with negative lights)
|
// prevent negative colour output (for example with negative lights)
|
||||||
shOutputColour(0).xyz = max(shOutputColour(0).xyz, float3(0.0,0.0,0.0));
|
shOutputColour(0).xyz = max(shOutputColour(0).xyz, float3(0.0,0.0,0.0));
|
||||||
}
|
}
|
||||||
|
#if NORMAL_MAP && SH_GLSLES
|
||||||
|
mat3 transpose(mat3 m){
|
||||||
|
return mat3(
|
||||||
|
m[0][0],m[1][0],m[2][0],
|
||||||
|
m[0][1],m[1][1],m[2][1],
|
||||||
|
m[0][2],m[1][2],m[2][2]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -221,6 +221,9 @@
|
||||||
#if UNDERWATER
|
#if UNDERWATER
|
||||||
#include "underwater.h"
|
#include "underwater.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if NORMAL_MAP && SH_GLSLES
|
||||||
|
mat3 transpose(mat3 m);
|
||||||
|
#endif
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
|
|
||||||
|
@ -319,7 +322,7 @@ shUniform(float4, cameraPos) @shAutoConstant(cameraPos, camera_position)
|
||||||
|
|
||||||
// derive final matrix
|
// derive final matrix
|
||||||
float3x3 tbn = float3x3(tangent, binormal, normal);
|
float3x3 tbn = float3x3(tangent, binormal, normal);
|
||||||
#if SH_GLSL
|
#if SH_GLSL || SH_GLSLES
|
||||||
tbn = transpose(tbn);
|
tbn = transpose(tbn);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -492,5 +495,13 @@ albedo = shLerp(albedo, diffuseTex, blendValues@shPropertyString(blendmap_compon
|
||||||
shOutputColour(0).a = 1.0-previousAlpha;
|
shOutputColour(0).a = 1.0-previousAlpha;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#if NORMAL_MAP && SH_GLSLES
|
||||||
|
mat3 transpose(mat3 m){
|
||||||
|
return mat3(
|
||||||
|
m[0][0],m[1][0],m[2][0],
|
||||||
|
m[0][1],m[1][1],m[2][1],
|
||||||
|
m[0][2],m[1][2],m[2][2]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue