RF CodeBase Oddities

Programming Reality Factory and Genesis3D.
Post Reply
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

RF CodeBase Oddities

Post by AndyCR » Wed Jan 11, 2006 10:35 pm

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?

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams » Thu Jan 12, 2006 12:18 am

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.

Pete
Posts: 46
Joined: Tue Jul 12, 2005 2:07 pm

Post by Pete » Thu Jan 12, 2006 1:01 am

don't forget the dreaded...

Code: Select all

//evil hack!

hike1
RF FAQ-Keeper
Posts: 607
Joined: Tue Jul 05, 2005 4:19 am
Contact:

Post by hike1 » Thu Jan 12, 2006 5:42 am

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

Post Reply