Fix graphics.c

This commit is contained in:
Simon Robertshaw 2011-10-26 16:24:54 +01:00
parent e3a7b626ab
commit 60de1cf575

View File

@ -1057,6 +1057,10 @@ for (; *s; s++)
r = 255; r = 255;
g = b = 0; g = b = 0;
break; break;
case 'l':
r = 255;
g = b = 75;
break;
case 'b': case 'b':
r = g = 0; r = g = 0;
b = 255; b = 255;
@ -1117,45 +1121,6 @@ while (*s)
y += FONT_H+2; y += FONT_H+2;
} }
else if (*s == '\b') else if (*s == '\b')
{
switch (s[1])
{
case 'w':
r = g = b = 255;
break;
case 'g':
r = g = b = 192;
break;
case 'o':
r = 255;
g = 216;
b = 32;
break;
case 'r':
r = 255;
g = b = 0;
break;
case 'l':
r = 255;
g = b = 75;
break;
case 'b':
r = g = 0;
b = 255;
break;
}
s++;
}
else
{
if (x-cw>=w)
{
x = sx;
rw = 0;
y += FONT_H+2;
}
else if (*s == '\b')
{ {
switch (s[1]) switch (s[1])
{ {
@ -1202,8 +1167,6 @@ while (*s)
} }
x = drawchar(vid, x, y, *(unsigned char *)s, r, g, b, a); x = drawchar(vid, x, y, *(unsigned char *)s, r, g, b, a);
} }
x = drawchar(vid, x, y, *(unsigned char *)s, r, g, b, a);
}
} }
} }
@ -1575,13 +1538,6 @@ void draw_grav(pixel *vid)
for (y=0; y<YRES/CELL; y++) for (y=0; y<YRES/CELL; y++)
{ {
for (x=0; x<XRES/CELL; x++) for (x=0; x<XRES/CELL; x++)
{
if(fabsf(gravx[y][x]) <= 0.001f && fabsf(gravy[y][x]) <= 0.001f)
continue;
nx = x*CELL;
ny = y*CELL;
dist = fabsf(gravx[y][x])+fabsf(gravy[y][x]);
for(i = 0; i < 4; i++)
{ {
ca = ((y*CELL)*XRES)+(x*CELL); ca = ((y*CELL)*XRES)+(x*CELL);
if(fabsf(gravpf[ca]) <= 0.001f && fabsf(gravyf[ca]) <= 0.001f) if(fabsf(gravpf[ca]) <= 0.001f && fabsf(gravyf[ca]) <= 0.001f)
@ -1598,7 +1554,6 @@ for (y=0; y<YRES/CELL; y++)
} }
} }
} }
}
void draw_line(pixel *vid, int x1, int y1, int x2, int y2, int r, int g, int b, int a) //Draws a line void draw_line(pixel *vid, int x1, int y1, int x2, int y2, int r, int g, int b, int a) //Draws a line
{ {
@ -1829,16 +1784,6 @@ void draw_parts(pixel *vid)
} }
} }
for (i = 0; i<=parts_lastActiveIndex; i++) { for (i = 0; i<=parts_lastActiveIndex; i++) {
#ifdef OpenGL
if (cmode == CM_FANCY) //If fancy mode
{
if (ny%(4*GRID_MODE)==0)
blendpixel(vid, nx, ny, 100, 100, 100, 80);
if (nx%(4*GRID_MODE)==0)
blendpixel(vid, nx, ny, 100, 100, 100, 80);
}
}
for (i = 0; i<=parts_lastActiveIndex; i++) {
#ifdef OpenGL #ifdef OpenGL
if (cmode == CM_FANCY) //If fancy mode if (cmode == CM_FANCY) //If fancy mode
{ {
@ -1997,7 +1942,7 @@ for (i = 0; i<=parts_lastActiveIndex; i++) {
draw_line(vid , nx, ny+3, figh->legs[8], figh->legs[9], 255, 255, 255, s); draw_line(vid , nx, ny+3, figh->legs[8], figh->legs[9], 255, 255, 255, s);
draw_line(vid , figh->legs[8], figh->legs[9], figh->legs[12], figh->legs[13], 255, 255, 255, s); draw_line(vid , figh->legs[8], figh->legs[9], figh->legs[12], figh->legs[13], 255, 255, 255, s);
} }
if (cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_GPMP && t!=PT_PBCN && t!=PT_FILT && t!=PT_HSWC && t!=PT_PCLN && t!=PT_DEUT && t!=PT_WIFI && t!=PT_LIFE)//nothing display but show needed color changes if (cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_GPMP && t!=PT_PBCN && t!=PT_FILT && t!=PT_HSWC && t!=PT_PCLN && t!=PT_DEUT && t!=PT_WIFI && t!=PT_LIFE && t!=PT_PVOD)//nothing display but show needed color changes
{ {
if (t==PT_PHOT) if (t==PT_PHOT)
{ {