Skip to content

Instantly share code, notes, and snippets.

@zrax
zrax / gist:918364
Created April 13, 2011 20:43
plJPEG output code
JSAMPROW jbuffer;
int row_stride = cinfo.output_width * cinfo.output_components;
int out_stride = cinfo.output_width * 4; // Decompress to RGBA
jbuffer = TRACKED_NEW JSAMPLE[row_stride];
UInt8 *destp = (UInt8 *)newMipmap->GetImage();
while( cinfo.output_scanline < cinfo.output_height )
{
(void) jpeg_read_scanlines( &cinfo, &jbuffer, 1 );
(void) memset( destp, 0xFF, out_stride );
@zrax
zrax / gist:1315448
Created October 26, 2011 04:37
pycdc oddity
#### Hand decompyle ####
def glue_setParam(id, value):
pd = glue_getParamDict()
if pd != None:
if pd.has_key(id):
try:
pd[id].__setvalue__(value)
except AttributeError:
if isinstance(pd[id], ptAttributeList):
pyKey* key = pyKey::ConvertFrom(keyObj);
144
- std::string name = "";
144
+ plString name;
145 145
if (PyUnicode_Check(nameObj))
146 146
{
147
@zrax
zrax / gist:2143512
Created March 21, 2012 01:41
Relicense under the GNU Affero General Public License (AGPL) v3+
The GNU Affero General Public License (AGPL) differs from the current GNU General Public License (GPL) in that it would require the full source used on any DIRTSAND server (or derivative work of DIRTSAND's sources) to be made available to anyone who can connect to the server software. This change is key in promoting openness and encouraging sharing of ideas, since it ensures the server software remains in the hands of the open source community.
This proposal is for the immediate relicensing of DIRTSAND to the Affero General Public License version 3 or later (AGPLv3+). For more information about the AGPLv3, please see http://www.gnu.org/licenses/agpl-3.0.html . In order to go ahead with this proposal, we need permission from everyone listed on https://github.com/H-uru/dirtsand/contributors to relicense their code under the new licence.
Please respond below with a statement ***clearly*** indicating if you will allow your code to be relicensed under the AGPLv3+.
#define DISPATCH_CONSTRUCTOR(name) name(funcptr fpu, funcptr sse1=0, funcptr sse2=0, funcptr sse3=0, funcptr ssse3=0, funcptr sse41=0, funcptr sse42=0, funcptr avx=0) \
: dispatcher(fpu, sse1, sse2, sse3, ssse3, sse41, sse42, avx) {}
template <typename result, typename arg1 = void, typename arg2 = void, typename arg3 = void>
struct hsFunctionDispatcher : public {
typedef result0(*funcptr)();
typedef result1(*funcptr)(arg1);
typedef result2(*funcptr)(arg1, arg2);
typedef result3(*funcptr)(arg1, arg2, arg3);
void dsGameServer::AcquireClient(dsSocket* sock)
{
GameConnectHeader connectInfo;
sock->peek(&connectInfo.fHeaderSize, sizeof(dsUInt32));
if (connectInfo.fHeaderSize != sizeof(connectInfo)) {
dsLog(kLogError, "Invalid Game Server connection packet");
delete sock;
return;
}
if (sock->recv(&connectInfo, sizeof(connectInfo)) != sizeof(connectInfo)) {
int dsGameServer::getClientConnection()
{
msghdr msg;
iovec iov[1];
char ccmsg[CMSG_SPACE(sizeof(int))];
char buf[1];
msg.msg_control = ccmsg;
msg.msg_controllen = sizeof(ccmsg);
msg.msg_name = NULL;
Error 1 error C3861: 'CreateDirectory': identifier not found E:\Data\Dev\Projects\Share\MOUL\Plasma\Sources\Plasma\PubUtilLib\plNetClientRecorder\plNetClientRecorder.cpp 82 1 plNetClientRecorder (Visual Studio 2010)
Error 2 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion) E:\Data\Dev\Projects\Share\MOUL\Plasma\Sources\Plasma\NucleusLib\pnAsyncCoreExe\pnAceIo.cpp 431 1 pnAsyncCoreExe (Visual Studio 2010)
Error 3 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion) E:\Data\Dev\Projects\Share\MOUL\Plasma\Sources\Plasma\NucleusLib\pnAsyncCoreExe\Private\Nt\pnAceNtSocket.cpp 492 1 pnAsyncCoreExe (Visual Studio 2010)
Error 4 error LNK1104: cannot open file '..\..\NucleusLib\pnAsyncCoreExe\Debug\pnAsyncCoreExe.lib' E:\Data\Dev\Projects\Share\MOUL\Plasma\build-vc10\Sources\Plasma\Apps\plUruLauncher\LINK plUruLauncher (Visual Studio 2010)
Error 5 error LNK1104:
diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h
index 0a81b6c..4724c7c 100644
--- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h
+++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h
@@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// PURPOSE: Class wrapper for game manager messages
//
+#include "HeadSpin.h"
#include "../pyGlueHelpers.h"
diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
index 44667bc..af4eaa9 100644
--- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
+++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
@@ -986,8 +986,7 @@ void NetVaultNodeFieldArray::GetFieldValueString_LCS (
case NetVaultNode::kUuid_2:
case NetVaultNode::kUuid_3:
case NetVaultNode::kUuid_4: {
- plString tmp = plUUID((char*)fieldAddr).AsString();
-