VOXELFORMAT: fixed color writing for vxm

master
Martin Gerhardy 2022-05-22 23:05:26 +02:00
parent bbaaab8afc
commit 62bc102e2e
2 changed files with 11 additions and 8 deletions

View File

@ -194,7 +194,10 @@ bool VXMFormat::saveGroups(const SceneGraph& sceneGraph, const core::String &fil
wrapBool(stream.writeUInt8(numColors))
for (int i = 0; i < numColors; ++i) {
const core::RGBA &matcolor = palette.colors[i];
wrapBool(stream.writeUInt32(matcolor.rgba))
wrapBool(stream.writeUInt8(matcolor.b))
wrapBool(stream.writeUInt8(matcolor.g))
wrapBool(stream.writeUInt8(matcolor.r))
wrapBool(stream.writeUInt8(matcolor.a))
const core::RGBA &glowcolor = palette.glowColors[i];
const bool emissive = glowcolor.a > 0;
wrapBool(stream.writeBool(emissive))

View File

@ -10,26 +10,26 @@ namespace voxelformat {
class VXMFormatTest: public AbstractVoxFormatTest {
};
TEST_F(VXMFormatTest, DISABLED_testLoadRGB) {
TEST_F(VXMFormatTest, DISABLED_testRGB) {
testRGB("rgb.vxm");
}
TEST_F(VXMFormatTest, testLoad) {
TEST_F(VXMFormatTest, testLoadVersion4) {
canLoad("test.vxm");
}
TEST_F(VXMFormatTest, testLoadFileCreatedBySandboxVoxeditVersion12) {
TEST_F(VXMFormatTest, testLoadVersion12) {
canLoad("test2.vxm");
}
TEST_F(VXMFormatTest, testSaveVerySmallVoxel) {
TEST_F(VXMFormatTest, testSaveSmallVolume) {
VXMFormat f;
testSaveSmallVolume("verysmallvolumesavetest.vxm", &f);
testSaveSmallVolume("testSaveSmallVolume.vxm", &f);
}
TEST_F(VXMFormatTest, testSaveSmallVoxel) {
TEST_F(VXMFormatTest, testSaveLoadVoxel) {
VXMFormat f;
testSaveLoadVoxel("sandbox-smallvolumesavetest.vxm", &f);
testSaveLoadVoxel("testSaveLoadVoxel.vxm", &f);
}
}