mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 16:52:45 +03:00
chore(gx): move GxDrawLockedElements from gx/Buffer into gx/Draw
This commit is contained in:
parent
d99c685dd1
commit
18b9ed493a
@ -433,25 +433,6 @@ void GxPrimLockVertexPtrs(uint32_t vertexCount, const C3Vector* pos, uint32_t po
|
||||
GxPrimVertexPtr(vertexCount, pos, posStride, normal, normalStride, color, colorStride, tex0, tex0Stride, tex1, tex1Stride);
|
||||
}
|
||||
|
||||
void GxDrawLockedElements(EGxPrim primType, uint32_t indexCount, const uint16_t* indices) {
|
||||
if (Buffer::s_lockVertexCount == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
GxPrimIndexPtr(indexCount, indices);
|
||||
|
||||
CGxBatch batch;
|
||||
batch.m_primType = primType;
|
||||
batch.m_minIndex = 0;
|
||||
batch.m_maxIndex = Buffer::s_lockVertexCount - 1;
|
||||
batch.m_start = 0;
|
||||
batch.m_count = indexCount;
|
||||
|
||||
BLIZZARD_ASSERT(batch.m_count > 0);
|
||||
|
||||
g_theGxDevicePtr->Draw(&batch, 1);
|
||||
}
|
||||
|
||||
void GxPrimUnlockVertexPtrs() {
|
||||
Buffer::s_lockVertexCount = 0;
|
||||
}
|
||||
|
||||
@ -45,8 +45,6 @@ void GxPrimVertexPtr(uint32_t vertexCount, const C3Vector* pos, uint32_t posStri
|
||||
|
||||
void GxPrimLockVertexPtrs(uint32_t vertexCount, const C3Vector* pos, uint32_t posStride, const C3Vector* normal, uint32_t normalStride, const CImVector* color, uint32_t colorStride, const unsigned char* bone, uint32_t boneStride, const C2Vector* tex0, uint32_t tex0Stride, const C2Vector* tex1, uint32_t tex1Stride);
|
||||
|
||||
void GxDrawLockedElements(EGxPrim primType, uint32_t indexCount, const uint16_t* indices);
|
||||
|
||||
void GxPrimUnlockVertexPtrs();
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,10 +1,30 @@
|
||||
#include "gx/Draw.hpp"
|
||||
#include "gx/Device.hpp"
|
||||
#include <bc/Debug.hpp>
|
||||
|
||||
void GxDraw(CGxBatch* batch, int32_t indexed) {
|
||||
g_theGxDevicePtr->Draw(batch, indexed);
|
||||
}
|
||||
|
||||
void GxDrawLockedElements(EGxPrim primType, uint32_t indexCount, const uint16_t* indices) {
|
||||
if (Buffer::s_lockVertexCount == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
GxPrimIndexPtr(indexCount, indices);
|
||||
|
||||
CGxBatch batch;
|
||||
batch.m_primType = primType;
|
||||
batch.m_minIndex = 0;
|
||||
batch.m_maxIndex = Buffer::s_lockVertexCount - 1;
|
||||
batch.m_start = 0;
|
||||
batch.m_count = indexCount;
|
||||
|
||||
BLIZZARD_ASSERT(batch.m_count > 0);
|
||||
|
||||
g_theGxDevicePtr->Draw(&batch, 1);
|
||||
}
|
||||
|
||||
void GxSceneClear(uint32_t mask, CImVector color) {
|
||||
g_theGxDevicePtr->SceneClear(mask, color);
|
||||
}
|
||||
|
||||
@ -10,6 +10,8 @@ class CImVector;
|
||||
|
||||
void GxDraw(CGxBatch* batch, int32_t indexed);
|
||||
|
||||
void GxDrawLockedElements(EGxPrim primType, uint32_t indexCount, const uint16_t* indices);
|
||||
|
||||
void GxSceneClear(uint32_t, CImVector);
|
||||
|
||||
void GxScenePresent(uint32_t a2);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user