fix: update correct Modulate behavior
This commit is contained in:
parent
e03a651d10
commit
39a7ee9c02
22
GL/draw.c
22
GL/draw.c
|
@ -628,10 +628,10 @@ static inline void _readUVData(const GLuint first, const GLuint count, Vertex* o
|
|||
}
|
||||
|
||||
static inline void _readSTData(const GLuint first, const GLuint count, VertexExtra* extra) {
|
||||
if((ENABLED_VERTEX_ATTRIBUTES & ST_ENABLED_FLAG) != ST_ENABLED_FLAG) {
|
||||
/*if((ENABLED_VERTEX_ATTRIBUTES & ST_ENABLED_FLAG) != ST_ENABLED_FLAG) {
|
||||
_fillZero2fVE(count, extra->st);
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
const GLubyte ststride = (ST_POINTER.stride) ? ST_POINTER.stride : ST_POINTER.size * byte_size(ST_POINTER.type);
|
||||
const void* stptr = ((GLubyte*) ST_POINTER.ptr + (first * ststride));
|
||||
|
@ -1057,9 +1057,9 @@ static void submitVertices(GLenum mode, GLsizei first, GLuint count, GLenum type
|
|||
//glActiveTextureARB(GL_TEXTURE0);
|
||||
//glGetBooleanv(GL_TEXTURE_2D, &doTexture);
|
||||
|
||||
doMultitexture = _GetBooleanTextureEnabled(GL_TEXTURE1);
|
||||
//glActiveTextureARB(GL_TEXTURE1);
|
||||
//glGetBooleanv(GL_TEXTURE_2D, &doMultitexture);
|
||||
//doMultitexture = _GetBooleanTextureEnabled(GL_TEXTURE1);
|
||||
glActiveTextureARB(GL_TEXTURE1);
|
||||
glGetBooleanv(GL_TEXTURE_2D, &doMultitexture);
|
||||
|
||||
doLighting = _glIsLightingEnabled();
|
||||
|
||||
|
@ -1177,7 +1177,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLuint count, GLenum type
|
|||
}
|
||||
|
||||
TextureObject* texture1 = _glGetTexture1();
|
||||
|
||||
|
||||
/* Multitexture implicitly disabled */
|
||||
if(!texture1 || ((ENABLED_VERTEX_ATTRIBUTES & ST_ENABLED_FLAG) != ST_ENABLED_FLAG)) {
|
||||
/* Multitexture actively disabled */
|
||||
|
@ -1215,12 +1215,12 @@ static void submitVertices(GLenum mode, GLsizei first, GLuint count, GLenum type
|
|||
GLboolean blendEnabled = glIsEnabled(GL_BLEND);
|
||||
GLboolean depthEnabled = glIsEnabled(GL_DEPTH_TEST);
|
||||
|
||||
glDepthFunc(GL_EQUAL);
|
||||
glEnable(GL_BLEND);
|
||||
//glDepthFunc(GL_EQUAL);
|
||||
//glEnable(GL_BLEND);
|
||||
|
||||
/* This is modulation, we need to switch depending on the texture env mode! */
|
||||
//glBlendFunc(GL_DST_COLOR, GL_ZERO);
|
||||
|
||||
/* This is modulation, we need to switch depending on the texture env mode! */
|
||||
glBlendFunc(GL_DST_COLOR, GL_ZERO);
|
||||
|
||||
/* Send the buffer again to the transparent list */
|
||||
push(mtHeader, mtStart, target->count, _glTransparentPolyList(), 1);
|
||||
|
||||
|
|
|
@ -314,7 +314,8 @@ static void _glInitializeTextureObject(TextureObject* txr, unsigned int id) {
|
|||
txr->width = txr->height = 0;
|
||||
txr->mipmap = 0;
|
||||
txr->uv_clamp = 0;
|
||||
txr->env = PVR_TXRENV_MODULATEALPHA;
|
||||
//txr->env = PVR_TXRENV_MODULATEALPHA;
|
||||
txr->env = PVR_TXRENV_MODULATE;
|
||||
txr->data = NULL;
|
||||
txr->mipmapCount = 0;
|
||||
txr->minFilter = GL_NEAREST;
|
||||
|
@ -430,7 +431,8 @@ void APIENTRY glTexEnvi(GLenum target, GLenum pname, GLint param) {
|
|||
|
||||
switch(param) {
|
||||
case GL_MODULATE:
|
||||
active->env = PVR_TXRENV_MODULATEALPHA;
|
||||
active->env = PVR_TXRENV_MODULATE;
|
||||
//active->env = PVR_TXRENV_MODULATEALPHA;
|
||||
break;
|
||||
case GL_DECAL:
|
||||
active->env = PVR_TXRENV_DECAL;
|
||||
|
|
9
Makefile
9
Makefile
|
@ -6,14 +6,15 @@
|
|||
# Copyright (C) 2018 Luke Benstead
|
||||
|
||||
TARGET = libGLdc.a
|
||||
OBJS = GL/gldc.o
|
||||
#OBJS = GL/draw.o GL/flush.o GL/framebuffer.o GL/immediate.o GL/lighting.o GL/state.o GL/texture.o GL/glu.o
|
||||
#OBJS += GL/matrix.o GL/fog.o GL/error.o GL/clip.o containers/stack.o containers/named_array.o containers/aligned_vector.o GL/profiler.o
|
||||
#OBJS = GL/gldc.o
|
||||
OBJS = GL/draw.o GL/flush.o GL/framebuffer.o GL/immediate.o GL/lighting.o GL/state.o GL/texture.o GL/glu.o
|
||||
OBJS += GL/matrix.o GL/fog.o GL/error.o GL/clip.o containers/stack.o containers/named_array.o containers/aligned_vector.o GL/profiler.o
|
||||
OBJS += containers/stack.o containers/named_array.o containers/aligned_vector.o GL/profiler.o
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
KOS_CFLAGS += -ffast-math -O3 -funroll-loops -Iinclude
|
||||
KOS_CFLAGS += -ffast-math -O3 -Iinclude -funsafe-math-optimizations -fno-expensive-optimizations
|
||||
GCC_FLAGS = -mlra
|
||||
|
||||
link:
|
||||
$(KOS_AR) rcs $(TARGET) $(OBJS)
|
||||
|
|
Loading…
Reference in New Issue
Block a user