Skip to content

Commit

Permalink
xrRenderPC_RC1\FStaticRender_Loader.cpp: Moved vertex buffer_size dec…
Browse files Browse the repository at this point in the history
…laration outside of loop
  • Loading branch information
revolucas committed Sep 10, 2016
1 parent 32005e8 commit 266f6bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,16 @@ void CRender::LoadBuffers (CStreamReader *base_fs)
u32 count = fs->r_u32();
DCL.resize (count);
VB.resize (count);

u32 buffer_size = (MAXD3DDECLLENGTH+1)*sizeof(D3DVERTEXELEMENT9);
D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size);

for (u32 i=0; i<count; i++)
{
// decl

// D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*) fs->pointer();
u32 buffer_size = (MAXD3DDECLLENGTH+1)*sizeof(D3DVERTEXELEMENT9);
D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size);

fs->r (dcl,buffer_size);
fs->advance (-(int)buffer_size);

Expand Down

0 comments on commit 266f6bb

Please sign in to comment.