mirror of https://github.com/nmlgc/ReC98.git
[Reverse-engineering] [th05] Aiming to the player
Yes, this only became a dedicated function in TH05, probably due to all the custom bullet types. Part of P0086, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
parent
cf68f49803
commit
8098b62285
|
@ -0,0 +1,21 @@
|
|||
public PLAYER_ANGLE_FROM
|
||||
player_angle_from proc near
|
||||
|
||||
@@plus_angle = byte ptr 4
|
||||
@@y = word ptr 6
|
||||
@@x = word ptr 8
|
||||
|
||||
push bp
|
||||
mov bp, sp
|
||||
mov ax, _player_pos.cur.y
|
||||
sub ax, [bp+@@y]
|
||||
push ax
|
||||
mov ax, _player_pos.cur.x
|
||||
sub ax, [bp+@@x]
|
||||
push ax
|
||||
call iatan2
|
||||
add al, [bp+@@plus_angle]
|
||||
pop bp
|
||||
retn 6
|
||||
player_angle_from endp
|
||||
nop
|
|
@ -0,0 +1,7 @@
|
|||
#include "th04/main/player/player.h"
|
||||
|
||||
// Calculates the angle from ([x], [y]) to the current player position, and
|
||||
// optionally adds [plus_angle] to the result.
|
||||
unsigned char pascal near player_angle_from(
|
||||
Subpixel x, Subpixel y, unsigned char plus_angle = 0
|
||||
);
|
742
th05_main.asm
742
th05_main.asm
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue