BINSIZE.BIN

From OHRRPGCE-Wiki

Jump to: navigation, search

BINSIZE.BIN stores the record size in bytes for other lumps, so that future versions of the OHRRPGCE can resize lumps without breaking backwards compatability. Unfortunately this lump was implemented very late, and currently only contains information on a couple of lumps.

About Formal Specs

Offset Data Meaning Default
(backwards compatability)
0INTLength of record in ATTACK.BIN N/A
1INTLength of each record in STF 64
2INTLength of each record in SONGDATA.BIN N/A
3INTLength of each record in SFXDATA.BIN N/A
4INTLength of each record in MAP lump 40
5INTLength of each record in MENUS.BIN N/A
6INTLength of each record in MENUITEM.BIN N/A
7INTLength of each record in UICOLORS.BIN N/A

Any binary record lumps that are added in the future will also have their record size stored in BINSIZE.BIN. Current lumps can be extended by modifying the lump reading/writing routines to check BINSIZE.BIN.

[edit] Default

Older RPG files may not have all these values set. If a record size is not present, use the backwards compatability Default record size.

[edit] Programming Interface

four functions are provided for accessing binsize information

getbinsize()   returns the current size in BYTES of the records in the specific binary file you are working with
curbinsize()   returns the correct size in BYTES for of the records for the version of the OHRRPGCE you are running
defbinsize()   returns the default size in BYTES to use for getbinsize() when no BINSIZE data is available at all
dimbinsize()   returns the size in INTS to make the array you will be loading the record into

ARCHINYM.LMP . BROWSE.TXT . ATTACK.BIN . BINSIZE.BIN . DEFPAL#.BIN . DEFPASS.BIN . FIXBITS.BIN . LOOKUP.BIN . MENUS.BIN . MENUITEM.BIN . PALETTES.BIN . PLOTSCR.LST . SFXDATA.BIN . SONGDATA.BIN . UICOLORS.BIN . GEN . BAM . Map Format . T . P . E . D . L . N . DOR . DOX . DT0 . DT1 . DT6 . EFS . FOR . FNT . HSP . HSZ . ITM . MAP . MAS . MN . MXS . PAL . PT0 . PT1 . PT2 . PT3 . PT4 . PT5 . PT6 . SAY . SHO . SNG . STF . STT . TAP . TIL . TMN . VEH

Personal tools