Skip to content

Commit 266f6bb

Browse files
committed
xrRenderPC_RC1\FStaticRender_Loader.cpp: Moved vertex buffer_size declaration outside of loop
1 parent 32005e8 commit 266f6bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,16 @@ void CRender::LoadBuffers (CStreamReader *base_fs)
177177
u32 count = fs->r_u32();
178178
DCL.resize (count);
179179
VB.resize (count);
180+
181+
u32 buffer_size = (MAXD3DDECLLENGTH+1)*sizeof(D3DVERTEXELEMENT9);
182+
D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size);
183+
180184
for (u32 i=0; i<count; i++)
181185
{
182186
// decl
183187

184188
// D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*) fs->pointer();
185-
u32 buffer_size = (MAXD3DDECLLENGTH+1)*sizeof(D3DVERTEXELEMENT9);
186-
D3DVERTEXELEMENT9 *dcl = (D3DVERTEXELEMENT9*)_alloca(buffer_size);
189+
187190
fs->r (dcl,buffer_size);
188191
fs->advance (-(int)buffer_size);
189192

0 commit comments

Comments
 (0)