Added initialization checks in CellGem

This commit is contained in:
Survanium90 2014-10-18 22:14:16 +04:00
parent 67bc9acbe0
commit 220e4ad8a6

View file

@ -21,36 +21,60 @@ cellGemInternal cellGemInstance;
int cellGemCalibrate() int cellGemCalibrate()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemClearStatusFlags() int cellGemClearStatusFlags()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemConvertVideoFinish() int cellGemConvertVideoFinish()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemConvertVideoStart() int cellGemConvertVideoStart()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemEnableCameraPitchAngleCorrection() int cellGemEnableCameraPitchAngleCorrection()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemEnableMagnetometer() int cellGemEnableMagnetometer()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
@ -69,60 +93,100 @@ int cellGemEnd()
int cellGemFilterState() int cellGemFilterState()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemForceRGB() int cellGemForceRGB()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetAccelerometerPositionInDevice() int cellGemGetAccelerometerPositionInDevice()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetAllTrackableHues() int cellGemGetAllTrackableHues()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetCameraState() int cellGemGetCameraState()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetEnvironmentLightingColor() int cellGemGetEnvironmentLightingColor()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetHuePixels() int cellGemGetHuePixels()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetImageState() int cellGemGetImageState()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetInertialState() int cellGemGetInertialState()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetInfo() int cellGemGetInfo()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
@ -140,30 +204,50 @@ s32 cellGemGetMemorySize(be_t<s32> max_connect)
int cellGemGetRGB() int cellGemGetRGB()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetRumble() int cellGemGetRumble()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetState() int cellGemGetState()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetStatusFlags() int cellGemGetStatusFlags()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemGetTrackerHue() int cellGemGetTrackerHue()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
@ -188,6 +272,10 @@ int cellGemInit(vm::ptr<CellGemAttribute> attribute)
int cellGemInvalidateCalibration() int cellGemInvalidateCalibration()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
@ -200,54 +288,90 @@ int cellGemIsTrackableHue()
int cellGemPrepareCamera() int cellGemPrepareCamera()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemPrepareVideoConvert() int cellGemPrepareVideoConvert()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemReset() int cellGemReset()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemSetRumble() int cellGemSetRumble()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemSetYaw() int cellGemSetYaw()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemTrackHues() int cellGemTrackHues()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemUpdateFinish() int cellGemUpdateFinish()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemUpdateStart() int cellGemUpdateStart()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }
int cellGemWriteExternalPort() int cellGemWriteExternalPort()
{ {
UNIMPLEMENTED_FUNC(cellGem); UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK; return CELL_OK;
} }