Revert some changes by Triclops200 in 42d707f8a4, Broke prototypes for drawrect with pixel functions, seems to have modified drawrect to make filled rects (forgot about fillrect?). Also use correct macros for getting colour components out of pixel data

This commit is contained in:
Simon Robertshaw 2012-08-15 13:02:15 +01:00
parent 54a81031bc
commit 1e406eeaf4
4 changed files with 8 additions and 11 deletions

View File

@ -160,7 +160,7 @@ public:
void xor_bitmap(unsigned char * bitmap, int x, int y, int w, int h);
void draw_line(int x, int y, int x2, int y2, int r, int g, int b, int a);
void drawrect(int x, int y, int width, int height, int r, int g, int b, int a,bool hollow=true);
void drawrect(int x, int y, int width, int height, int r, int g, int b, int a);
void fillrect(int x, int y, int width, int height, int r, int g, int b, int a);
void clearrect(int x, int y, int width, int height);
void gradientrect(int x, int y, int width, int height, int r, int g, int b, int a, int r2, int g2, int b2, int a2);

View File

@ -282,7 +282,7 @@ void PIXELMETHODS_CLASS::draw_line(int x, int y, int x2, int y2, int r, int g, i
glEnd();
}
void PIXELMETHODS_CLASS::drawrect(int x, int y, int width, int height, int r, int g, int b, int a,bool hollow)
void PIXELMETHODS_CLASS::drawrect(int x, int y, int width, int height, int r, int g, int b, int a)
{
float fx = float(x)+0.5f;
float fy = float(y)+0.5f;
@ -293,10 +293,7 @@ void PIXELMETHODS_CLASS::drawrect(int x, int y, int width, int height, int r, in
//height-=2;
//width-=2;
glColor4ub(r, g, b, a);
if(hollow)
glBegin(GL_LINE_STRIP);
else
glBegin(GL_QUADS);
glBegin(GL_LINE_STRIP);
glVertex2f(fx, fy);
glVertex2f(fx+fwidth, fy);
glVertex2f(fx+fwidth, fy+fheight);

View File

@ -593,9 +593,9 @@ void Renderer::DrawWalls()
pc = wtypes[wt].colour;
gc = wtypes[wt].eglow;
#ifdef OGLR
int r = (pc&0x00FF0000)>>8;
int g = (pc&0x0000FF00)>>4;
int b = (pc&0x000000FF)>>0;
int r = PIXR(pc);
int g = PIXG(pc);
int b = PIXB(pc);
int a = 255;
#endif
#ifndef OGLR
@ -715,7 +715,7 @@ void Renderer::DrawWalls()
}
#else
this->drawrect(x*CELL,y*CELL,CELL,CELL,r,g,b,a,false);
this->fillrect(x*CELL, y*CELL, CELL, CELL, r, g, b, a);
#endif
}
}

View File

@ -105,7 +105,7 @@ public:
void xor_bitmap(unsigned char * bitmap, int x, int y, int w, int h);
void draw_line(int x, int y, int x2, int y2, int r, int g, int b, int a);
void drawrect(int x, int y, int width, int height, int r, int g, int b, int a,bool hollow = true);
void drawrect(int x, int y, int width, int height, int r, int g, int b, int a);
void fillrect(int x, int y, int width, int height, int r, int g, int b, int a);
void clearrect(int x, int y, int width, int height);
void gradientrect(int x, int y, int width, int height, int r, int g, int b, int a, int r2, int g2, int b2, int a2);