//===========================================================================// // Copyright (C) Microsoft Corporation. All rights reserved. // //===========================================================================// #if !defined(MLR_MLRCLIPTRICK_HPP) #include #endif extern DWORD gEnableTextureSort, gShowClippedPolys; extern unsigned short *indexOffset; // [MidLevelRenderer::Max_Number_Vertices_Per_Mesh] #define HUNT_CLIP_ERROR 0 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void CLASSNAME::TransformNoClip(Matrix4D *mat, GOSVertexPool *vt,bool db) { Check_Object(this); Check_Object(vt); Start_Timer(Transform_Time); Verify(index.GetLength() > 0); unsigned short stride; bool textureAnimation = false; Scalar deltaU=0.0f, deltaV=0.0f; if(state.GetTextureHandle()) { MLRTexture *texture = (*MLRTexturePool::Instance)[state.GetTextureHandle()]; textureAnimation = texture->GetAnimateTexture(); if(textureAnimation) { Stuff::AffineMatrix4D &textureMatrix = texture->GetTextureMatrix(); deltaU = textureMatrix(3, 0); deltaV = textureMatrix(3, 1); } } int i, j, k, len = lengths.GetLength(); #ifdef I_SAY_YES_TO_DUAL_TEXTURES int tex2count = 0; #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES int m; // gos_PushCurrentHeap(StaticHeap); // static DynamicArrayOf *tex2count = new DynamicArrayOf(Limits::Max_Number_Of_Multitextures); int tex2count[Limits::Max_Number_Of_Multitextures]; // SPEW(("micgaert", "Michael!!! The new() on line 42 can cause memory leaks!")); // gos_PopCurrentHeap(); for(m=0;mGetActualVertexPool(db); numGOSVertices = 0; Verify(index.GetLength() > 0); Verify(coords.GetLength() == visibleIndexedVertices.GetLength()); if(visibleIndexedVerticesKey == false) { FindVisibleVertices(); } for(j=0,stride=0;jGetLast() + numGOSVertices < Limits::Max_Number_Vertices_Per_Frame); } else { Verify (numGOSVertices < 2*Limits::Max_Number_Vertices_Per_Mesh); } indexOffset[j] = (unsigned short)(j - stride); gos_vertices[numGOSVertices].GOSTransformNoClip( coords[j], *mat, &texCoords[j][0] #if FOG_HACK , (state.GetFogMode() != 0) #endif ); // gos_vertices[numGOSVertices].u = texCoords[j][0]; // gos_vertices[numGOSVertices].v = texCoords[j][1]; #ifdef I_SAY_YES_TO_COLOR #ifdef I_SAY_YES_TO_LIGHTING #if COLOR_AS_DWORD gos_vertices[numGOSVertices].argb = (*actualColors)[j]; #else gos_vertices[numGOSVertices].argb = GOSCopyColor(&(*actualColors)[j]); #endif #else #if COLOR_AS_DWORD gos_vertices[numGOSVertices].argb = colors[j]; #else gos_vertices[numGOSVertices].argb = GOSCopyColor(&colors[j]); #endif #endif #else gos_vertices[numGOSVertices].argb = 0xffffffff; #endif if(textureAnimation) { gos_vertices[numGOSVertices].u += deltaU; gos_vertices[numGOSVertices].v += deltaV; } #ifdef I_SAY_YES_TO_DUAL_TEXTURES (*texCoords2)[tex2count++] = texCoords[numVertices + j]; #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=1;mGetLast() + 2*numGOSVertices < vt->GetLength()); } else { Verify (2*numGOSVertices < 2*Limits::Max_Number_Vertices_Per_Mesh); } if(state2.GetTextureHandle()) { MLRTexture *texture = (*MLRTexturePool::Instance)[state.GetTextureHandle()]; textureAnimation = texture->GetAnimateTexture(); if(textureAnimation) { Stuff::AffineMatrix4D &textureMatrix = texture->GetTextureMatrix(); deltaU = textureMatrix(3, 0); deltaV = textureMatrix(3, 1); } } memcpy(gos_vertices + numGOSVertices, gos_vertices, numGOSVertices * sizeof(GOSVertex)); if(textureAnimation) { for(i=0,j=numGOSVertices;iIncrease(2*numGOSVertices); } #else #ifdef I_SAY_YES_TO_DETAIL_TEXTURES if(db==false) { Verify (vt->GetLast() + 2*numGOSVertices < vt->GetLength()); } else { Verify (2*numGOSVertices < 2*Limits::Max_Number_Vertices_Per_Mesh); } memcpy(gos_vertices + numGOSVertices, gos_vertices, numGOSVertices * sizeof(GOSVertex)); for(i=0,j=numGOSVertices;iIncrease(2*numGOSVertices); } #else if(db==false) { vt->Increase(numGOSVertices); } #endif #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=1;mGetLast() + numGOSVertices < vt->GetLength()); } else { Verify (numGOSVertices < 2*Limits::Max_Number_Vertices_Per_Mesh); } memcpy(gos_vertices + numGOSVertices, gos_vertices, numGOSVertices * sizeof(GOSVertex)); for(i=0,j=numGOSVertices;iIncrease(numGOSVertices); } } #endif gos_indices = vt->GetActualIndexPool(db); numGOSIndices = 0; int ngi = 0; for(i=0,j=0;i= 3); if(testList[i] == 0) { continue; } for(k=1;kGetLastIndex() + 3 + numGOSIndices) < vt->GetLength()); } else { Verify(3 + numGOSIndices < 2*Limits::Max_Number_Vertices_Per_Mesh); } gos_indices[ngi++] = indexOffset[index[j]]; gos_indices[ngi++] = indexOffset[index[j+1+k]]; gos_indices[ngi++] = indexOffset[index[j+k]]; } } numGOSIndices = (unsigned short)ngi; Check_Object(vt); if(db==false) { vt->IncreaseIndex(numGOSIndices); } Stop_Timer(Transform_Time); visible = numGOSVertices ? (unsigned char)1 : (unsigned char)0; } static MLRClippingState theAnd, theOr, theTest; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Now it gets serious int CLASSNAME::TransformAndClip(Matrix4D *mat, MLRClippingState clippingFlags, GOSVertexPool *vt, bool db) { Transform(mat); Start_Timer(Clipping_Time); Check_Object(this); unsigned short l, stride; int i, j, k, ret = 0; int len = lengths.GetLength(); Verify(len == testList.GetLength()); Verify(clippingFlags.GetClippingState() != 0); // //-------------------------------------- // See if we don't have to draw anything //-------------------------------------- // if(len <= 0) { visible = 0; Stop_Timer(Clipping_Time); return visible; } int mask, end, k0, k1, ct=0; Scalar a=0.0f; // Scalar bc0=0.0f, bc1=0.0f; bool textureAnimation = false; Scalar deltaU=0.0f, deltaV=0.0f; if(state.GetTextureHandle()) { MLRTexture *texture = (*MLRTexturePool::Instance)[state.GetTextureHandle()]; textureAnimation = texture->GetAnimateTexture(); if(textureAnimation) { Stuff::AffineMatrix4D &textureMatrix = texture->GetTextureMatrix(); deltaU = textureMatrix(3, 0); deltaV = textureMatrix(3, 1); } } #ifdef I_SAY_YES_TO_DUAL_TEXTURES bool textureAnimation2 = false; Scalar deltaU2=0.0f, deltaV2=0.0f; if(state2.GetTextureHandle()) { MLRTexture *texture = (*MLRTexturePool::Instance)[state.GetTextureHandle()]; textureAnimation2 = texture->GetAnimateTexture(); if(textureAnimation2) { Stuff::AffineMatrix4D &textureMatrix = texture->GetTextureMatrix(); deltaU2 = textureMatrix(3, 0); deltaV2 = textureMatrix(3, 1); } } #endif #ifdef I_SAY_YES_TO_DUAL_TEXTURES int tex2count = 0; int numVertices = GetNumVertices(); #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES int m; gos_PushCurrentHeap(StaticHeap); static DynamicArrayOf *tex2count = new DynamicArrayOf(Limits::Max_Number_Of_Multitextures); SPEW(("micgaert", "Michael!!! The new() on line 316 can cause memory leaks!")); gos_PopCurrentHeap(); for(m=0;m 0); if(visibleIndexedVerticesKey == false) { FindVisibleVertices(); } // //------------------------ // Handle the indexed case //------------------------ // // initialize visibleIndexedVertices memset(visibleIndexedVertices.GetData(), 0, visibleIndexedVertices.GetSize()); // //----------------------------------------------------------------- // Step through each polygon, making sure that we don't try to clip // backfaced polygons //----------------------------------------------------------------- // for(i=0,j=0;i 0); (*clipExtraColors)[clipped_index] = (*actualColors)[k0]; #else Verify(colors.GetLength() > 0); (*clipExtraColors)[clipped_index] = colors[k0]; #endif #endif Verify(texCoords.GetLength() > 0); (*clipExtraTexCoords)[clipped_index] = texCoords[k0]; #ifdef I_SAY_YES_TO_DUAL_TEXTURES (*clipExtraTexCoords2)[clipped_index] = texCoords[k0+numVertices]; #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=1;m= 0.0f && a <= 1.0f); ct = l; break; } mask <<= 1; } // //------------------------------ // Lerp the homogeneous position //------------------------------ // if(firstIsIn==true) { (*clipExtraCoords)[clipped_index].Lerp( (*transformedCoords)[k0], (*transformedCoords)[k1], a ); DoClipTrick((*clipExtraCoords)[clipped_index], ct); // //---------------------------------------------------------- // If there are colors, lerp them in screen space for now as // most cards do that anyway //---------------------------------------------------------- // #ifdef I_SAY_YES_TO_COLOR #ifdef I_SAY_YES_TO_LIGHTING Verify((*actualColors).GetLength() > 0); #if COLOR_AS_DWORD (*clipExtraColors)[clipped_index] = Color_DWORD_Lerp ( (*actualColors)[k0], (*actualColors)[k1], a ); #else (*clipExtraColors)[clipped_index].Lerp( (*actualColors)[k0], (*actualColors)[k1], a ); #endif #else Verify(colors.GetLength() > 0); #if COLOR_AS_DWORD (*clipExtraColors)[clipped_index] = Color_DWORD_Lerp ( colors[k0], colors[k1], a ); #else (*clipExtraColors)[clipped_index].Lerp( colors[k0], colors[k1], a ); #endif #endif #endif // //----------------------------------------------------- // If there are texture uv's, we need to lerp them in a // perspective correct manner //----------------------------------------------------- // Verify(texCoords.GetLength() > 0); (*clipExtraTexCoords)[clipped_index].Lerp ( texCoords[k0], texCoords[k1], a ); #ifdef I_SAY_YES_TO_DUAL_TEXTURES (*clipExtraTexCoords2)[clipped_index].Lerp ( texCoords[k0+numVertices], texCoords[k1+numVertices], a ); #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=1;m 0); #if COLOR_AS_DWORD (*clipExtraColors)[clipped_index] = Color_DWORD_Lerp ( (*actualColors)[k1], (*actualColors)[k0], a ); #else (*clipExtraColors)[clipped_index].Lerp( (*actualColors)[k1], (*actualColors)[k0], a ); #endif #else Verify(colors.GetLength() > 0); #if COLOR_AS_DWORD (*clipExtraColors)[clipped_index] = Color_DWORD_Lerp ( colors[k1], colors[k0], a ); #else (*clipExtraColors)[clipped_index].Lerp( colors[k1], colors[k0], a ); #endif #endif #endif // //----------------------------------------------------- // If there are texture uv's, we need to lerp them in a // perspective correct manner //----------------------------------------------------- // Verify(texCoords.GetLength() > 0); (*clipExtraTexCoords)[clipped_index].Lerp ( texCoords[k1], texCoords[k0], a ); #ifdef I_SAY_YES_TO_DUAL_TEXTURES (*clipExtraTexCoords2)[clipped_index].Lerp ( texCoords[k1+numVertices], texCoords[k0+numVertices], a ); #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=1;m 0); srcPolygon.coords = clipBuffer[dstBuffer].coords.GetData(); #ifdef I_SAY_YES_TO_COLOR #ifdef I_SAY_YES_TO_LIGHTING Verify((*actualColors).GetLength() > 0); #else Verify(colors.GetLength() > 0); #endif srcPolygon.colors = clipBuffer[dstBuffer].colors.GetData(); #endif srcPolygon.texCoords = clipBuffer[dstBuffer].texCoords.GetData(); srcPolygon.clipPerVertex = clipBuffer[dstBuffer].clipPerVertex.GetData(); // //---------------------------------------------------------- // unravel and copy the original data into the source buffer //---------------------------------------------------------- // for(k=j,l=0;k= 0.0f && a <= 1.0f); // //------------------------------ // Lerp the homogeneous position //------------------------------ // dstPolygon.coords[dstPolygon.length].Lerp( srcPolygon.coords[k], srcPolygon.coords[k1], a ); #if HUNT_CLIP_ERROR DEBUG_STREAM << "True " << a << " " << k << " " << k1 << " we get " << dstPolygon.length << '\n'; DEBUG_STREAM << setiosflags( ios::scientific) << setprecision(20) << dstPolygon.coords[dstPolygon.length].x << " " << dstPolygon.coords[dstPolygon.length].y << " " << dstPolygon.coords[dstPolygon.length].z << " " << dstPolygon.coords[dstPolygon.length].w << '\n'; #endif DoClipTrick(dstPolygon.coords[dstPolygon.length], l); // //---------------------------------------------------------- // If there are colors, lerp them in screen space for now as // most cards do that anyway //---------------------------------------------------------- // #ifdef I_SAY_YES_TO_COLOR #if COLOR_AS_DWORD dstPolygon.colors[dstPolygon.length] = Color_DWORD_Lerp( srcPolygon.colors[k], srcPolygon.colors[k1], a ); #else dstPolygon.colors[dstPolygon.length].Lerp( srcPolygon.colors[k], srcPolygon.colors[k1], a ); #endif #endif // //----------------------------------------------------- // If there are texture uv's, we need to lerp them in a // perspective correct manner //----------------------------------------------------- // #ifdef I_SAY_YES_TO_DUAL_TEXTURES dstPolygon.texCoords[2*dstPolygon.length].Lerp ( srcPolygon.texCoords[2*k], srcPolygon.texCoords[2*k1], a ); dstPolygon.texCoords[2*dstPolygon.length+1].Lerp ( srcPolygon.texCoords[2*k+1], srcPolygon.texCoords[2*k1+1], a ); #else #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=0;m= 0.0f && a <= 1.0f); // //------------------------------ // Lerp the homogeneous position //------------------------------ // dstPolygon.coords[dstPolygon.length].Lerp( srcPolygon.coords[k1], srcPolygon.coords[k], a ); #if HUNT_CLIP_ERROR DEBUG_STREAM << "False " << a << " " << k << " " << k1 << " we get " << dstPolygon.length << '\n'; DEBUG_STREAM << setiosflags( ios::scientific) << setprecision(20) << dstPolygon.coords[dstPolygon.length].x << " " << dstPolygon.coords[dstPolygon.length].y << " " << dstPolygon.coords[dstPolygon.length].z << " " << dstPolygon.coords[dstPolygon.length].w << '\n'; #endif DoClipTrick(dstPolygon.coords[dstPolygon.length], l); // //---------------------------------------------------------- // If there are colors, lerp them in screen space for now as // most cards do that anyway //---------------------------------------------------------- // #ifdef I_SAY_YES_TO_COLOR #if COLOR_AS_DWORD dstPolygon.colors[dstPolygon.length] = Color_DWORD_Lerp( srcPolygon.colors[k1], srcPolygon.colors[k], a ); #else dstPolygon.colors[dstPolygon.length].Lerp( srcPolygon.colors[k1], srcPolygon.colors[k], a ); #endif #endif // //----------------------------------------------------- // If there are texture uv's, we need to lerp them in a // perspective correct manner //----------------------------------------------------- // #ifdef I_SAY_YES_TO_DUAL_TEXTURES dstPolygon.texCoords[2*dstPolygon.length].Lerp ( srcPolygon.texCoords[2*k1], srcPolygon.texCoords[2*k], a ); dstPolygon.texCoords[2*dstPolygon.length+1].Lerp ( srcPolygon.texCoords[2*k1+1], srcPolygon.texCoords[2*k+1], a ); #else #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=0;mGetActualVertexPool(db); numGOSVertices = 0; gos_indices = vt->GetActualIndexPool(db); numGOSIndices = 0; k = visibleIndexedVertices.GetLength(); for(j=0,stride=0;jGetData(), #ifdef I_SAY_YES_TO_COLOR #ifdef I_SAY_YES_TO_LIGHTING actualColors->GetData(), #else colors.GetData(), #endif #endif texCoords.GetData(), j ); if(textureAnimation) { gos_vertices[numGOSVertices].u += deltaU; gos_vertices[numGOSVertices].v += deltaV; } #ifdef LAB_ONLY if(gShowClippedPolys) { gos_vertices[numGOSVertices].argb = 0xff0000ff; gos_vertices[numGOSVertices].u = 0.0f; gos_vertices[numGOSVertices].v = 0.0f; } #endif #ifdef I_SAY_YES_TO_DUAL_TEXTURES (*texCoords2)[tex2count++] = texCoords[numVertices + j]; #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=1;m= 3); if(testList[i] == 0) { j += stride; continue; } for(k=1;kGetLastIndex() + 3 + numGOSIndices) < vt->GetLength()); } else { Verify(3 + numGOSIndices < 2*Limits::Max_Number_Vertices_Per_Mesh); } gos_indices[numGOSIndices] = (unsigned short)(index[j] - indexOffset[index[j]]); gos_indices[numGOSIndices+1] = (unsigned short)(index[j+k+1] - indexOffset[index[j+k+1]]); gos_indices[numGOSIndices+2] = (unsigned short)(index[j+k] - indexOffset[index[j+k]]); numGOSIndices += 3; } j += stride; } if(myNumberUsedClipLength > 0) { for(i=0,j=0;i((*clipExtraLength)[i] & 0x7fff); #else stride = (*clipExtraLength)[i]; #endif #if 0 for(k=j;k -SMALL) { clipExtraCoords[k].x = 0.0f; } if(clipExtraCoords[k].y < 0.0f && clipExtraCoords[k].y > -SMALL) { clipExtraCoords[k].y = 0.0f; } if(clipExtraCoords[k].z < 0.0f && clipExtraCoords[k].z > -SMALL) { clipExtraCoords[k].z = 0.0f; } if(clipExtraCoords[k].x > clipExtraCoords[k].w && clipExtraCoords[k].x < clipExtraCoords[k].w + SMALL) { clipExtraCoords[k].x = clipExtraCoords[k].w; } if(clipExtraCoords[k].y > clipExtraCoords[k].w && clipExtraCoords[k].y < clipExtraCoords[k].w + SMALL) { clipExtraCoords[k].y = clipExtraCoords[k].w; } if(clipExtraCoords[k].z >= clipExtraCoords[k].w && clipExtraCoords[k].z < clipExtraCoords[k].w + SMALL) { clipExtraCoords[k].z = clipExtraCoords[k].w - SMALL; } } #endif for(k=1;kGetLast() + 3 + numGOSVertices) < vt->GetLength()); Verify((vt->GetLastIndex() + 3 + numGOSIndices) < vt->GetLength()); } else { Verify(3 + numGOSVertices < 2*Limits::Max_Number_Vertices_Per_Mesh); Verify(3 + numGOSIndices < 2*Limits::Max_Number_Vertices_Per_Mesh); } #if FOG_HACK int fogEntry = state.GetFogMode(); if(fogEntry) { fogEntry--; *((BYTE *)&gos_vertices[numGOSVertices].frgb + 3) = GOSVertex::fogTable[fogEntry][Truncate_Float_To_Word((*clipExtraCoords)[j].w)]; *((BYTE *)&gos_vertices[numGOSVertices+1].frgb + 3) = GOSVertex::fogTable[fogEntry][Truncate_Float_To_Word((*clipExtraCoords)[j+k+1].w)]; *((BYTE *)&gos_vertices[numGOSVertices+2].frgb + 3) = GOSVertex::fogTable[fogEntry][Truncate_Float_To_Word((*clipExtraCoords)[j+k].w)]; } else { *((BYTE *)&gos_vertices[numGOSVertices].frgb + 3) = 0xff; *((BYTE *)&gos_vertices[numGOSVertices+1].frgb + 3) = 0xff; *((BYTE *)&gos_vertices[numGOSVertices+2].frgb + 3) = 0xff; } #endif GOSCopyTriangleData( &gos_vertices[numGOSVertices], clipExtraCoords->GetData(), #ifdef I_SAY_YES_TO_COLOR clipExtraColors->GetData(), #endif clipExtraTexCoords->GetData(), j, j+k+1, j+k ); if(textureAnimation) { gos_vertices[numGOSVertices].u += deltaU; gos_vertices[numGOSVertices].v += deltaV; gos_vertices[numGOSVertices+1].u += deltaU; gos_vertices[numGOSVertices+1].v += deltaV; gos_vertices[numGOSVertices+2].u += deltaU; gos_vertices[numGOSVertices+2].v += deltaV; } #ifdef LAB_ONLY if(gShowClippedPolys) { if((*clipExtraLength)[i] & 0x8000) { gos_vertices[numGOSVertices].argb = 0xffff0000; gos_vertices[numGOSVertices].u = 0.0f; gos_vertices[numGOSVertices].v = 0.0f; gos_vertices[numGOSVertices+1].argb = 0xffff0000; gos_vertices[numGOSVertices+1].u = 0.0f; gos_vertices[numGOSVertices+1].v = 0.0f; gos_vertices[numGOSVertices+2].argb = 0xffff0000; gos_vertices[numGOSVertices+2].u = 0.0f; gos_vertices[numGOSVertices+2].v = 0.0f; } else { gos_vertices[numGOSVertices].argb = 0xffff9999; gos_vertices[numGOSVertices].u = 0.0f; gos_vertices[numGOSVertices].v = 0.0f; gos_vertices[numGOSVertices+1].argb = 0xffff9999; gos_vertices[numGOSVertices+1].u = 0.0f; gos_vertices[numGOSVertices+1].v = 0.0f; gos_vertices[numGOSVertices+2].argb = 0xffff9999; gos_vertices[numGOSVertices+2].u = 0.0f; gos_vertices[numGOSVertices+2].v = 0.0f; } } #endif #ifdef I_SAY_YES_TO_DUAL_TEXTURES (*texCoords2)[tex2count++] = (*clipExtraTexCoords2)[j]; (*texCoords2)[tex2count++] = (*clipExtraTexCoords2)[j+k+1]; (*texCoords2)[tex2count++] = (*clipExtraTexCoords2)[j+k]; #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=1;mGetLastIndex() + 3 + numGOSIndices) < vt->GetLength()); } else { Verify(3 + numGOSIndices < 2*Limits::Max_Number_Vertices_Per_Mesh); } Verify(numGOSIndices%3 == 0); gos_indices[numGOSIndices] = numGOSVertices; gos_indices[numGOSIndices+1] = (unsigned short)(numGOSVertices + 1); gos_indices[numGOSIndices+2] = (unsigned short)(numGOSVertices + 2); numGOSVertices += 3; numGOSIndices += 3; } j += stride; } #if HUNT_CLIP_ERROR DEBUG_STREAM << "***" << endl << endl; #endif } #ifdef I_SAY_YES_TO_DUAL_TEXTURES Verify (tex2count == numGOSVertices); if(db==false) { Verify (vt->GetLast() + 2*numGOSVertices < vt->GetLength()); } else { Verify (2*numGOSVertices < 2*Limits::Max_Number_Vertices_Per_Mesh); } memcpy(gos_vertices + numGOSVertices, gos_vertices, numGOSVertices * sizeof(GOSVertex)); if(textureAnimation2) { for(i=0,j=numGOSVertices;iIncrease(2*numGOSVertices); } #else #ifdef I_SAY_YES_TO_DETAIL_TEXTURES if(db==false) { Verify (vt->GetLast() + 2*numGOSVertices < vt->GetLength()); } else { Verify (2*numGOSVertices < 2*Limits::Max_Number_Vertices_Per_Mesh); } memcpy(gos_vertices + numGOSVertices, gos_vertices, numGOSVertices * sizeof(GOSVertex)); for(i=0,j=numGOSVertices;iIncrease(2*numGOSVertices); } #else if(db==false) { vt->Increase(numGOSVertices); } #endif #endif #ifdef I_SAY_YES_TO_MULTI_TEXTURES for(m=1;mGetLast() + numGOSVertices < vt->GetLength()); } else { Verify (numGOSVertices < 2*Limits::Max_Number_Vertices_Per_Mesh); } memcpy(gos_vertices + m*numGOSVertices, gos_vertices, numGOSVertices * sizeof(GOSVertex)); for(i=0,j=numGOSVertices;iIncrease(numGOSVertices); } } #endif if(db==false) { vt->IncreaseIndex(numGOSIndices); } visible = numGOSVertices ? (unsigned char)1 : (unsigned char)0; if(visible) { } else { } Stop_Timer(Clipping_Time); return ret; }