Salt/Stagnant water finally understood.

develop
Petr Mrázek 2010-10-29 07:36:06 +02:00
parent 603d11ea0a
commit ab1a3a8cef
3 changed files with 46 additions and 15 deletions

@ -148,7 +148,7 @@ namespace DFHack
liquid_water, liquid_water,
liquid_magma liquid_magma
}; };
/*
enum e_liquidcharacter enum e_liquidcharacter
{ {
liquid_fresh, liquid_fresh,
@ -156,7 +156,7 @@ namespace DFHack
liquid_salt, liquid_salt,
liquid_unk2, liquid_unk2,
}; };
*/
struct naked_designation struct naked_designation
{ {
unsigned int flow_size : 3; // how much liquid is here? unsigned int flow_size : 3; // how much liquid is here?
@ -196,14 +196,9 @@ namespace DFHack
unsigned int feature_local : 1; unsigned int feature_local : 1;
/// this tile is a part of a global feature. can be combined with 'featstone' tiles /// this tile is a part of a global feature. can be combined with 'featstone' tiles
unsigned int feature_global : 1; unsigned int feature_global : 1;
/** unsigned int water_stagnant : 1;
* water characteristics unsigned int water_salt : 1;
* fresh=0 // e_liquidcharacter liquid_character : 2;
* ?=1
* salt=2
* ?=3
*/
e_liquidcharacter liquid_character : 2;
}; };
union t_designation union t_designation

@ -1004,7 +1004,8 @@ int main (void)
if (fillmagma || fillwater) if (fillmagma || fillwater)
{ {
d->bits.flow_size=7; d->bits.flow_size=7;
d->bits.liquid_character = liquid_fresh; d->bits.water_stagnant = false;
d->bits.water_salt = false;
if (fillmagma) if (fillmagma)
{ {
d->bits.liquid_type=liquid_magma; d->bits.liquid_type=liquid_magma;
@ -1018,7 +1019,8 @@ int main (void)
{ {
//Otherwise, remove all liquids. //Otherwise, remove all liquids.
d->bits.flow_size=0; d->bits.flow_size=0;
d->bits.liquid_character = liquid_fresh; d->bits.water_stagnant = false;
d->bits.water_salt = false;
d->bits.liquid_type = liquid_water; d->bits.liquid_type = liquid_water;
} }
@ -1087,7 +1089,8 @@ int main (void)
//Erase any liquids, as they cause problems. //Erase any liquids, as they cause problems.
d->bits.flow_size=0; d->bits.flow_size=0;
d->bits.liquid_character = liquid_fresh; d->bits.water_stagnant = false;
d->bits.water_salt = false;
d->bits.liquid_type=liquid_water; d->bits.liquid_type=liquid_water;
//Placing an aquifer? //Placing an aquifer?
@ -1121,7 +1124,8 @@ int main (void)
//Erase any liquids, as they cause problems. //Erase any liquids, as they cause problems.
d->bits.flow_size=0; d->bits.flow_size=0;
d->bits.liquid_character = liquid_fresh; d->bits.water_stagnant = false;
d->bits.water_salt = false;
d->bits.liquid_type=liquid_water; d->bits.liquid_type=liquid_water;
break; break;
default: default:

@ -620,7 +620,9 @@ main(int argc, char *argv[])
{ {
TEMP_NO, TEMP_NO,
TEMP_1, TEMP_1,
TEMP_2 TEMP_2,
WATER_SALT,
WATER_STAGNANT
}; };
e_tempmode temperature = TEMP_NO; e_tempmode temperature = TEMP_NO;
@ -691,6 +693,12 @@ main(int argc, char *argv[])
case 'm': case 'm':
temperature = TEMP_2; temperature = TEMP_2;
break; break;
case 'c':
temperature = WATER_SALT;
break;
case 'v':
temperature = WATER_STAGNANT;
break;
case 27: // escape key case 27: // escape key
DF->Detach(); DF->Detach();
return 0; return 0;
@ -940,6 +948,30 @@ main(int argc, char *argv[])
} }
} }
} }
else if(temperature == WATER_SALT)
{
for(int x = 0; x < 16; x++) for(int y = 0; y < 16; y++)
{
if(Block->designation[x][y].bits.water_salt)
{
putch(x + 16,y + 16,'@',COLOR_WHITE);
}
}
gotoxy (50,8);
cprintf ("Salt water");
}
else if(temperature == WATER_STAGNANT)
{
for(int x = 0; x < 16; x++) for(int y = 0; y < 16; y++)
{
if(Block->designation[x][y].bits.water_stagnant)
{
putch(x + 16,y + 16,'@',COLOR_WHITE);
}
}
gotoxy (50,8);
cprintf ("Stagnant water");
}
else else
{ {
if(temperature == TEMP_1) if(temperature == TEMP_1)