mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Handle uint vs ulong for 3ds target
This commit is contained in:
parent
f1abdfe2d1
commit
d34e8779ad
@ -95,15 +95,24 @@ inline Tgl::Result MeshDeepClone(MeshImpl::MeshData* pSource, MeshImpl::MeshData
|
||||
|
||||
// Query information from old group
|
||||
DWORD dataSize;
|
||||
#if defined(__3DS__)
|
||||
unsigned long vcount, fcount, vperface;
|
||||
#else
|
||||
unsigned int vcount, fcount, vperface;
|
||||
#endif
|
||||
|
||||
Tgl::Result result =
|
||||
ResultVal(pSource->groupMesh->GetGroup(pSource->groupIndex, (long unsigned int*)&vcount, (long unsigned int*)&fcount, (long unsigned int*)&vperface, &dataSize, NULL));
|
||||
ResultVal(pSource->groupMesh->GetGroup(pSource->groupIndex, &vcount, &fcount, &vperface, &dataSize, NULL));
|
||||
assert(Succeeded(result));
|
||||
|
||||
|
||||
#if defined(__3DS__)
|
||||
unsigned long* faceBuffer = new unsigned long[dataSize];
|
||||
#else
|
||||
unsigned int* faceBuffer = new unsigned int[dataSize];
|
||||
#endif
|
||||
result =
|
||||
ResultVal(pSource->groupMesh->GetGroup(pSource->groupIndex, (long unsigned int*)&vcount, (long unsigned int*)&fcount, (long unsigned int*)&vperface, &dataSize, (long unsigned int*)&faceBuffer)
|
||||
ResultVal(pSource->groupMesh->GetGroup(pSource->groupIndex, &vcount, &fcount, &vperface, &dataSize, faceBuffer)
|
||||
);
|
||||
assert(Succeeded(result));
|
||||
|
||||
@ -122,7 +131,7 @@ inline Tgl::Result MeshDeepClone(MeshImpl::MeshData* pSource, MeshImpl::MeshData
|
||||
|
||||
// Push information to new group
|
||||
D3DRMGROUPINDEX index;
|
||||
result = ResultVal(pMesh->AddGroup(vcount, fcount, 3, (long unsigned int*)&faceBuffer, &index));
|
||||
result = ResultVal(pMesh->AddGroup(vcount, fcount, 3, faceBuffer, &index));
|
||||
assert(Succeeded(result));
|
||||
|
||||
rpTarget->groupIndex = index;
|
||||
|
||||
@ -63,7 +63,11 @@ inline Tgl::Result CreateMesh(
|
||||
int count = faceCount * 3;
|
||||
int index = 0;
|
||||
|
||||
#if defined(__3DS__)
|
||||
unsigned long* fData = new unsigned long[count];
|
||||
#else
|
||||
unsigned int* fData = new unsigned int[count];
|
||||
#endif
|
||||
|
||||
D3DRMVERTEX* vertices = new D3DRMVERTEX[vertexCount];
|
||||
memset(vertices, 0, sizeof(*vertices) * vertexCount);
|
||||
@ -97,7 +101,7 @@ inline Tgl::Result CreateMesh(
|
||||
}
|
||||
|
||||
Tgl::Result result;
|
||||
result = ResultVal(pD3DRM->AddGroup(vertexCount, faceCount, 3, (long unsigned int*)fData, &groupIndex));
|
||||
result = ResultVal(pD3DRM->AddGroup(vertexCount, faceCount, 3, fData, &groupIndex));
|
||||
|
||||
if (Succeeded(result)) {
|
||||
rpMesh->groupIndex = groupIndex;
|
||||
|
||||
@ -517,7 +517,7 @@ SDL3MeshCache Direct3DRMSDL3GPURenderer::UploadMesh(const MeshGroup& meshGroup)
|
||||
FlattenSurfaces(
|
||||
meshGroup.vertices.data(),
|
||||
meshGroup.vertices.size(),
|
||||
meshGroup.indices.data(),
|
||||
(const DWORD*)meshGroup.indices.data(),
|
||||
meshGroup.indices.size(),
|
||||
meshGroup.texture != nullptr,
|
||||
finalVertices,
|
||||
|
||||
@ -600,7 +600,7 @@ MeshCache UploadMesh(const MeshGroup& meshGroup)
|
||||
FlattenSurfaces(
|
||||
meshGroup.vertices.data(),
|
||||
meshGroup.vertices.size(),
|
||||
meshGroup.indices.data(),
|
||||
(const DWORD*) meshGroup.indices.data(),
|
||||
meshGroup.indices.size(),
|
||||
meshGroup.texture != nullptr,
|
||||
cache.vertices,
|
||||
|
||||
@ -13,7 +13,7 @@ struct MeshGroup {
|
||||
int vertexPerFace = 0;
|
||||
int version = 0;
|
||||
std::vector<D3DRMVERTEX> vertices;
|
||||
std::vector<DWORD> indices;
|
||||
std::vector<unsigned int> indices;
|
||||
|
||||
MeshGroup() = default;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user