Skip to content

Commit

Permalink
renderer fixes for dark models left over from changes some time ago
Browse files Browse the repository at this point in the history
  • Loading branch information
briancullinan2 committed Jun 16, 2022
1 parent 6dbed40 commit 9b99868
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ ifeq ($(COMPILE_PLATFORM),darwin)
CLIENT_LDFLAGS = -F/Library/Frameworks -framework SDL2
endif

ifeq ($(USE_SYSTEM_JPEG),1)
CLIENT_LDFLAGS += -ljpeg
endif

DEBUG_CFLAGS = $(BASE_CFLAGS) -DDEBUG -D_DEBUG -g -O0
RELEASE_CFLAGS = $(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)

Expand Down
4 changes: 4 additions & 0 deletions code/renderer2/qgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#elif defined( __linux__ ) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __sun )
#include <GL/gl.h>
#include <GL/glx.h>
#elif defined(__APPLE__)
#define GL_NUM_EXTENSIONS 0x821D
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#endif

#ifndef APIENTRY
Expand Down
12 changes: 6 additions & 6 deletions code/renderer2/tr_bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,15 +673,15 @@ static void LoadDrawVertToSrfVert(srfVert_t *s, const drawVert_t *d, int realLig
//hack: convert LDR vertex colors to HDR
if (r_hdr->integer)
{
v[0] = MAX(d->color.rgba[0] / 255.0f, 0.499f);
v[1] = MAX(d->color.rgba[1] / 255.0f, 0.499f);
v[2] = MAX(d->color.rgba[2] / 255.0f, 0.499f);
v[0] = MAX(d->color.rgba[0], 0.499f);
v[1] = MAX(d->color.rgba[1], 0.499f);
v[2] = MAX(d->color.rgba[2], 0.499f);
}
else
{
v[0] = d->color.rgba[0] / 255.0f;
v[1] = d->color.rgba[1] / 255.0f;
v[2] = d->color.rgba[2] / 255.0f;
v[0] = d->color.rgba[0];
v[1] = d->color.rgba[1];
v[2] = d->color.rgba[2];
}

}
Expand Down
2 changes: 1 addition & 1 deletion code/renderer2/tr_dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ GLvoid APIENTRY GLDSA_GenerateTextureMipmapEXT(GLuint texture, GLenum target)

void GL_BindNullProgram(void)
{
qglUseProgram(0);
qglUseProgram((unsigned)0);
glDsaState.program = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion code/renderer2/tr_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void R_ImageList_f( void ) {
// same as DXT1?
estSize /= 2;
break;
case GL_RGBA16F:
case GL_RGBA16F_ARB:
format = "RGBA16F";
// 8 bytes per pixel
estSize *= 8;
Expand Down
4 changes: 4 additions & 0 deletions code/renderer2/tr_shader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,10 @@ static qboolean ParseStage( shaderStage_t *stage, const char **text )

continue;
}
else if ( !Q_stricmp( token, "depthFragment" ) )
{
continue;
}
else
{
ri.Printf( PRINT_WARNING, "WARNING: unknown parameter '%s' in shader '%s'\n", token, shader.name );
Expand Down
8 changes: 4 additions & 4 deletions code/renderer2/tr_surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ static void RB_SurfacePolychain( const srfPoly_t *p ) {
VectorCopy( p->verts[i].xyz, tess.xyz[numv] );
tess.texCoords[numv][0] = p->verts[i].st[0];
tess.texCoords[numv][1] = p->verts[i].st[1];
tess.color[numv][0] = p->verts[i].modulate.rgba[0] * 257;
tess.color[numv][1] = p->verts[i].modulate.rgba[1] * 257;
tess.color[numv][2] = p->verts[i].modulate.rgba[2] * 257;
tess.color[numv][3] = p->verts[i].modulate.rgba[3] * 257;
tess.color[numv][0] = (int)p->verts[i].modulate.rgba[0] * 257;
tess.color[numv][1] = (int)p->verts[i].modulate.rgba[1] * 257;
tess.color[numv][2] = (int)p->verts[i].modulate.rgba[2] * 257;
tess.color[numv][3] = (int)p->verts[i].modulate.rgba[3] * 257;

numv++;
}
Expand Down

0 comments on commit 9b99868

Please sign in to comment.