Skip to content

Commit 59ffa68

Browse files
committed
- Cgame entity glow renderer hookup
- R_ShowImages: Adjust for overbright - a tribute to Rebecca Heineman and Jennell Jaquays
1 parent 735598b commit 59ffa68

File tree

5 files changed

+70
-1
lines changed

5 files changed

+70
-1
lines changed

code/renderer_oa/tr_backend.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,7 @@ void RB_ShowImages( void ) {
14571457
image_t *image;
14581458
float x, y, w, h;
14591459
int start, end;
1460+
float col = 1 * tr.identityLight; // leilei - overbright fix
14601461

14611462
if ( !backEnd.projection2D ) {
14621463
RB_SetGL2D();
@@ -1484,6 +1485,7 @@ void RB_ShowImages( void ) {
14841485

14851486
GL_Bind( image );
14861487
qglBegin (GL_QUADS);
1488+
qglColor3f (col,col,col); // leilei - overbright fix
14871489
qglTexCoord2f( 0, 0 );
14881490
qglVertex2f( x, y );
14891491
qglTexCoord2f( 1, 0 );

code/renderer_oa/tr_image.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,6 +2354,56 @@ image_t *R_FindImageFileIfItsThere( const char *name, imgType_t type, imgFlags_t
23542354
}
23552355

23562356

2357+
2358+
2359+
/*
2360+
================
2361+
Rebecca Heineman
2362+
2363+
1963-2025
2364+
2365+
Jennell Jaquays
2366+
2367+
1956-2024
2368+
================
2369+
*/
2370+
2371+
static void R_ebeccaHeineman( void ) {
2372+
int x,y;
2373+
byte data[16][16][4];
2374+
2375+
for (x=0 ; x<16 ; x++) {
2376+
for (y=0 ; y<16 ; y++) {
2377+
2378+
if (y<3 || y>12) // blue
2379+
{
2380+
data[y][x][0] = 31;
2381+
data[y][x][1] = 206;
2382+
data[y][x][2] = 250;
2383+
}
2384+
else if (y<6 || y>9) // pink
2385+
{
2386+
data[y][x][0] = 245;
2387+
data[y][x][1] = 169;
2388+
data[y][x][2] = 184;
2389+
}
2390+
else // white
2391+
{
2392+
data[y][x][0] = 255;
2393+
data[y][x][1] = 255;
2394+
data[y][x][2] = 255;
2395+
}
2396+
// data[y][x][0] =
2397+
// data[y][x][1] =
2398+
// data[y][x][2] = b;
2399+
data[y][x][3] = 255;
2400+
}
2401+
}
2402+
tr.transRights = R_CreateImage("thankYouRebeccaHeineman&JennellJaquays", (byte *)data, 16, 16, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 );
2403+
}
2404+
2405+
2406+
23572407
/*
23582408
================
23592409
R_CreateDlightImage
@@ -2561,6 +2611,7 @@ void R_CreateBuiltinImages( void ) {
25612611
tr.scratchImage[x] = R_CreateImage("*scratch", (byte *)data, DEFAULT_SIZE, DEFAULT_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_PICMIP | IMGFLAG_CLAMPTOEDGE, 0);
25622612
}
25632613

2614+
R_ebeccaHeineman();
25642615

25652616
R_CreateDlightImage();
25662617

code/renderer_oa/tr_local.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ typedef struct {
13171317
qboolean placeholderFogAvail;
13181318
qboolean placeholderAvail;
13191319

1320-
1320+
image_t *transRights; // leilei
13211321

13221322
} trGlobals_t;
13231323

code/renderer_oa/tr_shade_calc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,6 +1845,13 @@ void RB_CalcDiffuseColor( unsigned char *colors )
18451845
RB_CalcDiffuseColor_scalar( colors );
18461846
}
18471847

1848+
// leilei - glow property
1849+
if ((backEnd.currentEntity->e.glow >= 1337 && backEnd.currentEntity->e.glow <= 1340 )) // look for 1337-1340 as compatibility so we don't get malformed glows from old cgames
1850+
{
1851+
RB_GlowBlend( colors, backEnd.currentEntity->e.glowcol, (backEnd.currentEntity->e.glow - 1337) );
1852+
}
1853+
1854+
18481855
}
18491856

18501857

@@ -2203,6 +2210,11 @@ void RB_CalcMaterials( unsigned char *colors, int ambient, int diffuse, int spec
22032210
// TODO: Low detail materials
22042211
RB_CalcMaterialColor( colors, 1, ambient, diffuse, specular, emissive, spechard, alpha );
22052212

2213+
// leilei - glow property
2214+
if ((backEnd.currentEntity->e.glow >= 1337 && backEnd.currentEntity->e.glow <= 1340 )) // look for 1337-1340 as compatibility so we don't get malformed glows from old cgames
2215+
{
2216+
RB_GlowBlend( colors, backEnd.currentEntity->e.glowcol, (backEnd.currentEntity->e.glow - 1337) );
2217+
}
22062218
}
22072219

22082220

code/renderercommon/tr_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ typedef struct {
122122
vec3_t eyepos[2]; // looking from
123123
vec3_t eyelook; // looking from
124124

125+
// leilei - glow
126+
127+
int glow; // glow security + fx
128+
int glowcol; // glow color in hexadecimal
125129

126130
} refEntity_t;
127131

0 commit comments

Comments
 (0)