Page 1 of 2

Code Odds and Ends

Posted: Tue Mar 15, 2011 1:25 am
by JWPlatt
For a little fun, if you find anything interesting in the code, post it. (Mark already warned us about all the "mf horse" (Mark Finch) comments. - heh!)

So here's one:

"Anonymous Coward" is set in line 2087 of plPythonFileMod.cpp (MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\FeatureLib\pfPython)

No doubt there are more significant things to find, but that's what I found tonight. ;)

Re: Code Odds and Ends

Posted: Sat Mar 19, 2011 4:43 am
by cjkelly1
plSound.h line 264

// Note: ONLY THE AUDIOSYS SHOULD CALL THIS. If you're not the audioSys, get lost.

Wow. "Get lost". Rough stuff, there.


plPythonFileMod.cpp line 946
// Forgive my general crapulance...

I guess someone was not all that thrilled.

Re: Code Odds and Ends

Posted: Tue Mar 22, 2011 5:11 am
by cjkelly1
I guess this is never called:

Code: Select all

hsBool plLayerMultiply::MsgReceive(plMessage* msg)
{
	return plLayerMultiply::MsgReceive(msg);
}
The compiler hates it too.....
warning C4717: 'plLayerMultiply::MsgReceive' : recursive on all control paths, function will cause runtime stack overflow

Re: Code Odds and Ends

Posted: Wed Mar 30, 2011 2:27 pm
by JWPlatt
The "corrupt" KI JPG problem which inspired an entire customer base to download irfanview:

MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\PubUtilLib\plJPEG\plJPEG.cpp

Code: Select all

		/// Wonderful limitation of mixing our streams with IJL--it wants either a filename
		/// or a memory buffer. Since we can't give it the former, we have to read the entire
		/// JPEG stream into a separate buffer before we can decode it. Which means we ALSO
		/// have to write/read a length of said buffer. Such is life, I guess...
		jpegSourceSize = inStream->ReadSwap32();
		jpegSourceBuffer = TRACKED_NEW UInt8[ jpegSourceSize ];

Re: Code Odds and Ends

Posted: Mon Apr 04, 2011 12:53 pm
by Mac_Fife
A few midly amusing comments and couple of polite expletives from MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plPythonPack/main.cpp

Code: Select all

// remove the CRs, they seem to give Python heartburn
...
hsAssert(pythonCode,"Not sure why this didn't compile the second time???");
...
printf("......blast! Error during run-code!\n");
...
printf("......blast! Compile error!\n");

Re: Code Odds and Ends

Posted: Thu Apr 07, 2011 5:11 am
by branan
line 3340 of plDXPipeline.cpp

Code: Select all

	// This is a big waste of time, As a desparate "optimization" pass, the artists
	// insist on going through and marking objects to fade or pop out of rendering
	// past a certain distance. This breaks the batching and requires more CPU to
	// check the objects by distance. Since there is no pattern to the distance at
	// which objects will be told not to draw, there's no way to make this hierarchical,
	// which is what it would take to make it a performance win. So they succeed in
	// reducing the poly count, but generally the frame rate goes _down_ as well.
	// Unfortunately, this technique actually does work in a few key areas, so
	// I haven't been able to purge it.

Re: Code Odds and Ends

Posted: Tue Nov 29, 2011 2:25 pm
by MustardJeep
// So the crackers know who the tard is
static const char* tauntText = "My copy protection is uncrackable! -Brice";
:lol: Shh nobody tell the source code it's open source now.

DllMain.cpp

Re: Code Odds and Ends

Posted: Fri Dec 02, 2011 2:57 pm
by MustardJeep
// Guess what this is for :P
#include "pyJournalBook.h"
cypythoninterface.cpp

Re: Code Odds and Ends

Posted: Sun Dec 04, 2011 8:40 pm
by MustardJeep

Code: Select all

//	4.3.2003 mcn - Updated. Casting a char to a UInt16 sign-extends it if	 //
//				   the char is > 128, but casting it to an UInt8 first works.//
//				   Ugly as sin, but hey, so are you.
plFont.cpp

Re: Code Odds and Ends

Posted: Tue Feb 07, 2012 2:10 pm
by Jons
I think that some developper did not like Winodws.h

Code: Select all

// stupid Windows.h  and who started including that!
#undef DrawText
cyPhythonInterface.cpp