Server Help

LVZ/LVL Questions - LVL file format

Anonymous - Sat Jun 26, 2004 12:06 am
Post subject: LVL file format
Can someone point to me to a document which explains the LVL file format, or teach me here?
SuSE - Sat Jun 26, 2004 12:22 am
Post subject:
http://www4.ncsu.edu:8030/~rniyenga/subspace/old/lvlformat.html
2dragons - Sat Jun 26, 2004 1:35 am
Post subject:
If bitmap for tileset is included expect:

/*
* [File Header]
* offset length info
*-------------------------------------------
* 0 2 Type of file "BM"
* 2 4 Total file size
* 6 2 Reserved
* 8 2 Reserved
* 10 4 Bitmap offset
*
* [Info Header]
* offset length info
*-------------------------------------------
* 14 4 Bitmap info size
* 18 4 Width
* 22 4 Height
* 26 2 Bitplane size
* 28 2 Bit count
* 30 4 Compression type
* 34 4 Image size
* 38 4 Pixels per meter
* 42 4 Pixels per meter
* 46 4 Colors used
* 50 4 Colors important
*
* [Color Table] for( i = 0; i < 256; i++ )
* 54*i+0 1 Red
* 54*i+1 1 Green
* 54*i+2 1 Blue
* 54*i+3 1 Not used
*
* Notes:
* Type == BM
* Compression == 0
* Width == 304
* Height == 160
* Bits == 8
*
*/

After that just follow from the other guys link or here's the code I used:

while( available(4) ) {
byte[] b = readIn( 4 );
ByteArray array = new ByteArray( b );
int i = array.readLittleEndianInt( 0 );
int tile = i >> 24 & 0x00ff;
int y = (i >> 12) & 0x03FF;
int x = i & 0x03FF;
m_level[x][y] = tile;
}

Should be enough for you to figure it out
Anonymous - Sat Jun 26, 2004 1:55 pm
Post subject:
Yeah, seems pretty easy. I'm just not good with windows bmp files, so I'll have to look over that.

Oh, and the color table. Not too sure what to do there.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group