Como devo usar { e } neste código

Este código não funciona porque acredito que existe um erro no uso das chaves { e } em algum lugar. Qual deve ser o erro possivel?


código:




bool cSceneGen::RenderLightSources(FrustumCulling *pFrustum)
{

for (t=0; t<m_nNumLightObj; t++)
{
if (!pbInFrustum[t])
continue;
m_pDevice->SetTransform(D3DTS_WORLD, &m_pLightSources[t].Matrix);
if (m_pLightSources[t].pObj)
m_pLightSources[t].pObj->RenderPass(1);
}

m_pDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
m_pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);

return true;
}






"Todos já foram noobs um dia." - Provérbio chinês de Xuxu-Xaxa
English please
C/C++ compilers usually get confused when you mis-match braces { and }, and report the error only long after it is unavoidably apparent that something went wrong.

Check that the code before it doesn't have missing closing braces }. It typically helps if you get an editor that highlights brace matches.

Also, English and [code] tags help. Good luck!
Ops my bad. I was thinking much in code that I even forget about translate.




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bool cSceneGen::RenderLightSources(FrustumCulling *pFrustum)
{

for (t=0; t<m_nNumLightObj; t++)
{
if (!pbInFrustum[t])
continue;
m_pDevice->SetTransform(D3DTS_WORLD, &m_pLightSources[t].Matrix);
if (m_pLightSources[t].pObj)
m_pLightSources[t].pObj->RenderPass(1);
}

m_pDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
m_pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);

return true;
}







thx Bazzy and Duoas for the comments.

I guess that I must to use the correct braces in if statements. right? But I just don't know how looks that will to be.
Last edited on
As far as I can see, there is nothing wrong with what you posted.

Check that the code before it doesn't have missing closing braces }. It typically helps if you get an editor that highlights brace matches.
Topic archived. No new replies allowed.