summaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-16 11:15:29 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-16 11:15:29 (GMT)
commitf19c7f62c77f6a3e8f5728e015166b0c625f5f67 (patch)
treedc4c5067c6a4d6b7108e33da0cc3a18549eb2066 /src/graphics
parentca30e9f091376e81b61a0f72bc444a4f59fc4ae7 (diff)
downloadpowder-f19c7f62c77f6a3e8f5728e015166b0c625f5f67.zip
powder-f19c7f62c77f6a3e8f5728e015166b0c625f5f67.tar.gz
Air invert and grid mode switching
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/Renderer.cpp11
-rw-r--r--src/graphics/Renderer.h4
2 files changed, 10 insertions, 5 deletions
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp
index 7467493..2924503 100644
--- a/src/graphics/Renderer.cpp
+++ b/src/graphics/Renderer.cpp
@@ -1086,17 +1086,17 @@ void Renderer::render_parts()
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, partsFbo);
glTranslated(0, MENUSIZE, 0);
#else
- /*if (GRID_MODE)//draws the grid
+ if (gridSize)//draws the grid
{
for (ny=0; ny<YRES; ny++)
for (nx=0; nx<XRES; nx++)
{
- if (ny%(4*GRID_MODE)==0)
+ if (ny%(4*gridSize)==0)
blendpixel(nx, ny, 100, 100, 100, 80);
- if (nx%(4*GRID_MODE)==0)
+ if (nx%(4*gridSize)==0)
blendpixel(nx, ny, 100, 100, 100, 80);
}
- }*/
+ }
#endif
for(i = 0; i<=sim->parts_lastActiveIndex; i++) {
if (sim->parts[i].type) {
@@ -2284,7 +2284,8 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
mousePosY(-1),
display_mode(0),
render_mode(0),
- colour_mode(0)
+ colour_mode(0),
+ gridSize(0)
{
this->g = g;
this->sim = sim;
diff --git a/src/graphics/Renderer.h b/src/graphics/Renderer.h
index 2f9f404..dc5d633 100644
--- a/src/graphics/Renderer.h
+++ b/src/graphics/Renderer.h
@@ -131,12 +131,16 @@ public:
void SetColourMode(unsigned int mode);
unsigned int GetColourMode();
+ int GetGridSize() { return gridSize; }
+ void SetGridSize(int value) { gridSize = value; }
+
static VideoBuffer * WallIcon(int wallID, int width, int height);
Renderer(Graphics * g, Simulation * sim);
~Renderer();
private:
+ int gridSize;
#ifdef OGLR
GLuint zoomTex, airBuf, fireAlpha, glowAlpha, blurAlpha, partsFboTex, partsFbo, partsTFX, partsTFY, airPV, airVY, airVX;
GLuint fireProg, airProg_Pressure, airProg_Velocity, airProg_Cracker, lensProg;