Beispiel #1
0
void CzMarket::setCurrentProductID(const char* product_id)
{
	// If resource system iniitialised then update system variable with new id
	if (CZ_GLOBAL_RESOURCES != NULL)
	{
		CzXomlVariableArrayInt* system = (CzXomlVariableArrayInt*)CZ_GLOBAL_RESOURCES->getVariableManager()->findVariable("system");
		if (system != NULL)
			system->setValue(CzApp::SYS_LAST_PURCHASE_ID, product_id);
	}
	
	CurrentProductID = product_id;
}
Beispiel #2
0
void CzApp::CreateSystemArray()
{
	IzPlatformDisplay* display = PLATFORM_DISPLAY;

	// Create the system variable array
	int width = display->getCurrentWidth();
	int height = display->getCurrentHeight();
	CzXomlVariableArrayInt* system = new CzXomlVariableArrayInt();
	system->Init(SYS_MAX);
	system->Name = "system";
	system->setValue(SYS_SCREEN_WIDTH, CzString(width).c_str());
	system->setValue(SYS_SCREEN_HEIGHT, CzString(height).c_str());
	system->setValue(SYS_SCREEN_SIZE_HINT, CzString((width + height) / 400).c_str());
	system->setValue(SYS_SCREEN_MODE, CzString(CzUtils::GetGraphicModeIndex(width, height)).c_str());
	system->setValue(SYS_DEVICE_TYPE, CzString((int)PLATFORM_SYS->getDeviceType()).c_str());
	if (CZ_INPUT->isMultiTouch())
		system->setValue(SYS_HAS_MULTITOUCH, "1");
	else
		system->setValue(SYS_HAS_MULTITOUCH, "0");
	if (CZ_INPUT->isAccelerometerAvailable())
		system->setValue(SYS_HAS_ACCELEROMETER, "1");
	else
		system->setValue(SYS_HAS_ACCELEROMETER, "0");
	if (CZ_INPUT->isCompassAvailable())
		system->setValue(SYS_HAS_COMPASS, "1");
	else
		system->setValue(SYS_HAS_COMPASS, "0");
	if (CZ_INPUT->isKeysAvailable())
		system->setValue(SYS_HAS_KEYS, "1");
	else
		system->setValue(SYS_HAS_KEYS, "0");
	if (CZ_INPUT->isPointerAvailable())
		system->setValue(SYS_HAS_POINTER, "1");
	else
		system->setValue(SYS_HAS_POINTER, "0");
	system->setValue(SYS_LAST_PURCHASE_ID, "");
	system->setValue(SYS_SCREEN_ORIENTATION, CzString(PLATFORM_DISPLAY->getOrientation()).c_str());
	CZ_GLOBAL_RESOURCES->getVariableManager()->addVariable(system);

	// Create the touch input system array
	CzXomlVariableArrayInt* touches = new CzXomlVariableArrayInt();
	touches->Init(TOUCH_MAX);
	touches->Name = "touches";
	for (int t = 0; t < TOUCH_MAX; t++)
		touches->setValue(t, "0");
	CZ_GLOBAL_RESOURCES->getVariableManager()->addVariable(touches);

}