summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-15 12:02:15 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-15 12:02:15 (GMT)
commit1e406eeaf4d9e88f3638d3d145a48e58efc07f93 (patch)
tree1e62e168b838350fa2167d3c0a043494f281bbe3 /src
parent54a81031bcb8e67ef661fb4f96cb2f65501f4c85 (diff)
downloadpowder-1e406eeaf4d9e88f3638d3d145a48e58efc07f93.zip
powder-1e406eeaf4d9e88f3638d3d145a48e58efc07f93.tar.gz
Revert some changes by Triclops200 in 42d707f8a432afa001d58611fc960d6ce6021676, 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
Diffstat (limited to 'src')
-rw-r--r--src/graphics/Graphics.h2
-rw-r--r--src/graphics/OpenGLDrawMethods.inl7
-rw-r--r--src/graphics/Renderer.cpp8
-rw-r--r--src/graphics/Renderer.h2
4 files changed, 8 insertions, 11 deletions
diff --git a/src/graphics/Graphics.h b/src/graphics/Graphics.h
index 01318c8..46d28b4 100644
--- a/src/graphics/Graphics.h
+++ b/src/graphics/Graphics.h
@@ -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);
diff --git a/src/graphics/OpenGLDrawMethods.inl b/src/graphics/OpenGLDrawMethods.inl
index cbf3113..173cb4b 100644
--- a/src/graphics/OpenGLDrawMethods.inl
+++ b/src/graphics/OpenGLDrawMethods.inl
@@ -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);
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp
index f39e476..380aabd 100644
--- a/src/graphics/Renderer.cpp
+++ b/src/graphics/Renderer.cpp
@@ -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
}
}
diff --git a/src/graphics/Renderer.h b/src/graphics/Renderer.h
index b4f730f..6e814cc 100644
--- a/src/graphics/Renderer.h
+++ b/src/graphics/Renderer.h
@@ -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);