summaryrefslogtreecommitdiff
path: root/Block.h
diff options
context:
space:
mode:
authorJapa2010-04-09 14:24:27 +0000
committerJapa2010-04-09 14:24:27 +0000
commit114df922d3073bd296b38cf522997f520fb17850 (patch)
treec4cf372825118c3663cd77e18c69a6c3b59d070f /Block.h
parent81aefc8e03ff3f647494012e18bcdc8f33f4de42 (diff)
downloadstonesense-114df922d3073bd296b38cf522997f520fb17850.tar.gz
stonesense-114df922d3073bd296b38cf522997f520fb17850.tar.bz2
stonesense-114df922d3073bd296b38cf522997f520fb17850.tar.xz
updated trunk to the new graphics engine, and the latest DFhack
Diffstat (limited to 'Block.h')
-rw-r--r--Block.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/Block.h b/Block.h
new file mode 100644
index 0000000..1043d66
--- /dev/null
+++ b/Block.h
@@ -0,0 +1,94 @@
+#pragma once
+
+#include "common.h"
+
+class WorldSegment;
+
+
+class Block
+{
+public:
+ Block(WorldSegment* ownerSegment);
+ ~Block(void);
+ static void* operator new (size_t size);
+ static void operator delete (void *p);
+
+ WorldSegment* ownerSegment;
+
+ uint32_t x, y, z;
+ int floorType;
+ int wallType;
+ int stairType;
+ t_matglossPair material;
+ t_matglossPair layerMaterial;
+ t_matglossPair veinMaterial;
+ bool hasVein;
+
+ bool depthBorderNorth;
+ bool depthBorderWest;
+ int shadow;
+
+ t_matglossPair ramp;
+ t_matglossPair water;
+ t_designation designation;
+ t_occupancy occ;
+
+ t_creature* creature;
+ //bool mirroredBuilding;
+ t_matglossPair tree;
+
+ struct BlockEffects //size 40
+ {
+ uint16_t count;
+ uint16_t type;
+ t_matglossPair material;
+ int16_t lifetime;
+ int16_t x_direction;
+ int16_t y_direction;
+ uint8_t canCreateNew;//??
+ } blockeffects;
+
+ //individual effects
+ int16_t eff_miasma;
+ int16_t eff_water;
+ int16_t eff_water2;
+ int16_t eff_blood;
+ int16_t eff_dust;
+ int16_t eff_magma;
+ int16_t eff_smoke;
+ int16_t eff_dragonfire;
+ int16_t eff_fire;
+ int16_t eff_webing;
+ int16_t eff_boiling;
+ int16_t eff_oceanwave;
+ struct {
+ t_building info;
+ vector<t_SpriteWithOffset> sprites;
+ uint32_t index;
+ } building;
+
+ bool IsVisible(){
+ return (floorType || wallType) != 0;
+ }
+ void Draw();
+ void Drawcreaturetext();
+ void DrawRamptops();
+
+ //debugz!
+ t_designation designations;
+private:
+
+};
+void createEffectSprites();
+void destroyEffectSprites();
+void initRandomCube();
+
+//find a better place for these
+bool hasWall(Block* b);
+bool hasBuildingOfID(Block* b, int ID);
+bool hasBuildingIdentity(Block* b, uint32_t index, int buildingOcc);
+bool hasBuildingOfIndex(Block* b, uint32_t index);
+bool wallShouldNotHaveBorders( int in );
+
+ALLEGRO_COLOR getSpriteColor(t_subSprite &sprite, t_matglossPair material, t_matglossPair layerMaterial, t_matglossPair veinMaterial);
+ALLEGRO_COLOR getSpriteColor(t_SpriteWithOffset &sprite, t_matglossPair material, t_matglossPair layerMaterial, t_matglossPair veinMaterial); \ No newline at end of file