Page 1 of 1

RF CodeBase Oddities

Posted: Wed Jan 11, 2006 10:35 pm
by AndyCR
I found some funny things in the RF codebase while digging through it, so I decided to start a thread to hold them all, as a humor kind of thing.

In one instance, the destructor of one class calls a function in a class, then deletes that class, and the destructor of THAT class calls the very same function.

Then theres this: :lol:
// You only need one include file.

#include "RabidFramework.h"
#include <process.h>
Yeah, one include file...
delete pTemp; // ZAP! It's dead, Jim.
Ooookaaay, it's dead alright. :shock:

Anyone else know of any?

Posted: Thu Jan 12, 2006 12:18 am
by QuestOfDreams
well, even programmers need some fun from time to time :lol:
there are quite a few funny things in the source:

Code: Select all

// Ok, check to see if there are  ElectricBolt in this world
pSet = geWorld_GetEntitySet(CCD->World(), "ActMaterial");

if(!pSet)
	return RGF_SUCCESS;

// Ok, we have logic gates somewhere.  Dig through 'em all.

Code: Select all

pEntry->localRotation = theRotation;	// Set it, and forget it!

Code: Select all

CActorManager::SetPassenger(...)
{
...
return RGF_FAILURE; // This bus is PACKED!
}

CActorManager::RemovePassenger(...)
{
...
return RGF_FAILURE; // Yo, he's not in MY cab
}

Code: Select all

//	If Winblows has something to say, take it in and pass it on in the
//	..off-chance someone cares.
while (PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE))

Code: Select all

		m_Streams[m_LoopingProxy]->Stop();		// Stop it.
		
		delete m_Streams[m_LoopingProxy];		// Kill it
		m_Streams[m_LoopingProxy] = NULL;		// Crush it
		
		delete m_FileList[m_LoopingProxy];		// Smear it
		m_FileList[m_LoopingProxy] = NULL;		// Be mean to it!
		
		m_LoopingProxy = -1;					// ..and make it go away.

Code: Select all

//	End of the force-the-bitmap-to-be-ready code.  Blech.

Posted: Thu Jan 12, 2006 1:01 am
by Pete
don't forget the dreaded...

Code: Select all

//evil hack!

Posted: Thu Jan 12, 2006 5:42 am
by hike1
Most of those are by Ed Averill, the Founding Father of RF, he's into torque now:
http://www.garagegames.com/blogs/32647/9062

See him at http://terrymorgan.net/rfpeople.html