kolibrios/programs/media/animage/trunk/sprites.inc
IgorA c06136cd31 fix keys in dialog file -> new,
optimize code,
add memory constants

git-svn-id: svn://kolibrios.org@6342 a494cfbc-eb01-0410-851d-a64ba20cac60
2016-03-15 22:30:18 +00:00

97 lines
2.1 KiB
PHP

;-----------------------------------------------------------
;------------------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