]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_vrs.h
wwwwwwwwwwwwwwwwwwwwwwwwwwww vrstest.c works wwwwww yakui-lover wwwww look! wwww
[16.git] / src / lib / 16_vrs.h
index dacc606bf88c04260904679cb80729e9c54fc418..381b7108dbea75e39c4be851a361960a46d64456 100755 (executable)
 #ifndef __16_VRS__
 #define __16_VRS__
 
-#include "src/lib/16_head.h"
 #include "src/lib/modex16.h"
-#include "src/lib/16_ca.h"
-#include "src/lib/16_mm.h"
+#include "src/lib/typdefst.h"
 //#include <hw/cpu/cpu.h>
 //#include <hw/dos/dos.h>
-//#include <hw/vga/vga.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
+#include <hw/vga/vrl.h>
+#include "src/lib/16_ca.h"
 
 struct vrs_container{
-       dword size;
+       // Size of a .vrs lob in memory
+       // minus header
+       dword data_size;
        union{
-               byte *buffer;
-               struct vrs_header *vrs_hdr;
+               byte huge *buffer;
+               struct vrs_header huge *vrs_hdr;
        };
-       uint16_t anchor_sprite_id;
-       uint16_t current_sprite_id;
+       // Array of corresponding vrl line offsets
+       vrl1_vgax_offset_t **vrl_line_offsets;
 };
 
-// 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{
-       dword size;
+       // Size of a .vrl blob in memory
+       // minus header
+       dword data_size;
        union{
-               byte *buffer;
-               struct vrl1_vgax_header *vrl_header;
+               byte huge *buffer;
+               struct vrl1_vgax_header huge *vrl_header;
        };
+       // Pointer to a corresponding vrl line offsets struct
+       vrl1_vgax_offset_t *line_offsets;
 };
 
-// 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);
+/* 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(global_game_variables_t *gvar, 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);
+/* 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
+* + struct vrl_container * vrl_cont - pointer to vrl_container to load to
+* Out:
+* int - operation status
+* to the requested .vrl blob
+*/
+int get_vrl_by_id(struct vrs_container *vrs_cont, uint16_t id, struct vrl_container * vrl_cont);
 
 #endif