#include #include #include #include "precalcs.h" #include "engine3d.h" #include "ZeDemo.h" unsigned short shades[64][256]; int pdiv[4096]; int fsin1[2048], fsin2[2048], fsin3[2048]; int fsin4[2048], fsin5[2048], fsin6[2048]; extern unsigned char bitfonts[]; unsigned char fonts[59*64]; short floorstuff[2*WIDTH*HEIGHT]; unsigned char dist_angle[2*WIDTH*HEIGHT]; unsigned char rbmp[SSIZE]; unsigned char gbmp[SSIZE]; unsigned char bbmp[SSIZE]; unsigned char rbuffer[SSIZE]; unsigned char gbuffer[SSIZE]; unsigned char bbuffer[SSIZE]; short radir0[SSIZE]; short radir1[SSIZE]; short radir2[SSIZE]; short radir3[SSIZE]; short radir4[SSIZE]; short radir5[SSIZE]; extern unsigned short sky1[], sky3[]; void InitRadialBitmap1() { int x, y, i = 0; unsigned short c; for (y=0; y>11) & 31) << 3; gbmp[i] = ((c>>5) & 63) << 2; bbmp[i] = (c & 31) << 3; i++; } } } void InitRadialBitmap2() { int x, y, i = 0; unsigned short c; for (y=0; y>11) & 31) << 3; gbmp[i] = ((c>>5) & 63) << 2; bbmp[i] = (c & 31) << 3; i++; } } } void InitRadial() { InitRadialBitmap1(); float rb_shortness = 4.0f; int xi, yi; int i=0; int x, y; for (y=0; y>1) + (yi>>1)*WIDTH; radir1[i] = (xi>>2) + (yi>>2)*WIDTH; radir2[i] = (xi>>3) + (yi>>3)*WIDTH; i++; } } i=0; for (y=0; y>1) + (yi>>1)*WIDTH; radir4[i] = (xi>>2) + (yi>>2)*WIDTH; radir5[i] = (xi>>3) + (yi>>3)*WIDTH; i++; } } } void InitPolar() { int x, y, c; float w=Twidth/2; int i=0; for (y=-HEIGHT/2; y>2; for (y=-h0+adj;y> (7 - x)) & 1) * 255; } } } } void DrawFont(int xp, int yp, int ch, int bpp, unsigned short* vram) { unsigned char *vram8; unsigned short *vram16; int cp = ch << 6; int x, y, yc, yi; switch(bpp) { case 8: vram8 = (unsigned char*)vram + xp + yp* WIDTH; for (y=0; y<8; y++) { yc = yp + y; if ((yc>=1) && (yc=1) && (yc31 && c<92) DrawFont(xtp, ytp, c - 32, bpp, vram); else if (c==0) n = cn; xtp+=8; if (xtp>WIDTH - 1) n = cn; } } void MakeColors(unsigned short cols[], ColorRGB c0, ColorRGB c1, int n0, int n1) { float dr,dg,db; float cr,cg,cb; cr=c0.r; cg=c0.g; cb=c0.b; dr=((float)c1.r - (float)c0.r)/(float)(n1 - n0 + 1); dg=((float)c1.g - (float)c0.g)/(float)(n1 - n0 + 1); db=((float)c1.b - (float)c0.b)/(float)(n1 - n0 + 1); int i; for (i=n0; i<=n1; i++) { cr+=dr; cg+=dg; cb+=db; cols[i]= ((int)cr<<11) | ((int)cg<<5) | (int)cb; } } void MakeSines(int sines[], int n, float freq, float hght1, float hght2) { int i; for (i=0; i