2014-10-31 22:28:24 +01:00
|
|
|
; glVertex
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glVertex4f: ;x, y, z, w
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Vertex
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 20 ;=sizeof(dd)*5
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glVertex2f, x:dword, y:dword
|
|
|
|
stdcall glVertex4f,[x],[y],0.0,1.0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2015-01-05 20:13:01 +01:00
|
|
|
align 4
|
|
|
|
proc glVertex2fv uses eax, v:dword
|
|
|
|
mov eax,[v]
|
|
|
|
stdcall glVertex4f,[eax],[eax+4],0.0,1.0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2014-10-31 22:28:24 +01:00
|
|
|
align 4
|
|
|
|
proc glVertex3f, x:dword, y:dword, z:dword
|
|
|
|
stdcall glVertex4f,[x],[y],[z],1.0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glVertex3fv uses eax, v:dword
|
|
|
|
mov eax,[v]
|
|
|
|
stdcall glVertex4f,[eax],[eax+4],[eax+8],1.0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2015-01-05 20:13:01 +01:00
|
|
|
align 4
|
|
|
|
proc glVertex4fv uses eax, v:dword
|
|
|
|
mov eax,[v]
|
|
|
|
stdcall glVertex4f,[eax],[eax+4],[eax+8],[eax+12]
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2014-10-31 22:28:24 +01:00
|
|
|
; glNormal
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glNormal3f: ;x, y, z
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Normal
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 16 ;=sizeof(dd)*4
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glNormal3fv uses eax, v:dword
|
|
|
|
mov eax,[v]
|
|
|
|
stdcall glNormal3f,[eax],[eax+4],[eax+8]
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
; glColor
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glColor4f uses eax, r:dword, g:dword, b:dword, a:dword
|
|
|
|
locals
|
|
|
|
p rd 8
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_Color
|
|
|
|
mov eax,[b]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[g]
|
|
|
|
mov dword[p+8],eax
|
|
|
|
mov eax,[r]
|
|
|
|
mov dword[p+12],eax
|
|
|
|
mov eax,[a]
|
|
|
|
mov dword[p+16],eax
|
|
|
|
; direct convertion to integer to go faster if no shading
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-12] ;ebp-12 = &p[5]
|
2014-10-31 22:28:24 +01:00
|
|
|
push eax
|
|
|
|
add eax,4 ;ebp-8 = &p[6]
|
|
|
|
push eax
|
|
|
|
add eax,4 ;ebp-4 = &p[7]
|
|
|
|
push eax
|
|
|
|
stdcall RGBFtoRGBI,[r],[g],[b] ;call: r,g,b,&p[7],&p[6],&p[5]
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-32] ;=sizeof(dd)*8
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glColor4fv uses eax ebx, v:dword
|
|
|
|
mov eax,[v]
|
2015-02-18 00:01:48 +01:00
|
|
|
stdcall glColor4f,[eax],[eax+4],[eax+8],[eax+12],1.0
|
2014-10-31 22:28:24 +01:00
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glColor3f, r:dword, g:dword, b:dword
|
|
|
|
stdcall glColor4f,[r],[g],[b],1.0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glColor3fv uses eax, v:dword
|
|
|
|
mov eax,[v]
|
|
|
|
stdcall glColor4f,[eax],[eax+4],[eax+8],1.0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2015-01-28 17:54:02 +01:00
|
|
|
align 4
|
|
|
|
fl_255 dd 255.0
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glColor3ub uses eax, r:dword, g:dword, b:dword
|
|
|
|
push dword 1.0
|
|
|
|
fld dword[fl_255]
|
|
|
|
|
|
|
|
movzx eax,byte[b]
|
|
|
|
mov dword[esp-4],eax
|
|
|
|
fild dword[esp-4]
|
|
|
|
fdiv st0,st1
|
|
|
|
fstp dword[esp-4] ;преобразовали int во float
|
|
|
|
movzx eax,byte[g]
|
|
|
|
mov dword[esp-8],eax
|
|
|
|
fild dword[esp-8]
|
|
|
|
fdiv st0,st1
|
|
|
|
fstp dword[esp-8]
|
|
|
|
movzx eax,byte[r]
|
|
|
|
mov dword[esp-12],eax
|
|
|
|
fild dword[esp-12]
|
|
|
|
fdiv st0,st1
|
|
|
|
fstp dword[esp-12]
|
|
|
|
|
|
|
|
ffree st0
|
|
|
|
fincstp
|
|
|
|
sub esp,12
|
|
|
|
call glColor4f
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2014-10-31 22:28:24 +01:00
|
|
|
; TexCoord
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glTexCoord4f: ;s, t, r, q
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_TexCoord
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 20 ;=sizeof(dd)*5
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glTexCoord2f, s:dword, t:dword
|
|
|
|
stdcall glTexCoord4f,[s],[t],0.0,1.0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glTexCoord2fv uses eax, v:dword
|
|
|
|
mov eax,[v]
|
|
|
|
stdcall glTexCoord4f,[eax],[eax+4],0.0,1.0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glEdgeFlag: ;flag
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_EdgeFlag
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
; misc
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glShadeModel: ;mode
|
2014-10-31 22:28:24 +01:00
|
|
|
; assert(mode == GL_FLAT || mode == GL_SMOOTH);
|
2020-09-16 08:59:01 +02:00
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_ShadeModel
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glCullFace: ;mode
|
2014-10-31 22:28:24 +01:00
|
|
|
; assert(mode == GL_BACK ||
|
|
|
|
; mode == GL_FRONT ||
|
|
|
|
; mode == GL_FRONT_AND_BACK);
|
2020-09-16 08:59:01 +02:00
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_CullFace
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glFrontFace uses eax, mode:dword
|
|
|
|
locals
|
|
|
|
p rd 2
|
|
|
|
endl
|
|
|
|
|
|
|
|
; assert(mode == GL_CCW || mode == GL_CW);
|
|
|
|
|
|
|
|
mov dword[p],OP_FrontFace
|
|
|
|
xor eax,eax
|
|
|
|
cmp dword[mode],GL_CCW
|
|
|
|
je @f
|
|
|
|
inc eax
|
|
|
|
@@:
|
|
|
|
mov dword[p+4],eax
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-8] ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glPolygonMode: ;face, mode
|
2014-10-31 22:28:24 +01:00
|
|
|
; assert(face == GL_BACK ||
|
|
|
|
; face == GL_FRONT ||
|
|
|
|
; face == GL_FRONT_AND_BACK);
|
|
|
|
; assert(mode == GL_POINT || mode == GL_LINE || mode==GL_FILL);
|
2020-09-16 08:59:01 +02:00
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_PolygonMode
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 12 ;=sizeof(dd)*3
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
; glEnable / glDisable
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glEnable uses eax, cap:dword
|
|
|
|
locals
|
|
|
|
p rd 3
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_EnableDisable
|
|
|
|
mov eax,[cap]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov dword[p+8],1
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-12] ;=sizeof(dd)*3
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glDisable uses eax, cap:dword
|
|
|
|
locals
|
|
|
|
p rd 3
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_EnableDisable
|
|
|
|
mov eax,[cap]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov dword[p+8],0
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-12] ;=sizeof(dd)*3
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
; glBegin / glEnd
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glBegin: ;mode
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Begin
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glEnd:
|
|
|
|
stdcall gl_add_op,op_End
|
2014-10-31 22:28:24 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
; matrix
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glMatrixMode: ;mode
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_MatrixMode
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glLoadMatrixf uses ecx edi esi, m:dword
|
|
|
|
locals
|
|
|
|
p rd 17
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_LoadMatrix
|
|
|
|
mov ecx,16
|
|
|
|
mov esi,[m]
|
|
|
|
mov edi,ebp
|
|
|
|
sub edi,64 ;=sizeof(M4)
|
|
|
|
rep movsd
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea ecx,[ebp-68] ;=sizeof(dd)*17
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,ecx
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glLoadIdentity:
|
|
|
|
stdcall gl_add_op,op_LoadIdentity
|
2014-10-31 22:28:24 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glMultMatrixf uses ecx edi esi, m:dword
|
|
|
|
locals
|
|
|
|
p rd 17
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_MultMatrix
|
|
|
|
mov ecx,16
|
|
|
|
mov esi,[m]
|
|
|
|
mov edi,ebp
|
|
|
|
sub edi,64 ;=sizeof(M4)
|
|
|
|
rep movsd
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea ecx,[ebp-68] ;=sizeof(dd)*17
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,ecx
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glPushMatrix:
|
|
|
|
stdcall gl_add_op,op_PushMatrix
|
2014-10-31 22:28:24 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glPopMatrix:
|
|
|
|
stdcall gl_add_op,op_PopMatrix
|
2014-10-31 22:28:24 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glRotatef: ;angle, x, y, z
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Rotate
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 20 ;=sizeof(dd)*5
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glTranslatef: ;x, y, z
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Translate
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 16 ;=sizeof(dd)*4
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glScalef: ;x, y, z
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Scale
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 16 ;=sizeof(dd)*4
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glViewport: ;x, y, width, heigh
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Viewport
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 20 ;=sizeof(dd)*5
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-09 13:56:39 +02:00
|
|
|
proc glFrustum uses eax, left:qword, right:qword, bottom:qword, top:qword,\
|
|
|
|
near:qword, farv:qword
|
2014-10-31 22:28:24 +01:00
|
|
|
locals
|
|
|
|
p rd 7
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_Frustum
|
2020-09-09 13:56:39 +02:00
|
|
|
fld qword[left]
|
2014-10-31 22:28:24 +01:00
|
|
|
fstp dword[p+4]
|
2020-09-09 13:56:39 +02:00
|
|
|
fld qword[right]
|
2014-10-31 22:28:24 +01:00
|
|
|
fstp dword[p+8]
|
2020-09-09 13:56:39 +02:00
|
|
|
fld qword[bottom]
|
2014-10-31 22:28:24 +01:00
|
|
|
fstp dword[p+12]
|
2020-09-09 13:56:39 +02:00
|
|
|
fld qword[top]
|
2014-10-31 22:28:24 +01:00
|
|
|
fstp dword[p+16]
|
2020-09-09 13:56:39 +02:00
|
|
|
fld qword[near]
|
2014-10-31 22:28:24 +01:00
|
|
|
fstp dword[p+20]
|
2020-09-09 13:56:39 +02:00
|
|
|
fld qword[farv]
|
2014-10-31 22:28:24 +01:00
|
|
|
fstp dword[p+24]
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-28] ;=sizeof(dd)*7
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2020-09-14 23:31:00 +02:00
|
|
|
align 4
|
|
|
|
proc glOrtho uses eax, left:qword, right:qword, bottom:qword, top:qword,\
|
|
|
|
near:qword, farv:qword
|
|
|
|
locals
|
|
|
|
p rd 7
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_Ortho
|
|
|
|
fld qword[left]
|
|
|
|
fstp dword[p+4]
|
|
|
|
fld qword[right]
|
|
|
|
fstp dword[p+8]
|
|
|
|
fld qword[bottom]
|
|
|
|
fstp dword[p+12]
|
|
|
|
fld qword[top]
|
|
|
|
fstp dword[p+16]
|
|
|
|
fld qword[near]
|
|
|
|
fstp dword[p+20]
|
|
|
|
fld qword[farv]
|
|
|
|
fstp dword[p+24]
|
|
|
|
|
|
|
|
lea eax,[ebp-28] ;=sizeof(dd)*7
|
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2015-01-05 20:13:01 +01:00
|
|
|
; lightening
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glMaterialfv uses eax ecx, mode:dword, type:dword, v:dword
|
|
|
|
locals
|
|
|
|
p rd 7
|
|
|
|
endl
|
|
|
|
|
|
|
|
; assert(mode == GL_FRONT || mode == GL_BACK || mode==GL_FRONT_AND_BACK);
|
|
|
|
|
|
|
|
mov dword[p],OP_Material
|
|
|
|
mov eax,[mode]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[type]
|
|
|
|
mov dword[p+8],eax
|
|
|
|
|
|
|
|
mov eax,[v]
|
|
|
|
mov ecx,[eax+8]
|
|
|
|
mov dword[p+12],ecx
|
|
|
|
mov ecx,[eax+4]
|
|
|
|
mov dword[p+16],ecx
|
|
|
|
mov ecx,[eax]
|
|
|
|
mov dword[p+20],ecx
|
|
|
|
mov ecx,[eax+12]
|
|
|
|
mov dword[p+24],ecx
|
|
|
|
|
|
|
|
cmp dword[type],GL_SHININESS
|
|
|
|
jne @f
|
|
|
|
mov dword[p+16],0.0
|
|
|
|
mov dword[p+20],0.0
|
|
|
|
mov dword[p+24],0.0
|
|
|
|
@@:
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-28] ;=sizeof(dd)*7
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glMaterialf uses eax, mode:dword, type:dword, v:dword
|
|
|
|
locals
|
|
|
|
p rd 7
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_Material
|
|
|
|
mov eax,[mode]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[type]
|
|
|
|
mov dword[p+8],eax
|
|
|
|
mov eax,[v]
|
|
|
|
mov dword[p+12],eax
|
|
|
|
mov dword[p+16],0.0
|
|
|
|
mov dword[p+20],0.0
|
|
|
|
mov dword[p+24],0.0
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-28] ;=sizeof(dd)*7
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glColorMaterial: ;mode, type
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_ColorMaterial
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 12 ;=sizeof(dd)*3
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glLightfv uses eax ecx, light:dword, type:dword, v:dword
|
|
|
|
locals
|
|
|
|
p rd 7
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_Light
|
|
|
|
mov eax,[light]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[type]
|
|
|
|
mov dword[p+8],eax
|
|
|
|
|
|
|
|
;TODO: 3 composants ?
|
|
|
|
mov eax,[v]
|
|
|
|
mov ecx,[eax]
|
|
|
|
mov dword[p+12],ecx
|
|
|
|
mov ecx,[eax+4]
|
|
|
|
mov dword[p+16],ecx
|
|
|
|
mov ecx,[eax+8]
|
|
|
|
mov dword[p+20],ecx
|
|
|
|
mov ecx,[eax+12]
|
|
|
|
mov dword[p+24],ecx
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-28] ;=sizeof(dd)*7
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glLightf uses eax, light:dword, type:dword, v:dword
|
|
|
|
locals
|
|
|
|
p rd 7
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_Light
|
|
|
|
mov eax,[light]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[type]
|
|
|
|
mov dword[p+8],eax
|
|
|
|
mov eax,[v]
|
|
|
|
mov dword[p+12],eax
|
|
|
|
mov dword[p+16],0.0
|
|
|
|
mov dword[p+20],0.0
|
|
|
|
mov dword[p+24],0.0
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-28] ;=sizeof(dd)*7
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glLightModeli uses eax, pname:dword, param:dword
|
|
|
|
locals
|
|
|
|
p rd 6
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_LightModel
|
|
|
|
mov eax,[pname]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
fild dword[param]
|
|
|
|
fstp dword[p+8] ;преобразовали int во float
|
|
|
|
|
|
|
|
mov dword[p+12],0.0
|
|
|
|
mov dword[p+16],0.0
|
|
|
|
mov dword[p+20],0.0
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-24] ;=sizeof(dd)*6
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glLightModelfv uses eax ecx, pname:dword, param:dword
|
|
|
|
locals
|
|
|
|
p rd 6
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_LightModel
|
|
|
|
mov eax,[pname]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[param]
|
|
|
|
mov ecx,[eax]
|
|
|
|
mov dword[p+8],ecx
|
|
|
|
mov ecx,[eax+4]
|
|
|
|
mov dword[p+12],ecx
|
|
|
|
mov ecx,[eax+8]
|
|
|
|
mov dword[p+16],ecx
|
|
|
|
mov ecx,[eax+12]
|
|
|
|
mov dword[p+20],ecx
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-24] ;=sizeof(dd)*6
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2015-01-05 20:13:01 +01:00
|
|
|
; clear
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glClear: ;mask
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Clear
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glClearColor uses eax, r:dword, g:dword, b:dword, a:dword
|
|
|
|
locals
|
|
|
|
p rd 5
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_ClearColor
|
|
|
|
mov eax,[b]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[g]
|
|
|
|
mov dword[p+8],eax
|
|
|
|
mov eax,[r]
|
|
|
|
mov dword[p+12],eax
|
|
|
|
mov eax,[a]
|
|
|
|
mov dword[p+16],eax
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-20] ;=sizeof(dd)*5
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glClearDepth uses eax, depth:dword
|
|
|
|
locals
|
|
|
|
p rd 2
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_ClearDepth
|
|
|
|
mov eax,[depth]
|
|
|
|
fld qword[eax]
|
|
|
|
fstp dword[p+4]
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-8] ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
2015-01-05 20:13:01 +01:00
|
|
|
; textures
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glTexImage2D: ;target, level, components, width, height, border, format, type, pixels
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_TexImage2D
|
|
|
|
stdcall gl_add_op,eax
|
|
|
|
pop eax
|
|
|
|
ret 40 ;=sizeof(dd)*10
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glBindTexture: ;target, texture
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_BindTexture
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 12 ;=sizeof(dd)*3
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glTexEnvi uses eax, target:dword, pname:dword, param:dword
|
|
|
|
locals
|
|
|
|
p rd 8
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_TexEnv
|
|
|
|
mov eax,[target]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[pname]
|
|
|
|
mov dword[p+8],eax
|
|
|
|
mov eax,[param]
|
|
|
|
mov dword[p+12],eax
|
|
|
|
mov dword[p+16],0.0
|
|
|
|
mov dword[p+20],0.0
|
|
|
|
mov dword[p+24],0.0
|
|
|
|
mov dword[p+28],0.0
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-32] ;=sizeof(dd)*8
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glTexParameteri uses eax, target:dword, pname:dword, param:dword
|
|
|
|
locals
|
|
|
|
p rd 8
|
|
|
|
endl
|
|
|
|
mov dword[p],OP_TexParameter
|
|
|
|
mov eax,[target]
|
|
|
|
mov dword[p+4],eax
|
|
|
|
mov eax,[pname]
|
|
|
|
mov dword[p+8],eax
|
|
|
|
mov eax,[param]
|
|
|
|
mov dword[p+12],eax
|
|
|
|
mov dword[p+16],0.0
|
|
|
|
mov dword[p+20],0.0
|
|
|
|
mov dword[p+24],0.0
|
|
|
|
mov dword[p+28],0.0
|
|
|
|
|
2020-09-16 08:59:01 +02:00
|
|
|
lea eax,[ebp-32] ;=sizeof(dd)*8
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glPixelStorei: ;pname, param
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_PixelStore
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 12 ;=sizeof(dd)*3
|
2014-10-31 22:28:24 +01:00
|
|
|
|
2015-01-05 20:13:01 +01:00
|
|
|
; selection
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glInitNames:
|
|
|
|
stdcall gl_add_op,op_InitNames
|
2014-10-31 22:28:24 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glPushName: ;name
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_PushName
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glPopName:
|
|
|
|
stdcall gl_add_op,op_PopName
|
2014-10-31 22:28:24 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glLoadName: ;name
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_LoadName
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glPolygonOffset: ;factor, units
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_PolygonOffset
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 12 ;=sizeof(dd)*3
|
2014-10-31 22:28:24 +01:00
|
|
|
|
2015-01-05 20:13:01 +01:00
|
|
|
; Special Functions
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glCallList: ;list
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_CallList
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 8 ;=sizeof(dd)*2
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glFlush ;(void)
|
|
|
|
;nothing to do
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
2020-09-16 08:59:01 +02:00
|
|
|
glHint: ;target, mode
|
|
|
|
push dword[esp] ;копируем адрес возврата
|
|
|
|
push eax
|
|
|
|
lea eax,[esp+8]
|
|
|
|
mov dword[eax],OP_Hint
|
2014-10-31 22:28:24 +01:00
|
|
|
stdcall gl_add_op,eax
|
2020-09-16 08:59:01 +02:00
|
|
|
pop eax
|
|
|
|
ret 12 ;=sizeof(dd)*3
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
; Non standard functions
|
|
|
|
|
|
|
|
align 4
|
|
|
|
proc glDebug uses eax, mode:dword
|
|
|
|
stdcall gl_get_context ;после вызова функции в eax указатель на GLContext
|
|
|
|
push dword[mode]
|
2016-09-16 10:39:28 +02:00
|
|
|
pop dword[eax+GLContext.print_flag]
|
2014-10-31 22:28:24 +01:00
|
|
|
ret
|
|
|
|
endp
|