Android fixes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3956 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
0b7e5ce3e6
commit
5651e77c30
6 changed files with 54 additions and 20 deletions
|
@ -1191,9 +1191,9 @@ droid-rel: droid/build.xml droid/ftekeystore
|
|||
@echo
|
||||
@echo Signing package... I hope you remember your password.
|
||||
@echo
|
||||
jarsigner -verbose -keystore droid/ftekeystore droid/bin/FTEDroid-unsigned.apk autogen
|
||||
jarsigner -digestalg SHA1 -sigalg MD5withRSA -keystore droid/ftekeystore droid/bin/FTEDroid-unsigned.apk autogen
|
||||
-rm -f $(RELEASE_DIR)/FTEDroid.apk
|
||||
$(DROID_SDK_PATH)/tools/zipalign -v 4 droid/bin/FTEDroid-unsigned.apk $(RELEASE_DIR)/FTEDroid.apk
|
||||
$(DROID_SDK_PATH)/tools/zipalign 4 droid/bin/FTEDroid-unsigned.apk $(RELEASE_DIR)/FTEDroid.apk
|
||||
|
||||
droid-opt: droid/build.xml droid/ftekeystore
|
||||
$(MAKE) FTE_TARGET=droid gl-rel
|
||||
|
@ -1207,6 +1207,6 @@ droid-dbg: droid/build.xml
|
|||
$(MAKE) FTE_TARGET=droid gl-dbg
|
||||
@mkdir -p droid/libs/armeabi
|
||||
@cp $(DEBUG_DIR)/libftedroid.so droid/libs/armeabi/
|
||||
@cd droid && ant debug && ant install
|
||||
@cd droid && ant debug install
|
||||
cp droid/bin/FTEDroid-debug.apk $(DEBUG_DIR)/FTEDroid.apk
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
package="com.fteqw"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<uses-sdk android:minSdkVersion="3" />
|
||||
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
|
||||
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
#include "quakedef.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
//FIXME: this shouldn't be defined
|
||||
#define FORCESTATE
|
||||
#else
|
||||
//#define FORCESTATE
|
||||
#endif
|
||||
//#define WIREFRAME
|
||||
|
||||
#ifdef GLQUAKE
|
||||
|
@ -249,6 +244,7 @@ void GL_TexEnv(GLenum mode)
|
|||
|
||||
static void BE_SetPassBlendMode(int tmu, int pbm)
|
||||
{
|
||||
|
||||
#ifndef FORCESTATE
|
||||
if (shaderstate.blendmode[tmu] != pbm)
|
||||
#endif
|
||||
|
@ -616,7 +612,8 @@ static void RevertToKnownState(void)
|
|||
|
||||
BE_SetPassBlendMode(0, PBM_REPLACE);
|
||||
|
||||
qglColor3f(1,1,1);
|
||||
if (qglColor3f)
|
||||
qglColor3f(1,1,1);
|
||||
|
||||
shaderstate.shaderbits &= ~(SBITS_MISC_DEPTHEQUALONLY|SBITS_MISC_DEPTHCLOSERONLY|SBITS_MASK_BITS);
|
||||
shaderstate.shaderbits |= SBITS_MISC_DEPTHWRITE;
|
||||
|
@ -962,6 +959,11 @@ void GLBE_Init(void)
|
|||
shaderstate.shader_cube = R_RegisterCustom("rtlight_sube", Shader_LightPass_Cube, NULL);
|
||||
}
|
||||
|
||||
gl_overbright.modified = true; /*in case the d3d renderer does the same*/
|
||||
/*lock the cvar down if the backend can't actually do it*/
|
||||
if (!gl_config.tex_env_combine && !gl_config.nofixedfunc && gl_overbright.ival)
|
||||
Cvar_ApplyLatchFlag(&gl_overbright, "0", CVAR_RENDERERLATCH);
|
||||
|
||||
shaderstate.shaderbits = ~0;
|
||||
BE_SendPassBlendDepthMask(0);
|
||||
|
||||
|
|
|
@ -790,7 +790,7 @@ static void Shader_EntityMergable ( shader_t *shader, shaderpass_t *pass, char *
|
|||
|
||||
static void Shader_ProgAutoFields(program_t *prog, char **cvarnames, int *cvartypes);
|
||||
/*program text is already loaded, this function parses the 'header' of it to see which permutations it provides, and how many times we need to recompile it*/
|
||||
static void Shader_LoadPermutations(char *name, program_t *prog, char *script, int qrtype, int ver)
|
||||
static qboolean Shader_LoadPermutations(char *name, program_t *prog, char *script, int qrtype, int ver)
|
||||
{
|
||||
static char *permutationname[] =
|
||||
{
|
||||
|
@ -921,6 +921,8 @@ static void Shader_LoadPermutations(char *name, program_t *prog, char *script, i
|
|||
}
|
||||
permutationdefines[pn++] = NULL;
|
||||
prog->handle[p].glsl = GLSlang_CreateProgram(name, (((p & PERMUTATION_SKELETAL) && ver < 120)?120:ver), permutationdefines, script, script);
|
||||
if (!p && !prog->handle[p].glsl)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#ifdef D3DQUAKE
|
||||
|
@ -937,7 +939,8 @@ static void Shader_LoadPermutations(char *name, program_t *prog, char *script, i
|
|||
permutationdefines[pn++] = permutationname[n];
|
||||
}
|
||||
permutationdefines[pn++] = NULL;
|
||||
D3DShader_CreateProgram(prog, p, permutationdefines, script, script);
|
||||
if (!D3DShader_CreateProgram(prog, p, permutationdefines, script, script))
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -945,6 +948,10 @@ static void Shader_LoadPermutations(char *name, program_t *prog, char *script, i
|
|||
free(permutationdefines[--nummodifiers]);
|
||||
|
||||
Shader_ProgAutoFields(prog, cvarnames, cvartypes);
|
||||
|
||||
if (p == PERMUTATIONS)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
typedef struct sgeneric_s
|
||||
{
|
||||
|
@ -2321,6 +2328,7 @@ static program_t *Shader_LoadGeneric(char *name, int qrtype)
|
|||
void *file;
|
||||
|
||||
sgeneric_t *g;
|
||||
|
||||
for (g = sgenerics; g; g = g->next)
|
||||
{
|
||||
if (!strcmp(name, g->name))
|
||||
|
@ -2359,7 +2367,7 @@ static program_t *Shader_LoadGeneric(char *name, int qrtype)
|
|||
if (file)
|
||||
{
|
||||
Con_DPrintf("Loaded %s from disk\n", name);
|
||||
Shader_LoadPermutations(name, &g->prog, file, qrtype, 0);
|
||||
g->failed = !Shader_LoadPermutations(name, &g->prog, file, qrtype, 0);
|
||||
FS_FreeFile(file);
|
||||
|
||||
g->prog.refs++;
|
||||
|
@ -2392,7 +2400,7 @@ static program_t *Shader_LoadGeneric(char *name, int qrtype)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
Shader_LoadPermutations(name, &g->prog, sbuiltins[i].body, sbuiltins[i].qrtype, sbuiltins[i].apiver);
|
||||
g->failed = !Shader_LoadPermutations(name, &g->prog, sbuiltins[i].body, sbuiltins[i].qrtype, sbuiltins[i].apiver);
|
||||
|
||||
g->prog.refs++;
|
||||
return &g->prog;
|
||||
|
@ -2727,7 +2735,11 @@ static void Shader_SLProgramName (shader_t *shader, shaderpass_t *pass, char **p
|
|||
shader->prog = malloc(sizeof(*shader->prog));
|
||||
memset(shader->prog, 0, sizeof(*shader->prog));
|
||||
shader->prog->refs = 1;
|
||||
Shader_LoadPermutations(shader->name, shader->prog, programbody, qrtype, 0);
|
||||
if (!Shader_LoadPermutations(shader->name, shader->prog, programbody, qrtype, 0))
|
||||
{
|
||||
free(shader->prog);
|
||||
shader->prog = NULL;
|
||||
}
|
||||
|
||||
BZ_Free(programbody);
|
||||
}
|
||||
|
@ -4187,9 +4199,24 @@ static qboolean Shader_Parsetok (shader_t *shader, shaderpass_t *pass, shaderkey
|
|||
|
||||
void Shader_SetPassFlush (shaderpass_t *pass, shaderpass_t *pass2)
|
||||
{
|
||||
qboolean config_tex_env_combine = 1;//0;
|
||||
qboolean config_nv_tex_env_combine4 = 1;//0;
|
||||
qboolean config_env_add = 1;//0;
|
||||
qboolean config_tex_env_combine;
|
||||
qboolean config_nv_tex_env_combine4;
|
||||
qboolean config_env_add;
|
||||
|
||||
#ifdef GLQUAKE
|
||||
if (qrenderer == QR_OPENGL)
|
||||
{
|
||||
config_tex_env_combine = gl_config.tex_env_combine;
|
||||
config_nv_tex_env_combine4 = gl_config.nv_tex_env_combine4;
|
||||
config_env_add = gl_config.env_add;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
config_tex_env_combine = 1;
|
||||
config_nv_tex_env_combine4 = 1;
|
||||
config_env_add = 1;
|
||||
}
|
||||
|
||||
if (((pass->flags & SHADER_PASS_DETAIL) && !r_detailtextures.value) ||
|
||||
((pass2->flags & SHADER_PASS_DETAIL) && !r_detailtextures.value) ||
|
||||
|
@ -4220,6 +4247,10 @@ void Shader_SetPassFlush (shaderpass_t *pass, shaderpass_t *pass2)
|
|||
if ((pass->shaderbits & SBITS_MASK_BITS) != (pass2->shaderbits & SBITS_MASK_BITS))
|
||||
return;
|
||||
|
||||
/*don't merge passes if the hardware cannot support it*/
|
||||
if (pass->numMergedPasses >= be_maxpasses)
|
||||
return;
|
||||
|
||||
// check if we can use multiple passes
|
||||
if (pass2->blendmode == PBM_DOTPRODUCT)
|
||||
{
|
||||
|
@ -4250,7 +4281,7 @@ void Shader_SetPassFlush (shaderpass_t *pass, shaderpass_t *pass2)
|
|||
}
|
||||
else return;
|
||||
|
||||
if (pass2->texgen == T_GEN_LIGHTMAP && pass2->blendmode == PBM_MODULATE)
|
||||
if (pass2->texgen == T_GEN_LIGHTMAP && pass2->blendmode == PBM_MODULATE && config_tex_env_combine)
|
||||
pass2->blendmode = PBM_OVERBRIGHT;
|
||||
}
|
||||
|
||||
|
|
|
@ -456,6 +456,7 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name), float ver)
|
|||
qglClientActiveTextureARB = (void *) getglext("glClientActiveTexture");
|
||||
qglSelectTextureSGIS = qglActiveTextureARB;
|
||||
mtexid0 = GL_TEXTURE0_ARB;
|
||||
qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_mtexarbable);
|
||||
}
|
||||
else if (GL_CheckExtension("GL_ARB_multitexture") && !COM_CheckParm("-noamtex"))
|
||||
{ //ARB multitexture is the popular choice.
|
||||
|
|
|
@ -88,7 +88,7 @@ void R_DrawSkyChain (batch_t *batch)
|
|||
GL_SkyForceDepth(batch);
|
||||
return;
|
||||
}
|
||||
#ifdef GLQUAKE
|
||||
#if defined(GLQUAKE) && !defined(ANDROID)
|
||||
if (*r_fastsky.string && qrenderer == QR_OPENGL && TEXVALID(batch->shader->defaulttextures.base))
|
||||
{
|
||||
R_CalcSkyChainBounds(batch);
|
||||
|
|
Loading…
Reference in a new issue