kolibrios-fun/programs/media/animage/trunk/sprites.inc

97 lines
2.1 KiB
PHP
Raw Normal View History

;-----------------------------------------------------------
;------------------SaveFonForSprite-------------------------
;-----------------------------------------------------------
SaveFonForSprite:
mov edi,[PointerToSpriteBufer]
mov ecx,[SpriteSizeX]
mov edx,[Picture_SizeX]
sub edx,[SpriteSizeX]
mov esi,[SpriteCoordinatY]
imul esi,[Picture_SizeX]
add esi,[SpriteCoordinatX]
lea edx,[edx+edx*2]
lea esi,[esi+esi*2]
add esi,[PointerToPicture]
mov ebx,[SpriteSizeY]
mov [counter],ecx
next_line_sprite_save:
mov ecx,[counter]
next_pixel_sprite_save:
movsw
movsb
dec ecx
jnz next_pixel_sprite_save
add esi,edx
dec ebx
jnz next_line_sprite_save
ret
;-----------------------------------------------------------
;-------------------PutFonForSprite-------------------------
;-----------------------------------------------------------
PutFonForSprite:
mov esi,[PointerToSpriteBufer]
mov ecx,[SpriteSizeX]
mov edx,[Picture_SizeX]
sub edx,[SpriteSizeX]
mov edi,[SpriteOldCoordinatY]
imul edi,[Picture_SizeX]
add edi,[SpriteOldCoordinatX]
lea edx,[edx+edx*2]
lea edi,[edi+edi*2]
add edi,[PointerToPicture]
mov ebx,[SpriteSizeY]
mov [counter],ecx
next_line_sprite_put:
mov ecx,[counter]
next_pixel_sprite_put:
movsw
movsb
dec ecx
jnz next_pixel_sprite_put
add edi,edx
dec ebx
jnz next_line_sprite_put
ret
;-----------------------------------------------------------
;------------------DrawFonForSprite-------------------------
;-----------------------------------------------------------
DrawSprite:
mov esi,[PointerToEditBufer]
mov ecx,[SpriteSizeX]
mov edx,[Picture_SizeX]
sub edx,[SpriteSizeX]
mov edi,[SpriteCoordinatY]
imul edi,[Picture_SizeX]
add edi,[SpriteCoordinatX]
lea edx,[edx+edx*2]
lea edi,[edi+edi*2]
add edi,[PointerToPicture]
mov ebx,[SpriteSizeY]
mov [counter],ecx
next_line_sprite_draw:
mov ecx,[counter]
next_pixel_sprite_draw:
movsw
movsb
dec ecx
jnz next_pixel_sprite_draw
add edi,edx
dec ebx
jnz next_line_sprite_draw
ret