31.25, tweaks to make dfliquids and dfreveal better

develop
Petr Mrázek 2011-03-30 14:27:47 +02:00
parent b3455b0192
commit 37b0dbe02e
4 changed files with 29 additions and 15 deletions

@ -2148,6 +2148,10 @@
<Version name="v0.31.24 SDL" os="windows" base="v0.31.23 SDL"> <Version name="v0.31.24 SDL" os="windows" base="v0.31.23 SDL">
<PETimeStamp value="0x4D8F39F9" /> <PETimeStamp value="0x4D8F39F9" />
<MD5 value="eddc258fa59c89481516ad96eb51b35b" /> <MD5 value="eddc258fa59c89481516ad96eb51b35b" />
</Version>
<Version name="v0.31.25 SDL" os="windows" base="v0.31.24 SDL">
<PETimeStamp value="0x4D90764F" />
<MD5 value="6ada05fc94785b53efe6aa5728b3756b" />
</Version> </Version>
.-"""-. .-"""-.
' \ ' \

@ -572,9 +572,9 @@ void VersionInfoFactory::EvalVersion(string base, VersionInfo * mem)
v_descr & desc = knownVersions[base]; v_descr & desc = knownVersions[base];
if (!desc.second) if (!desc.second)
{ {
VersionInfo * newmem = new VersionInfo(); VersionInfo * basemem = new VersionInfo();
ParseVersion(desc.first, newmem); ParseVersion(desc.first, basemem);
desc.second = newmem; desc.second = basemem;
} }
mem->copy(desc.second); mem->copy(desc.second);
} }

@ -264,7 +264,7 @@ int main (int argc, char** argv)
z_levels = command == "" ? z_levels : atoi (command.c_str()); z_levels = command == "" ? z_levels : atoi (command.c_str());
if(z_levels < 1) z_levels = 1; if(z_levels < 1) z_levels = 1;
delete brush; delete brush;
if(width == height == z_levels == 1) if(width == 1 && height == 1 && z_levels == 1)
{ {
brushname="point"; brushname="point";
} }
@ -348,16 +348,18 @@ int main (int argc, char** argv)
} }
cout << "cursor coords: " << x << "/" << y << "/" << z << endl; cout << "cursor coords: " << x << "/" << y << "/" << z << endl;
MapCache mcache(Maps); MapCache mcache(Maps);
cout << "getting tiles from brush" << endl;
DFHack::DFCoord cursor(x,y,z); DFHack::DFCoord cursor(x,y,z);
coord_vec all_tiles = brush->points(mcache,cursor); coord_vec all_tiles = brush->points(mcache,cursor);
cout << "doing things" << endl; cout << "working..." << endl;
if(mode == "obsidian") if(mode == "obsidian")
{ {
coord_vec::iterator iter = all_tiles.begin(); coord_vec::iterator iter = all_tiles.begin();
while (iter != all_tiles.end()) while (iter != all_tiles.end())
{ {
mcache.setTiletypeAt(*iter, 331); mcache.setTiletypeAt(*iter, 331);
DFHack::t_designation des = mcache.designationAt(*iter);
des.bits.liquid_type = DFHack::liquid_magma;
mcache.setDesignationAt(*iter, des);
iter ++; iter ++;
} }
} }
@ -411,12 +413,6 @@ int main (int argc, char** argv)
continue; continue;
} }
// if we are setting the levels to 0 or changing magma into water // if we are setting the levels to 0 or changing magma into water
if(amount == 0 || des.bits.liquid_type == DFHack::liquid_magma && mode == "water")
{
// reset temperature to sane default
mcache.setTemp1At(current,10015);
mcache.setTemp2At(current,10015);
}
if(setmode == "s.") if(setmode == "s.")
{ {
flow.flow_size = amount; flow.flow_size = amount;
@ -431,10 +427,24 @@ int main (int argc, char** argv)
if (flow.flow_size > amount) if (flow.flow_size > amount)
flow.flow_size = amount; flow.flow_size = amount;
} }
if(mode == "magma") if(amount != 0 && mode == "magma")
{
flow.liquid_type = DFHack::liquid_magma; flow.liquid_type = DFHack::liquid_magma;
else if(mode == "water") mcache.setTemp1At(current,12000);
mcache.setTemp2At(current,12000);
}
else if(amount != 0 && mode == "water")
{
flow.liquid_type = DFHack::liquid_water; flow.liquid_type = DFHack::liquid_water;
mcache.setTemp1At(current,10015);
mcache.setTemp2At(current,10015);
}
else if(amount == 0 && (mode == "water" || mode == "magma"))
{
// reset temperature to sane default
mcache.setTemp1At(current,10015);
mcache.setTemp2At(current,10015);
}
mcache.setDesignationAt(current,des); mcache.setDesignationAt(current,des);
} }
seen_blocks.insert(mcache.BlockAt((*iter) / 16)); seen_blocks.insert(mcache.BlockAt((*iter) / 16));

@ -112,7 +112,7 @@ int main (void)
cout << "Map revealed. The game has been paused for you." << endl; cout << "Map revealed. The game has been paused for you." << endl;
cout << "Unpausing can unleash the forces of hell!" << endl << endl; cout << "Unpausing can unleash the forces of hell!" << endl << endl;
cout << "Press any key to unreveal." << endl; cout << "Press any key to unreveal." << endl;
cout << "Close to keep the map revealed." << endl; cout << "Close to keep the map revealed !!FOREVER!!" << endl;
cin.ignore(); cin.ignore();
cout << "Unrevealing... please wait." << endl; cout << "Unrevealing... please wait." << endl;
// FIXME: do some consistency checks here! // FIXME: do some consistency checks here!