mirror of
https://github.com/minetest/minetestmapper.git
synced 2025-07-04 17:40:22 +02:00
Added block position decoder.
This commit is contained in:
@ -10,9 +10,10 @@
|
||||
#ifndef TILEGENERATOR_H_JJNUCARH
|
||||
#define TILEGENERATOR_H_JJNUCARH
|
||||
|
||||
#include <map>
|
||||
#include <sqlite3.h>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
struct Color {
|
||||
uint8_t r;
|
||||
@ -20,6 +21,15 @@ struct Color {
|
||||
uint8_t b;
|
||||
};
|
||||
|
||||
struct BlockPos {
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
};
|
||||
|
||||
class DbError {
|
||||
};
|
||||
|
||||
class TileGenerator
|
||||
{
|
||||
private:
|
||||
@ -36,8 +46,14 @@ public:
|
||||
void setDrawPlayers(bool drawPlayers);
|
||||
void setDrawScale(bool drawScale);
|
||||
void setDrawUnderground(bool drawUnderground);
|
||||
void generate(const std::string &input, const std::string &output);
|
||||
void parseColorsFile(const std::string &fileName);
|
||||
void generate(const std::string &input, const std::string &output);
|
||||
|
||||
private:
|
||||
void openDb(const std::string &input);
|
||||
void loadBlocks();
|
||||
BlockPos decodeBlockPos(sqlite3_int64 blockId);
|
||||
int unsignedToSigned(long i, long max_positive);
|
||||
|
||||
private:
|
||||
std::string m_bgColor;
|
||||
@ -48,6 +64,7 @@ private:
|
||||
bool m_drawPlayers;
|
||||
bool m_drawScale;
|
||||
bool m_drawUnderground;
|
||||
sqlite3 *m_db;
|
||||
ColorMap m_colors;
|
||||
}; /* ----- end of class TileGenerator ----- */
|
||||
|
||||
|
Reference in New Issue
Block a user