Merge branch 'master' of github.com:FacialTurd/PowderToypp

This commit is contained in:
Simon Robertshaw 2012-09-16 12:02:09 +01:00
commit 95bbd04d21
7 changed files with 56 additions and 24 deletions

View File

@ -353,4 +353,4 @@ namespace vm
Push<int4_t>(Pop<float4_t>());
return 0;
}
}
}

View File

@ -68,4 +68,19 @@ namespace vm
{
sim->part_change_type(ARG(0).int4, ARG(1).int4, ARG(2).int4, ARG(3).int4);
}
}
TRAPDEF(pmapData)
{
Push<int4_t>(sim->pmap[ARG(1).int4][ARG(0).int4]);
}
TRAPDEF(deletePart)
{
sim->delete_part(ARG(0).int4, ARG(1).int4, ARG(2).int4);
}
TRAPDEF(killPart)
{
sim->kill_part(ARG(0).int4);
}
}

View File

@ -1,11 +1,14 @@
TRAPDEF(-104, sin)
TRAPDEF(-105, cos)
TRAPDEF(-106, atan2)
TRAPDEF(-107, sqrt)
TRAPDEF(-108, floor)
TRAPDEF(-109, ceil)
TRAPDEF(-1, sin)
TRAPDEF(-2, cos)
TRAPDEF(-3, atan2)
TRAPDEF(-4, sqrt)
TRAPDEF(-5, floor)
TRAPDEF(-6, ceil)
TRAPDEF(-110, error)
TRAPDEF(-111, print)
TRAPDEF(-112, partCreate)
TRAPDEF(-113, partChangeType)
TRAPDEF(-7, error)
TRAPDEF(-8, print)
TRAPDEF(-9, partCreate)
TRAPDEF(-10, partChangeType)
TRAPDEF(-11, pmapData)
TRAPDEF(-12, deletePart)
TRAPDEF(-13, killPart)

View File

@ -279,4 +279,4 @@ public:
};
};
}
}

View File

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

View File

@ -1,13 +1,16 @@
code
equ sin -104
equ cos -105
equ atan2 -106
equ sqrt -107
equ floor -108
equ ceil -109
equ sin -1
equ cos -2
equ atan2 -3
equ sqrt -4
equ floor -5
equ ceil -6
equ error -110
equ print -111
equ partCreate -112
equ partChangeType -113
equ error -7
equ print -8
equ partCreate -9
equ partChangeType -10
equ pmapData -11
equ deletePart -12
equ killPart -13

View File

@ -13,5 +13,8 @@ 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