Rev 2758 | Rev 2815 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2758 | Rev 2759 | ||
---|---|---|---|
Line 2910... | Line 2910... | ||
2910 | 2910 | ||
2911 | ; |
2911 | ; |
2912 | align 4 |
2912 | align 4 |
2913 | proc vox_add, buf_v1:dword, buf_v2:dword, coord_x:dword, coord_y:dword, coord_z:dword |
2913 | proc vox_add, buf_v1:dword, buf_v2:dword, coord_x:dword, coord_y:dword, coord_z:dword |
2914 | pushad |
2914 | pushad |
2915 | mov eax,[coord_x] |
2915 | mov ebx,[coord_x] |
2916 | mov ebx,[coord_y] |
2916 | mov eax,[coord_y] |
2917 | mov edi,[buf_v2] |
2917 | mov edi,[buf_v2] |
2918 | mov ecx,buf2d_h |
2918 | mov ecx,buf2d_h |
2919 | mov esi,buf2d_w |
2919 | mov esi,buf2d_w |
2920 | imul ecx,esi |
2920 | imul ecx,esi |
2921 | add esi,eax |
2921 | add esi,ebx |
2922 | mov edx,buf2d_data |
2922 | mov edx,buf2d_data |
2923 | cld |
2923 | cld |
2924 | ;ecx - count pixels in voxel |
2924 | ;ecx - count pixels in voxel |
2925 | ;edx - 㪠§ â¥«ì ¤ ë¥ ¢ ¢®ªá¥«ì®¬ ¡ãä¥à¥ |
2925 | ;edx - 㪠§ â¥«ì ¤ ë¥ ¢ ¢®ªá¥«ì®¬ ¡ãä¥à¥ |
2926 | ;edi - 㪠§ â¥«ì ¢®ªá¥«ìë© ¡ãä¥à |
2926 | ;edi - 㪠§ â¥«ì ¢®ªá¥«ìë© ¡ãä¥à |
2927 | ;esi - width voxel buffer add coord x |
2927 | ;esi - width voxel buffer add coord x |
2928 | .cycle: |
2928 | .cycle: |
2929 | cmp dword[edx],0 |
2929 | cmp dword[edx],0 |
2930 | je @f |
2930 | je @f |
2931 | ;¯à®¢¥à塞 ¡ãä¥à £«ã¡¨ë |
2931 | ;¯à®¢¥à塞 ¡ãä¥à £«ã¡¨ë |
2932 | push eax ecx esi |
2932 | push eax ecx edi esi |
- | 2933 | mov ecx,eax |
|
2933 | mov ecx,eax |
2934 | mov edi,[buf_v1] |
2934 | stdcall buf_get_pixel, [buf_v1],ecx,ebx |
2935 | call get_pixel_32 ;stdcall buf_get_pixel, [buf_v1],ebx,ecx |
2935 | mov esi,[edx] |
2936 | mov esi,[edx] |
2936 | add esi,[coord_z] |
2937 | add esi,[coord_z] |
2937 | cmp eax,esi |
2938 | cmp eax,esi |
2938 | jge .end_draw |
2939 | jge .end_draw |
2939 | stdcall buf_set_pixel, [buf_v1],ecx,ebx,esi ;esi = new coord z |
2940 | stdcall buf_set_pixel, [buf_v1],ebx,ecx,esi ;esi = new coord z |
2940 | .end_draw: |
2941 | .end_draw: |
2941 | pop esi ecx eax |
2942 | pop esi edi ecx eax |
2942 | @@: |
2943 | @@: |
2943 | add edx,4 |
- | |
2944 | inc eax |
- | |
2945 | cmp eax,esi |
- | |
2946 | jl @f |
2944 | add edx,4 |
- | 2945 | inc ebx |
|
- | 2946 | cmp ebx,esi |
|
- | 2947 | jl @f |
|
2947 | inc ebx |
2948 | inc eax |
2948 | sub eax,buf2d_w |
2949 | sub ebx,buf2d_w |
2949 | @@: |
2950 | @@: |
2950 | loop .cycle |
2951 | loop .cycle |
2951 | popad |
2952 | popad |
2952 | ret |
2953 | ret |