Code Odds and Ends

Discussions About CyanWorlds.com Engine Client & Plugin
User avatar
JWPlatt
Member
Posts: 1139
Joined: Sun Dec 07, 2008 7:32 pm
Location: Everywhere, all at once

Code Odds and Ends

Post 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. ;)
Perfect speed is being there.
cjkelly1
Member
Posts: 67
Joined: Mon Dec 29, 2008 6:08 am

Re: Code Odds and Ends

Post 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.
cjkelly1
Member
Posts: 67
Joined: Mon Dec 29, 2008 6:08 am

Re: Code Odds and Ends

Post 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
User avatar
JWPlatt
Member
Posts: 1139
Joined: Sun Dec 07, 2008 7:32 pm
Location: Everywhere, all at once

Re: Code Odds and Ends

Post 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 ];
Perfect speed is being there.
User avatar
Mac_Fife
Member
Posts: 1239
Joined: Fri Dec 19, 2008 12:38 am
Location: Scotland
Contact:

Re: Code Odds and Ends

Post 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");
Mac_Fife
OpenUru.org wiki wrangler
User avatar
branan
Member
Posts: 84
Joined: Wed Apr 06, 2011 11:35 pm

Re: Code Odds and Ends

Post 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.
MustardJeep
Member
Posts: 54
Joined: Sat Dec 27, 2008 8:15 pm

Re: Code Odds and Ends

Post 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
MustardJeep
Member
Posts: 54
Joined: Sat Dec 27, 2008 8:15 pm

Re: Code Odds and Ends

Post by MustardJeep »

// Guess what this is for :P
#include "pyJournalBook.h"
cypythoninterface.cpp
MustardJeep
Member
Posts: 54
Joined: Sat Dec 27, 2008 8:15 pm

Re: Code Odds and Ends

Post 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
Jons
Member
Posts: 11
Joined: Sun Jan 29, 2012 1:48 pm

Re: Code Odds and Ends

Post 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
Jons
Post Reply

Return to “CyanWorlds.com Engine - Client & Plugin”