Skip to content

Commit

Permalink
DOS: brightmaps - small optimizations and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JNechaevsky committed Dec 31, 2017
1 parent c37076b commit 997d257
Show file tree
Hide file tree
Showing 7 changed files with 253 additions and 215 deletions.
8 changes: 0 additions & 8 deletions r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ lighttable_t *brightmaps_greenonly2;
lighttable_t *brightmaps_greenonly3;
lighttable_t *brightmaps_orangeyellow;
lighttable_t *brightmaps_dimmeditems;
lighttable_t *brightmaps_blueonly;

//
// MAPTEXTURE_T CACHING
Expand Down Expand Up @@ -640,7 +639,6 @@ void R_InitColormaps (void)
int lump7, length7;
int lump8, length8;
int lump9, length9;
int lump10, length10;

// Load in the light tables,
// 256 byte align tables.
Expand Down Expand Up @@ -701,12 +699,6 @@ void R_InitColormaps (void)
brightmaps_dimmeditems = Z_Malloc (length9, PU_STATIC, 0);
brightmaps_dimmeditems = (byte *)( ((int)brightmaps_dimmeditems + 255)&~0xff);
W_ReadLump (lump9,brightmaps_dimmeditems);

lump10 = W_GetNumForName("BRTMAP9");
length10 = W_LumpLength (lump10) + 255;
brightmaps_blueonly = Z_Malloc (length10, PU_STATIC, 0);
brightmaps_blueonly = (byte *)( ((int)brightmaps_blueonly + 255)&~0xff);
W_ReadLump (lump10,brightmaps_blueonly);
}


Expand Down
2 changes: 0 additions & 2 deletions r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ lighttable_t* fullbright_greenonly2[LIGHTLEVELS][MAXLIGHTSCALE];
lighttable_t* fullbright_greenonly3[LIGHTLEVELS][MAXLIGHTSCALE];
lighttable_t* fullbright_orangeyellow[LIGHTLEVELS][MAXLIGHTSCALE];
lighttable_t* fullbright_dimmeditems[LIGHTLEVELS][MAXLIGHTSCALE];
lighttable_t* fullbright_blueonly[LIGHTLEVELS][MAXLIGHTSCALE];
extern boolean vanilla;

// bumped light from gun blasts
Expand Down Expand Up @@ -803,7 +802,6 @@ void R_ExecuteSetViewSize (void)
fullbright_greenonly3[i][j] = brightmaps_greenonly3 + level*256;
fullbright_orangeyellow[i][j] = brightmaps_orangeyellow + level*256;
fullbright_dimmeditems[i][j] = brightmaps_dimmeditems + level*256;
fullbright_blueonly[i][j] = brightmaps_blueonly + level*256;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion r_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ extern lighttable_t* fullbright_greenonly2[LIGHTLEVELS][MAXLIGHTSCALE];
extern lighttable_t* fullbright_greenonly3[LIGHTLEVELS][MAXLIGHTSCALE];
extern lighttable_t* fullbright_orangeyellow[LIGHTLEVELS][MAXLIGHTSCALE];
extern lighttable_t* fullbright_dimmeditems[LIGHTLEVELS][MAXLIGHTSCALE];
extern lighttable_t* fullbright_blueonly[LIGHTLEVELS][MAXLIGHTSCALE];

extern int extralight;
extern lighttable_t* fixedcolormap;
Expand Down
11 changes: 1 addition & 10 deletions r_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ void R_InitBrightmaps(void)
// Not in Doom 1
if (commercial || tnt || plutonia)
{
bmaptexture35 = R_TextureNumForName(("SILVER2"));
bmaptexture42 = R_TextureNumForName(("SILVER3"));
}

Expand Down Expand Up @@ -797,16 +798,6 @@ void R_InitBrightmaps(void)
bmaptexture84 = R_TextureNumForName(("YELMETAL"));
}

// -------------------------------------------------------
// Blue only
// -------------------------------------------------------

// Not in Doom 1
if (commercial || tnt || plutonia)
{
bmaptexture35 = R_TextureNumForName(("SILVER2"));
}

// -------------------------------------------------------
// Brightmap terminator
// -------------------------------------------------------
Expand Down
445 changes: 252 additions & 193 deletions r_segs.c

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion r_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ extern lighttable_t* brightmaps_greenonly2;
extern lighttable_t* brightmaps_greenonly3;
extern lighttable_t* brightmaps_orangeyellow;
extern lighttable_t* brightmaps_dimmeditems;
extern lighttable_t* brightmaps_blueonly;

extern int viewwidth;
extern int scaledviewwidth;
Expand Down
Binary file modified rusdoom.wad
Binary file not shown.

0 comments on commit 997d257

Please sign in to comment.