Difference between revisions of "User:Viader"

From VCMI Project Wiki
Jump to: navigation, search
Line 1: Line 1:
 
Najpierw pozbierajmy informacje znalezione w internecie :)
 
Najpierw pozbierajmy informacje znalezione w internecie :)
  
<b> Format LOD </b>
+
<b>Text formats<b>
 +
 
 +
<b>Format TXT</b>
 +
http://en.wikipedia.org/wiki/Text_file //NOTE: check encoding - probably ASCII
 +
 
 +
<b>Format JSON</b>
 +
Describe soon...
 +
 
 +
<b>Image formats<b>
 +
 
 +
<b>Format BMP</b>
 +
http://en.wikipedia.org/wiki/BMP_file_format
  
<pre>struct h3lod {
+
<b>Format JPG</b>
uint32_t magic; // always 0x00444f4c, that is, a null-terminated "LOD" string
+
https://en.wikipedia.org/wiki/JPEG
uint32_t type; // 200 for base archives, 500 for expansion pack archives, probably completely arbitrary numbers
 
uint32_t files_count; // obvious
 
uint8_t unknown[80]; // 80 bytes of hell knows what - in most cases that's all zeros, but in H3sprite.lod there's a bunch of seemingly irrelevant numbers here, any information is welcome
 
struct h3lod_file[10000]; // file list
 
}
 
 
struct h3lod_file {
 
char name[16]; // null-terminated, sometimes null-padded too, sometimes padded with, well, something after the null
 
uint32_t offset; // includes the header size, no preprocessing required
 
uint32_t size_original; // before compression, that is
 
uint32_t type; // what's in the file - probably not used by the game directly, more on that below
 
uint32_t size_compressed; // how many bytes to read, starting from offset - can be zero for stored files, use size_original in such case
 
}</pre>
 
  
 +
<b>Format PNG</b>
 +
http://en.wikipedia.org/wiki/Portable_Network_Graphics
  
Source:
+
<b>Format TGA</b>
http://wiki.enleth.com/homm:homm3-lod-archives
+
https://en.wikipedia.org/wiki/Truevision_TGA
  
 
<b> Format PCX </b>
 
<b> Format PCX </b>
Line 98: Line 98:
 
http://wiki.enleth.com/homm:homm3-def-animations
 
http://wiki.enleth.com/homm:homm3-def-animations
  
<b>FORMAT 82M</b>
+
<b>Music formats<b>
 +
 
 +
<b>Format MP3</b>
 +
http://en.wikipedia.org/wiki/MP3
 +
 
 +
<b>Format OGG</b>
 +
https://en.wikipedia.org/wiki/Ogg
 +
 
 +
<b>Format 82M</b>
 +
Renamed WAVE format
 +
https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
 +
 
 +
 
 +
 
 +
<b>Video formats<b>
 +
 
 +
<b>Format AVI</b>
 +
http://en.wikipedia.org/wiki/Audio_Video_Interleave
 +
 
 +
<b>Format SMK</b>
 +
http://en.wikipedia.org/wiki/Smacker_video
 +
 
 +
<b>Format BIK</b>
 +
http://en.wikipedia.org/wiki/Bink_Video
 +
 
 +
<b>Format MJPG</b> //better link needed
 +
http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml#notes
 +
 
 +
<b>Format MPQ</b> rather not Blizzard format...
  
<pre>
 
struct __attribute__((packed)){
 
  unsigned int riff; // "RIFF"
 
  unsigned int size; // size_d + 0x22
 
  unsigned int wave; // "WAVE"
 
  unsigned int fmt; // "FMT"
 
  unsigned int size_t; // 0x10
 
  unsigned short int format; // 0x01 pcm
 
  unsigned short int channels; // 0x01 mono
 
  unsigned int samples; // 22050
 
  unsigned int byteper; // 22050 = channels * samples * bitsper / 8
 
  unsigned short int align; // 1    = channels * bitsper / 8
 
  unsigned short int bitsper; // 8
 
  unsigned int data; // "DATA"
 
  unsigned int size_d; //
 
} wavetable;
 
</pre>
 
  
Source:
+
<b>Palette formats<b>
http://rewiki.regengedanken.de/wiki/.82M_%28Heroes_of_Might_and_Magic%29
 
  
 
<b>FORMAT PAL</b>
 
<b>FORMAT PAL</b>
 +
http://worms2d.info/Palette_file
 +
 +
<b>Palette formats<b>
 +
 +
<b> Format LOD </b>
 +
 +
<pre>struct h3lod {
 +
uint32_t magic; // always 0x00444f4c, that is, a null-terminated "LOD" string
 +
uint32_t type; // 200 for base archives, 500 for expansion pack archives, probably completely arbitrary numbers
 +
uint32_t files_count; // obvious
 +
uint8_t unknown[80]; // 80 bytes of hell knows what - in most cases that's all zeros, but in H3sprite.lod there's a bunch of seemingly irrelevant numbers here, any information is welcome
 +
struct h3lod_file[10000]; // file list
 +
}
 +
 +
