mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
larp renderer
This commit is contained in:
parent
c391d290ec
commit
a8846c9f46
|
|
@ -174,6 +174,15 @@ void C4JRender::DrawVertices(ePrimitiveType PrimitiveType, int count,
|
||||||
{
|
{
|
||||||
if (count <= 0 || !dataIn) return;
|
if (count <= 0 || !dataIn) return;
|
||||||
|
|
||||||
|
static int _dbgDVCount = 0;
|
||||||
|
_dbgDVCount++;
|
||||||
|
if (_dbgDVCount <= 10 || (_dbgDVCount % 5000 == 0)) {
|
||||||
|
GLenum err = ::glGetError();
|
||||||
|
fprintf(stderr, "[RENDER] DrawVertices call=%d count=%d prim=%d vType=%d displayList=%d glErr=%d\n",
|
||||||
|
_dbgDVCount, count, (int)PrimitiveType, (int)vType, isCompilingDisplayList(), err);
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
GLenum mode = mapPrimType((int)PrimitiveType);
|
GLenum mode = mapPrimType((int)PrimitiveType);
|
||||||
unsigned char *data = (unsigned char *)dataIn;
|
unsigned char *data = (unsigned char *)dataIn;
|
||||||
|
|
||||||
|
|
@ -245,6 +254,13 @@ void C4JRender::CBuffEnd()
|
||||||
bool C4JRender::CBuffCall(int index, bool /*full*/)
|
bool C4JRender::CBuffCall(int index, bool /*full*/)
|
||||||
{
|
{
|
||||||
if (index <= 0) return false;
|
if (index <= 0) return false;
|
||||||
|
static int _dbgCBCount = 0;
|
||||||
|
_dbgCBCount++;
|
||||||
|
if (_dbgCBCount <= 5 || (_dbgCBCount % 5000 == 0)) {
|
||||||
|
fprintf(stderr, "[RENDER] CBuffCall call=%d index=%d isList=%d\n",
|
||||||
|
_dbgCBCount, index, ::glIsList(index));
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
if (::glIsList(index)) { ::glCallList(index); return true; }
|
if (::glIsList(index)) { ::glCallList(index); return true; }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -995,6 +995,13 @@ int GameRenderer::getLightTexture(int iPad, Level *level)
|
||||||
|
|
||||||
void GameRenderer::render(float a, bool bFirst)
|
void GameRenderer::render(float a, bool bFirst)
|
||||||
{
|
{
|
||||||
|
static int _dbgRenderCount = 0;
|
||||||
|
_dbgRenderCount++;
|
||||||
|
if (_dbgRenderCount <= 5 || (_dbgRenderCount % 300 == 0)) {
|
||||||
|
fprintf(stderr, "[RENDER] GameRenderer::render frame=%d level=%p screen=%p width=%d height=%d\n",
|
||||||
|
_dbgRenderCount, (void*)mc->level, (void*)mc->screen, mc->width, mc->height);
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
if( _updateLightTexture && bFirst) updateLightTexture(a);
|
if( _updateLightTexture && bFirst) updateLightTexture(a);
|
||||||
if (Display::isActive())
|
if (Display::isActive())
|
||||||
{
|
{
|
||||||
|
|
@ -1254,6 +1261,17 @@ void GameRenderer::DisableUpdateThread()
|
||||||
|
|
||||||
void GameRenderer::renderLevel(float a, __int64 until)
|
void GameRenderer::renderLevel(float a, __int64 until)
|
||||||
{
|
{
|
||||||
|
static int _dbgRLCount = 0;
|
||||||
|
_dbgRLCount++;
|
||||||
|
if (_dbgRLCount <= 3 || (_dbgRLCount % 300 == 0)) {
|
||||||
|
fprintf(stderr, "[RENDER] renderLevel frame=%d player=%p levelRenderer=%p\n",
|
||||||
|
_dbgRLCount, (void*)mc->player.get(), (void*)mc->levelRenderer);
|
||||||
|
if (mc->player) {
|
||||||
|
fprintf(stderr, "[RENDER] playerPos=(%.1f, %.1f, %.1f)\n",
|
||||||
|
mc->player->x, mc->player->y, mc->player->z);
|
||||||
|
}
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
// if (updateLightTexture) updateLightTexture(); // 4J - TODO - Java 1.0.1 has this line enabled, should check why - don't want to put it in now in case it breaks split-screen
|
// if (updateLightTexture) updateLightTexture(); // 4J - TODO - Java 1.0.1 has this line enabled, should check why - don't want to put it in now in case it breaks split-screen
|
||||||
|
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue