Ver código fonte

core: fix a bad format string and disable an annoying warning in Array<>.

legacy
Sam Hocevar sam 12 anos atrás
pai
commit
5b57aa50fe
2 arquivos alterados com 7 adições e 3 exclusões
  1. +6
    -2
      src/array.h
  2. +1
    -1
      src/gpu/vertexbuffer.cpp

+ 6
- 2
src/array.h Ver arquivo

@@ -191,8 +191,12 @@ public:
if (toreserve <= (int)m_reserved)
return;

Element *tmp = reinterpret_cast<Element *>
(new uint8_t [sizeof(Element) * toreserve]);
/* This cast is not very nice, because we kill any alignment
* information we could have. But until C++ gives us the proper
* tools to deal with it, we assume new uint8_t[] returns properly
* aligned data. */
Element *tmp = reinterpret_cast<Element *>(reinterpret_cast<uintptr_t>
(new uint8_t[sizeof(Element) * toreserve]));
for (int i = 0; i < m_count; i++)
{
new(&tmp[i]) Element(m_data[i]);


+ 1
- 1
src/gpu/vertexbuffer.cpp Ver arquivo

@@ -435,7 +435,7 @@ void VertexDeclaration::SetStream(VertexBuffer *vb, ShaderAttrib attr1,
stride, (GLvoid const *)(uintptr_t)offset);
break;
default:
Log::Error("vertex usage %d is not supported yet\n");
Log::Error("vertex usage %d is not supported yet\n", usage);
break;
}
# endif


Carregando…
Cancelar
Salvar