git » fp-git.git » commit 13cbe4c

more functions

author ecalot
2004-06-23 02:58:40 UTC
committer ecalot
2004-06-23 02:58:40 UTC
parent 198b06a454bad3c59f8a7fa1a585f7f24cf67c02

more functions

FP/src/res/maps.c +25 -5

diff --git a/FP/src/res/maps.c b/FP/src/res/maps.c
index d7d87ac..bb81357 100644
--- a/FP/src/res/maps.c
+++ b/FP/src/res/maps.c
@@ -37,7 +37,7 @@ static int sscreen;
 
 //Privates
 
-void maps_getStartPosition(char* pantalla, char* p, char *b,tDirection *sentido,tDirection *sentido2) {
+void maps_getStartPosition(int* pantalla, int* p, int *b,tDirection *sentido,tDirection *sentido2) {
 	int valor;
 
 	*pantalla =slevel[MAPS_BLOCK_OFFSET_START_POSITION];
@@ -48,6 +48,20 @@ void maps_getStartPosition(char* pantalla, char* p, char *b,tDirection *sentido,
 	*sentido2 =(slevel[MAPS_BLOCK_OFFSET_START_POSITION+6])?eRight:eLeft;
 }
 
+void maps_getGuard(int pantalla,int *p,int *b,int *skill,int *color,tDirection *sentido,int *exists) {
+	//Posicion
+	unsigned char valor=(slevel[(MAPS_BLOCK_OFFSET_GUARD_POSITION+sscreen-1)]);
+	*exists = (valor<30);
+	*b      = (valor%10);
+	*p      = (valor/10);
+	//sentido
+	*sentido=slevel[MAPS_BLOCK_OFFSET_GUARD_DIRECTION+pantalla-1]?eRight:eLeft;
+	//skill
+	*skill  =slevel[MAPS_BLOCK_OFFSET_GUARD_SKILL+pantalla-1];
+	//Color
+	*color  =slevel[MAPS_BLOCK_OFFSET_GUARD_COLOR+pantalla-1];
+}
+
 //Publics
 
 int levelUse(void* level) {
@@ -110,12 +124,18 @@ int levelMoveScreen(tDirection direction) {
 int levelGetGuards(/* TODO: add modifiers */);
 int levelGetDoorMap(/* TODO: idem */);
 
-int levelGetStarPosition(int* screen, int* position); /* TODO: define
-		         position as an int or using x,y coordinate system*/
+int levelGetStarPosition(int* screen, int* position) {
+/* TODO: define position as an int or using x,y coordinate system*/
+	//maps_getStartPosition(screen, position, int *b,tDirection *sentido,tDirection *sentido2);
 
-int levelGetInformation(int* thisScreen, char* UDLRscreens, char* cornerScreens);
-/* TODO: define the format of cornerscreens */
+}
 
+int levelGetInformation(int *thisScreen, unsigned char* LRUDscreens, unsigned char* cornerScreens) {
+/* TODO: define the format of cornerscreens */
+	*thisScreen=sscreen;
+	memcpy(LRUDscreens,slevel+MAPS_BLOCK_OFFSET_LINK+(sscreen-1)*4,4);
+	return sscreen;
+}
 
 #ifdef OLD_MAP_SRC