1
0
Fork 0

Fixed some color types in renderers

This commit is contained in:
Eugene 2022-02-05 20:12:09 +02:00
parent eecfb74dfd
commit d6014532c0
8 changed files with 32 additions and 32 deletions

View File

@ -1517,8 +1517,8 @@ void RB_CheckOverflow( int verts, int indexes );
void RB_StageIteratorGeneric( void );
void RB_StageIteratorSky( void );
void RB_AddQuadStamp( const vec3_t origin, const vec3_t left, const vec3_t up, const byte *color );
void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up, const byte *color, float s1, float t1, float s2, float t2 );
void RB_AddQuadStamp( const vec3_t origin, const vec3_t left, const vec3_t up, color4ub_t color );
void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up, color4ub_t color, float s1, float t1, float s2, float t2 );
void RB_AddQuadStamp2( float x, float y, float w, float h, float s1, float t1, float s2, float t2, color4ub_t color );
void RB_ShowImages( void );

View File

@ -267,7 +267,7 @@ void DeformText( const char *text ) {
vec3_t origin, width, height;
int len;
int ch;
byte color[4];
color4ub_t color;
float bottom, top;
vec3_t mid;
@ -306,7 +306,7 @@ void DeformText( const char *text ) {
tess.numIndexes = 0;
tess.numVertexes = 0;
color[0] = color[1] = color[2] = color[3] = 255;
color.u32 = 0xFFFFFFFF;
// draw each character
for ( i = 0 ; i < len ; i++ ) {
@ -410,7 +410,7 @@ static void AutospriteDeform( void ) {
VectorScale(up, axisLength, up);
}
RB_AddQuadStamp( mid, left, up, tess.vertexColors[i].rgba );
RB_AddQuadStamp( mid, left, up, tess.vertexColors[i] );
}
}

View File

@ -764,11 +764,13 @@ void RB_DrawSun( float scale, shader_t *shader ) {
float size;
float dist;
vec3_t origin, vec1, vec2;
byte sunColor[4] = { 255, 255, 255, 255 };
color4ub_t sunColor;
if ( !backEnd.skyRenderedThisView )
return;
sunColor.u32 = 0xFFFFFFFF;
qglLoadMatrixf( backEnd.viewParms.world.modelMatrix );
dist = backEnd.viewParms.zFar / 1.75; // div sqrt(3)

View File

@ -70,7 +70,7 @@ void RB_CheckOverflow( int verts, int indexes ) {
RB_AddQuadStampExt
==============
*/
void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up, const byte *color, float s1, float t1, float s2, float t2 ) {
void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up, color4ub_t color, float s1, float t1, float s2, float t2 ) {
vec3_t normal;
int ndx;
@ -83,7 +83,7 @@ void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up
ndx = tess.numVertexes;
// triangle indexes for a simple quad
tess.indexes[ tess.numIndexes ] = ndx;
tess.indexes[ tess.numIndexes + 0 ] = ndx + 0;
tess.indexes[ tess.numIndexes + 1 ] = ndx + 1;
tess.indexes[ tess.numIndexes + 2 ] = ndx + 3;
@ -107,7 +107,6 @@ void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up
tess.xyz[ndx+3][1] = origin[1] + left[1] - up[1];
tess.xyz[ndx+3][2] = origin[2] + left[2] - up[2];
// constant normal all the way around
VectorSubtract( vec3_origin, backEnd.viewParms.or.axis[0], normal );
@ -130,11 +129,10 @@ void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up
// constant color all the way around
// should this be identity and let the shader specify from entity?
tess.vertexColors[ndx+0].u32 =
tess.vertexColors[ndx+1].u32 =
tess.vertexColors[ndx+2].u32 =
tess.vertexColors[ndx+3].u32 =
* ( uint32_t * )color;
tess.vertexColors[ndx + 0].u32 =
tess.vertexColors[ndx + 1].u32 =
tess.vertexColors[ndx + 2].u32 =
tess.vertexColors[ndx + 3].u32 = color.u32;
tess.numVertexes += 4;
tess.numIndexes += 6;
@ -201,7 +199,7 @@ void RB_AddQuadStamp2( float x, float y, float w, float h, float s1, float t1, f
RB_AddQuadStamp
==============
*/
void RB_AddQuadStamp( const vec3_t origin, const vec3_t left, const vec3_t up, const byte *color ) {
void RB_AddQuadStamp( const vec3_t origin, const vec3_t left, const vec3_t up, color4ub_t color ) {
RB_AddQuadStampExt( origin, left, up, color, 0, 0, 1, 1 );
}
@ -239,7 +237,7 @@ static void RB_SurfaceSprite( void ) {
VectorSubtract( vec3_origin, left, left );
}
RB_AddQuadStamp( backEnd.currentEntity->e.origin, left, up, backEnd.currentEntity->e.shader.rgba );
RB_AddQuadStamp( backEnd.currentEntity->e.origin, left, up, backEnd.currentEntity->e.shader );
}

View File

@ -1612,8 +1612,8 @@ void RB_CheckOverflow( int verts, int indexes );
void RB_StageIteratorGeneric( void );
void RB_StageIteratorSky( void );
void RB_AddQuadStamp( const vec3_t origin, const vec3_t left, const vec3_t up, const byte *color );
void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up, const byte *color, float s1, float t1, float s2, float t2 );
void RB_AddQuadStamp( const vec3_t origin, const vec3_t left, const vec3_t up, color4ub_t color );
void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up, color4ub_t color, float s1, float t1, float s2, float t2 );
void RB_AddQuadStamp2( float x, float y, float w, float h, float s1, float t1, float s2, float t2, color4ub_t color );
void RB_ShowImages( void );

View File

@ -267,7 +267,7 @@ void DeformText( const char *text ) {
vec3_t origin, width, height;
int len;
int ch;
byte color[4];
color4ub_t color;
float bottom, top;
vec3_t mid;
@ -306,7 +306,7 @@ void DeformText( const char *text ) {
tess.numIndexes = 0;
tess.numVertexes = 0;
color[0] = color[1] = color[2] = color[3] = 255;
color.u32 = 0xFFFFFFFF;
// draw each character
for ( i = 0 ; i < len ; i++ ) {
@ -410,7 +410,7 @@ static void AutospriteDeform( void ) {
VectorScale(up, axisLength, up);
}
RB_AddQuadStamp( mid, left, up, tess.vertexColors[i].rgba );
RB_AddQuadStamp( mid, left, up, tess.vertexColors[i] );
}
}

View File

@ -771,11 +771,13 @@ void RB_DrawSun( float scale, shader_t *shader ) {
float size;
float dist;
vec3_t origin, vec1, vec2;
byte sunColor[4] = { 255, 255, 255, 255 };
color4ub_t sunColor;
if ( !backEnd.skyRenderedThisView )
return;
sunColor.u32 = 0xFFFFFFFF;
#ifdef USE_VULKAN
vk_update_mvp( NULL );
#else

View File

@ -70,7 +70,7 @@ void RB_CheckOverflow( int verts, int indexes ) {
RB_AddQuadStampExt
==============
*/
void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up, const byte *color, float s1, float t1, float s2, float t2 ) {
void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up, color4ub_t color, float s1, float t1, float s2, float t2 ) {
vec3_t normal;
int ndx;
@ -87,7 +87,7 @@ void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up
ndx = tess.numVertexes;
// triangle indexes for a simple quad
tess.indexes[ tess.numIndexes ] = ndx;
tess.indexes[ tess.numIndexes + 0 ] = ndx + 0;
tess.indexes[ tess.numIndexes + 1 ] = ndx + 1;
tess.indexes[ tess.numIndexes + 2 ] = ndx + 3;
@ -111,7 +111,6 @@ void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up
tess.xyz[ndx+3][1] = origin[1] + left[1] - up[1];
tess.xyz[ndx+3][2] = origin[2] + left[2] - up[2];
// constant normal all the way around
VectorSubtract( vec3_origin, backEnd.viewParms.or.axis[0], normal );
@ -134,11 +133,10 @@ void RB_AddQuadStampExt( const vec3_t origin, const vec3_t left, const vec3_t up
// constant color all the way around
// should this be identity and let the shader specify from entity?
tess.vertexColors[ndx+0].u32 =
tess.vertexColors[ndx+1].u32 =
tess.vertexColors[ndx+2].u32 =
tess.vertexColors[ndx+3].u32 =
* ( uint32_t * )color;
tess.vertexColors[ndx + 0].u32 =
tess.vertexColors[ndx + 1].u32 =
tess.vertexColors[ndx + 2].u32 =
tess.vertexColors[ndx + 3].u32 = color.u32;
tess.numVertexes += 4;
tess.numIndexes += 6;
@ -209,7 +207,7 @@ void RB_AddQuadStamp2( float x, float y, float w, float h, float s1, float t1, f
RB_AddQuadStamp
==============
*/
void RB_AddQuadStamp( const vec3_t origin, const vec3_t left, const vec3_t up, const byte *color ) {
void RB_AddQuadStamp( const vec3_t origin, const vec3_t left, const vec3_t up, color4ub_t color ) {
RB_AddQuadStampExt( origin, left, up, color, 0, 0, 1, 1 );
}
@ -247,7 +245,7 @@ static void RB_SurfaceSprite( void ) {
VectorSubtract( vec3_origin, left, left );
}
RB_AddQuadStamp( backEnd.currentEntity->e.origin, left, up, backEnd.currentEntity->e.shader.rgba );
RB_AddQuadStamp( backEnd.currentEntity->e.origin, left, up, backEnd.currentEntity->e.shader );
}