Namespaced Color8
This commit is contained in:
parent
64415a3c86
commit
09899eef97
@ -13,7 +13,8 @@
|
||||
#include <scene/resources/mesh.h>
|
||||
#include <scene/resources/packed_scene.h>
|
||||
|
||||
using namespace zylann::voxel;
|
||||
using namespace zylann;
|
||||
using namespace voxel;
|
||||
|
||||
String VoxelVoxImporter::get_importer_name() const {
|
||||
return "VoxelVoxImporter";
|
||||
|
@ -5,12 +5,15 @@
|
||||
|
||||
#include <scene/resources/mesh.h>
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
namespace VoxelDebug {
|
||||
|
||||
FixedArray<Ref<Mesh>, ID_COUNT> g_wirecubes;
|
||||
bool g_finalized = false;
|
||||
|
||||
template <typename T> void raw_copy_to(Vector<T> &dst, const T *src, unsigned int count) {
|
||||
template <typename T>
|
||||
void raw_copy_to(Vector<T> &dst, const T *src, unsigned int count) {
|
||||
dst.resize(count);
|
||||
memcpy(dst.ptrw(), src, count * sizeof(T));
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
|
||||
void set_world(World3D *world);
|
||||
void begin();
|
||||
void draw_box(const Transform3D &t, Color8 color);
|
||||
void draw_box(const Transform3D &t, zylann::Color8 color);
|
||||
void end();
|
||||
void clear();
|
||||
|
||||
@ -60,7 +60,7 @@ public:
|
||||
|
||||
// Draws a box wireframe using MultiMesh, allowing to draw much more without slowing down.
|
||||
// The box's origin is its lower corner. Size is defined by the transform's basis.
|
||||
void draw_box_mm(const Transform3D &t, Color8 color);
|
||||
void draw_box_mm(const Transform3D &t, zylann::Color8 color);
|
||||
|
||||
// Call this after issuing all drawing commands
|
||||
void end();
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "voxel_color_palette.h"
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
VoxelColorPalette::VoxelColorPalette() {
|
||||
// Default palette
|
||||
_colors[0] = Color8(0, 0, 0, 0);
|
||||
|
@ -23,11 +23,11 @@ public:
|
||||
|
||||
// Internal
|
||||
|
||||
inline void set_color8(uint8_t i, Color8 c) {
|
||||
inline void set_color8(uint8_t i, zylann::Color8 c) {
|
||||
_colors[i] = c;
|
||||
}
|
||||
|
||||
inline Color8 get_color8(uint8_t i) const {
|
||||
inline zylann::Color8 get_color8(uint8_t i) const {
|
||||
return _colors[i];
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ private:
|
||||
|
||||
static void _bind_methods();
|
||||
|
||||
FixedArray<Color8, MAX_COLORS> _colors;
|
||||
FixedArray<zylann::Color8, MAX_COLORS> _colors;
|
||||
};
|
||||
|
||||
#endif // VOXEL_COLOR_PALETTE_H
|
||||
|
@ -707,7 +707,8 @@ VoxelMesherCubes::VoxelMesherCubes() {
|
||||
VoxelMesherCubes::~VoxelMesherCubes() {}
|
||||
|
||||
void VoxelMesherCubes::build(VoxelMesher::Output &output, const VoxelMesher::Input &input) {
|
||||
using namespace zylann::voxel;
|
||||
using namespace zylann;
|
||||
using namespace voxel;
|
||||
|
||||
VOXEL_PROFILE_SCOPE();
|
||||
const int channel = VoxelBufferInternal::CHANNEL_COLOR;
|
||||
|
@ -11,7 +11,7 @@ class VoxelMesherCubes : public VoxelMesher {
|
||||
public:
|
||||
static const unsigned int PADDING = 1;
|
||||
|
||||
enum Materials {
|
||||
enum Materials { //
|
||||
MATERIAL_OPAQUE = 0,
|
||||
MATERIAL_TRANSPARENT,
|
||||
MATERIAL_COUNT
|
||||
@ -51,7 +51,9 @@ public:
|
||||
void set_store_colors_in_texture(bool enable);
|
||||
bool get_store_colors_in_texture() const;
|
||||
|
||||
bool supports_lod() const override { return true; }
|
||||
bool supports_lod() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Structs
|
||||
|
||||
@ -81,7 +83,7 @@ public:
|
||||
unsigned int size_y;
|
||||
unsigned int surface_index;
|
||||
};
|
||||
std::vector<Color8> colors;
|
||||
std::vector<zylann::Color8> colors;
|
||||
std::vector<ImageInfo> images;
|
||||
|
||||
void clear() {
|
||||
|
@ -3,6 +3,8 @@
|
||||
#include "../storage/voxel_buffer.h"
|
||||
#include "vox_data.h"
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
Error VoxelVoxLoader::load_from_file(String fpath, Ref<VoxelBuffer> p_voxels, Ref<VoxelColorPalette> palette) {
|
||||
ERR_FAIL_COND_V(p_voxels.is_null(), ERR_INVALID_PARAMETER);
|
||||
VoxelBufferInternal &voxels = p_voxels->get_buffer();
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include <scene/resources/world_3d.h>
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
DirectMultiMeshInstance::DirectMultiMeshInstance() {}
|
||||
|
||||
DirectMultiMeshInstance::~DirectMultiMeshInstance() {
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
|
||||
struct TransformAndColor8 {
|
||||
Transform3D transform;
|
||||
Color8 color;
|
||||
zylann::Color8 color;
|
||||
};
|
||||
|
||||
static void make_transform_and_color8_3d_bulk_array(
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include <core/math/color.h>
|
||||
|
||||
namespace zylann {
|
||||
|
||||
struct Color8 {
|
||||
union {
|
||||
struct {
|
||||
@ -65,4 +67,6 @@ struct Color8 {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace zylann
|
||||
|
||||
#endif // COLOR8_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user