2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Alright, this _TEMP_CONVERT_ stuff was a stupid idea

This commit is contained in:
2012-11-13 01:02:23 -08:00
parent 075c535e2c
commit b219c3c3cc
97 changed files with 314 additions and 466 deletions

View File

@ -1127,7 +1127,7 @@ uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector<pyPlayer*> & tolis
{
// create the messge that will contain the chat message
pfKIMsg *msg = new pfKIMsg( pfKIMsg::kHACKChatMsg );
msg->SetString( message );
msg->SetString( plString::FromWchar(message) );
msg->SetUser( from.GetPlayerName(), from.GetPlayerID() );
msg->SetFlags( flags );
msg->SetBCastFlag(plMessage::kNetPropagate | plMessage::kNetForce);
@ -1199,7 +1199,7 @@ void cyMisc::SendKIMessageS(uint32_t command, const wchar_t* value)
// create the mesage to send
pfKIMsg *msg = new pfKIMsg( (uint8_t)command );
msg->SetString( value );
msg->SetString( plString::FromWchar( value ) );
// send it off
plgDispatch::MsgSend( msg );

View File

@ -1862,7 +1862,7 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
// yes...
// find the value that would go with a command
PyObject* value;
std::wstring str;
plStringBuffer<wchar_t> str;
switch (pkimsg->GetCommand())
{
case pfKIMsg::kSetChatFadeDelay:
@ -1873,8 +1873,8 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
break;
case pfKIMsg::kYesNoDialog:
value = PyTuple_New(2);
str = pkimsg->GetStringU();
PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str.c_str(), str.length()));
str = pkimsg->GetString().ToWchar();
PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str, str.GetSize()));
PyTuple_SetItem(value, 1, pyKey::New(pkimsg->GetSender()));
break;
case pfKIMsg::kGZInRange:
@ -1884,23 +1884,23 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
break;
case pfKIMsg::kRateIt:
value = PyTuple_New(3);
str = pkimsg->GetStringU();
str = pkimsg->GetString().ToWchar();
PyTuple_SetItem(value,0,PyString_FromString(pkimsg->GetUser()));
PyTuple_SetItem(value,1,PyUnicode_FromWideChar(str.c_str(), str.length()));
PyTuple_SetItem(value,1,PyUnicode_FromWideChar(str, str.GetSize()));
PyTuple_SetItem(value,2,PyLong_FromLong(pkimsg->GetIntValue()));
break;
case pfKIMsg::kRegisterImager:
value = PyTuple_New(2);
str = pkimsg->GetStringU();
PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str.c_str(), str.length()));
str = pkimsg->GetString().ToWchar();
PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str, str.GetSize()));
PyTuple_SetItem(value, 1, pyKey::New(pkimsg->GetSender()));
break;
case pfKIMsg::kAddPlayerDevice:
case pfKIMsg::kRemovePlayerDevice:
{
str = pkimsg->GetStringU();
if ( str.length() > 0 )
value = PyUnicode_FromWideChar(str.c_str(), str.length());
str = pkimsg->GetString().ToWchar();
if ( str.GetSize() > 0 )
value = PyUnicode_FromWideChar(str, str.GetSize());
else
{
Py_INCREF(Py_None);
@ -1915,8 +1915,8 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
case pfKIMsg::kKIOKDialogNoQuit:
case pfKIMsg::kGZFlashUpdate:
case pfKIMsg::kKICreateMarkerNode:
str = pkimsg->GetStringU();
value = PyUnicode_FromWideChar(str.c_str(), str.length());
str = pkimsg->GetString().ToWchar();
value = PyUnicode_FromWideChar(str, str.GetSize());
break;
case pfKIMsg::kMGStartCGZGame:
case pfKIMsg::kMGStopCGZGame:
@ -2905,7 +2905,7 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
void plPythonFileMod::ReportError()
{
plString objectName = this->GetKeyName();
objectName += _TEMP_CONVERT_FROM_LITERAL(" - ");
objectName += " - ";
PythonInterface::WriteToStdErr(objectName.c_str());
@ -3050,4 +3050,4 @@ void plPythonFileMod::Write(hsStream* stream, hsResMgr* mgr)
//// kGlobalNameKonstant /////////////////////////////////////////////////
// My continued attempt to spread the CORRECT way to spell konstant. -mcn
plString plPythonFileMod::kGlobalNameKonstant = _TEMP_CONVERT_FROM_LITERAL("VeryVerySpecialPythonFileMod");
plString plPythonFileMod::kGlobalNameKonstant("VeryVerySpecialPythonFileMod");

View File

@ -61,8 +61,8 @@ PyObject* pyGameScoreMsg::CreateFinal(pfGameScoreMsg* msg)
plString pyGameScoreMsg::GetError() const
{
if (fMsg)
return _TEMP_CONVERT_FROM_WCHAR_T(NetErrorToString(fMsg->GetResult()));
return _TEMP_CONVERT_FROM_LITERAL("pfGameScoreMsg is NULL");
return plString::FromWchar(NetErrorToString(fMsg->GetResult()));
return "pfGameScoreMsg is NULL";
}
bool pyGameScoreMsg::IsValid() const

View File

@ -291,7 +291,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadJPEGFromDisk, args, "Params: filename,widt
if (PyString_CheckEx(filenameObj))
{
plString text = PyString_AsStringEx(filenameObj);
PyObject* ret = pyImage::LoadJPEGFromDisk(_TEMP_CONVERT_TO_WCHAR_T(text), width, height);
PyObject* ret = pyImage::LoadJPEGFromDisk(text.ToWchar(), width, height);
return ret;
}
else
@ -313,7 +313,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadPNGFromDisk, args, "Params: filename,width
if (PyString_CheckEx(filenameObj))
{
plString text = PyString_AsStringEx(filenameObj);
PyObject* ret = pyImage::LoadPNGFromDisk(_TEMP_CONVERT_TO_WCHAR_T(text), width, height);
PyObject* ret = pyImage::LoadPNGFromDisk(text.ToWchar(), width, height);
return ret;
}
else

View File

@ -84,8 +84,8 @@ public:
// required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBook);
static PyObject *New(std::string htmlSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = _TEMP_CONVERT_FROM_LITERAL(""));
static PyObject *New(std::wstring htmlSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = _TEMP_CONVERT_FROM_LITERAL(""));
static PyObject *New(std::string htmlSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString());
static PyObject *New(std::wstring htmlSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString());
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyJournalBook object
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyJournalBook); // converts a PyObject to a pyJournalBook (throws error if not correct type)
@ -94,8 +94,8 @@ public:
static void AddPlasmaConstantsClasses(PyObject *m);
// Deletes the existing book and re-creates it, for use by the python glue
void MakeBook(std::string esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = _TEMP_CONVERT_FROM_LITERAL(""));
void MakeBook(std::wstring esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = _TEMP_CONVERT_FROM_LITERAL(""));
void MakeBook(std::string esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString());
void MakeBook(std::wstring esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString());
// Interface functions per book
virtual void Show( bool startOpened );

View File

@ -103,7 +103,7 @@ PYTHON_INIT_DEFINITION(ptPlayer, args, keywords)
PYTHON_RETURN_INIT_ERROR;
}
self->fThis->Init(key, _TEMP_CONVERT_TO_CONST_CHAR(name), pid, distSeq);
self->fThis->Init(key, name.c_str(), pid, distSeq);
PYTHON_RETURN_INIT_OK;
}

