Classic: optimize background 'rainbow' drawing in use for editor/debug.

Also, draw it at shade 18 and don't use fullbright colors.

git-svn-id: https://svn.eduke32.com/eduke32@3721 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-05-01 17:42:05 +00:00
parent 0193d7b0e5
commit 198a3a556c
1 changed files with 14 additions and 13 deletions

View File

@ -1180,23 +1180,24 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t),
// must have writable frame buffer, i.e. done begindrawing() // must have writable frame buffer, i.e. done begindrawing()
static void draw_rainbow_background(void) static void draw_rainbow_background(void)
{ {
int32_t i, j; int32_t y, i;
const int32_t dimenprod = bytesperline*ydimen; const int32_t N = 240; // don't use fullbright colors
char *const p = (char *)frameplace; const int32_t numfull=bytesperline/N, numrest=bytesperline%N;
j = 0; const char *const src = palookup[0] + 256*18;
for (i=0; i<dimenprod; i++) char *dst = (char *)frameplace;
for (y=0; y<ydim; y++)
{ {
p[i] = (char)j; for (i=0; i<numfull; i++)
j++; Bmemcpy(&dst[N*i], src, N);
if (j >= xdimen) if (numrest > 0)
{ Bmemcpy(&dst[N*i], src, numrest);
while (j < bytesperline)
i++, j++; dst += bytesperline;
j = 0;
}
} }
} }
// //
// setslope // setslope
// //