fix '=' resetting air heat, fix uninitialized ambient heat setting, a few LOLZ / LOVE changes

This commit is contained in:
jacob1 2012-12-17 21:11:33 -05:00
parent f68cded2d2
commit b5de23433d
6 changed files with 21 additions and 32 deletions

View File

@ -41,12 +41,16 @@ void Air::make_kernel(void) //used for velocity
void Air::Clear()
{
std::fill(&hv[0][0], &hv[0][0]+((XRES/CELL)*(YRES/CELL)), 273.15f + 22.0f);
std::fill(&pv[0][0], &pv[0][0]+((XRES/CELL)*(YRES/CELL)), 0.0f);
std::fill(&vy[0][0], &vy[0][0]+((XRES/CELL)*(YRES/CELL)), 0.0f);
std::fill(&vx[0][0], &vx[0][0]+((XRES/CELL)*(YRES/CELL)), 0.0f);
}
void Air::ClearAirH()
{
std::fill(&hv[0][0], &hv[0][0]+((XRES/CELL)*(YRES/CELL)), 273.15f + 22.0f);
}
void Air::update_airh(void)
{
int x, y, i, j;

View File

@ -30,6 +30,7 @@ public:
void update_airh(void);
void update_air(void);
void Clear();
void ClearAirH();
void Invert();
Air(Simulation & sim);
};

View File

@ -1976,7 +1976,10 @@ void Simulation::clear_sim(void)
if(grav)
grav->Clear();
if(air)
{
air->Clear();
air->ClearAirH();
}
SetEdgeMode(edgeMode);
}
void Simulation::init_can_move()
@ -3372,11 +3375,9 @@ void Simulation::update_particles_i(int start, int inc)
}
}
if (ISLOVE || ISLOLZ) //LOVE and LOLZ element handling
if (elementCount[PT_LOVE] > 0 || elementCount[PT_LOLZ] > 0) //LOVE and LOLZ element handling
{
int nx, nnx, ny, nny, r, rt;
ISLOVE = 0;
ISLOLZ = 0;
for (ny=0; ny<YRES-4; ny++)
{
for (nx=0; nx<XRES-4; nx++)
@ -3390,11 +3391,11 @@ void Simulation::update_particles_i(int start, int inc)
kill_part(r>>8);
else if (parts[r>>8].type==PT_LOVE)
{
love[nx/9][ny/9] = 1;
Element_LOVE::love[nx/9][ny/9] = 1;
}
else if (parts[r>>8].type==PT_LOLZ)
{
lolz[nx/9][ny/9] = 1;
Element_LOLZ::lolz[nx/9][ny/9] = 1;
}
}
}
@ -3402,7 +3403,7 @@ void Simulation::update_particles_i(int start, int inc)
{
for (ny=9; ny<=YRES-7; ny++)
{
if (love[nx/9][ny/9]==1)
if (Element_LOVE::love[nx/9][ny/9]==1)
{
for ( nnx=0; nnx<9; nnx++)
for ( nny=0; nny<9; nny++)
@ -3419,8 +3420,8 @@ void Simulation::update_particles_i(int start, int inc)
}
}
}
love[nx/9][ny/9]=0;
if (lolz[nx/9][ny/9]==1)
Element_LOVE::love[nx/9][ny/9]=0;
if (Element_LOLZ::lolz[nx/9][ny/9]==1)
{
for ( nnx=0; nnx<9; nnx++)
for ( nny=0; nny<9; nny++)
@ -3438,7 +3439,7 @@ void Simulation::update_particles_i(int start, int inc)
}
}
}
lolz[nx/9][ny/9]=0;
Element_LOLZ::lolz[nx/9][ny/9]=0;
}
}
}
@ -4805,6 +4806,7 @@ Simulation::Simulation():
vy = air->vy;
pv = air->pv;
hv = air->hv;
aheat_enable = false;
int menuCount;
menu_section * msectionsT = LoadMenus(menuCount);

View File

@ -118,10 +118,6 @@ public:
int pretty_powder;
int sandcolour;
int sandcolour_frame;
bool ISLOVE;
int love[XRES/9][YRES/9];
bool ISLOLZ;
int lolz[XRES/9][YRES/9];
int Load(GameSave * save);
int Load(int x, int y, GameSave * save);

View File

@ -42,8 +42,6 @@ Element_LOLZ::Element_LOLZ()
HighTemperature = ITH;
HighTemperatureTransition = NT;
Update = &Element_LOLZ::update;
}
//#TPT-Directive ElementHeader Element_LOLZ static int RuleTable[9][9]
@ -60,12 +58,7 @@ int Element_LOLZ::RuleTable[9][9] =
{0,1,0,0,0,0,0,1,0},
};
//#TPT-Directive ElementHeader Element_LOLZ static int update(UPDATE_FUNC_ARGS)
int Element_LOLZ::update(UPDATE_FUNC_ARGS)
{
sim->ISLOLZ = true;
return 0;
}
//#TPT-Directive ElementHeader Element_LOLZ static int lolz[XRES/9][YRES/9];
int Element_LOLZ::lolz[XRES/9][YRES/9];
Element_LOLZ::~Element_LOLZ() {}

View File

@ -42,8 +42,6 @@ Element_LOVE::Element_LOVE()
HighTemperature = ITH;
HighTemperatureTransition = NT;
Update = &Element_LOVE::update;
}
//#TPT-Directive ElementHeader Element_LOVE static int RuleTable[9][9]
@ -60,12 +58,7 @@ int Element_LOVE::RuleTable[9][9] =
{0,0,1,1,0,0,0,0,0},
};
//#TPT-Directive ElementHeader Element_LOVE static int update(UPDATE_FUNC_ARGS)
int Element_LOVE::update(UPDATE_FUNC_ARGS)
{
sim->ISLOVE = true;
return 0;
}
//#TPT-Directive ElementHeader Element_LOVE static int love[XRES/9][YRES/9];
int Element_LOVE::love[XRES/9][YRES/9];
Element_LOVE::~Element_LOVE() {}