Rev 9516 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9516 | Rev 9521 | ||
---|---|---|---|
Line 72... | Line 72... | ||
72 | cmp [esi],word 4D4Dh |
72 | cmp [esi],word 4D4Dh |
73 | jne .asc |
73 | jne .asc |
74 | call read_tp_variables ; init points and triangles count variables |
74 | call read_tp_variables ; init points and triangles count variables |
75 | cmp eax,0 |
75 | cmp eax,0 |
76 | je .gen |
76 | |
77 | jmp .malloc |
- | |
- | 77 | jne .malloc |
|
78 | .gen: |
78 | .gen: |
79 | call generate_object |
79 | ; if no house.3ds on board - generate |
- | 80 | xor bl,bl ; reallocate memory |
|
- | 81 | mov [triangles_count_var],20000 |
|
- | 82 | mov [points_count_var],20000 |
|
- | 83 | call alloc_mem_for_tp |
|
- | 84 | ||
- | 85 | mov bl,[generator_flag] |
|
- | 86 | call generate_object |
|
80 | jmp .opt |
87 | jmp .opt |
81 | .asc: |
88 | .asc: |
82 | mov [triangles_count_var],10000 ; to do: read asc header |
89 | mov [triangles_count_var],10000 ; to do: read asc header |
83 | mov [points_count_var],10000 |
90 | mov [points_count_var],10000 |
84 | call alloc_mem_for_tp |
91 | call alloc_mem_for_tp |
Line 366... | Line 373... | ||
366 | .next_m: |
373 | .next_m: |
367 | cmp ah,18 |
374 | cmp ah,18 |
368 | jne .next_m2 |
375 | jne .next_m2 |
369 | 376 | ||
Line 370... | Line 377... | ||
370 | mov [re_alloc_flag],1 ; reallocate memory |
377 | mov bl,1 ; reallocate memory |
371 | mov [triangles_count_var],20000 |
378 | mov [triangles_count_var],20000 |
372 | mov [points_count_var],20000 |
379 | mov [points_count_var],20000 |
373 | call alloc_mem_for_tp |
380 | call alloc_mem_for_tp |
374 | mov [re_alloc_flag],0 |
- | |
Line 375... | Line 381... | ||
375 | 381 | ||
376 | mov bl,[generator_flag] |
382 | mov bl,[generator_flag] |
377 | ; or bl,bl |
383 | ; or bl,bl |
378 | ; jz .next_m2 |
384 | ; jz .next_m2 |
Line 390... | Line 396... | ||
390 | call generate_object3 |
396 | call generate_object3 |
391 | .calc_norm: |
397 | .calc_norm: |
392 | call optimize_object1 |
398 | call optimize_object1 |
393 | call init_triangles_normals2 |
399 | call init_triangles_normals2 |
394 | call init_point_normals |
400 | if Ext >= SSE2 |
- | 401 | call detect_chunks |
|
- | 402 | mov [chunks_number],ecx |
|
- | 403 | mov [chunks_ptr],ebx |
|
- | 404 | ||
- | 405 | ; esi - tri_ch |
|
- | 406 | ; edi - t_ptr - every vertice index - pointer to to all triangles |
|
- | 407 | ; that have this index |
|
- | 408 | end if |
|
- | 409 | ||
- | 410 | call init_point_normals |
|
395 | call calc_bumpmap_coords ; bump and texture mapping |
411 | call calc_bumpmap_coords ; bump and texture mapping |
396 | call do_edges_list |
412 | call do_edges_list |
397 | call write_info |
413 | call write_info |
398 | .next_m2: |
414 | .next_m2: |
399 | cmp ah,19 |
415 | cmp ah,19 |
Line 3284... | Line 3300... | ||
3284 | ret |
3300 | ret |
3285 | 3301 | ||
Line 3286... | Line 3302... | ||
3286 | 3302 | ||
- | 3303 | alloc_mem_for_tp: |
|
3287 | alloc_mem_for_tp: |
3304 | ;in: bl = 1 - realloc |
3288 | mov eax, 68 |
3305 | mov eax, 68 |
3289 | cmp [re_alloc_flag],1 |
3306 | cmp bl,1 |
3290 | jz @f |
3307 | jz @f |
3291 | mov ebx, 12 |
3308 | mov ebx, 12 |
3292 | jmp .alloc |
3309 | jmp .alloc |
3293 | @@: |
3310 | @@: |
Line 3350... | Line 3367... | ||
3350 | int 0x40 |
3367 | int 0x40 |
3351 | mov [points_rotated_ptr], eax |
3368 | mov [points_rotated_ptr], eax |
3352 | 3369 | ||
Line 3353... | Line 3370... | ||
3353 | mov eax, 68 |
3370 | mov eax, 68 |
3354 | mov ebx, 12 |
3371 | ; mov ebx, 12 |
3355 | mov ecx, [points_count_var] |
3372 | mov ecx, [points_count_var] |
3356 | shl ecx,2 |
3373 | shl ecx,2 |
3357 | add ecx,32 |
3374 | add ecx,32 |
3358 | mov edx,[tex_points_ptr] |
3375 | mov edx,[tex_points_ptr] |
3359 | int 0x40 |
3376 | int 0x40 |