git » fp-git.git » commit c2bfd4a

Added a resLoad use sample

author ecalot
2004-06-19 20:21:21 UTC
committer ecalot
2004-06-19 20:21:21 UTC
parent a3d23c830e9535ca928d8cb01eb371b38bf1c728

Added a resLoad use sample

FP/src/ker/kernel.c +23 -0

diff --git a/FP/src/ker/kernel.c b/FP/src/ker/kernel.c
index a125c7e..ca853b4 100644
--- a/FP/src/ker/kernel.c
+++ b/FP/src/ker/kernel.c
@@ -31,6 +31,7 @@ resources.h: Princed Resources : Resource Handler headers
 */
 
 #include "kernel.h"
+#include "resources.h"
 
 int kernel(int optionflag,int level) {
 /* levels=-1 is default
@@ -38,7 +39,29 @@ int kernel(int optionflag,int level) {
  *  
  * optionflag may be read using hasFlag(name_flag); Note that the variable must be called optionflag
  */
+	
+	tData* testResource;
+	int i;
+			
 	printf("Hello, I'm a dummy kernel, I was called to do the stuff\nwith '%x' options and go to the level '%d'\n",optionflag,level);
+	testResource=resLoad(RES_ANIM_RUN_LEFT);	
+	
+	/* How to use a resource */
+	if (!testResource) {
+		printf("The resource couldn't be loaded!\n");
+		exit(1);
+	}
+
+	printf("Resource number: %d. Frames: %d. Type: %d.\n",
+		RES_ANIM_RUN_LEFT,
+		testResource->frames,
+		testResource->type
+	);
+	
+	for (i=0;i<testResource->frames;i++) {
+		//printf("frame %d: ",i);
+	}
+	
 	return 0;
 }