codeparts.asm
来自「这是一个数字图像处理的matlab仿真程序」· 汇编 代码 · 共 42 行
ASM
42 行
;---------------------------------------------------------------------------
; Initialization is called in WM_CREATE
;---------------------------------------------------------------------------
Initialization proc uses ebx esi hWnd:DWORD
LOCAL TempRect:RECT
invoke GetClientRect, hWnd, ADDR TempRect
xor ebx, ebx
; This loop will crate MAX_SMILES unique objects of CSprite Objects..
; and then initialize each with the Instance handle, a drawing DC, and
; the drawing rect to draw within, and lastly a random speed is set to each
; sprite object.
.WHILE ebx < MAX_SMILIES
newobject CSprite
mov esi, eax
mov dword ptr [offset SmileyArray + 4 * ebx], eax
invoke RAND32, 3
add eax, 200 ; base of smiley resources (200, 201, 202 etc)
invoke LoadBitmap, hInstance, eax
method esi, CSprite, setBitmap, eax
method esi, CSprite, setDrawingDC, hBackDC
method esi, CSprite, setScreenSize, TempRect.right,TempRect.bottom
invoke RAND32, 25
add eax, 5
method esi, CSprite, setSpeed, eax
inc ebx
.ENDW
ret
Initialization endp
; This proc will step thu the array and destroy each object created.
Cleanup proc
xor ebx, ebx
.WHILE ebx < MAX_SMILIES
newobject CSprite
mov eax, [offset SmileyArray + 4 * ebx]
destroy eax ; DESTROY IT!
inc ebx
.ENDW
ret
Cleanup endp
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?