display-name: "Games/Duke Nukem 3D"
meta: {"Working": ["Packed file extraction", "Artwork", "Sounds"]}

if (file.name like "*.grp")
{
	data(12) unknown
	unsigned32 file-count

	data-start: file.position + file-count * (12 + 4)
	file [file-count]
	{
		fixed-string(12) name
		unsigned32 size
	}
}

if (file.name like "*.mid")
{
	interpret-as "music-midi"
}

if (file.name like "*.voc")
{
	interpret-as "sound-VOC"
}

if (file.name == "palette.dat")
{
	palette
	{
		size: 256
		format: "R6G6B6"
	}
}

if (file.name like "*.art")
{
	unsigned32 version
	unsigned32 numTilesMax
	unsigned32 localTileStart
	unsigned32 localTileEnd

	numTiles: localTileEnd - localTileStart + 1

	unsigned16[numTiles] widths
	unsigned16[numTiles] heights
	unsigned32[numTiles] animData

	counter: 0

	image-layout-width: 320
	
	image-layout
	{
		loop (numTiles)
		{
			if (widths[counter] != 0 and heights[counter] != 0)
			{
				image
				{
					format: "I8"
					columnar: true

					width: widths[counter]
					height: heights[counter]
					palette: "palette.dat"
					transparent-index: 255
				}
			}
			counter = counter + 1
		}
	}
}

if (file.name like "*.con")
{
	folder: "Scripts"
	text
}

if (file.name like "*.map")
{
	folder: "Levels"
}