A sorta different way to do framerects

Dec 26, 2013 at 2:08 AM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 27
Pronouns: he/him

Optimization to the max.



direction sets U/D on the scale.



frame number sets leftness/rightness.



the only downfall is that directions are skewed. (0001 would be right)
Code:
offset [*something*]

push ebp
mov ebp,esp

;================================
;=======<///FRAMARECTS\\\>=======
;================================

SUB ESP,1C                         ;10 represents the total amount of variables. 

MOV DWORD PTR SS:[EBP-10],0 
MOV DWORD PTR SS:[EBP-C],0 
MOV DWORD PTR SS:[EBP-8],0
MOV DWORD PTR SS:[EBP-4],0



;=================================
;=====<///RENDER GRAPHICS\\\>=====
;=================================

setpointer
XOR EAX,EAX                           ;MOV EAX,0   


;render face direction

MOV EAX, [ECX+4C]                     ;move direction of NPC to EAX
MOV EDX, 10
IMUL EAX,EDX                          ;multiply by 10
                                      ;if your NPC was lower down on the sprite sheet, we can add an ADD EAX, -- here!
mov npc.displayU, eax                 ;and that is the Up rect of you NPC if direction is 2 then it would be 20 for the up rect
add eax, 10
mov npc.displayD, eax                 ;and pending on the size of the npc, we ad 10 for the down rect.



;render frame number

setpointer     
MOV EAX,DWORD PTR DS:[ECX+68]         ;move frame number to EAX
MOV EDX, 10                           ;and then we repeat the process here.
IMUL EAX,EDX                          ;except instead of directon, we fo go the frome number to prove leftness/rightness of thee NPC
mov npc.displayL, eax
add eax, 10
mov npc.displayR, eax


MOV ESP,EBP             
POP EBP                  
RETN
I don't care what you do with this, I don't need any credit for this because It's a modification of Noxid's code for the mecha walker.



(Thanks Noxid)






 
Dec 26, 2013 at 2:30 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
Dec 26, 2013 at 3:36 AM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 27
Pronouns: he/him
Well THAT was useless.

:/

I never learned thoes fancy commands like SHL/SHR....


Back to the drawing board.
 
Dec 26, 2013 at 4:14 AM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
Dude I didn't understand a single word you just wrote.
 
Dec 27, 2013 at 10:25 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 9, 2013
Location: Genesis : Spirit.
Posts: 61
Age: 27
Pronouns: he/him
It's a progaming language or something like that,propably wrote with ollydbg.If U want to undersand it, learn assembly(It takes months,or more,I have started learning 3 months ago,and i understand a bit :p)
 
Dec 27, 2013 at 7:56 PM
Sincerity will always triumph over irony.
Modding Community Discord Admin
"What're YOU lookin' at?"
Join Date: Apr 23, 2013
Location: In a cave above the surface.
Posts: 1079
Age: 26
Pronouns: He/Him
Quote hell master said:
It's a progaming language or something like that,propably wrote with ollydbg.If U want to undersand it, learn assembly(It takes months,or more,I have started learning 3 months ago,and i understand a bit :p)
He knows what ASM is.
 
Back
Top