struct h3lod_file {
 +
char name[16]; // null-terminated, sometimes null-padded too, sometimes padded with, well, something after the null
 +
uint32_t offset; // includes the header size, no preprocessing required
 +
uint32_t size_original; // before compression, that is
 +
uint32_t type; // what's in the file - probably not used by the game directly, more on that below
 +
uint32_t size_compressed; // how many bytes to read, starting from offset - can be zero for stored files, use size_original in such case
 +
}</pre>
  
256x
 
<pre>
 
uint8 r;
 
uint8 g;
 
uint8 b;
 
</pre>
 
  
Source:
+
<b>Map formats<b>
http://rewiki.regengedanken.de/wiki/.PAL_%28Heroes_of_Might_and_Magic%29
 
  
 
<b>Format H3M</b>
 
<b>Format H3M</b>

Revision as of 11:38, 22 July 2013

Najpierw pozbierajmy informacje znalezione w internecie :)

Text formats<b>

<b>Format TXT http://en.wikipedia.org/wiki/Text_file //NOTE: check encoding - probably ASCII

Format JSON Describe soon...

Image formats<b>

<b>Format BMP http://en.wikipedia.org/wiki/BMP_file_format

Format JPG https://en.wikipedia.org/wiki/JPEG

Format PNG http://en.wikipedia.org/wiki/Portable_Network_Graphics

Format TGA https://en.wikipedia.org/wiki/Truevision_TGA

Format PCX

struct h3pcx_color_indexed {
	uint8_t r;
	uint8_t g;
	uint8_t b;
};
 
struct h3pcx_indexed {
	uint32_t bitmap_size; // equals to width*height - 1 byte per pixel
	uint32_t width;
	uint32_t height;
	uint8_t bitmap[width*height];
	h3pcx_color_indexed palette[256];
};
 
struct h3pcx_color_bgr {
	uint8_t b;
	uint8_t g;
	uint8_t r;
};
 
struct h3pcx_bgr {
	uint32_t bitmap_size; // equals to 3*width*height - 3 bytes per pixel
	uint32_t width;
	uint32_t height;
	h3pcx_color_bgr bitmap[width*height];
};

Source: http://wiki.enleth.com/homm:homm3-pcx-graphics

Format DEF

struct h3def_color_indexed {
	uint8_t r;
	uint8_t g;
	uint8_t b;
};
 
struct h3def_header {
	uint32_t type;
	uint32_t width;
	uint32_t height;
	uint32_t sequences_count;
	h3def_color_indexed palette[256];
};

struct h3def_sequence {
        uint32_t type;
        uint32_t length;
        uint32_t unknown1;
        uint32_t unknown2;
        char *names[length];
        uint32_t offsets[length];
};

struct h3def_frame_header {
        uint32_t data_size;
        uint32_t type;
        uint32_t width;
        uint32_t height;
        uint32_t img_width;
        uint32_t img_height;
        uint32_t x;
        uint32_t y;
};

Source: http://wiki.enleth.com/homm:homm3-def-animations

Music formats<b>

<b>Format MP3 http://en.wikipedia.org/wiki/MP3

Format OGG https://en.wikipedia.org/wiki/Ogg

Format 82M Renamed WAVE format https://ccrma.stanford.edu/courses/422/projects/WaveFormat/


Video formats<b>

<b>Format AVI http://en.wikipedia.org/wiki/Audio_Video_Interleave

Format SMK http://en.wikipedia.org/wiki/Smacker_video

Format BIK http://en.wikipedia.org/wiki/Bink_Video

Format MJPG //better link needed http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml#notes

Format MPQ rather not Blizzard format...


Palette formats<b>

<b>FORMAT PAL http://worms2d.info/Palette_file

Palette formats<b>

<b> Format LOD

struct h3lod {
	uint32_t magic; // always 0x00444f4c, that is, a null-terminated "LOD" string
	uint32_t type; // 200 for base archives, 500 for expansion pack archives, probably completely arbitrary numbers
	uint32_t files_count; // obvious
	uint8_t unknown[80]; // 80 bytes of hell knows what - in most cases that's all zeros, but in H3sprite.lod there's a bunch of seemingly irrelevant numbers here, any information is welcome
	struct h3lod_file[10000]; // file list
}
 
struct h3lod_file {
	char name[16]; // null-terminated, sometimes null-padded too, sometimes padded with, well, something after the null
	uint32_t offset; // includes the header size, no preprocessing required
	uint32_t size_original; // before compression, that is
	uint32_t type; // what's in the file - probably not used by the game directly, more on that below
	uint32_t size_compressed; // how many bytes to read, starting from offset - can be zero for stored files, use size_original in such case 
}


Map formats<b>

<b>Format H3M

Source: http://corexii.com/h3m_description.english.txt