summaryrefslogtreecommitdiff
path: root/GUI.h
diff options
context:
space:
mode:
authorJonas Ask2009-10-20 12:23:52 +0000
committerJonas Ask2009-10-20 12:23:52 +0000
commit9b1b95b33e4ba93a6ab7fed504d4bcf6e2abee9a (patch)
tree2a7833db49114f38fd87fbaf39e0b69279bb8c2e /GUI.h
parent002c766257789fabe04deeb9d79d2e3fbcefc195 (diff)
downloadstonesense-9b1b95b33e4ba93a6ab7fed504d4bcf6e2abee9a.tar.gz
stonesense-9b1b95b33e4ba93a6ab7fed504d4bcf6e2abee9a.tar.bz2
stonesense-9b1b95b33e4ba93a6ab7fed504d4bcf6e2abee9a.tar.xz
Adding all the code and resources for the first time. God speed!
Diffstat (limited to 'GUI.h')
-rw-r--r--GUI.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/GUI.h b/GUI.h
new file mode 100644
index 0000000..caf26a1
--- /dev/null
+++ b/GUI.h
@@ -0,0 +1,71 @@
+#pragma once
+
+#include "common.h"
+
+class DisplaySegment{
+private:
+ vector<Block*> blocks;
+public:
+ int x, y, z;
+ int sizex, sizey, sizez;
+ Crd3D regionSize;
+ Block** blocksAsPointerVolume;
+
+
+ DisplaySegment(int x, int y, int z, int sizex, int sizey, int sizez){
+ this->x = x;
+ this->y = y;
+ this->z = z - sizez + 1;
+ this->sizex = sizex; this->sizey = sizey; this->sizez = sizez;
+
+ regionSize.x = regionSize.y = regionSize.z = 0;
+
+ uint32_t memoryNeeded = sizex * sizey * sizez * sizeof(Block*);
+ blocksAsPointerVolume = (Block**) malloc( memoryNeeded );
+ memset(blocksAsPointerVolume, 0, memoryNeeded);
+ }
+
+ ~DisplaySegment(){
+ for(uint32_t i = 0; i < blocks.size(); i++){
+ free(blocks[i]);
+ }
+ }
+
+ void Dispose(void){
+ free(blocksAsPointerVolume);
+ }
+
+ uint32_t getNumBlocks(){
+ return (uint32_t)blocks.size();
+ }
+
+ Block* getBlock(uint32_t x, uint32_t y, uint32_t z);
+ Block* getBlock(uint32_t index);
+ void addBlock(Block* b);
+ void drawAllBlocks(BITMAP* target);
+};
+
+
+
+
+void pointToScreen(int *inx, int *iny, int inz);
+Crd2D WorldBlockToScreen(uint32_t x, uint32_t y, uint32_t z);
+void DrawMinimap(BITMAP* target);
+void paintboard();
+
+
+BITMAP* load_bitmap_withWarning(char* path);
+void loadGraphicsFromDisk();
+void destroyGraphics();
+void saveScreenshot();
+
+extern DisplaySegment* viewedSegment;//current, loaded
+extern int DisplayedSegmentX;
+extern int DisplayedSegmentY;
+extern int DisplayedSegmentZ;
+
+
+extern BITMAP* IMGFloorSheet;
+extern BITMAP* IMGWallSheet;
+extern BITMAP* IMGStairSheet;
+extern BITMAP* IMGRampSheet; \ No newline at end of file