; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.40219.01 TITLE E:\Private\Frank\Code\blu-flame.org\4kgfx\mesh.cpp .686P .XMM include listing.inc .model flat INCLUDELIB MSVCRT INCLUDELIB OLDNAMES PUBLIC ?glGenVertexArrays@@3P6GXHPAI@ZA ; glGenVertexArrays PUBLIC ?glBindVertexArray@@3P6GXI@ZA ; glBindVertexArray PUBLIC ?glGenBuffers@@3P6GXHPAI@ZA ; glGenBuffers PUBLIC ?glBindBuffer@@3P6GXII@ZA ; glBindBuffer PUBLIC ?glBufferData@@3P6GXI_JPBXI@ZA ; glBufferData PUBLIC ?glGetAttribLocation@@3P6GHIPBD@ZA ; glGetAttribLocation PUBLIC ?glEnableVertexAttribArray@@3P6GXI@ZA ; glEnableVertexAttribArray PUBLIC ?glVertexAttribPointer@@3P6GXIHIEHPBX@ZA ; glVertexAttribPointer PUBLIC ?glMapBuffer@@3P6GPAXII@ZA ; glMapBuffer PUBLIC ?glUnmapBuffer@@3P6GEI@ZA ; glUnmapBuffer _BSS SEGMENT ?glGenVertexArrays@@3P6GXHPAI@ZA DD 01H DUP (?) ; glGenVertexArrays ?glBindVertexArray@@3P6GXI@ZA DD 01H DUP (?) ; glBindVertexArray ?glGenBuffers@@3P6GXHPAI@ZA DD 01H DUP (?) ; glGenBuffers ?glBindBuffer@@3P6GXII@ZA DD 01H DUP (?) ; glBindBuffer ?glBufferData@@3P6GXI_JPBXI@ZA DD 01H DUP (?) ; glBufferData ?glGetAttribLocation@@3P6GHIPBD@ZA DD 01H DUP (?) ; glGetAttribLocation ?glEnableVertexAttribArray@@3P6GXI@ZA DD 01H DUP (?) ; glEnableVertexAttribArray ?glVertexAttribPointer@@3P6GXIHIEHPBX@ZA DD 01H DUP (?) ; glVertexAttribPointer ?glMapBuffer@@3P6GPAXII@ZA DD 01H DUP (?) ; glMapBuffer ?glUnmapBuffer@@3P6GEI@ZA DD 01H DUP (?) ; glUnmapBuffer _BSS ENDS PUBLIC ??0MeshVertex@@QAE@XZ ; MeshVertex::MeshVertex EXTRN ??0vec4@@QAE@XZ:PROC ; vec4::vec4 ; Function compile flags: /Ogspy ; COMDAT ??0MeshVertex@@QAE@XZ compile SEGMENT ??0MeshVertex@@QAE@XZ PROC ; MeshVertex::MeshVertex, COMDAT ; _this$ = ecx push esi mov esi, ecx call ??0vec4@@QAE@XZ ; vec4::vec4 lea ecx, DWORD PTR [esi+16] call ??0vec4@@QAE@XZ ; vec4::vec4 mov eax, esi pop esi ret 0 ??0MeshVertex@@QAE@XZ ENDP ; MeshVertex::MeshVertex compile ENDS PUBLIC ??_H@YGXPAXIHP6EPAX0@Z@Z ; `vector constructor iterator' ; Function compile flags: /Ogspy ; COMDAT ??_H@YGXPAXIHP6EPAX0@Z@Z _TEXT SEGMENT ___t$ = 8 ; size = 4 ___s$ = 12 ; size = 4 ___n$ = 16 ; size = 4 ___f$ = 20 ; size = 4 ??_H@YGXPAXIHP6EPAX0@Z@Z PROC ; `vector constructor iterator', COMDAT push ebp mov ebp, esp dec DWORD PTR ___n$[ebp] js SHORT $LN1@vector push esi mov esi, DWORD PTR ___t$[ebp] $LL2@vector: mov ecx, esi call DWORD PTR ___f$[ebp] add esi, DWORD PTR ___s$[ebp] dec DWORD PTR ___n$[ebp] jns SHORT $LL2@vector pop esi $LN1@vector: pop ebp ret 16 ; 00000010H ??_H@YGXPAXIHP6EPAX0@Z@Z ENDP ; `vector constructor iterator' _TEXT ENDS PUBLIC ??_C@_08LMCMEEB@inNormal?$AA@ ; `string' PUBLIC ??_C@_0L@LKEIBJK@inPosition?$AA@ ; `string' PUBLIC ?Render@Mesh@@QAEXXZ ; Mesh::Render EXTRN __imp__glDrawElements@16:PROC EXTRN ?currentProgramId@@3IA:DWORD ; currentProgramId ; COMDAT ??_C@_08LMCMEEB@inNormal?$AA@ ; File e:\private\frank\code\blu-flame.org\4kgfx\mesh.cpp CONST SEGMENT ??_C@_08LMCMEEB@inNormal?$AA@ DB 'inNormal', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0L@LKEIBJK@inPosition?$AA@ CONST SEGMENT ??_C@_0L@LKEIBJK@inPosition?$AA@ DB 'inPosition', 00H ; `string' ; Function compile flags: /Ogspy CONST ENDS compile SEGMENT ?Render@Mesh@@QAEXXZ PROC ; Mesh::Render ; _this$ = ecx ; 24 : { push ebx push ebp push esi push edi mov esi, ecx ; 25 : glBindVertexArray(VertexArrayObject); push DWORD PTR [esi+4751408] call DWORD PTR ?glBindVertexArray@@3P6GXI@ZA ; glBindVertexArray ; 26 : ; 27 : unsigned int positionId = glGetAttribLocation(currentProgramId, "inPosition"); push OFFSET ??_C@_0L@LKEIBJK@inPosition?$AA@ push DWORD PTR ?currentProgramId@@3IA ; currentProgramId call DWORD PTR ?glGetAttribLocation@@3P6GHIPBD@ZA ; glGetAttribLocation ; 28 : unsigned int normalId = glGetAttribLocation(currentProgramId, "inNormal"); push OFFSET ??_C@_08LMCMEEB@inNormal?$AA@ push DWORD PTR ?currentProgramId@@3IA ; currentProgramId mov edi, eax call DWORD PTR ?glGetAttribLocation@@3P6GHIPBD@ZA ; glGetAttribLocation ; 29 : ; 30 : glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IndexBufferObject); push DWORD PTR [esi+4751416] mov ebp, eax push 34963 ; 00008893H call DWORD PTR ?glBindBuffer@@3P6GXII@ZA ; glBindBuffer ; 31 : glBindBuffer(GL_ARRAY_BUFFER, VertexArrayBuffer); push DWORD PTR [esi+4751412] push 34962 ; 00008892H call DWORD PTR ?glBindBuffer@@3P6GXII@ZA ; glBindBuffer ; 32 : ; 33 : if (positionId+1 != 0) lea eax, DWORD PTR [edi+1] mov ebx, 5126 ; 00001406H test eax, eax je SHORT $LN2@Render ; 34 : { ; 35 : glEnableVertexAttribArray(positionId); push edi call DWORD PTR ?glEnableVertexAttribArray@@3P6GXI@ZA ; glEnableVertexAttribArray ; 36 : glVertexAttribPointer(positionId, 4, GL_FLOAT, GL_FALSE, sizeof(MeshVertex), (const GLvoid*)0); push 0 push 32 ; 00000020H push 0 push ebx push 4 push edi call DWORD PTR ?glVertexAttribPointer@@3P6GXIHIEHPBX@ZA ; glVertexAttribPointer $LN2@Render: ; 37 : } ; 38 : if (normalId+1 != 0) lea eax, DWORD PTR [ebp+1] test eax, eax je SHORT $LN5@Render ; 39 : { ; 40 : glEnableVertexAttribArray(normalId); push ebp call DWORD PTR ?glEnableVertexAttribArray@@3P6GXI@ZA ; glEnableVertexAttribArray ; 41 : glVertexAttribPointer(normalId, 4, GL_FLOAT, GL_FALSE, sizeof(MeshVertex), (const GLvoid*)16); push 16 ; 00000010H push 32 ; 00000020H push 0 push ebx push 4 push ebp call DWORD PTR ?glVertexAttribPointer@@3P6GXIHIEHPBX@ZA ; glVertexAttribPointer $LN5@Render: ; 42 : } ; 43 : ; 44 : glDrawElements(GL_TRIANGLES, IndexCount, GL_UNSIGNED_SHORT, 0); push 0 push 5123 ; 00001403H push DWORD PTR [esi+4] push 4 call DWORD PTR __imp__glDrawElements@16 ; 45 : ; 46 : glBindVertexArray(0); push 0 call DWORD PTR ?glBindVertexArray@@3P6GXI@ZA ; glBindVertexArray pop edi pop esi pop ebp pop ebx ; 47 : } ret 0 ?Render@Mesh@@QAEXXZ ENDP ; Mesh::Render compile ENDS PUBLIC ?Lock@Mesh@@QAEXXZ ; Mesh::Lock ; Function compile flags: /Ogspy compile SEGMENT ?Lock@Mesh@@QAEXXZ PROC ; Mesh::Lock ; _this$ = ecx ; 51 : { push ebx push ebp push esi push edi mov esi, ecx ; 52 : glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IndexBufferObject); push DWORD PTR [esi+4751416] mov ebp, 34963 ; 00008893H push ebp call DWORD PTR ?glBindBuffer@@3P6GXII@ZA ; glBindBuffer ; 53 : glBindBuffer(GL_ARRAY_BUFFER, VertexArrayBuffer); push DWORD PTR [esi+4751412] lea ebx, DWORD PTR [ebp-1] push ebx call DWORD PTR ?glBindBuffer@@3P6GXII@ZA ; glBindBuffer ; 54 : ; 55 : IndexBuffer = (unsigned short*)glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_READ_WRITE); lea edi, DWORD PTR [ebp+39] push edi push ebp call DWORD PTR ?glMapBuffer@@3P6GPAXII@ZA ; glMapBuffer ; 56 : VertexBuffer = (MeshVertex*)glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); push edi push ebx mov DWORD PTR [esi+16], eax call DWORD PTR ?glMapBuffer@@3P6GPAXII@ZA ; glMapBuffer pop edi mov DWORD PTR [esi+12], eax pop esi pop ebp pop ebx ; 57 : } ret 0 ?Lock@Mesh@@QAEXXZ ENDP ; Mesh::Lock compile ENDS PUBLIC ?Unlock@Mesh@@QAEXXZ ; Mesh::Unlock ; Function compile flags: /Ogspy compile SEGMENT ?Unlock@Mesh@@QAEXXZ PROC ; Mesh::Unlock ; _this$ = ecx ; 62 : glUnmapBuffer(GL_ARRAY_BUFFER); push 34962 ; 00008892H call DWORD PTR ?glUnmapBuffer@@3P6GEI@ZA ; glUnmapBuffer ; 63 : glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); push 34963 ; 00008893H call DWORD PTR ?glUnmapBuffer@@3P6GEI@ZA ; glUnmapBuffer ; 64 : } ret 0 ?Unlock@Mesh@@QAEXXZ ENDP ; Mesh::Unlock compile ENDS PUBLIC __real@00000000 PUBLIC __real@3f800000 PUBLIC ?GenerateNormals@Mesh@@AAEXXZ ; Mesh::GenerateNormals EXTRN ??Yvec4@@QAEXABU0@@Z:PROC ; vec4::operator+= EXTRN ?cross@@YA?AUvec4@@AAU1@0@Z:PROC ; cross EXTRN ??Gvec4@@QBE?AU0@ABU0@@Z:PROC ; vec4::operator- EXTRN ??0vec4@@QAE@MMMM@Z:PROC ; vec4::vec4 EXTRN __fltused:DWORD ; COMDAT __real@00000000 CONST SEGMENT __real@00000000 DD 000000000r ; 0 CONST ENDS ; COMDAT __real@3f800000 CONST SEGMENT __real@3f800000 DD 03f800000r ; 1 ; Function compile flags: /Ogspy CONST ENDS compile SEGMENT tv340 = -80 ; size = 4 tv327 = -80 ; size = 4 tv432 = -76 ; size = 4 _i$17804 = -76 ; size = 4 tv390 = -72 ; size = 4 _count$17813 = -68 ; size = 4 _i$17809 = -64 ; size = 4 tv86 = -60 ; size = 4 _index$17818 = -56 ; size = 4 _indexNext$17820 = -52 ; size = 4 _p2$17824 = -48 ; size = 16 _p1$17822 = -32 ; size = 16 $T17808 = -32 ; size = 16 $T17825 = -16 ; size = 16 ?GenerateNormals@Mesh@@AAEXXZ PROC ; Mesh::GenerateNormals ; _this$ = ecx ; 68 : { push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 84 ; 00000054H push ebx ; 69 : for (int i = 0; i < VertexCount; ++i) xor eax, eax mov ebx, ecx push esi push edi mov DWORD PTR _i$17804[esp+96], eax cmp DWORD PTR [ebx], eax jle SHORT $LN6@GenerateNo mov DWORD PTR tv327[esp+96], eax $LN8@GenerateNo: ; 70 : { ; 71 : VertexBuffer[i].Normal = vec4(0, 0, 0, 1); fld1 sub esp, 16 ; 00000010H fstp DWORD PTR [esp+12] lea ecx, DWORD PTR $T17808[esp+112] fldz fst DWORD PTR [esp+8] fst DWORD PTR [esp+4] fstp DWORD PTR [esp] call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 mov ecx, DWORD PTR [ebx+12] mov edx, DWORD PTR tv327[esp+96] inc DWORD PTR _i$17804[esp+96] add DWORD PTR tv327[esp+96], 32 ; 00000020H mov esi, eax mov eax, DWORD PTR _i$17804[esp+96] lea edi, DWORD PTR [ecx+edx+16] movsd movsd movsd movsd cmp eax, DWORD PTR [ebx] jl SHORT $LN8@GenerateNo $LN6@GenerateNo: ; 72 : } ; 73 : ; 74 : for (int i = 0; i < IndexCount; ) xor esi, esi cmp DWORD PTR [ebx+4], esi jle $LN4@GenerateNo $LN5@GenerateNo: ; 75 : { ; 76 : int count = IndexBuffer[i]; mov eax, DWORD PTR [ebx+16] movzx edi, WORD PTR [eax+esi*2] ; 77 : ++i; inc esi mov DWORD PTR _count$17813[esp+96], edi mov DWORD PTR _i$17809[esp+96], esi ; 78 : for (int j = 0; j < count; ++j) test edi, edi jle $LN1@GenerateNo ; 75 : { ; 76 : int count = IndexBuffer[i]; lea eax, DWORD PTR [edi-1] mov DWORD PTR tv340[esp+96], eax lea eax, DWORD PTR [esi+esi] ; 78 : for (int j = 0; j < count; ++j) mov DWORD PTR tv432[esp+96], 2 sub DWORD PTR tv432[esp+96], edi mov DWORD PTR tv390[esp+96], eax mov DWORD PTR tv86[esp+96], edi $LL18@GenerateNo: ; 79 : { ; 80 : int index = IndexBuffer[i + j]; mov ecx, DWORD PTR [ebx+16] mov eax, DWORD PTR tv390[esp+96] movzx eax, WORD PTR [eax+ecx] mov DWORD PTR _index$17818[esp+96], eax ; 81 : int indexPrev = IndexBuffer[i + ((j + count - 1) % count)]; ; 82 : int indexNext = IndexBuffer[i + ((j + 1) % count)]; mov eax, DWORD PTR tv432[esp+96] add eax, DWORD PTR tv340[esp+96] cdq idiv edi ; 83 : vec4 p1(VertexBuffer[indexPrev].Position - VertexBuffer[index].Position); mov edi, DWORD PTR [ebx+12] add edx, esi movzx eax, WORD PTR [ecx+edx*2] mov esi, DWORD PTR _index$17818[esp+96] mov DWORD PTR _indexNext$17820[esp+96], eax shl esi, 5 lea eax, DWORD PTR [esi+edi] push eax lea eax, DWORD PTR _p1$17822[esp+100] push eax mov eax, DWORD PTR tv340[esp+104] cdq idiv DWORD PTR _count$17813[esp+104] add edx, DWORD PTR _i$17809[esp+104] movzx ecx, WORD PTR [ecx+edx*2] shl ecx, 5 add ecx, edi call ??Gvec4@@QBE?AU0@ABU0@@Z ; vec4::operator- ; 84 : vec4 p2(VertexBuffer[indexNext].Position - VertexBuffer[index].Position); mov eax, DWORD PTR [ebx+12] lea ecx, DWORD PTR [eax+esi] push ecx lea ecx, DWORD PTR _p2$17824[esp+100] push ecx mov ecx, DWORD PTR _indexNext$17820[esp+104] shl ecx, 5 add ecx, eax call ??Gvec4@@QBE?AU0@ABU0@@Z ; vec4::operator- ; 85 : VertexBuffer[index].Normal += cross(p1, p2); lea eax, DWORD PTR _p2$17824[esp+96] push eax lea eax, DWORD PTR _p1$17822[esp+100] push eax lea eax, DWORD PTR $T17825[esp+104] push eax call ?cross@@YA?AUvec4@@AAU1@0@Z ; cross add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR [ebx+12] lea ecx, DWORD PTR [eax+esi+16] call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= add DWORD PTR tv390[esp+96], 2 inc DWORD PTR tv340[esp+96] dec DWORD PTR tv86[esp+96] mov edi, DWORD PTR _count$17813[esp+96] mov esi, DWORD PTR _i$17809[esp+96] jne $LL18@GenerateNo $LN1@GenerateNo: ; 86 : } ; 87 : i += count; add esi, edi cmp esi, DWORD PTR [ebx+4] jl $LN5@GenerateNo $LN4@GenerateNo: ; 88 : } ; 89 : } pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 ?GenerateNormals@Mesh@@AAEXXZ ENDP ; Mesh::GenerateNormals compile ENDS PUBLIC ?NormalizeNormals@Mesh@@AAEXXZ ; Mesh::NormalizeNormals EXTRN ?normalize@@YA?AUvec4@@ABU1@@Z:PROC ; normalize ; Function compile flags: /Ogspy compile SEGMENT tv151 = -24 ; size = 4 _i$17829 = -20 ; size = 4 $T17833 = -16 ; size = 16 ?NormalizeNormals@Mesh@@AAEXXZ PROC ; Mesh::NormalizeNormals ; _this$ = ecx ; 93 : { push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 36 ; 00000024H push ebx push esi push edi ; 94 : for (int i = 0; i < VertexCount; ++i) xor edi, edi mov ebx, ecx mov DWORD PTR _i$17829[esp+48], edi cmp DWORD PTR [ebx], edi jle SHORT $LN1@NormalizeN mov DWORD PTR tv151[esp+48], edi jmp SHORT $LN3@NormalizeN $LL8@NormalizeN: mov edi, DWORD PTR tv151[esp+48] $LN3@NormalizeN: ; 95 : { ; 96 : VertexBuffer[i].Normal = normalize(VertexBuffer[i].Normal); mov eax, DWORD PTR [ebx+12] lea eax, DWORD PTR [edi+eax+16] push eax lea eax, DWORD PTR $T17833[esp+52] push eax call ?normalize@@YA?AUvec4@@ABU1@@Z ; normalize inc DWORD PTR _i$17829[esp+56] add DWORD PTR tv151[esp+56], 32 ; 00000020H pop ecx pop ecx mov ecx, DWORD PTR [ebx+12] lea edi, DWORD PTR [edi+ecx+16] mov esi, eax mov eax, DWORD PTR _i$17829[esp+48] movsd movsd movsd movsd cmp eax, DWORD PTR [ebx] jl SHORT $LL8@NormalizeN $LN1@NormalizeN: ; 97 : } ; 98 : } pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 ?NormalizeNormals@Mesh@@AAEXXZ ENDP ; Mesh::NormalizeNormals compile ENDS PUBLIC ?Reset@OpInfo@Mesh@@QAEXXZ ; Mesh::OpInfo::Reset EXTRN _memclear:PROC ; Function compile flags: /Ogspy compile SEGMENT ?Reset@OpInfo@Mesh@@QAEXXZ PROC ; Mesh::OpInfo::Reset ; _this$ = ecx ; 308 : { push esi push edi mov esi, ecx ; 309 : memclear(NextVB, sizeof (NextVB)); push 2097152 ; 00200000H push esi call _memclear ; 310 : memclear(NextIB, sizeof (NextIB)); mov edi, 589824 ; 00090000H lea eax, DWORD PTR [esi+2097152] push edi push eax call _memclear ; 311 : memclear(EdgeConfiguration, sizeof (EdgeConfiguration)); lea eax, DWORD PTR [esi+2686992] push 1179648 ; 00120000H push eax call _memclear ; 312 : memclear(EdgeUsage, sizeof (EdgeUsage)); lea eax, DWORD PTR [esi+3866640] push 294912 ; 00048000H push eax call _memclear ; 313 : memclear(EdgeID, sizeof (EdgeID)); lea eax, DWORD PTR [esi+4161552] push edi push eax call _memclear ; 314 : ; 315 : NextVertexCount = 0; xor eax, eax add esp, 40 ; 00000028H pop edi mov DWORD PTR [esi+2686976], eax ; 316 : NextIndexCount = 0; mov DWORD PTR [esi+2686980], eax ; 317 : NextFaceCount = 0; mov DWORD PTR [esi+2686984], eax ; 318 : ; 319 : EdgeCount = 0; mov DWORD PTR [esi+2686988], eax pop esi ; 320 : } ret 0 ?Reset@OpInfo@Mesh@@QAEXXZ ENDP ; Mesh::OpInfo::Reset compile ENDS PUBLIC ?MakeEdgeID@OpInfo@Mesh@@QAEHGG@Z ; Mesh::OpInfo::MakeEdgeID ; Function compile flags: /Ogspy compile SEGMENT _VertexA$ = 8 ; size = 2 _VertexB$ = 12 ; size = 2 ?MakeEdgeID@OpInfo@Mesh@@QAEHGG@Z PROC ; Mesh::OpInfo::MakeEdgeID ; _this$ = ecx ; 325 : unsigned int edgeConfiguration = VertexA > VertexB ? (VertexA << 16 | VertexB) : (VertexB << 16 | VertexA); mov ax, WORD PTR _VertexA$[esp-4] cmp ax, WORD PTR _VertexB$[esp-4] jbe SHORT $LN7@MakeEdgeID movzx edx, ax movzx eax, WORD PTR _VertexB$[esp-4] jmp SHORT $LN12@MakeEdgeID $LN7@MakeEdgeID: movzx edx, WORD PTR _VertexB$[esp-4] movzx eax, ax $LN12@MakeEdgeID: shl edx, 16 ; 00000010H push esi ; 326 : ; 327 : for (int i = 0; i < EdgeCount; ++i) mov esi, DWORD PTR [ecx+2686988] or edx, eax xor eax, eax push edi test esi, esi jle SHORT $LN2@MakeEdgeID lea edi, DWORD PTR [ecx+2686992] $LL4@MakeEdgeID: ; 328 : { ; 329 : if (EdgeConfiguration[i] == edgeConfiguration) cmp DWORD PTR [edi], edx je SHORT $LN10@MakeEdgeID ; 326 : ; 327 : for (int i = 0; i < EdgeCount; ++i) inc eax add edi, 4 cmp eax, esi jl SHORT $LL4@MakeEdgeID $LN2@MakeEdgeID: ; 333 : } ; 334 : } ; 335 : ; 336 : EdgeConfiguration[EdgeCount] = edgeConfiguration; mov DWORD PTR [ecx+esi*4+2686992], edx ; 337 : EdgeUsage[EdgeCount]++; mov eax, DWORD PTR [ecx+2686988] lea eax, DWORD PTR [eax+ecx+3866640] inc BYTE PTR [eax] ; 338 : EdgeID[EdgeCount] = NextVertexCount; mov edx, DWORD PTR [ecx+2686988] mov si, WORD PTR [ecx+2686976] mov WORD PTR [ecx+edx*2+4161552], si ; 339 : NextVertexCount++; ; 340 : ; 341 : return EdgeCount++; mov eax, DWORD PTR [ecx+2686988] inc DWORD PTR [ecx+2686976] lea edx, DWORD PTR [eax+1] mov DWORD PTR [ecx+2686988], edx $LN5@MakeEdgeID: ; 342 : } pop edi pop esi ret 8 $LN10@MakeEdgeID: ; 330 : { ; 331 : EdgeUsage[i]++; lea ecx, DWORD PTR [eax+ecx+3866640] inc BYTE PTR [ecx] ; 332 : return i; jmp SHORT $LN5@MakeEdgeID ?MakeEdgeID@OpInfo@Mesh@@QAEHGG@Z ENDP ; Mesh::OpInfo::MakeEdgeID compile ENDS PUBLIC __real@40000000 PUBLIC ?StandardSubdivide@Mesh@@AAEXXZ ; Mesh::StandardSubdivide EXTRN ??Kvec4@@QBE?AU0@M@Z:PROC ; vec4::operator/ EXTRN ??Hvec4@@QBE?AU0@ABU0@@Z:PROC ; vec4::operator+ EXTRN _memcpy:PROC ; COMDAT __real@40000000 CONST SEGMENT __real@40000000 DD 040000000r ; 2 ; Function compile flags: /Ogspy CONST ENDS compile SEGMENT tv601 = -108 ; size = 4 _count$17994 = -108 ; size = 4 tv569 = -104 ; size = 4 _i$17990 = -104 ; size = 4 _ibIndex$ = -100 ; size = 4 _count$17973 = -100 ; size = 4 _nextIndex$17981 = -96 ; size = 4 _face$ = -96 ; size = 4 tv748 = -92 ; size = 4 _prevIndex$17978 = -92 ; size = 4 tv246 = -88 ; size = 4 tv204 = -84 ; size = 4 _i$17969 = -84 ; size = 4 tv410 = -80 ; size = 4 _nextEdgeID$17983 = -76 ; size = 4 tv739 = -72 ; size = 4 _prevEdgeID$17982 = -72 ; size = 4 _vbFaceOffset$ = -68 ; size = 4 _index$17980 = -68 ; size = 4 _fp$17995 = -64 ; size = 16 $T17985 = -64 ; size = 16 $T17984 = -48 ; size = 16 $T17987 = -32 ; size = 16 $T18001 = -16 ; size = 16 $T17986 = -16 ; size = 16 ?StandardSubdivide@Mesh@@AAEXXZ PROC ; Mesh::StandardSubdivide ; _this$ = ecx ; 346 : { push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 116 ; 00000074H push ebx mov ebx, ecx push esi ; 347 : OP.Reset(); lea esi, DWORD PTR [ebx+32] push edi mov ecx, esi call ?Reset@OpInfo@Mesh@@QAEXXZ ; Mesh::OpInfo::Reset ; 348 : memcpy(OP.NextVB, VertexBuffer, VertexCount * sizeof(MeshVertex)); mov eax, DWORD PTR [ebx] shl eax, 5 push eax push DWORD PTR [ebx+12] push esi call _memcpy ; 349 : OP.NextVertexCount = VertexCount; mov eax, DWORD PTR [ebx] ; 350 : ; 351 : int face = 0; ; 352 : for (int i = 0; i < IndexCount; ++face) xor edi, edi add esp, 12 ; 0000000cH mov DWORD PTR [ebx+2687008], eax cmp DWORD PTR [ebx+4], edi jle $LN11@StandardSu $LN13@StandardSu: ; 353 : { ; 354 : int count = IndexBuffer[i++]; mov eax, DWORD PTR [ebx+16] movzx ecx, WORD PTR [eax+edi*2] inc edi mov DWORD PTR _count$17973[esp+128], ecx mov DWORD PTR _i$17969[esp+128], edi ; 355 : ; 356 : for (int j = 0; j < count; ++j) test ecx, ecx jle $LN8@StandardSu ; 353 : { ; 354 : int count = IndexBuffer[i++]; or eax, -1 lea edx, DWORD PTR [edi+edi] mov DWORD PTR tv569[esp+128], eax mov DWORD PTR tv601[esp+128], edx mov DWORD PTR tv246[esp+128], ecx jmp SHORT $LN10@StandardSu $LL24@StandardSu: mov eax, DWORD PTR tv569[esp+128] $LN10@StandardSu: ; 357 : { ; 358 : int prevIndex = j - 1; mov edx, eax ; 359 : if (prevIndex < 0) test eax, eax jns SHORT $LN7@StandardSu ; 360 : prevIndex += count; lea edx, DWORD PTR [eax+ecx] $LN7@StandardSu: ; 361 : prevIndex = IndexBuffer[i + prevIndex]; mov ecx, DWORD PTR [ebx+16] add edx, edi movzx edx, WORD PTR [ecx+edx*2] mov DWORD PTR _prevIndex$17978[esp+128], edx ; 362 : int index = IndexBuffer[i + j]; mov edx, DWORD PTR tv601[esp+128] movzx esi, WORD PTR [edx+ecx] ; 363 : int nextIndex = IndexBuffer[i + ((j + 1) % count)]; add eax, 2 cdq idiv DWORD PTR _count$17973[esp+128] ; 364 : int prevEdgeID = OP.EdgeID[OP.MakeEdgeID(prevIndex, index)]; push esi push DWORD PTR _prevIndex$17978[esp+132] mov DWORD PTR _index$17980[esp+136], esi add edx, edi movzx eax, WORD PTR [ecx+edx*2] lea ecx, DWORD PTR [ebx+32] mov DWORD PTR _nextIndex$17981[esp+136], eax call ?MakeEdgeID@OpInfo@Mesh@@QAEHGG@Z ; Mesh::OpInfo::MakeEdgeID movzx edi, WORD PTR [ebx+eax*2+4161584] ; 365 : int nextEdgeID = OP.EdgeID[OP.MakeEdgeID(index, nextIndex)]; push DWORD PTR _nextIndex$17981[esp+128] lea ecx, DWORD PTR [ebx+32] push esi mov DWORD PTR _prevEdgeID$17982[esp+136], edi call ?MakeEdgeID@OpInfo@Mesh@@QAEHGG@Z ; Mesh::OpInfo::MakeEdgeID movzx eax, WORD PTR [ebx+eax*2+4161584] ; 366 : OP.NextVB[prevEdgeID].Position = (VertexBuffer[prevIndex].Position + VertexBuffer[index].Position) / 2; fld DWORD PTR __real@40000000 push ecx mov DWORD PTR _nextEdgeID$17983[esp+132], eax mov eax, DWORD PTR [ebx+12] fstp DWORD PTR [esp] shl esi, 5 lea ecx, DWORD PTR $T17985[esp+132] push ecx mov DWORD PTR tv410[esp+136], esi add esi, eax push esi lea ecx, DWORD PTR $T17984[esp+140] push ecx mov ecx, DWORD PTR _prevIndex$17978[esp+144] shl ecx, 5 add ecx, eax call ??Hvec4@@QBE?AU0@ABU0@@Z ; vec4::operator+ mov ecx, eax call ??Kvec4@@QBE?AU0@M@Z ; vec4::operator/ ; 367 : OP.NextVB[nextEdgeID].Position = (VertexBuffer[nextIndex].Position + VertexBuffer[index].Position) / 2; fld DWORD PTR __real@40000000 inc edi shl edi, 5 add edi, ebx mov esi, eax movsd push ecx movsd fstp DWORD PTR [esp] movsd lea ecx, DWORD PTR $T17987[esp+132] push ecx mov ecx, DWORD PTR tv410[esp+136] movsd mov eax, DWORD PTR [ebx+12] add ecx, eax push ecx lea ecx, DWORD PTR $T17986[esp+140] push ecx mov ecx, DWORD PTR _nextIndex$17981[esp+144] shl ecx, 5 add ecx, eax call ??Hvec4@@QBE?AU0@ABU0@@Z ; vec4::operator+ mov ecx, eax call ??Kvec4@@QBE?AU0@M@Z ; vec4::operator/ mov ecx, DWORD PTR _nextEdgeID$17983[esp+128] lea edi, DWORD PTR [ecx+1] shl edi, 5 add edi, ebx mov esi, eax movsd movsd movsd movsd ; 368 : OP.NextIB[OP.NextIndexCount + 0] = 4; mov eax, DWORD PTR [ebx+2687012] push 4 pop edx mov WORD PTR [ebx+eax*2+2097184], dx ; 369 : OP.NextIB[OP.NextIndexCount + 1] = 0; // will be set later (face offset) mov eax, DWORD PTR [ebx+2687012] add DWORD PTR tv601[esp+128], 2 mov edi, DWORD PTR _i$17969[esp+128] xor edx, edx mov WORD PTR [ebx+eax*2+2097186], dx ; 370 : OP.NextIB[OP.NextIndexCount + 2] = prevEdgeID; mov eax, DWORD PTR [ebx+2687012] mov dx, WORD PTR _prevEdgeID$17982[esp+128] mov WORD PTR [ebx+eax*2+2097188], dx ; 371 : OP.NextIB[OP.NextIndexCount + 3] = index; mov eax, DWORD PTR [ebx+2687012] mov dx, WORD PTR _index$17980[esp+128] mov WORD PTR [ebx+eax*2+2097190], dx ; 372 : OP.NextIB[OP.NextIndexCount + 4] = nextEdgeID; mov eax, DWORD PTR [ebx+2687012] mov WORD PTR [ebx+eax*2+2097192], cx ; 373 : OP.NextIndexCount += 5; add DWORD PTR [ebx+2687012], 5 ; 374 : ++OP.NextFaceCount; inc DWORD PTR [ebx+2687016] inc DWORD PTR tv569[esp+128] dec DWORD PTR tv246[esp+128] mov ecx, DWORD PTR _count$17973[esp+128] jne $LL24@StandardSu $LN8@StandardSu: ; 375 : } ; 376 : ; 377 : i += count; add edi, ecx cmp edi, DWORD PTR [ebx+4] jl $LN13@StandardSu $LN11@StandardSu: ; 378 : } ; 379 : ; 380 : int vbFaceOffset = OP.NextVertexCount; mov esi, DWORD PTR [ebx+2687008] ; 381 : int ibIndex = 1; ; 382 : face = 0; xor edi, edi mov DWORD PTR _vbFaceOffset$[esp+128], esi mov DWORD PTR _ibIndex$[esp+128], 1 mov DWORD PTR _face$[esp+128], edi ; 383 : for (int i = 0; i < IndexCount; ++face) cmp DWORD PTR [ebx+4], edi jle $LN4@StandardSu ; 378 : } ; 379 : ; 380 : int vbFaceOffset = OP.NextVertexCount; lea eax, DWORD PTR [esi+1] shl eax, 5 add eax, ebx mov DWORD PTR tv748[esp+128], eax jmp SHORT $LN6@StandardSu $LL25@StandardSu: mov edi, DWORD PTR _i$17990[esp+128] mov esi, DWORD PTR _vbFaceOffset$[esp+128] $LN6@StandardSu: ; 384 : { ; 385 : int count = IndexBuffer[i++]; mov eax, DWORD PTR [ebx+16] movzx eax, WORD PTR [eax+edi*2] inc edi ; 386 : ; 387 : vec4 fp; lea ecx, DWORD PTR _fp$17995[esp+128] mov DWORD PTR _count$17994[esp+128], eax mov DWORD PTR _i$17990[esp+128], edi call ??0vec4@@QAE@XZ ; vec4::vec4 ; 388 : for (int j = 0; j < count; ++j) cmp DWORD PTR _count$17994[esp+128], 0 jle SHORT $LN1@StandardSu mov eax, DWORD PTR _face$[esp+128] add eax, esi mov DWORD PTR tv739[esp+128], eax mov eax, DWORD PTR _ibIndex$[esp+128] lea esi, DWORD PTR [ebx+eax*2+2097184] mov eax, DWORD PTR _count$17994[esp+128] mov DWORD PTR tv204[esp+128], eax imul eax, 5 add edi, edi add DWORD PTR _ibIndex$[esp+128], eax $LL3@StandardSu: ; 389 : { ; 390 : fp += VertexBuffer[IndexBuffer[i + j]].Position; mov eax, DWORD PTR [ebx+16] movzx eax, WORD PTR [edi+eax] shl eax, 5 add eax, DWORD PTR [ebx+12] lea ecx, DWORD PTR _fp$17995[esp+128] push eax call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= ; 391 : OP.NextIB[ibIndex] = vbFaceOffset + face; mov ax, WORD PTR tv739[esp+128] mov WORD PTR [esi], ax ; 392 : ibIndex += 5; add esi, 10 ; 0000000aH add edi, 2 dec DWORD PTR tv204[esp+128] jne SHORT $LL3@StandardSu $LN1@StandardSu: ; 393 : } ; 394 : OP.NextVB[vbFaceOffset + face].Position = fp / (float)count; fild DWORD PTR _count$17994[esp+128] push ecx lea eax, DWORD PTR $T18001[esp+132] lea ecx, DWORD PTR _fp$17995[esp+132] fstp DWORD PTR [esp] push eax call ??Kvec4@@QBE?AU0@M@Z ; vec4::operator/ mov edi, DWORD PTR tv748[esp+128] add DWORD PTR tv748[esp+128], 32 ; 00000020H mov esi, eax ; 395 : ++OP.NextVertexCount; ; 396 : i += count; mov eax, DWORD PTR _i$17990[esp+128] add eax, DWORD PTR _count$17994[esp+128] movsd movsd movsd movsd inc DWORD PTR [ebx+2687008] inc DWORD PTR _face$[esp+128] mov DWORD PTR _i$17990[esp+128], eax cmp eax, DWORD PTR [ebx+4] jl $LL25@StandardSu $LN4@StandardSu: ; 397 : } ; 398 : ; 399 : memcpy(VertexBuffer, OP.NextVB, MaxVertexBuffer * sizeof(MeshVertex)); push 2097152 ; 00200000H lea eax, DWORD PTR [ebx+32] push eax push DWORD PTR [ebx+12] call _memcpy ; 400 : memcpy(IndexBuffer, OP.NextIB, MaxIndexBuffer * sizeof(unsigned short)); push 589824 ; 00090000H lea eax, DWORD PTR [ebx+2097184] push eax push DWORD PTR [ebx+16] call _memcpy ; 401 : VertexCount = OP.NextVertexCount; mov eax, DWORD PTR [ebx+2687008] mov DWORD PTR [ebx], eax ; 402 : IndexCount = OP.NextIndexCount; mov eax, DWORD PTR [ebx+2687012] add esp, 24 ; 00000018H mov DWORD PTR [ebx+4], eax ; 403 : FaceCount = OP.NextFaceCount; mov eax, DWORD PTR [ebx+2687016] ; 404 : } pop edi pop esi mov DWORD PTR [ebx+8], eax pop ebx mov esp, ebp pop ebp ret 0 ?StandardSubdivide@Mesh@@AAEXXZ ENDP ; Mesh::StandardSubdivide compile ENDS PUBLIC ?Homogenize@Mesh@@AAEXXZ ; Mesh::Homogenize ; Function compile flags: /Ogspy compile SEGMENT ?Homogenize@Mesh@@AAEXXZ PROC ; Mesh::Homogenize ; _this$ = ecx ; 457 : for (int i = 0; i < VertexCount; ++i) xor edx, edx xor eax, eax cmp DWORD PTR [ecx], edx jle SHORT $LN1@Homogenize push esi $LL3@Homogenize: ; 458 : VertexBuffer[i].Position.w = 1; fld1 mov esi, DWORD PTR [ecx+12] fstp DWORD PTR [edx+esi+12] inc eax add edx, 32 ; 00000020H cmp eax, DWORD PTR [ecx] jl SHORT $LL3@Homogenize pop esi $LN1@Homogenize: ; 459 : } ret 0 ?Homogenize@Mesh@@AAEXXZ ENDP ; Mesh::Homogenize compile ENDS PUBLIC ?Transform@Mesh@@QAEXABUMatrix@@@Z ; Mesh::Transform EXTRN ??DMatrix@@QBE?AUvec4@@ABU1@@Z:PROC ; Matrix::operator* ; Function compile flags: /Ogspy compile SEGMENT tv150 = -24 ; size = 4 _i$18034 = -20 ; size = 4 $T18038 = -16 ; size = 16 _transform$ = 8 ; size = 4 ?Transform@Mesh@@QAEXABUMatrix@@@Z PROC ; Mesh::Transform ; _this$ = ecx ; 463 : { push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 36 ; 00000024H push ebx push esi push edi mov ebx, ecx ; 464 : Lock(); call ?Lock@Mesh@@QAEXXZ ; Mesh::Lock ; 465 : for (int i = 0; i < VertexCount; ++i) xor eax, eax mov DWORD PTR _i$18034[esp+48], eax cmp DWORD PTR [ebx], eax jle SHORT $LN1@Transform ; 464 : Lock(); mov DWORD PTR tv150[esp+48], eax $LN3@Transform: ; 466 : { ; 467 : VertexBuffer[i].Position = transform * VertexBuffer[i].Position; mov eax, DWORD PTR [ebx+12] add eax, DWORD PTR tv150[esp+48] mov ecx, DWORD PTR _transform$[ebp] push eax lea eax, DWORD PTR $T18038[esp+52] push eax call ??DMatrix@@QBE?AUvec4@@ABU1@@Z ; Matrix::operator* mov edi, DWORD PTR [ebx+12] add edi, DWORD PTR tv150[esp+48] inc DWORD PTR _i$18034[esp+48] add DWORD PTR tv150[esp+48], 32 ; 00000020H mov esi, eax mov eax, DWORD PTR _i$18034[esp+48] movsd movsd movsd movsd cmp eax, DWORD PTR [ebx] jl SHORT $LN3@Transform $LN1@Transform: ; 468 : } ; 469 : Unlock(); mov ecx, ebx call ?Unlock@Mesh@@QAEXXZ ; Mesh::Unlock ; 470 : } pop edi pop esi pop ebx mov esp, ebp pop ebp ret 4 ?Transform@Mesh@@QAEXABUMatrix@@@Z ENDP ; Mesh::Transform compile ENDS PUBLIC ??0OpInfo@Mesh@@QAE@XZ ; Mesh::OpInfo::OpInfo ; Function compile flags: /Ogspy ; COMDAT ??0OpInfo@Mesh@@QAE@XZ compile SEGMENT ??0OpInfo@Mesh@@QAE@XZ PROC ; Mesh::OpInfo::OpInfo, COMDAT ; _this$ = ecx push ebx push esi push edi mov edi, ecx mov esi, edi mov ebx, 65535 ; 0000ffffH $LL4@OpInfo: mov ecx, esi call ??0vec4@@QAE@XZ ; vec4::vec4 lea ecx, DWORD PTR [esi+16] call ??0vec4@@QAE@XZ ; vec4::vec4 add esi, 32 ; 00000020H dec ebx jns SHORT $LL4@OpInfo mov eax, edi pop edi pop esi pop ebx ret 0 ??0OpInfo@Mesh@@QAE@XZ ENDP ; Mesh::OpInfo::OpInfo compile ENDS PUBLIC ?Triangulate@Mesh@@AAEXXZ ; Mesh::Triangulate ; Function compile flags: /Ogspy compile SEGMENT _firstVertex$17842 = -12 ; size = 4 _count$17841 = -8 ; size = 4 _j$17844 = -4 ; size = 4 ?Triangulate@Mesh@@AAEXXZ PROC ; Mesh::Triangulate ; _this$ = ecx ; 102 : { push ebp mov ebp, esp sub esp, 12 ; 0000000cH push esi mov esi, ecx ; 103 : OP.Reset(); lea ecx, DWORD PTR [esi+32] call ?Reset@OpInfo@Mesh@@QAEXXZ ; Mesh::OpInfo::Reset ; 104 : OP.NextVertexCount = 0; xor eax, eax mov DWORD PTR [esi+2687008], eax ; 105 : OP.NextFaceCount = 0; mov DWORD PTR [esi+2687016], eax ; 106 : for (int i = 0; i < IndexCount;) cmp DWORD PTR [esi+4], eax jle $LN4@Triangulat mov ecx, DWORD PTR [esi+16] push ebx push edi $LL5@Triangulat: ; 107 : { ; 108 : int count = IndexBuffer[i++]; movzx edx, WORD PTR [ecx+eax*2] ; 109 : int firstVertex = IndexBuffer[i++]; ; 110 : int secondVertex = IndexBuffer[i++]; movzx edi, WORD PTR [ecx+eax*2+4] ; 111 : int j = 0; and DWORD PTR _j$17844[ebp], 0 mov DWORD PTR _count$17841[ebp], edx movzx edx, WORD PTR [ecx+eax*2+2] mov DWORD PTR _firstVertex$17842[ebp], edx lea edx, DWORD PTR [eax+eax+6] $LL3@Triangulat: ; 112 : do ; 113 : { ; 114 : OP.NextIB[OP.NextIndexCount++] = firstVertex; mov ecx, DWORD PTR [esi+2687012] mov bx, WORD PTR _firstVertex$17842[ebp] mov WORD PTR [esi+ecx*2+2097184], bx inc DWORD PTR [esi+2687012] mov ecx, DWORD PTR [esi+2687012] ; 115 : OP.NextIB[OP.NextIndexCount++] = secondVertex; ; 116 : OP.NextIB[OP.NextIndexCount++] = IndexBuffer[i + j]; ; 117 : OP.NextFaceCount++; ; 118 : secondVertex = IndexBuffer[i + j++]; ; 119 : } while (j < count - 2); mov ebx, DWORD PTR _count$17841[ebp] mov WORD PTR [esi+ecx*2+2097184], di inc DWORD PTR [esi+2687012] mov edi, DWORD PTR [esi+16] mov di, WORD PTR [edx+edi] mov ecx, DWORD PTR [esi+2687012] mov WORD PTR [esi+ecx*2+2097184], di inc DWORD PTR [esi+2687012] inc DWORD PTR [esi+2687016] mov ecx, DWORD PTR [esi+16] movzx edi, WORD PTR [edx+ecx] inc DWORD PTR _j$17844[ebp] add ebx, -2 ; fffffffeH add edx, 2 cmp DWORD PTR _j$17844[ebp], ebx jl SHORT $LL3@Triangulat ; 120 : i += count - 2; mov edx, DWORD PTR _count$17841[ebp] lea eax, DWORD PTR [eax+edx+1] cmp eax, DWORD PTR [esi+4] jl $LL5@Triangulat pop edi pop ebx $LN4@Triangulat: ; 121 : } ; 122 : ; 123 : memcpy(IndexBuffer, OP.NextIB, MaxIndexBuffer * sizeof(unsigned short)); push 589824 ; 00090000H lea eax, DWORD PTR [esi+2097184] push eax push DWORD PTR [esi+16] call _memcpy ; 124 : IndexCount = OP.NextIndexCount; mov eax, DWORD PTR [esi+2687012] mov DWORD PTR [esi+4], eax ; 125 : FaceCount = OP.NextFaceCount; mov eax, DWORD PTR [esi+2687016] add esp, 12 ; 0000000cH mov DWORD PTR [esi+8], eax pop esi ; 126 : } leave ret 0 ?Triangulate@Mesh@@AAEXXZ ENDP ; Mesh::Triangulate compile ENDS PUBLIC __real@3f000000 PUBLIC ?CatmullClarkSubdivide@Mesh@@AAEXXZ ; Mesh::CatmullClarkSubdivide EXTRN ??Dvec4@@QBE?AU0@M@Z:PROC ; vec4::operator* EXTRN ??_0vec4@@QAEXM@Z:PROC ; vec4::operator/= ; COMDAT __real@3f000000 CONST SEGMENT __real@3f000000 DD 03f000000r ; 0.5 ; Function compile flags: /Ogspy CONST ENDS compile SEGMENT tv1252 = -220 ; size = 4 tv991 = -220 ; size = 4 tv730 = -220 ; size = 4 tv529 = -220 ; size = 4 _openEdgeCount$17883 = -220 ; size = 4 tv1155 = -216 ; size = 4 tv1143 = -216 ; size = 4 tv995 = -216 ; size = 4 tv890 = -216 ; size = 4 tv1138 = -212 ; size = 4 _i$17855 = -212 ; size = 4 _i$17875 = -208 ; size = 4 _count$17859 = -208 ; size = 4 _openEdges$17879 = -201 ; size = 1 tv1216 = -200 ; size = 4 tv1197 = -200 ; size = 4 tv1145 = -200 ; size = 4 tv642 = -200 ; size = 4 _V1$17914 = -200 ; size = 4 tv1290 = -196 ; size = 4 tv1018 = -196 ; size = 4 _index$17866 = -196 ; size = 4 _edgeCount$17882 = -192 ; size = 4 _face$ = -192 ; size = 4 tv1250 = -188 ; size = 4 _fp$17860 = -188 ; size = 4 tv667 = -184 ; size = 4 _V2$17915 = -184 ; size = 4 _ib$17861 = -180 ; size = 4 _edgesVector$17880 = -176 ; size = 16 _mid$17892 = -160 ; size = 16 _openEdgesVector$17881 = -144 ; size = 16 $T17917 = -128 ; size = 16 $T17902 = -128 ; size = 16 $T17897 = -112 ; size = 16 $T17908 = -96 ; size = 16 $T17904 = -80 ; size = 16 $T17907 = -64 ; size = 16 $T17905 = -48 ; size = 16 $T17898 = -32 ; size = 16 $T17899 = -16 ; size = 16 ?CatmullClarkSubdivide@Mesh@@AAEXXZ PROC ; Mesh::CatmullClarkSubdivide ; _this$ = ecx ; 130 : { push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 228 ; 000000e4H push ebx mov ebx, ecx ; 131 : if (IndexCount >= MaxIndexBuffer / 4 || VertexCount >= MaxVertexBuffer * 9 / 4) cmp DWORD PTR [ebx+4], 73728 ; 00012000H push esi push edi jge $LN24@CatmullCla cmp DWORD PTR [ebx], 147456 ; 00024000H jge $LN24@CatmullCla ; 132 : { ; 133 : return; ; 134 : } ; 135 : ; 136 : // neuer VB ist so: ; 137 : // alter VB bzw. verschobene Originalpunkte ; 138 : // ein Vertex pro Face (FacePunkte) ; 139 : // ein Vertex pro Edge (EdgePunkte) ; 140 : ; 141 : //neuer IB ist so: ; 142 : // 4 / alte Ecke0 / EdgePunkt / FaceFacePunkt / EdgePunkt ; 143 : // 4 / alte Ecke1 / EdgePunkt / FaceFacePunkt / EdgePunkt ; 144 : //... ; 145 : // 4 / alte EckeN / EdgePunkt / FaceFacePunkt / EdgePunkt (N = = Vertexcount) ; 146 : //beim kopieren dann ueberall noch 4 ; 147 : ; 148 : OP.Reset(); lea ecx, DWORD PTR [ebx+32] call ?Reset@OpInfo@Mesh@@QAEXXZ ; Mesh::OpInfo::Reset ; 149 : OP.NextVertexCount = VertexCount + FaceCount; //Basis Vertices sind die alte Ecken und die neuen FacePunkte mov eax, DWORD PTR [ebx] add eax, DWORD PTR [ebx+8] mov DWORD PTR [ebx+2687008], eax ; 150 : ; 151 : int face = 0; xor eax, eax mov DWORD PTR _face$[esp+240], eax ; 152 : for (int i = 0; i < IndexCount;) cmp DWORD PTR [ebx+4], eax jle $LN22@CatmullCla jmp SHORT $LN23@CatmullCla $LL43@CatmullCla: mov eax, DWORD PTR _i$17855[esp+240] $LN23@CatmullCla: ; 155 : vec4& fp = OP.NextVB[VertexCount + face].Position; mov edx, DWORD PTR [ebx] mov esi, DWORD PTR _face$[esp+240] mov ecx, DWORD PTR [ebx+16] movzx ecx, WORD PTR [ecx+eax*2] lea esi, DWORD PTR [edx+esi+1] ; 156 : unsigned short int* ib = OP.NextIB + OP.NextIndexCount; mov edx, DWORD PTR [ebx+2687012] shl esi, 5 inc eax add esi, ebx lea edi, DWORD PTR [ebx+edx*2+2097184] mov DWORD PTR _count$17859[esp+240], ecx mov DWORD PTR _i$17855[esp+240], eax mov DWORD PTR _fp$17860[esp+240], esi mov DWORD PTR _ib$17861[esp+240], edi ; 157 : ; 158 : for (int j = 0; j < count; ++j) test ecx, ecx jle SHORT $LN19@CatmullCla ; 153 : { ; 154 : int count = IndexBuffer[i++]; add eax, eax mov DWORD PTR tv890[esp+240], eax add edi, 6 mov DWORD PTR tv529[esp+240], ecx $LN21@CatmullCla: ; 159 : { ; 160 : int index = IndexBuffer[i + j]; mov eax, DWORD PTR [ebx+16] mov ecx, DWORD PTR tv890[esp+240] movzx eax, WORD PTR [ecx+eax] mov DWORD PTR _index$17866[esp+240], eax ; 161 : fp += VertexBuffer[index].Position; shl eax, 5 add eax, DWORD PTR [ebx+12] mov ecx, esi push eax call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= add DWORD PTR tv890[esp+240], 2 ; 162 : ib[j * 5] = 4; push 4 pop eax mov WORD PTR [edi-6], ax ; 163 : ib[j * 5 + 1] = index; mov ax, WORD PTR _index$17866[esp+240] mov WORD PTR [edi-4], ax ; 164 : ib[j * 5 + 3] = VertexCount + face; // erste Haelfte IB fertig mov ax, WORD PTR [ebx] add ax, WORD PTR _face$[esp+240] mov WORD PTR [edi], ax add edi, 10 ; 0000000aH dec DWORD PTR tv529[esp+240] jne SHORT $LN21@CatmullCla $LN19@CatmullCla: ; 165 : } ; 166 : fp /= (float)count; // jetzt ist der FacePunkt fertig fild DWORD PTR _count$17859[esp+240] push ecx mov ecx, esi fstp DWORD PTR [esp] call ??_0vec4@@QAEXM@Z ; vec4::operator/= ; 167 : ; 168 : for (int j = 0; j < count; ++j) mov ecx, DWORD PTR _count$17859[esp+240] xor eax, eax test ecx, ecx jle $LN16@CatmullCla ; 165 : } ; 166 : fp /= (float)count; // jetzt ist der FacePunkt fertig imul ecx, 5 mov DWORD PTR tv667[esp+240], ecx mov ecx, DWORD PTR _i$17855[esp+240] add ecx, ecx mov DWORD PTR tv995[esp+240], ecx mov ecx, DWORD PTR _ib$17861[esp+240] add ecx, 4 mov DWORD PTR tv991[esp+240], 9 mov DWORD PTR tv1018[esp+240], ecx $LN18@CatmullCla: ; 169 : { ; 170 : int index = IndexBuffer[i + j]; mov ecx, DWORD PTR [ebx+16] mov edx, DWORD PTR tv995[esp+240] movzx edi, WORD PTR [edx+ecx] ; 171 : int indexNext = IndexBuffer[i + ((j + 1) % count)]; inc eax mov DWORD PTR tv642[esp+240], eax cdq idiv DWORD PTR _count$17859[esp+240] add edx, DWORD PTR _i$17855[esp+240] movzx eax, WORD PTR [ecx+edx*2] ; 172 : int Edge = OP.MakeEdgeID(index, indexNext); push eax push edi lea ecx, DWORD PTR [ebx+32] call ?MakeEdgeID@OpInfo@Mesh@@QAEHGG@Z ; Mesh::OpInfo::MakeEdgeID ; 173 : OP.NextVB[OP.EdgeID[Edge]].Position += fp; // Summe aller FacePunkte zu dieser Ecke sind hier push DWORD PTR _fp$17860[esp+240] lea esi, DWORD PTR [ebx+eax*2+4161584] movzx ecx, WORD PTR [esi] inc ecx shl ecx, 5 add ecx, ebx call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= ; 174 : ; 175 : ib[j * 5 + 2] = OP.EdgeID[Edge]; mov ax, WORD PTR [esi] mov ecx, DWORD PTR tv1018[esp+240] mov WORD PTR [ecx], ax ; 176 : ib[(j * 5 + 9) % (count * 5)] = OP.EdgeID[Edge]; // IB fertig! mov eax, DWORD PTR tv991[esp+240] cdq idiv DWORD PTR tv667[esp+240] mov ax, WORD PTR [esi] mov ecx, DWORD PTR _ib$17861[esp+240] ; 177 : ; 178 : OP.NextVB[index].Position += fp; //Summe aller FacePunkte die an diesen Originalpunkt grenzen push DWORD PTR _fp$17860[esp+240] mov WORD PTR [ecx+edx*2], ax lea ecx, DWORD PTR [edi+1] shl ecx, 5 add ecx, ebx call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= mov eax, DWORD PTR tv642[esp+240] add DWORD PTR tv995[esp+240], 2 add DWORD PTR tv1018[esp+240], 10 ; 0000000aH add DWORD PTR tv991[esp+240], 5 cmp eax, DWORD PTR _count$17859[esp+240] jl $LN18@CatmullCla $LN16@CatmullCla: ; 179 : } ; 180 : ; 181 : i += count; mov eax, DWORD PTR _count$17859[esp+240] add DWORD PTR _i$17855[esp+240], eax ; 182 : face++; ; 183 : OP.NextIndexCount += count * 5; ; 184 : OP.NextFaceCount += count; add DWORD PTR [ebx+2687016], eax inc DWORD PTR _face$[esp+240] mov ecx, eax mov eax, DWORD PTR _i$17855[esp+240] imul ecx, 5 add DWORD PTR [ebx+2687012], ecx cmp eax, DWORD PTR [ebx+4] jl $LL43@CatmullCla $LN22@CatmullCla: ; 185 : } ; 186 : ; 187 : // Originalpunkte verschieben ; 188 : for (int i = 0; i < VertexCount; ++i) and DWORD PTR _i$17875[esp+240], 0 fldz cmp DWORD PTR [ebx], 0 jle $LN13@CatmullCla lea eax, DWORD PTR [ebx+32] mov DWORD PTR tv1143[esp+240], -32 ; ffffffe0H sub DWORD PTR tv1143[esp+240], ebx mov DWORD PTR tv1138[esp+240], eax $LL15@CatmullCla: ; 191 : vec4 edgesVector(0,0,0,0); sub esp, 16 ; 00000010H fst DWORD PTR [esp+12] lea ecx, DWORD PTR _edgesVector$17880[esp+256] fst DWORD PTR [esp+8] mov BYTE PTR _openEdges$17879[esp+256], 0 fst DWORD PTR [esp+4] fstp DWORD PTR [esp] call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 ; 192 : vec4 openEdgesVector(0,0,0,0); fldz sub esp, 16 ; 00000010H fst DWORD PTR [esp+12] lea ecx, DWORD PTR _openEdgesVector$17881[esp+256] fst DWORD PTR [esp+8] fst DWORD PTR [esp+4] fstp DWORD PTR [esp] call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 ; 193 : int edgeCount = 0; xor edi, edi mov DWORD PTR _edgeCount$17882[esp+240], edi ; 194 : int openEdgeCount = 0; mov DWORD PTR _openEdgeCount$17883[esp+240], edi ; 195 : ; 196 : for (int j = 0; j < OP.EdgeCount; ++j) cmp DWORD PTR [ebx+2687020], edi jle $LN6@CatmullCla ; 189 : { ; 190 : bool openEdges = false; // gab es offene Kanten (d.h. einseitig benutze?) lea esi, DWORD PTR [ebx+2687024] $LL12@CatmullCla: ; 197 : { ; 198 : int V1 = (OP.EdgeConfiguration[j] & 0x0000ffff); mov ecx, DWORD PTR [esi] ; 199 : int V2 = (OP.EdgeConfiguration[j] & 0xffff0000) >> 16; movzx eax, WORD PTR [esi+2] and ecx, 65535 ; 0000ffffH ; 200 : if (V1 == i || V2 == i) cmp ecx, DWORD PTR _i$17875[esp+240] je SHORT $LN8@CatmullCla cmp eax, DWORD PTR _i$17875[esp+240] jne SHORT $LN11@CatmullCla $LN8@CatmullCla: ; 201 : { ; 202 : vec4 mid = VertexBuffer[V1].Position + VertexBuffer[V2].Position; mov edx, DWORD PTR [ebx+12] shl eax, 5 add eax, edx push eax lea eax, DWORD PTR _mid$17892[esp+244] shl ecx, 5 push eax add ecx, edx call ??Hvec4@@QBE?AU0@ABU0@@Z ; vec4::operator+ ; 203 : if (OP.EdgeUsage[j] == 1) cmp BYTE PTR [edi+ebx+3866672], 1 jne SHORT $LN7@CatmullCla ; 204 : { ; 205 : openEdges = true; ; 206 : openEdgeCount++; inc DWORD PTR _openEdgeCount$17883[esp+240] ; 207 : openEdgesVector += mid; lea eax, DWORD PTR _mid$17892[esp+240] push eax lea ecx, DWORD PTR _openEdgesVector$17881[esp+244] mov BYTE PTR _openEdges$17879[esp+244], 1 call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= $LN7@CatmullCla: ; 208 : } ; 209 : edgeCount++; inc DWORD PTR _edgeCount$17882[esp+240] ; 210 : edgesVector += mid; lea eax, DWORD PTR _mid$17892[esp+240] push eax lea ecx, DWORD PTR _edgesVector$17880[esp+244] call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= $LN11@CatmullCla: ; 195 : ; 196 : for (int j = 0; j < OP.EdgeCount; ++j) inc edi add esi, 4 cmp edi, DWORD PTR [ebx+2687020] jl SHORT $LL12@CatmullCla ; 211 : } ; 212 : } ; 213 : ; 214 : if (openEdges) cmp BYTE PTR _openEdges$17879[esp+240], 0 je SHORT $LN6@CatmullCla ; 215 : { ; 216 : OP.NextVB[i].Position = openEdgesVector / (float)(openEdgeCount * 4) + VertexBuffer[i].Position * 0.5f; fld DWORD PTR __real@3f000000 mov edi, DWORD PTR tv1138[esp+240] push ecx mov ecx, DWORD PTR [ebx+12] fstp DWORD PTR [esp] add ecx, DWORD PTR tv1143[esp+244] lea eax, DWORD PTR $T17898[esp+244] push eax add ecx, edi call ??Dvec4@@QBE?AU0@M@Z ; vec4::operator* push eax lea eax, DWORD PTR $T17899[esp+244] push eax mov eax, DWORD PTR _openEdgeCount$17883[esp+248] shl eax, 2 mov DWORD PTR tv1216[esp+248], eax fild DWORD PTR tv1216[esp+248] push ecx lea eax, DWORD PTR $T17897[esp+252] lea ecx, DWORD PTR _openEdgesVector$17881[esp+252] fstp DWORD PTR [esp] push eax call ??Kvec4@@QBE?AU0@M@Z ; vec4::operator/ mov ecx, eax call ??Hvec4@@QBE?AU0@ABU0@@Z ; vec4::operator+ mov esi, eax movsd movsd movsd movsd ; 217 : } ; 218 : else jmp $LN14@CatmullCla $LN6@CatmullCla: ; 219 : { ; 220 : OP.NextVB[i].Position = ; 221 : OP.NextVB[i].Position / (float)edgeCount + ; 222 : edgesVector / (float)edgeCount + ; 223 : VertexBuffer[i].Position * (float)(edgeCount - 3); mov eax, DWORD PTR _edgeCount$17882[esp+240] fild DWORD PTR _edgeCount$17882[esp+240] push ecx mov ecx, DWORD PTR [ebx+12] add ecx, DWORD PTR tv1143[esp+244] fstp DWORD PTR tv730[esp+244] add eax, -3 ; fffffffdH add ecx, DWORD PTR tv1138[esp+244] mov DWORD PTR tv1197[esp+244], eax fild DWORD PTR tv1197[esp+244] lea eax, DWORD PTR $T17907[esp+244] fstp DWORD PTR [esp] push eax call ??Dvec4@@QBE?AU0@M@Z ; vec4::operator* fld DWORD PTR tv730[esp+240] push eax lea eax, DWORD PTR $T17908[esp+244] push eax push ecx lea eax, DWORD PTR $T17904[esp+252] fstp DWORD PTR [esp] push eax lea ecx, DWORD PTR _edgesVector$17880[esp+256] call ??Kvec4@@QBE?AU0@M@Z ; vec4::operator/ fld DWORD PTR tv730[esp+248] push eax lea eax, DWORD PTR $T17905[esp+252] push eax push ecx mov ecx, DWORD PTR tv1138[esp+260] fstp DWORD PTR [esp] lea eax, DWORD PTR $T17902[esp+260] push eax call ??Kvec4@@QBE?AU0@M@Z ; vec4::operator/ mov ecx, eax call ??Hvec4@@QBE?AU0@ABU0@@Z ; vec4::operator+ mov ecx, eax call ??Hvec4@@QBE?AU0@ABU0@@Z ; vec4::operator+ ; 224 : OP.NextVB[i].Position /= (float)edgeCount; fld DWORD PTR tv730[esp+240] mov edi, DWORD PTR tv1138[esp+240] mov esi, eax movsd movsd movsd push ecx mov ecx, DWORD PTR tv1138[esp+244] movsd fstp DWORD PTR [esp] call ??_0vec4@@QAEXM@Z ; vec4::operator/= $LN14@CatmullCla: ; 185 : } ; 186 : ; 187 : // Originalpunkte verschieben ; 188 : for (int i = 0; i < VertexCount; ++i) inc DWORD PTR _i$17875[esp+240] fldz mov eax, DWORD PTR _i$17875[esp+240] add DWORD PTR tv1138[esp+240], 32 ; 00000020H cmp eax, DWORD PTR [ebx] jl $LL15@CatmullCla $LN13@CatmullCla: ; 225 : } ; 226 : } ; 227 : ; 228 : //EdgePunkte anpassen ; 229 : for (int j = 0; j < OP.EdgeCount; ++j) cmp DWORD PTR [ebx+2687020], 0 jle $LN51@CatmullCla lea eax, DWORD PTR [ebx+3866672] lea edi, DWORD PTR [ebx+4161584] lea ecx, DWORD PTR [ebx+2687024] mov DWORD PTR tv1290[esp+240], -3866672 ; ffc4ffd0H sub DWORD PTR tv1290[esp+240], ebx mov DWORD PTR tv1155[esp+240], eax mov DWORD PTR tv1250[esp+240], edi mov DWORD PTR tv1252[esp+240], ecx jmp SHORT $LN4@CatmullCla $LL41@CatmullCla: fldz mov ecx, DWORD PTR tv1252[esp+240] $LN4@CatmullCla: ; 230 : { ; 231 : int V1 = (OP.EdgeConfiguration[j] & 0x0000ffff); mov eax, DWORD PTR [ecx] ; 232 : int V2 = (OP.EdgeConfiguration[j] & 0xffff0000) >> 16; movzx esi, WORD PTR [ecx+2] ; 233 : if (OP.EdgeUsage[j] < 2) mov ecx, DWORD PTR tv1155[esp+240] and eax, 65535 ; 0000ffffH cmp BYTE PTR [ecx], 2 mov DWORD PTR _V1$17914[esp+240], eax mov DWORD PTR _V2$17915[esp+240], esi jae SHORT $LN55@CatmullCla ; 234 : { ; 235 : OP.NextVB[OP.EdgeID[j]].Position = vec4(0,0,0,0); sub esp, 16 ; 00000010H fst DWORD PTR [esp+12] lea ecx, DWORD PTR $T17917[esp+256] fst DWORD PTR [esp+8] fst DWORD PTR [esp+4] fstp DWORD PTR [esp] call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 movzx edi, WORD PTR [edi] inc edi shl edi, 5 add edi, ebx mov esi, eax ; 236 : OP.EdgeUsage[j] = 0; mov eax, DWORD PTR tv1155[esp+240] movsd movsd movsd movsd mov edi, DWORD PTR tv1250[esp+240] mov esi, DWORD PTR _V2$17915[esp+240] mov BYTE PTR [eax], 0 mov eax, DWORD PTR _V1$17914[esp+240] jmp SHORT $LN1@CatmullCla $LN55@CatmullCla: fstp ST(0) $LN1@CatmullCla: ; 237 : } ; 238 : ; 239 : OP.NextVB[OP.EdgeID[j]].Position += VertexBuffer[V1].Position; movzx ecx, WORD PTR [edi] shl eax, 5 add eax, DWORD PTR [ebx+12] inc ecx shl ecx, 5 push eax add ecx, ebx call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= ; 240 : OP.NextVB[OP.EdgeID[j]].Position += VertexBuffer[V2].Position; movzx ecx, WORD PTR [edi] shl esi, 5 add esi, DWORD PTR [ebx+12] inc ecx shl ecx, 5 push esi add ecx, ebx call ??Yvec4@@QAEXABU0@@Z ; vec4::operator+= ; 241 : OP.NextVB[OP.EdgeID[j]].Position /= (float)(OP.EdgeUsage[j] + 2); mov esi, DWORD PTR tv1155[esp+240] movzx eax, BYTE PTR [esi] push ecx movzx ecx, WORD PTR [edi] add eax, 2 mov DWORD PTR tv1145[esp+244], eax inc ecx shl ecx, 5 fild DWORD PTR tv1145[esp+244] add ecx, ebx fstp DWORD PTR [esp] call ??_0vec4@@QAEXM@Z ; vec4::operator/= add DWORD PTR tv1252[esp+240], 4 mov eax, DWORD PTR tv1290[esp+240] add edi, 2 inc esi add eax, esi mov DWORD PTR tv1250[esp+240], edi mov DWORD PTR tv1155[esp+240], esi cmp eax, DWORD PTR [ebx+2687020] jl $LL41@CatmullCla ; 225 : } ; 226 : } ; 227 : ; 228 : //EdgePunkte anpassen ; 229 : for (int j = 0; j < OP.EdgeCount; ++j) jmp SHORT $LN2@CatmullCla $LN51@CatmullCla: fstp ST(0) $LN2@CatmullCla: ; 242 : } ; 243 : ; 244 : memcpy(VertexBuffer, OP.NextVB, MaxVertexBuffer * sizeof(MeshVertex)); push 2097152 ; 00200000H lea eax, DWORD PTR [ebx+32] push eax push DWORD PTR [ebx+12] call _memcpy ; 245 : memcpy(IndexBuffer, OP.NextIB, MaxIndexBuffer * sizeof(unsigned short)); push 589824 ; 00090000H lea eax, DWORD PTR [ebx+2097184] push eax push DWORD PTR [ebx+16] call _memcpy ; 246 : VertexCount = OP.NextVertexCount; mov eax, DWORD PTR [ebx+2687008] mov DWORD PTR [ebx], eax ; 247 : IndexCount = OP.NextIndexCount; mov eax, DWORD PTR [ebx+2687012] mov DWORD PTR [ebx+4], eax ; 248 : FaceCount = OP.NextFaceCount; mov eax, DWORD PTR [ebx+2687016] add esp, 24 ; 00000018H mov DWORD PTR [ebx+8], eax $LN24@CatmullCla: ; 249 : } pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 ?CatmullClarkSubdivide@Mesh@@AAEXXZ ENDP ; Mesh::CatmullClarkSubdivide compile ENDS PUBLIC ?Extrude@Mesh@@AAEXM@Z ; Mesh::Extrude ; Function compile flags: /Ogspy compile SEGMENT tv377 = -20 ; size = 4 _indexNext$17935 = -16 ; size = 4 tv672 = -12 ; size = 4 _count$17929 = -12 ; size = 4 tv697 = -8 ; size = 4 tv575 = -8 ; size = 4 tv624 = -4 ; size = 4 _j$17930 = -4 ; size = 4 _iAdd$17947 = 8 ; size = 4 _fExtend$ = 8 ; size = 4 ?Extrude@Mesh@@AAEXM@Z PROC ; Mesh::Extrude ; _this$ = ecx ; 253 : { push ebp mov ebp, esp sub esp, 20 ; 00000014H push ebx push esi mov ebx, ecx push edi ; 254 : OP.Reset(); lea ecx, DWORD PTR [ebx+32] call ?Reset@OpInfo@Mesh@@QAEXXZ ; Mesh::OpInfo::Reset ; 255 : ; 256 : for (int i = 0; i < IndexCount;) xor esi, esi cmp DWORD PTR [ebx+4], esi jle $LN12@Extrude $LL13@Extrude: ; 257 : { ; 258 : int count = IndexBuffer[i]; mov ecx, DWORD PTR [ebx+16] movzx eax, WORD PTR [ecx+esi*2] ; 259 : IndexBuffer[i + IndexCount] = count; mov edx, DWORD PTR [ebx+4] ; 260 : ++i; ; 261 : ; 262 : for (int j = 0; j < count; ++j) and DWORD PTR _j$17930[ebp], 0 add edx, esi inc esi mov DWORD PTR _count$17929[ebp], eax mov WORD PTR [ecx+edx*2], ax test eax, eax jle SHORT $LN9@Extrude ; 257 : { ; 258 : int count = IndexBuffer[i]; lea eax, DWORD PTR [esi+esi] mov DWORD PTR tv575[ebp], eax $LL26@Extrude: ; 263 : { ; 264 : int index = IndexBuffer[i + j]; mov ecx, DWORD PTR [ebx+16] mov eax, DWORD PTR tv575[ebp] movzx edi, WORD PTR [eax+ecx] ; 265 : int indexNext = IndexBuffer[i + ((j + 1) % count)]; mov eax, DWORD PTR _j$17930[ebp] inc eax mov DWORD PTR tv377[ebp], eax cdq idiv DWORD PTR _count$17929[ebp] add edx, esi movzx eax, WORD PTR [ecx+edx*2] ; 266 : int ID = OP.MakeEdgeID(index, indexNext); push eax push edi lea ecx, DWORD PTR [ebx+32] mov DWORD PTR _indexNext$17935[ebp], eax call ?MakeEdgeID@OpInfo@Mesh@@QAEHGG@Z ; Mesh::OpInfo::MakeEdgeID ; 267 : if (index > indexNext) cmp edi, DWORD PTR _indexNext$17935[ebp] jle SHORT $LN8@Extrude ; 268 : { ; 269 : OP.EdgeUsage[ID] += 0x80; lea eax, DWORD PTR [eax+ebx+3866672] sub BYTE PTR [eax], -128 ; ffffff80H $LN8@Extrude: ; 270 : } ; 271 : IndexBuffer[i + IndexCount + count - j - 1] = index + VertexCount; mov edx, DWORD PTR [ebx+4] sub edx, DWORD PTR _j$17930[ebp] mov cx, WORD PTR [ebx] mov eax, DWORD PTR _count$17929[ebp] add DWORD PTR tv575[ebp], 2 add cx, di mov edi, DWORD PTR [ebx+16] add edx, eax add edx, esi mov WORD PTR [edi+edx*2-2], cx mov ecx, DWORD PTR tv377[ebp] mov DWORD PTR _j$17930[ebp], ecx cmp ecx, eax jl SHORT $LL26@Extrude $LN9@Extrude: ; 272 : } ; 273 : i += count; add esi, eax cmp esi, DWORD PTR [ebx+4] jl $LL13@Extrude $LN12@Extrude: ; 274 : } ; 275 : ; 276 : for (int i = 0; i < VertexCount; ++i) xor ecx, ecx xor edx, edx cmp DWORD PTR [ebx], ecx jle SHORT $LN5@Extrude $LL7@Extrude: ; 277 : { ; 278 : VertexBuffer[i + VertexCount].Position = VertexBuffer[i].Position; mov edi, DWORD PTR [ebx] mov eax, DWORD PTR [ebx+12] add edi, edx shl edi, 5 add edi, eax lea esi, DWORD PTR [ecx+eax] movsd movsd movsd movsd ; 279 : VertexBuffer[i].Position.z -= fExtend; mov eax, DWORD PTR [ebx+12] lea eax, DWORD PTR [ecx+eax+8] add ecx, 32 ; 00000020H fld DWORD PTR [eax] fsub DWORD PTR _fExtend$[ebp] fstp DWORD PTR [eax] ; 280 : VertexBuffer[i + VertexCount].Position.z += fExtend; mov eax, DWORD PTR [ebx] mov esi, DWORD PTR [ebx+12] add eax, edx shl eax, 5 lea eax, DWORD PTR [eax+esi+8] fld DWORD PTR [eax] inc edx fadd DWORD PTR _fExtend$[ebp] fstp DWORD PTR [eax] cmp edx, DWORD PTR [ebx] jl SHORT $LL7@Extrude $LN5@Extrude: ; 281 : } ; 282 : ; 283 : IndexCount *= 2; shl DWORD PTR [ebx+4], 1 ; 284 : FaceCount *= 2; shl DWORD PTR [ebx+8], 1 ; 285 : ; 286 : for (int i = 0; i < OP.EdgeCount; ++i) cmp DWORD PTR [ebx+2687020], 0 jle $LN2@Extrude ; 281 : } ; 282 : ; 283 : IndexCount *= 2; lea esi, DWORD PTR [ebx+3866672] lea eax, DWORD PTR [ebx+2687024] mov DWORD PTR tv697[ebp], -3866672 ; ffc4ffd0H sub DWORD PTR tv697[ebp], ebx mov DWORD PTR tv624[ebp], esi mov DWORD PTR tv672[ebp], eax $LL28@Extrude: ; 287 : { ; 288 : if ((OP.EdgeUsage[i] & 0x7f) == 1) mov cl, BYTE PTR [esi] mov dl, cl and dl, 127 ; 0000007fH cmp dl, 1 jne $LN3@Extrude ; 289 : { ; 290 : int iAdd = OP.EdgeUsage[i] == 1 ? 0 : VertexCount; cmp cl, dl jne SHORT $LN16@Extrude and DWORD PTR _iAdd$17947[ebp], 0 jmp SHORT $LN17@Extrude $LN16@Extrude: mov ecx, DWORD PTR [ebx] mov DWORD PTR _iAdd$17947[ebp], ecx $LN17@Extrude: ; 291 : int V1 = (OP.EdgeConfiguration[i] & 0x0000ffff); ; 292 : int V2 = (OP.EdgeConfiguration[i] & 0xffff0000) >> 16; movzx edx, WORD PTR [eax+2] mov ecx, DWORD PTR [eax] ; 293 : IndexBuffer[IndexCount++] = 4; mov eax, DWORD PTR [ebx+4] mov esi, DWORD PTR [ebx+16] and ecx, 65535 ; 0000ffffH push 4 pop edi mov WORD PTR [esi+eax*2], di inc DWORD PTR [ebx+4] mov eax, DWORD PTR [ebx+4] ; 294 : IndexBuffer[IndexCount++] = V1 + iAdd; mov edi, DWORD PTR [ebx+16] mov esi, DWORD PTR _iAdd$17947[ebp] add esi, ecx mov WORD PTR [edi+eax*2], si inc DWORD PTR [ebx+4] ; 295 : iAdd = VertexCount - iAdd; mov eax, DWORD PTR [ebx] sub eax, DWORD PTR _iAdd$17947[ebp] mov esi, DWORD PTR [ebx+4] ; 296 : IndexBuffer[IndexCount++] = V1 + iAdd; mov edi, DWORD PTR [ebx+16] add ecx, eax mov WORD PTR [edi+esi*2], cx inc DWORD PTR [ebx+4] mov ecx, DWORD PTR [ebx+4] ; 297 : IndexBuffer[IndexCount++] = V2 + iAdd; mov edi, DWORD PTR [ebx+16] lea esi, DWORD PTR [edx+eax] mov WORD PTR [edi+ecx*2], si ; 298 : iAdd = VertexCount - iAdd; ; 299 : IndexBuffer[IndexCount++] = V2 + iAdd; mov si, WORD PTR [ebx] inc DWORD PTR [ebx+4] mov ecx, DWORD PTR [ebx+4] sub si, ax mov eax, DWORD PTR [ebx+16] add si, dx mov WORD PTR [eax+ecx*2], si inc DWORD PTR [ebx+4] ; 300 : FaceCount += 1; inc DWORD PTR [ebx+8] mov eax, DWORD PTR tv672[ebp] mov esi, DWORD PTR tv624[ebp] $LN3@Extrude: ; 285 : ; 286 : for (int i = 0; i < OP.EdgeCount; ++i) mov ecx, DWORD PTR tv697[ebp] add eax, 4 inc esi add ecx, esi mov DWORD PTR tv672[ebp], eax mov DWORD PTR tv624[ebp], esi cmp ecx, DWORD PTR [ebx+2687020] jl $LL28@Extrude $LN2@Extrude: ; 301 : } ; 302 : } ; 303 : VertexCount *= 2; shl DWORD PTR [ebx], 1 pop edi pop esi pop ebx ; 304 : } leave ret 4 ?Extrude@Mesh@@AAEXM@Z ENDP ; Mesh::Extrude compile ENDS PUBLIC __real@c0000000 PUBLIC __real@bf800000 PUBLIC ?CreateCube@Mesh@@QAEXXZ ; Mesh::CreateCube ; COMDAT __real@c0000000 CONST SEGMENT __real@c0000000 DD 0c0000000r ; -2 CONST ENDS ; COMDAT __real@bf800000 CONST SEGMENT __real@bf800000 DD 0bf800000r ; -1 ; Function compile flags: /Ogspy CONST ENDS compile SEGMENT $T18010 = -16 ; size = 16 $T18009 = -16 ; size = 16 $T18008 = -16 ; size = 16 $T18007 = -16 ; size = 16 ?CreateCube@Mesh@@QAEXXZ PROC ; Mesh::CreateCube ; _this$ = ecx ; 408 : { push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 20 ; 00000014H push ebx push esi push edi mov ebx, ecx ; 409 : Lock(); call ?Lock@Mesh@@QAEXXZ ; Mesh::Lock ; 410 : VertexBuffer[0].Position = vec4(-2, -1, 0, 1); fld1 sub esp, 16 ; 00000010H fstp DWORD PTR [esp+12] fldz lea ecx, DWORD PTR $T18007[esp+48] fstp DWORD PTR [esp+8] fld DWORD PTR __real@bf800000 fstp DWORD PTR [esp+4] fld DWORD PTR __real@c0000000 fstp DWORD PTR [esp] call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 ; 411 : VertexBuffer[1].Position = vec4(-2, 1, 0, 1); fld1 mov edi, DWORD PTR [ebx+12] mov esi, eax movsd sub esp, 16 ; 00000010H movsd fst DWORD PTR [esp+12] fldz fstp DWORD PTR [esp+8] movsd fstp DWORD PTR [esp+4] fld DWORD PTR __real@c0000000 lea ecx, DWORD PTR $T18008[esp+48] fstp DWORD PTR [esp] movsd call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 mov edi, DWORD PTR [ebx+12] ; 412 : VertexBuffer[2].Position = vec4(2, 1, 0, 1); fld1 add edi, 32 ; 00000020H mov esi, eax movsd sub esp, 16 ; 00000010H movsd fst DWORD PTR [esp+12] fldz fstp DWORD PTR [esp+8] movsd fstp DWORD PTR [esp+4] fld DWORD PTR __real@40000000 lea ecx, DWORD PTR $T18009[esp+48] fstp DWORD PTR [esp] movsd call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 mov edi, DWORD PTR [ebx+12] ; 413 : VertexBuffer[3].Position = vec4(2, -1, 0, 1); fld1 add edi, 64 ; 00000040H mov esi, eax movsd sub esp, 16 ; 00000010H movsd fstp DWORD PTR [esp+12] fldz fstp DWORD PTR [esp+8] movsd fld DWORD PTR __real@bf800000 fstp DWORD PTR [esp+4] fld DWORD PTR __real@40000000 lea ecx, DWORD PTR $T18010[esp+48] fstp DWORD PTR [esp] movsd call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 mov edi, DWORD PTR [ebx+12] add edi, 96 ; 00000060H mov esi, eax movsd movsd movsd movsd ; 414 : VertexCount = 4; ; 415 : IndexBuffer[0] = 4; mov ecx, DWORD PTR [ebx+16] push 4 pop eax mov DWORD PTR [ebx], eax mov WORD PTR [ecx], ax ; 416 : IndexBuffer[1] = 0; mov eax, DWORD PTR [ebx+16] ; 417 : IndexBuffer[2] = 1; ; 418 : IndexBuffer[3] = 2; ; 419 : IndexBuffer[4] = 3; ; 420 : IndexCount = 5; ; 421 : FaceCount = 1; ; 422 : Extrude(1.0f); fld1 xor ecx, ecx mov WORD PTR [eax+2], cx mov ecx, DWORD PTR [ebx+16] xor eax, eax inc eax push 2 mov edx, eax mov WORD PTR [ecx+4], dx mov ecx, DWORD PTR [ebx+16] pop edx mov WORD PTR [ecx+6], dx mov ecx, DWORD PTR [ebx+16] push 3 pop edx mov WORD PTR [ecx+8], dx push ecx mov ecx, ebx fstp DWORD PTR [esp] mov DWORD PTR [ebx+4], 5 mov DWORD PTR [ebx+8], eax call ?Extrude@Mesh@@AAEXM@Z ; Mesh::Extrude ; 423 : GenerateNormals(); mov ecx, ebx call ?GenerateNormals@Mesh@@AAEXXZ ; Mesh::GenerateNormals ; 424 : Triangulate(); mov ecx, ebx call ?Triangulate@Mesh@@AAEXXZ ; Mesh::Triangulate ; 425 : Homogenize(); mov ecx, ebx call ?Homogenize@Mesh@@AAEXXZ ; Mesh::Homogenize ; 426 : Unlock(); call ?Unlock@Mesh@@QAEXXZ ; Mesh::Unlock ; 427 : } pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 ?CreateCube@Mesh@@QAEXXZ ENDP ; Mesh::CreateCube compile ENDS PUBLIC ?CreateSphere@Mesh@@QAEXI@Z ; Mesh::CreateSphere ; Function compile flags: /Ogspy compile SEGMENT $T18018 = -16 ; size = 16 $T18017 = -16 ; size = 16 $T18016 = -16 ; size = 16 $T18015 = -16 ; size = 16 _lod$ = 8 ; size = 4 ?CreateSphere@Mesh@@QAEXI@Z PROC ; Mesh::CreateSphere ; _this$ = ecx ; 431 : { push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 20 ; 00000014H push ebx push esi push edi mov ebx, ecx ; 432 : Lock(); call ?Lock@Mesh@@QAEXXZ ; Mesh::Lock ; 433 : VertexBuffer[0].Position = vec4(-1, -1, 0, 1); fld1 sub esp, 16 ; 00000010H fstp DWORD PTR [esp+12] fldz lea ecx, DWORD PTR $T18015[esp+48] fstp DWORD PTR [esp+8] fld DWORD PTR __real@bf800000 fst DWORD PTR [esp+4] fstp DWORD PTR [esp] call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 ; 434 : VertexBuffer[1].Position = vec4(-1, 1, 0, 1); fld1 mov edi, DWORD PTR [ebx+12] mov esi, eax movsd sub esp, 16 ; 00000010H movsd fst DWORD PTR [esp+12] fldz fstp DWORD PTR [esp+8] movsd fstp DWORD PTR [esp+4] fld DWORD PTR __real@bf800000 lea ecx, DWORD PTR $T18016[esp+48] fstp DWORD PTR [esp] movsd call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 mov edi, DWORD PTR [ebx+12] ; 435 : VertexBuffer[2].Position = vec4(1, 1, 0, 1); fld1 add edi, 32 ; 00000020H mov esi, eax movsd sub esp, 16 ; 00000010H movsd fst DWORD PTR [esp+12] fldz fstp DWORD PTR [esp+8] movsd fst DWORD PTR [esp+4] lea ecx, DWORD PTR $T18017[esp+48] fstp DWORD PTR [esp] movsd call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 mov edi, DWORD PTR [ebx+12] ; 436 : VertexBuffer[3].Position = vec4(1, -1, 0, 1); fld1 add edi, 64 ; 00000040H mov esi, eax movsd sub esp, 16 ; 00000010H movsd fst DWORD PTR [esp+12] fldz fstp DWORD PTR [esp+8] movsd fld DWORD PTR __real@bf800000 fstp DWORD PTR [esp+4] lea ecx, DWORD PTR $T18018[esp+48] fstp DWORD PTR [esp] movsd call ??0vec4@@QAE@MMMM@Z ; vec4::vec4 mov edi, DWORD PTR [ebx+12] add edi, 96 ; 00000060H mov esi, eax movsd movsd movsd movsd ; 437 : VertexCount = 4; ; 438 : IndexBuffer[0] = 4; mov ecx, DWORD PTR [ebx+16] push 4 pop eax mov DWORD PTR [ebx], eax mov WORD PTR [ecx], ax ; 439 : IndexBuffer[1] = 0; mov eax, DWORD PTR [ebx+16] xor ecx, ecx mov WORD PTR [eax+2], cx ; 440 : IndexBuffer[2] = 1; mov ecx, DWORD PTR [ebx+16] ; 441 : IndexBuffer[3] = 2; ; 442 : IndexBuffer[4] = 3; ; 443 : IndexCount = 5; ; 444 : FaceCount = 1; ; 445 : Extrude(1.0f); fld1 xor eax, eax inc eax push 2 mov edx, eax mov WORD PTR [ecx+4], dx mov ecx, DWORD PTR [ebx+16] pop edx mov WORD PTR [ecx+6], dx mov ecx, DWORD PTR [ebx+16] push 3 pop edx mov WORD PTR [ecx+8], dx push ecx mov ecx, ebx fstp DWORD PTR [esp] mov DWORD PTR [ebx+4], 5 mov DWORD PTR [ebx+8], eax call ?Extrude@Mesh@@AAEXM@Z ; Mesh::Extrude ; 446 : for (unsigned int i = 0; i < lod; ++i) mov esi, DWORD PTR _lod$[ebp] test esi, esi je SHORT $LN1@CreateSphe $LL3@CreateSphe: ; 447 : CatmullClarkSubdivide(); mov ecx, ebx call ?CatmullClarkSubdivide@Mesh@@AAEXXZ ; Mesh::CatmullClarkSubdivide dec esi jne SHORT $LL3@CreateSphe $LN1@CreateSphe: ; 448 : GenerateNormals(); mov ecx, ebx call ?GenerateNormals@Mesh@@AAEXXZ ; Mesh::GenerateNormals ; 449 : Triangulate(); mov ecx, ebx call ?Triangulate@Mesh@@AAEXXZ ; Mesh::Triangulate ; 450 : Homogenize(); mov ecx, ebx call ?Homogenize@Mesh@@AAEXXZ ; Mesh::Homogenize ; 451 : Unlock(); call ?Unlock@Mesh@@QAEXXZ ; Mesh::Unlock ; 452 : } pop edi pop esi pop ebx mov esp, ebp pop ebp ret 4 ?CreateSphere@Mesh@@QAEXI@Z ENDP ; Mesh::CreateSphere compile ENDS PUBLIC ??0Mesh@@QAE@XZ ; Mesh::Mesh ; Function compile flags: /Ogspy compile SEGMENT ??0Mesh@@QAE@XZ PROC ; Mesh::Mesh ; _this$ = ecx ; 7 : { push ebx push ebp push esi mov esi, ecx xor ebp, ebp push edi lea ecx, DWORD PTR [esi+32] mov DWORD PTR [esi], ebp mov DWORD PTR [esi+4], ebp call ??0OpInfo@Mesh@@QAE@XZ ; 8 : glGenVertexArrays(1, &VertexArrayObject); lea edi, DWORD PTR [esi+4751408] push edi push 1 call DWORD PTR ?glGenVertexArrays@@3P6GXHPAI@ZA ; glGenVertexArrays ; 9 : glBindVertexArray(VertexArrayObject); push DWORD PTR [edi] call DWORD PTR ?glBindVertexArray@@3P6GXI@ZA ; glBindVertexArray ; 10 : ; 11 : glGenBuffers(1, &VertexArrayBuffer); lea edi, DWORD PTR [esi+4751412] push edi push 1 call DWORD PTR ?glGenBuffers@@3P6GXHPAI@ZA ; glGenBuffers ; 12 : glBindBuffer(GL_ARRAY_BUFFER, VertexArrayBuffer); push DWORD PTR [edi] mov edi, 34962 ; 00008892H push edi call DWORD PTR ?glBindBuffer@@3P6GXII@ZA ; glBindBuffer ; 13 : glBufferData(GL_ARRAY_BUFFER, MaxVertexBuffer * sizeof(MeshVertex), 0, GL_STATIC_DRAW); lea ebx, DWORD PTR [edi+82] push ebx push ebp push ebp push 2097152 ; 00200000H push edi call DWORD PTR ?glBufferData@@3P6GXI_JPBXI@ZA ; glBufferData ; 14 : ; 15 : glGenBuffers(1, &IndexBufferObject); lea edi, DWORD PTR [esi+4751416] push edi push 1 call DWORD PTR ?glGenBuffers@@3P6GXHPAI@ZA ; glGenBuffers ; 16 : glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IndexBufferObject); push DWORD PTR [edi] lea edi, DWORD PTR [ebx-81] push edi call DWORD PTR ?glBindBuffer@@3P6GXII@ZA ; glBindBuffer ; 17 : glBufferData(GL_ELEMENT_ARRAY_BUFFER, MaxIndexBuffer * sizeof(unsigned short), NULL, GL_STATIC_DRAW); push ebx push ebp push ebp push 589824 ; 00090000H push edi call DWORD PTR ?glBufferData@@3P6GXI_JPBXI@ZA ; glBufferData ; 18 : glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); push ebp push edi call DWORD PTR ?glBindBuffer@@3P6GXII@ZA ; glBindBuffer ; 19 : glBindVertexArray(0); push ebp call DWORD PTR ?glBindVertexArray@@3P6GXI@ZA ; glBindVertexArray pop edi ; 20 : } mov eax, esi pop esi pop ebp pop ebx ret 0 ??0Mesh@@QAE@XZ ENDP ; Mesh::Mesh compile ENDS END