mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-01-17 14:28:30 +01:00
Hooked more functions to VM.
This commit is contained in:
parent
b626864293
commit
ec0dfa27e8
@ -71,10 +71,16 @@ namespace vm
|
||||
|
||||
TRAPDEF(pmapData)
|
||||
{
|
||||
int xarg, yarg;
|
||||
yarg = ARG(0).int4;
|
||||
xarg = ARG(1).int4;
|
||||
Push<int4_t>(sim->pmap[ARG(1).int4][ARG(0).int4]);
|
||||
}
|
||||
|
||||
Push<int4_t>(sim->pmap[yarg][xarg]);
|
||||
TRAPDEF(deletePart)
|
||||
{
|
||||
sim->delete_part(ARG(0).int4, ARG(1).int4, ARG(2).int4);
|
||||
}
|
||||
|
||||
TRAPDEF(killPart)
|
||||
{
|
||||
sim->kill_part(ARG(0).int4);
|
||||
}
|
||||
}
|
||||
|
@ -10,3 +10,5 @@ TRAPDEF(-8, print)
|
||||
TRAPDEF(-9, partCreate)
|
||||
TRAPDEF(-10, partChangeType)
|
||||
TRAPDEF(-11, pmapData)
|
||||
TRAPDEF(-12, deletePart)
|
||||
TRAPDEF(-13, killPart)
|
||||
|
@ -2,6 +2,14 @@
|
||||
|
||||
int update_TEST(int i, int x, int y, int nt, int ss)
|
||||
{
|
||||
partCreate(-1, x, y-1, 2);
|
||||
int k, j, index;
|
||||
|
||||
for(k=-1; k<2; k++)
|
||||
for(j=-1; j<2; j++)
|
||||
{
|
||||
index = pmapData(x+k, y+j);
|
||||
if ((index&0xFF) == 2)
|
||||
killPart(index>>8);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -12,3 +12,5 @@ equ print -8
|
||||
equ partCreate -9
|
||||
equ partChangeType -10
|
||||
equ pmapData -11
|
||||
equ deletePart -12
|
||||
equ killPart -13
|
||||
|
@ -14,5 +14,7 @@ void error(char * message);
|
||||
int partCreate(int i, int x, int y, int type);
|
||||
void partChangeType(int i, int x, int y, int type);
|
||||
int pmapData(int x, int y);
|
||||
void deletePart(int x, int y, int flags);
|
||||
void killPart(int i);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user