Page 1 of 1

Graf - Whats the deal with this RIFF in w_wad.cpp

Posted: Fri Nov 11, 2005 19:09
by nwbeeman
I found these lines in the w_wad.cpp containing refrences to the BLOOD RIFF format
[spoiler]

Code: Select all

else if (header.magic == RFF_ID)
	{ // This is a Blood RFF file

		rfflump_t *lumps, *rff_p;
		int skipped = 0;

		header.rff.NumLumps = LONG(header.rff.NumLumps);
		header.rff.DirOfs = LONG(header.rff.DirOfs);
		lumps = new rfflump_t[header.rff.NumLumps];
		wadinfo->Seek (header.rff.DirOfs, SEEK_SET);
		wadinfo->Read (lumps, header.rff.NumLumps * sizeof(rfflump_t));
		BloodCrypt (lumps, header.rff.DirOfs, header.rff.NumLumps * sizeof(rfflump_t));

		NumLumps += header.rff.NumLumps;
		LumpInfo = (LumpRecord *)Realloc (LumpInfo, NumLumps*sizeof(LumpRecord));
		lump_p = &LumpInfo[startlump];

		for (i = 0, rff_p = lumps; i < header.rff.NumLumps; ++i, ++rff_p)
		{
			if (rff_p->Extension[0] == 'S' && rff_p->Extension[1] == 'F' &&
				rff_p->Extension[2] == 'X')
			{
				lump_p->namespc = ns_bloodsfx;
			}
			else if (rff_p->Extension[0] == 'R' && rff_p->Extension[1] == 'A' &&
				rff_p->Extension[2] == 'W')
			{
				lump_p->namespc = ns_bloodraw;
			}
			else
			{
				//lump_p->namespc = ns_bloodmisc;
				--NumLumps;
				++skipped;
				continue;
			}
			uppercopy (lump_p->name, rff_p->Name);
			lump_p->wadnum = (WORD)NumWads;
			lump_p->position = LONG(rff_p->FilePos);
			lump_p->size = LONG(rff_p->Size);
			lump_p->flags = (rff_p->Flags & 0x10) >> 4;
			lump_p++;
		}
		delete[] lumps;
		if (skipped != 0)
		{
			LumpInfo = (LumpRecord *)Realloc (LumpInfo, NumLumps*sizeof(LumpRecord));
		}
	}
[/spoiler]
You have any idea why its there? I remember a while back Randy posted a joke screenshot of Blood's caranval level. Why is the RIFF support in there? I thought Blood used the Build engine, like Duke3d does. You have any insight on this? Or should I ask Randy?[/code]

Posted: Fri Nov 11, 2005 19:38
by Enjay
Are you sure that screenshot was a joke? Zdoom can load build maps although it's really not an awful lot of use as they won't play and many of the build features aren't supported. Zdoom can also load and use the Blood "Blood Bath Announcer" as an alternative deathmatch commentary.

Posted: Fri Nov 11, 2005 22:12
by Graf Zahl
That's indeed for loading Blood resource files. The screenshot was not a joke, btw. All the code necessary to do it is in the engine.

Posted: Sat Nov 12, 2005 12:12
by nwbeeman
wow. pretty cool. I always thought that screenshot was a joke. Guess it wasn't.