From 2728cf852b41d6b015582bb4ad95772be58b277b Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 17 Dec 2012 19:41:32 -0500 Subject: fix WARP being invisible, make it visible in heat display mode though diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index e56ae50..07d2e63 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -702,7 +702,15 @@ void GameController::Exit() void GameController::ResetAir() { - gameModel->GetSimulation()->air->Clear(); + Simulation * sim = gameModel->GetSimulation(); + sim->air->Clear(); + for (int i = 0; i < NPART; i++) + { + if (sim->parts[i].type == PT_QRTZ || sim->parts[i].type == PT_GLAS) + { + sim->parts[i].pavg[0] = sim->parts[i].pavg[1] = 0; + } + } } void GameController::ResetSpark() diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index eaec74c..98b94b1 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -1217,7 +1217,10 @@ void Renderer::render_parts() fireg = colg = (unsigned char)color_data[caddress+1]; fireb = colb = (unsigned char)color_data[caddress+2]; cola = 255; - if(pixel_mode & (FIREMODE | PMODE_GLOW)) pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR; + if(pixel_mode & (FIREMODE | PMODE_GLOW)) + pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR; + else if (!pixel_mode) + pixel_mode |= PMODE_FLAT; } else if(colour_mode & COLOUR_LIFE) { @@ -1228,7 +1231,10 @@ void Renderer::render_parts() q = sim->parts[i].life; colr = colg = colb = sin(gradv*q) * 100 + 128; cola = 255; - if(pixel_mode & (FIREMODE | PMODE_GLOW)) pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR; + if(pixel_mode & (FIREMODE | PMODE_GLOW)) + pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR; + else if (!pixel_mode) + pixel_mode |= PMODE_FLAT; } else if(colour_mode & COLOUR_BASC) { diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 21f8109..afb50c5 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -136,6 +136,10 @@ int Simulation::Load(int fullX, int fullY, GameSave * save) } } } + if (parts[i].pavg[0] || parts[i].pavg[1]) + { + parts[i].pavg[0] = parts[i].pavg[1] = 0; + } } parts_lastActiveIndex = NPART-1; force_stacking_check = 1; diff --git a/src/simulation/elements/WARP.cpp b/src/simulation/elements/WARP.cpp index bb8f8e1..5dd19c5 100644 --- a/src/simulation/elements/WARP.cpp +++ b/src/simulation/elements/WARP.cpp @@ -43,7 +43,7 @@ Element_WARP::Element_WARP() HighTemperatureTransition = NT; Update = &Element_WARP::update; - + Graphics = &Element_WARP::graphics; } //#TPT-Directive ElementHeader Element_WARP static int update(UPDATE_FUNC_ARGS) -- cgit v0.9.2-21-gd62e