1
0
mirror of https://github.com/luanti-org/minetestmapper.git synced 2025-10-06 13:55:22 +02:00

Move source files into folder

This commit is contained in:
sfan5
2025-02-18 15:45:14 +01:00
parent 1c16c40ccc
commit 527a56f22e
31 changed files with 40 additions and 32 deletions

44
src/PixelAttributes.h Normal file
View File

@@ -0,0 +1,44 @@
#pragma once
#include <climits>
#include <cstdint>
#define BLOCK_SIZE 16
struct PixelAttribute {
PixelAttribute() : height(INT16_MIN), thickness(0) {};
int16_t height;
uint8_t thickness;
inline bool valid_height() const {
return height != INT16_MIN;
}
};
class PixelAttributes
{
public:
PixelAttributes();
virtual ~PixelAttributes();
void setWidth(int width);
void scroll();
inline PixelAttribute &attribute(int z, int x) {
return m_pixelAttributes[z + 1][x + 1];
};
private:
void freeAttributes();
private:
enum Line {
FirstLine = 0,
LastLine = BLOCK_SIZE,
EmptyLine = BLOCK_SIZE + 1,
LineCount = BLOCK_SIZE + 2
};
PixelAttribute *m_pixelAttributes[BLOCK_SIZE + 2]; // 1px gradient + empty
int m_width;
};