diff options
| -rw-r--r-- | Block.cpp | 3 | ||||
| -rw-r--r-- | ContentLoader.cpp | 19 | ||||
| -rw-r--r-- | ContentLoader.h | 2 | ||||
| -rw-r--r-- | MapLoading.cpp | 4 | ||||
| -rw-r--r-- | SpriteObjects.cpp | 3 | ||||
| -rw-r--r-- | UserInput.cpp | 2 | ||||
| -rw-r--r-- | commonTypes.h | 2 | ||||
| -rw-r--r-- | resources/SSProfIcons.png | bin | 9057 -> 25359 bytes | |||
| -rw-r--r-- | resources/creatures/large_256/dwarff.png | bin | 161994 -> 165363 bytes | |||
| -rw-r--r-- | resources/creatures/large_256/dwarfm.png | bin | 183309 -> 186687 bytes |
10 files changed, 21 insertions, 14 deletions
@@ -616,8 +616,7 @@ void Block::DrawPixel(int drawx, int drawy) (tileMaterial == tiletype_material::GRASS_DRY) ||
(tileMaterial == tiletype_material::GRASS_DEAD)))
{
- DFHack::t_matglossPair woodymat; woodymat.index = WOOD, woodymat.type = grassmat;
- temp = lookupMaterialColor(woodymat);
+ temp = lookupMaterialColor(WOOD, grassmat);
al_draw_pixel(drawx, drawy, al_map_rgba_f(temp.r,temp.g, temp.b, (float)grasslevel/100.0f));
}
}
diff --git a/ContentLoader.cpp b/ContentLoader.cpp index a3f7c26..c597f0b 100644 --- a/ContentLoader.cpp +++ b/ContentLoader.cpp @@ -749,16 +749,21 @@ void ContentLoader::flushCreatureConfig() ALLEGRO_COLOR lookupMaterialColor(DFHack::t_matglossPair matt)
{
- DFHack::t_matglossPair dyematt;
- dyematt.index = -1, dyematt.type = -1;
- return lookupMaterialColor(matt, dyematt);
+ return lookupMaterialColor((int) matt.type, (int) matt.index, -1, -1);
}
ALLEGRO_COLOR lookupMaterialColor(DFHack::t_matglossPair matt, DFHack::t_matglossPair dyematt)
-{
- int matType = (int) matt.type;
- int matIndex = (int) matt.index;
+{
+ return lookupMaterialColor((int) matt.type, (int) matt.index, (int) dyematt.type, (int) dyematt.index);
+}
+ALLEGRO_COLOR lookupMaterialColor(int matType, int matIndex)
+{
+ return lookupMaterialColor( matType, matIndex, -1, -1);
+}
+
+ALLEGRO_COLOR lookupMaterialColor(int matType, int matIndex, int dyeType, int dyeIndex)
+{
if (matType < 0)
{
//This should not normally happen, but if it does, we don't want crashes, so we'll return magic pink so show something's wrong.
@@ -785,7 +790,7 @@ ALLEGRO_COLOR lookupMaterialColor(DFHack::t_matglossPair matt, DFHack::t_matglos MaterialInfo mat, dye;
if(mat.decode(matType, matIndex))
{
- if(dyematt.type>=0 && dyematt.index>=0 && dye.decode(dyematt.type, dyematt.index))
+ if(dyeType>=0 && dyeIndex>=0 && dye.decode(dyeType, dyeIndex))
return al_map_rgb_f(
contentLoader->Mats->color[dye.material->powder_dye].red * contentLoader->Mats->color[mat.material->state_color[0]].red,
contentLoader->Mats->color[dye.material->powder_dye].green * contentLoader->Mats->color[mat.material->state_color[0]].green,
diff --git a/ContentLoader.h b/ContentLoader.h index a1d0d9e..4bedeed 100644 --- a/ContentLoader.h +++ b/ContentLoader.h @@ -110,5 +110,7 @@ uint8_t lookupMaterialBright(int matType,int matIndex); const char *lookupTreeName(int matIndex);
ALLEGRO_COLOR lookupMaterialColor(DFHack::t_matglossPair matt, DFHack::t_matglossPair dyematt);
ALLEGRO_COLOR lookupMaterialColor(DFHack::t_matglossPair matt);
+ALLEGRO_COLOR lookupMaterialColor(int matType, int matIndex, int dyeType, int dyeIndex);
+ALLEGRO_COLOR lookupMaterialColor(int matType, int matIndex);
const char * lookupFormName(int formType);
ShadeBy getShadeType(const char* Input);
diff --git a/MapLoading.cpp b/MapLoading.cpp index 3852c4d..228c05e 100644 --- a/MapLoading.cpp +++ b/MapLoading.cpp @@ -848,7 +848,9 @@ void beautify_Segment(WorldSegment * segment) for(uint32_t i=0; i < numblocks; i++){
Block* b = segment->getBlock(i);
- if(config.occlusion)
+ if(config.occlusion == 1)
+ occlude_block(b);
+ else if(config.occlusion == 2 && b->designation.bits.hidden)
occlude_block(b);
if(!b->visible)
diff --git a/SpriteObjects.cpp b/SpriteObjects.cpp index 3a30122..5b5ff5f 100644 --- a/SpriteObjects.cpp +++ b/SpriteObjects.cpp @@ -944,8 +944,7 @@ ALLEGRO_COLOR c_sprite::get_color(void* block) case ShadeMat:
return lookupMaterialColor(b->material);
case ShadeGrass:
- DFHack::t_matglossPair woodymat; woodymat.index = WOOD, woodymat.type = b->grassmat;
- return lookupMaterialColor(woodymat);
+ return lookupMaterialColor(WOOD, b->grassmat);
case ShadeBuilding:
return lookupMaterialColor(b->building.info.material);
case ShadeLayer:
diff --git a/UserInput.cpp b/UserInput.cpp index 96c31fb..55cb7ac 100644 --- a/UserInput.cpp +++ b/UserInput.cpp @@ -225,7 +225,7 @@ void doKeys(int Key) timeToReloadSegment = true;
}
if(Key == ALLEGRO_KEY_O){
- config.occlusion = !config.occlusion;
+ config.occlusion = (config.occlusion+1)%3;
timeToReloadSegment = true;
}
if(Key == ALLEGRO_KEY_M){
diff --git a/commonTypes.h b/commonTypes.h index 40c7c7f..3af3a5c 100644 --- a/commonTypes.h +++ b/commonTypes.h @@ -196,7 +196,7 @@ typedef struct bool fog_of_war;
- bool occlusion;
+ char occlusion;
bool block_count;
uint16_t bloodcutoff;
diff --git a/resources/SSProfIcons.png b/resources/SSProfIcons.png Binary files differindex 14cbfc3..800e8e5 100644 --- a/resources/SSProfIcons.png +++ b/resources/SSProfIcons.png diff --git a/resources/creatures/large_256/dwarff.png b/resources/creatures/large_256/dwarff.png Binary files differindex 4b7bd61..7a6f54c 100644 --- a/resources/creatures/large_256/dwarff.png +++ b/resources/creatures/large_256/dwarff.png diff --git a/resources/creatures/large_256/dwarfm.png b/resources/creatures/large_256/dwarfm.png Binary files differindex a318676..366041d 100644 --- a/resources/creatures/large_256/dwarfm.png +++ b/resources/creatures/large_256/dwarfm.png |
