Files
isle/LEGO1/lego/sources/shape/legovertex.cpp
Anonymous Maarten 2915aa014f Use sizeof(type) instead of sizeof(variableName) when (de)serializing data (#1505)
* Use sizeof(type) instead of sizeof(variableName) when (de)serializing data

* Less usage of sizeof(variableName) while (de)serializing
2025-05-18 22:56:28 +02:00

31 lines
687 B
C++

#include "legovertex.h"
#include "decomp.h"
#include "misc/legostorage.h"
DECOMP_SIZE_ASSERT(LegoVertex, 0x0c)
// FUNCTION: LEGO1 0x100d37b0
LegoVertex::LegoVertex()
{
m_coordinates[0] = 0.0F;
m_coordinates[1] = 0.0F;
m_coordinates[2] = 0.0F;
}
// FUNCTION: LEGO1 0x100d37c0
LegoResult LegoVertex::Read(LegoStorage* p_storage)
{
LegoResult result;
if ((result = p_storage->Read(&m_coordinates[0], sizeof(LegoFloat))) != SUCCESS) {
return result;
}
if ((result = p_storage->Read(&m_coordinates[1], sizeof(LegoFloat))) != SUCCESS) {
return result;
}
if ((result = p_storage->Read(&m_coordinates[2], sizeof(LegoFloat))) != SUCCESS) {
return result;
}
return SUCCESS;
}