Browse Source

Use plString in PtGetCameraNumber()

Adam Johnson 12 years ago
parent
commit
8091fffa1d
  1. 8
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  2. 2
      Sources/Plasma/FeatureLib/pfPython/cyMisc.h
  3. 2
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp

8
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -2459,14 +2459,14 @@ int cyMisc::GetNumCameras()
return (plVirtualCam1::Instance()->GetNumCameras()); return (plVirtualCam1::Instance()->GetNumCameras());
} }
const char* cyMisc::GetCameraNumber(int number) plString cyMisc::GetCameraNumber(int number)
{ {
plCameraModifier1* pCam = plVirtualCam1::Instance()->GetCameraNumber(number-1); plCameraModifier1* pCam = plVirtualCam1::Instance()->GetCameraNumber(number-1);
if (pCam && pCam->GetTarget()) if (pCam && pCam->GetTarget())
{ {
const char* ret = pCam->GetTarget()->GetKeyName().c_str(); plString ret = pCam->GetTarget()->GetKeyName();
plString str = plString::Format("saving camera named %s to chronicle\n",ret); plString log = plString::Format("saving camera named %s to chronicle\n", ret.c_str());
plVirtualCam1::Instance()->AddMsgToLog(str.c_str()); plVirtualCam1::Instance()->AddMsgToLog(log.c_str());
return ret; return ret;
} }
plVirtualCam1::Instance()->AddMsgToLog("sending empty to camera chronicle\n"); plVirtualCam1::Instance()->AddMsgToLog("sending empty to camera chronicle\n");

2
Sources/Plasma/FeatureLib/pfPython/cyMisc.h

@ -809,7 +809,7 @@ public:
// //
static int GetNumCameras(); static int GetNumCameras();
static const char* GetCameraNumber(int number); static plString GetCameraNumber(int number);
static void RebuildCameraStack(const plString& name, const char* ageName); static void RebuildCameraStack(const plString& name, const char* ageName);
static void PyClearCameraStack(); static void PyClearCameraStack();
static void RecenterCamera(); static void RecenterCamera();

2
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp

@ -337,7 +337,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtGetCameraNumber, args, "Params: x\nReturns cam
PyErr_SetString(PyExc_TypeError, "PtGetCameraNumber expects an int"); PyErr_SetString(PyExc_TypeError, "PtGetCameraNumber expects an int");
PYTHON_RETURN_ERROR; PYTHON_RETURN_ERROR;
} }
return PyString_FromString(cyMisc::GetCameraNumber(x)); return PyString_FromPlString(cyMisc::GetCameraNumber(x));
} }
PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetNumCameras, "returns camera stack size") PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetNumCameras, "returns camera stack size")

Loading…
Cancel
Save