View File

@ -223,7 +223,7 @@ plString pySceneObject::GetName()
{
if ( fSceneObjects.Count() > 0 )
return fSceneObjects[0]->GetName();
return _TEMP_CONVERT_FROM_LITERAL("");
return plString();
}
PyObject* pySceneObject::findObj(const plString& name)

View File

@ -72,7 +72,7 @@ bool pyStatusLog::Open(plString logName, uint32_t numLines, uint32_t flags)
// create a status log guy for this
fICreatedLog = true;
fLog = plStatusLogMgr::GetInstance().CreateStatusLog( (uint8_t)numLines, _TEMP_CONVERT_TO_CONST_CHAR(logName), flags );
fLog = plStatusLogMgr::GetInstance().CreateStatusLog( (uint8_t)numLines, logName.c_str(), flags );
if (fLog)
{
fLog->SetForceLog(true);
@ -85,7 +85,7 @@ bool pyStatusLog::Write(plString text)
{
if (fLog)
{
fLog->AddLine(_TEMP_CONVERT_TO_CONST_CHAR(text));
fLog->AddLine(text.c_str());
return true;
}
@ -100,7 +100,7 @@ bool pyStatusLog::WriteColor(plString text, pyColor& color)
((uint32_t)(color.getRed()*255)<<16) +
((uint32_t)(color.getGreen()*255)<<8) +
((uint32_t)(color.getBlue()*255));
fLog->AddLine( _TEMP_CONVERT_TO_CONST_CHAR(text), st_color );
fLog->AddLine( text.c_str(), st_color );
return true;
}

View File

@ -673,8 +673,8 @@ void pyVault::CreateNeighborhood()
plUUID guid(GuidGenerate());
link.GetAgeInfo()->SetAgeInstanceGuid(&guid);
link.GetAgeInfo()->SetAgeUserDefinedName( _TEMP_CONVERT_TO_CONST_CHAR(title) );
link.GetAgeInfo()->SetAgeDescription( _TEMP_CONVERT_TO_CONST_CHAR(desc) );
link.GetAgeInfo()->SetAgeUserDefinedName( title.c_str() );
link.GetAgeInfo()->SetAgeDescription( desc.c_str() );
VaultRegisterOwnedAge(&link);
}