Uint32 map[4][5];
NJS_TEXLIST texlist;
NJS_TEXMEMLIST *texmemlist;
/* Cell definition */
/* Prepare to load 5 textures */
texmemlist = malloc(sizeof(NJS_TEXMEMLIST)*5);
njInitTexture(texmemlist,5);
njLoadTexture(&texlist);
/* The scroll function does not require calling njSetTexture or njSetTextureNum */
/* Set the scroll structure */
scl.mapw = 5; /* Number of map cells horizontally */
scl.maph = 4; /* Number of map cells vertically */
scl.sx = 1.0f; /* Scale horizontally */
scl.sy = 1.0f; /* Scale vertically */
scl.spx = 320.f; /* Scale center x coordinate */
scl.spy = 240.f; /* Scale center y coordinate */
scl.list = &texlist; /* Texture list */
scl.map = (Uint32*)map; /* Map array */
scl.mflag = ON; /* Matrix flag */
scl.sflag = ON; /* Scale flag */
scl.pr = -100.f; /* Priority -1.f (front) to -65535.f (rear) */
scl.px = 0.f; /* Movement x coordinate */
scl.py = 0.f; /* Movement y coordinate */
scl.bx = 0.f; /* Start of map write x coordinate */
scl.by = 0.f; /* Start of map write y coordinate */
scl.cx = 320.f; /* Rotation center x coordinate */
scl.cy = 240.f; /* Rotation center y coordinate */
scl.clip[0].x = 0.f; /* Upper left clip x coordinate */
scl.clip[0].y = 0.f; /* Upper left clip y coordinate */
scl.clip[1].x = 640.f; /* Lower right clip x coordinate */
scl.clip[1].y = 480.f; /* Lower right clip y coordinate */
scl.sclc.argb.a = 255; /* Globally applied A*/
scl.sclc.argb.r = 255; /* Globally applied R*/
scl.sclc.argb.g = 255; /* Globally applied g*/
scl.sclc.argb.b = 255; /* Globally applied B */
scl.colmode = NJD_COLOR_MODE_TEXTURE; /* Set color mode */