diff --git a/src/Renderer.cpp b/src/Renderer.cpp index 7f6f9cc49..58d44446b 100644 --- a/src/Renderer.cpp +++ b/src/Renderer.cpp @@ -2001,18 +2001,18 @@ Renderer::Renderer(Graphics * g, Simulation * sim): glEnable(GL_TEXTURE_2D); glGenTextures(1, &partsTFX); glBindTexture(GL_TEXTURE_2D, partsTFX); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, XRES, YRES, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, XRES/CELL, YRES/CELL, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); glGenTextures(1, &partsTFY); glBindTexture(GL_TEXTURE_2D, partsTFY); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, XRES, YRES, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, XRES/CELL, YRES/CELL, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); glDisable(GL_TEXTURE_2D); diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 1e4ca76f2..a10d9e4b4 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -865,6 +865,8 @@ void GameView::OnDraw() ren->render_fire(); ren->draw_grav(); ren->DrawWalls(); + ren->DrawSigns(); + ren->FinaliseParts(); if(activeBrush && currentMouse.X > 0 && currentMouse.X < XRES && currentMouse.Y > 0 && currentMouse.Y < YRES) { if(drawMode==DrawRect && isMouseDown) @@ -880,8 +882,6 @@ void GameView::OnDraw() activeBrush->RenderPoint(g, c->PointTranslate(currentMouse)); } } - ren->DrawSigns(); - ren->FinaliseParts(); ren->RenderZoom(); if(selectMode!=SelectNone) diff --git a/src/render/RenderView.cpp b/src/render/RenderView.cpp index e44c72f72..f0868a358 100644 --- a/src/render/RenderView.cpp +++ b/src/render/RenderView.cpp @@ -239,9 +239,14 @@ void RenderView::OnDraw() g->clearrect(0, 0, XRES, YRES+MENUSIZE); if(ren) { + ren->clearScreen(1.0f); ren->draw_air(); ren->render_parts(); ren->render_fire(); + ren->draw_grav(); + ren->DrawWalls(); + ren->DrawSigns(); + ren->FinaliseParts(); } g->draw_line(0, YRES, XRES-1, YRES, 255, 255, 255, XRES+BARSIZE); g->draw_line(180, YRES, 180, YRES+MENUSIZE, 200, 200, 200, XRES+BARSIZE); diff --git a/src/simulation/tools/Grav.cpp b/src/simulation/tools/Grav.cpp new file mode 100644 index 000000000..630ba1265 --- /dev/null +++ b/src/simulation/tools/Grav.cpp @@ -0,0 +1,18 @@ +#include "simulation/Tools.h" +#include "simulation/Simulation.h" +//#TPT-Directive ToolClass Tool_Grav TOOL_GRAV 4 +Tool_Grav::Tool_Grav() +{ + Identifier = "DEFAULT_TOOL_GRAV"; + Name = "GRAV"; + Colour = PIXPACK(0xCCCCFF); + Description = "Creates a short-lasting gravity well"; +} + +int Tool_Grav::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) +{ + sim->gravmap[((y/CELL)*(XRES/CELL))+(x/CELL)] += 0.03f*strength; + return 1; +} + +Tool_Grav::~Tool_Grav() {} \ No newline at end of file