Skip to content

Commit

Permalink
Removed some warnings (need to clean up code later someday)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borf committed Nov 30, 2023
1 parent 3a36903 commit 8b08e52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions browedit/components/Rsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ void Rsm::Mesh::calcMatrix1(int time)
prevIndex++;
}

float prevTick = prevIndex < 0 ? 0 : scaleFrames[prevIndex].time;
float nextTick = nextIndex == scaleFrames.size() ? model->animLen : scaleFrames[nextIndex].time;
float prevTick = (float)(prevIndex < 0 ? 0 : scaleFrames[prevIndex].time); //TODO: this part is repeated for rot,scale,pos... dedupe code
float nextTick = (float)(nextIndex == scaleFrames.size() ? model->animLen : scaleFrames[nextIndex].time);
glm::vec3 prev = prevIndex < 0 ? glm::vec3(1) : scaleFrames[prevIndex].scale;
glm::vec3 next = nextIndex == scaleFrames.size() ? scaleFrames[nextIndex - 1].scale : scaleFrames[nextIndex].scale;

Expand All @@ -619,8 +619,8 @@ void Rsm::Mesh::calcMatrix1(int time)
prevIndex++;
}

float prevTick = prevIndex < 0 ? 0 : rotFrames[prevIndex].time;
float nextTick = nextIndex == rotFrames.size() ? model->animLen : rotFrames[nextIndex].time;
float prevTick = (float)(prevIndex < 0 ? 0 : rotFrames[prevIndex].time);
float nextTick = (float)(nextIndex == rotFrames.size() ? model->animLen : rotFrames[nextIndex].time);
glm::quat prev = prevIndex < 0 ? glm::quat() : rotFrames[prevIndex].quaternion;
glm::quat next = nextIndex == rotFrames.size() ? rotFrames[nextIndex - 1].quaternion : rotFrames[nextIndex].quaternion;

Expand Down Expand Up @@ -655,8 +655,8 @@ void Rsm::Mesh::calcMatrix1(int time)
prevIndex++;
}

float prevTick = prevIndex < 0 ? 0 : posFrames[prevIndex].time;
float nextTick = nextIndex == posFrames.size() ? model->animLen : posFrames[nextIndex].time;
float prevTick = (float)(prevIndex < 0 ? 0 : posFrames[prevIndex].time);
float nextTick = (float)(nextIndex == posFrames.size() ? model->animLen : posFrames[nextIndex].time);
glm::vec3 prev = prevIndex < 0 ? pos_ : posFrames[prevIndex].position;
glm::vec3 next = nextIndex == posFrames.size() ? posFrames[nextIndex - 1].position : posFrames[nextIndex].position;

Expand Down Expand Up @@ -798,7 +798,7 @@ void Rsm::Mesh::save(std::ostream* pFile)
pFile->write(t->parentName.c_str(), len);
pFile->write(zeroes, 40 - len);
// Texture ID count
int textureCount = t->textures.size();
auto textureCount = t->textures.size();
pFile->write((char*)&textureCount, 4);
// Texture ID
for (int i = 0; i < textureCount; i++) {
Expand All @@ -823,15 +823,15 @@ void Rsm::Mesh::save(std::ostream* pFile)
pFile->write((char*)&t->scale, sizeof(float) * 3);

// Vertices
int vertexCount = t->vertices.size();
auto vertexCount = t->vertices.size();
pFile->write((char*)&vertexCount, sizeof(int));

for (int i = 0; i < vertexCount; i++) {
pFile->write((char*)&t->vertices[i], sizeof(float) * 3);
}

// Texture Coordinates
int texCoordCount = t->texCoords.size();
auto texCoordCount = t->texCoords.size();
pFile->write((char*)&texCoordCount, sizeof(int));
for (int i = 0; i < texCoordCount; i++)
{
Expand All @@ -840,7 +840,7 @@ void Rsm::Mesh::save(std::ostream* pFile)
}

// Faces
int faceCount = t->faces.size();
auto faceCount = t->faces.size();
pFile->write((char*)&faceCount, sizeof(int));
for (int i = 0; i < faceCount; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion browedit/components/Rsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class Rsm : public Component



VERSIONLIMIT(0x0104, 0xFFFF, char, alpha);
VERSIONLIMIT(0x0104, 0xFFFF, unsigned char, alpha);
int animLen;
std::vector<std::string> textures;

Expand Down

0 comments on commit 8b08e52

Please sign in to comment.