summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/BiomeView.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-11-18 14:56:32 +0100
committerHowaner <franzi.moos@googlemail.com>2014-11-18 14:56:32 +0100
commit42120e2ea5db0cdb9920ff1c5efef33e0f496d48 (patch)
tree20ba1ae0a53f757cb8814b6cd6a466fe5acf1308 /Tools/QtBiomeVisualiser/BiomeView.h
parentFixed compile errors. (diff)
parentMerge pull request #1598 from mc-server/SignEditor (diff)
downloadcuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.gz
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.bz2
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.lz
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.xz
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.tar.zst
cuberite-42120e2ea5db0cdb9920ff1c5efef33e0f496d48.zip
Diffstat (limited to 'Tools/QtBiomeVisualiser/BiomeView.h')
-rw-r--r--Tools/QtBiomeVisualiser/BiomeView.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/Tools/QtBiomeVisualiser/BiomeView.h b/Tools/QtBiomeVisualiser/BiomeView.h
index f0521571d..cd9c7ead9 100644
--- a/Tools/QtBiomeVisualiser/BiomeView.h
+++ b/Tools/QtBiomeVisualiser/BiomeView.h
@@ -2,7 +2,7 @@
#include <QWidget>
#include <memory>
-#include "ChunkCache.h"
+#include "RegionCache.h"
#include "ChunkSource.h"
@@ -25,14 +25,34 @@ public:
The entire view is then invalidated and regenerated. */
void setChunkSource(std::shared_ptr<ChunkSource> a_ChunkSource);
+ /** Sets the position of the central pixel of the map to the specified point and redraws the view. */
+ void setPosition(int a_BlockX, int a_BlockZ);
+
+ /** Sets the zoom level to the specified value and redraws the view. */
+ void setZoomLevel(double a_ZoomLevel);
+
signals:
+ /** Signalled when the user uses the wheel to scroll upwards. */
+ void wheelUp();
+
+ /** Signalled when the user uses the wheel to scroll downwards. */
+ void wheelDown();
+
+ /** Signalled when the user presses a key to increase zoom. */
+ void increaseZoom();
+
+ /** Signalled when the user presses a key to decrease zoom. */
+ void decreaseZoom();
+
+ /** Emitted when the user moves the mouse, to reflect the current block under the cursor. */
+ void hoverChanged(int a_BlockX, int a_BlockZ, int a_Biome);
public slots:
/** Redraw the entire widget area. */
void redraw();
- /** A specified chunk has become available, redraw it. */
- void chunkAvailable(int a_ChunkX, int a_ChunkZ);
+ /** A specified region has become available, redraw it. */
+ void regionAvailable(int a_RegionX, int a_RegionZ);
/** Reloads the current chunk source and redraws the entire workspace. */
void reload();
@@ -42,7 +62,7 @@ protected:
double m_Zoom;
/** Cache for the loaded chunk data. */
- ChunkCache m_Cache;
+ RegionCache m_Cache;
/** The entire view's contents in an offscreen image. */
QImage m_Image;
@@ -59,6 +79,9 @@ protected:
/** Data used for rendering a chunk that hasn't been loaded yet */
uchar m_EmptyChunkImage[16 * 16 * 4];
+ /** Data placeholder for chunks that aren't valid. */
+ short m_EmptyChunkBiomes[16 * 16];
+
/** Draws the specified chunk into m_Image */
void drawChunk(int a_ChunkX, int a_ChunkZ);
@@ -86,12 +109,6 @@ protected:
/** Called when the user presses a key. */
virtual void keyPressEvent(QKeyEvent * a_Event) override;
-
- /** Decreases the zoom level and queues a redraw. */
- void decreaseZoom();
-
- /** Increases the zoom level and queues a redraw. */
- void increaseZoom();
};