Przeglądaj źródła

Minor compilation warning fixes.

legacy
Sam Hocevar 4 lat temu
rodzic
commit
a1e258656e
2 zmienionych plików z 4 dodań i 4 usunięć
  1. +2
    -2
      src/easymesh/csgbsp.cpp
  2. +2
    -2
      src/image/codec/zed-image.cpp

+ 2
- 2
src/easymesh/csgbsp.cpp Wyświetl plik

@@ -19,7 +19,7 @@ namespace lol
//--
int CsgBsp::AddLeaf(int leaf_type, vec3 origin, vec3 normal, int above_idx)
{
if (leaf_type > 2 && leaf_type < -1)
if (leaf_type > 2 || leaf_type < -1)
return -1;

if ((m_tree.count() == 0 && above_idx == -1) ||
@@ -104,7 +104,7 @@ void CsgBsp::AddTriangleToTree(int const &tri_idx, vec3 const &tri_p0, vec3 cons

for (int i = 0; i < 3; i++)
{
vec3 ray = v[(i + 1) % 3] - v[i];
//vec3 ray = v[(i + 1) % 3] - v[i];

if (TestRayVsPlane(v[i], v[(i + 1) % 3],
m_tree[leaf_idx].m_origin, m_tree[leaf_idx].m_normal,


+ 2
- 2
src/image/codec/zed-image.cpp Wyświetl plik

@@ -121,7 +121,7 @@ ResourceCodecData* ZedImageCodec::Load(std::string const &path)
//Get FileCount
uint32_t file_pos = 0;
uint16_t file_count = 0;
file_count = *((uint16_t*)(&file_buffer[file_pos]));
memcpy(&file_count, &file_buffer[file_pos], sizeof(uint16_t));
file_pos += sizeof(uint16_t);

array<uint32_t> file_offset;
@@ -129,7 +129,7 @@ ResourceCodecData* ZedImageCodec::Load(std::string const &path)
//Get all the file offsets
for (int i = 0; i < file_count; i++)
{
file_offset[i] = *((uint32_t*)(&file_buffer[file_pos]));
memcpy(&file_offset[i], &file_buffer[file_pos], sizeof(uint32_t));
file_pos += sizeof(uint32_t);
}
file_offset << file_size;


Ładowanie…
Anuluj
Zapisz