diff --git a/programs/develop/libraries/TinyGL/asm_fork/arrays.asm b/programs/develop/libraries/TinyGL/asm_fork/arrays.asm index ddc9da05f..c07e8fb63 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/arrays.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/arrays.asm @@ -306,68 +306,169 @@ endl endp align 4 -proc glopDrawElements uses eax ebx edx, context:dword, param:dword +proc glopDrawElements, context:dword, param:dword locals + ii dd ? + idx dd ? + states dd ? + type dd ? + size dd ? + indices dd ? ;указатель на 16 или 32 битные индексы p rd 8 endl - +pushad mov edx,[context] mov ebx,[param] - ;int i; - ;int idx; - ;int states = c->client_states; - ;int count = param[2].i; - ;int type = param[3].i; - ;unsigned int *indices_u32 = (unsigned int*)param[4].p; - ;unsigned short *indices_u16 = (unsigned short*)indices_u32; - + mov eax,[edx+offs_cont_client_states] + mov [states],eax mov eax,[ebx+4] mov [p+4],eax ;p[1].i = param[1].i + mov ecx,[ebx+8] ;count = param[2].i + mov eax,[ebx+12] + mov [type],eax ;type = param[3].i + mov eax,[ebx+16] + mov [indices],eax ;*indices = param[4].p mov eax,ebp sub eax,32 ;=sizeof(dd)*8 stdcall glopBegin, edx,eax -; for (int ii=0; iicolor_array_size; -; i = idx * (size + c->color_array_stride); -; p[1].f = c->color_array[i]; -; p[2].f = c->color_array[i+1]; -; p[3].f = c->color_array[i+2]; -; p[4].f = size > 3 ? c->color_array[i+3] : 1.0f; -; glopColor(c, p); -; } -; if (states & NORMAL_ARRAY) { -; i = idx * (3 + c->normal_array_stride); -; c->current_normal.X = c->normal_array[i]; -; c->current_normal.Y = c->normal_array[i+1]; -; c->current_normal.Z = c->normal_array[i+2]; -; c->current_normal.W = 0.0f; -; } -; if (states & TEXCOORD_ARRAY) { -; int size = c->texcoord_array_size; -; i = idx * (size + c->texcoord_array_stride); -; c->current_tex_coord.X = c->texcoord_array[i]; -; c->current_tex_coord.Y = c->texcoord_array[i+1]; -; c->current_tex_coord.Z = size > 2 ? c->texcoord_array[i+2] : 0.0f; -; c->current_tex_coord.W = size > 3 ? c->texcoord_array[i+3] : 1.0f; -; } -; if (states & VERTEX_ARRAY) { -; GLParam p[5]; -; int size = c->vertex_array_size; -; i = idx * (size + c->vertex_array_stride); -; p[1].f = c->vertex_array[i]; -; p[2].f = c->vertex_array[i+1]; -; p[3].f = size > 2 ? c->vertex_array[i+2] : 0.0f; -; p[4].f = size > 3 ? c->vertex_array[i+3] : 1.0f; -; glopVertex(c, p); -; } -; } + mov dword[ii],0 +align 4 + .cycle_0: ;for (int ii=0; ii