]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_vrs.h
Documented 16_vrs files
[16.git] / src / lib / 16_vrs.h
index 38b8132ddd0e71488668ad3d3b8ab94bcb166f42..a0f306201855ef5b01109ffe5daeb2b150d2d291 100755 (executable)
@@ -1,14 +1,32 @@
+#ifndef __16_VRS__
+#define __16_VRS__
+
+#include <stdint.h>
 #include "hw/vga/vrl.h"
 #include "hw/vga/vrs.h"
 
+// Container for .vrs files loaded in memory with useful info
+// Includes: 
+// + size of the .vrs blob in memory
+// + pointer to the blob/vrs header
+// + id of the curent (shown) animation
+// + id of the first sprite of the curret animation (supplementary)
+// + id of the current (shown) sprite
+
 struct vrs_container{
        unsigned long size;
        union{
                unsigned char *buffer;
                struct vrs_header *vrs_hdr;
        };
+       uint16_t anchor_sprite_id;
+       uint16_t current_sprite_id; 
 };
 
+// Container for .vrl files loaded in memory with useful info
+// Includes:
+// + size of the .vrl blob in memory
+// + pointer to the blob/vrl header
 struct vrl_container{
        unsigned long size;
        union{
@@ -17,5 +35,23 @@ struct vrl_container{
        };
 };
 
+// Read .vrs file into memory
+// In:
+// + char *filename - name of the file to load
+// + struct vrs_container *vrs_cont - pointer to the vrs_container 
+// to load the file into
+// Out:
+// + int - 0 on succes, 1 on failure
 int read_vrs(char *filename, struct vrs_container *vrs_cont);
+
+// Seek and return a specified .vrl blob from .vrs blob in memory
+// In:
+// + struct vrs_container *vrs_cont - pointer to the vrs_container 
+// with a loaded .vrs file
+// + uint16_t id - id of the vrl to retrive
+// Out:
+// struct vrl_container* - a pointer to a vrl_container with a pointer
+// to the requested .vrl blob
 struct vrl_container* get_vrl_by_id(struct vrs_container *vrs_cont, uint16_t id);
+
+#endif