mirror of
https://github.com/luanti-org/minetestmapper.git
synced 2025-10-05 21:35:22 +02:00
Don't use a temporary table for block positions
This also moves database functions and data structures to db.h
This commit is contained in:
15
db-leveldb.h
15
db-leveldb.h
@@ -1,5 +1,5 @@
|
||||
#ifndef _DB_LEVELDB_H
|
||||
#define _DB_LEVELDB_H
|
||||
#ifndef DB_LEVELDB_HEADER
|
||||
#define DB_LEVELDB_HEADER
|
||||
|
||||
#include "db.h"
|
||||
#include <leveldb/db.h>
|
||||
@@ -7,16 +7,15 @@
|
||||
class DBLevelDB : public DB {
|
||||
public:
|
||||
DBLevelDB(const std::string &mapdir);
|
||||
virtual std::vector<int64_t> getBlockPos();
|
||||
virtual DBBlockList getBlocksOnZ(int zPos);
|
||||
virtual std::vector<BlockPos> getBlockPos();
|
||||
virtual void getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos);
|
||||
~DBLevelDB();
|
||||
private:
|
||||
void loadPosCache();
|
||||
|
||||
leveldb::DB *db;
|
||||
std::vector<BlockPos> posCache;
|
||||
|
||||
bool posCacheLoaded;
|
||||
std::vector<int64_t> posCache;
|
||||
leveldb::DB *db;
|
||||
};
|
||||
|
||||
#endif // _DB_LEVELDB_H
|
||||
#endif // DB_LEVELDB_HEADER
|
||||
|
Reference in New Issue
Block a user