Exemplo n.º 1
0
int io_mkdir(const char* path)
{
	/* Remember the current directory */
	char cwd[8192];
	platform_getcwd(cwd, 8192);

	/* Split the path and check each part in turn */
	strcpy(buffer, path);
	path = buffer;

	while (path != NULL)
	{
		char* ptr = strchr(path, '/');
		if (ptr != NULL)
			*ptr = '\0';

		platform_mkdir(path);
		platform_chdir(path);

		path = (ptr != NULL) ? ptr + 1 : NULL;
	}

	/* Restore the original working directory */
	platform_chdir(cwd);
	return 1;
}
Exemplo n.º 2
0
void SelectMenuLayer::addWorld (CCObject *object)
{
    worldSelectMenu->setPosition( ccp(0, 50 * GetGameParams->worlds.size() / 2) );
    
    CCSize screenSize = GameParams::getInstanse()->screenSize;
    CCMenuItemFont * world_ = CCMenuItemFont::create(CCString::createWithFormat("Мир %ld", GetGameParams->worlds.size()+1)->m_sString.c_str(), this, menu_selector(SelectMenuLayer::setWorld));
    world_->setPosition( ccp(screenSize.width / 2, screenSize.height / 2 - GetGameParams->worlds.size()*50) );
    worldSelectMenu->addChild(world_);
    
    GameParams::getInstanse()->worlds.push_back(0);
    
    plusButton->setPosition( ccp(screenSize.width / 2, screenSize.height / 2 - GetGameParams->worlds.size()*50) );
    
    char tmp[100] = "";
    sprintf(tmp, "%sMaps/World%ld",writablePath.c_str(),GameParams::getInstanse()->worlds.size()-1);
    
    platform_mkdir(tmp);
    
    MapEditorGameLayer::getInstanse()->mapVer++;
    MapEditorGameLayer::getInstanse()->saveWorldsetLocal();
}
Exemplo n.º 3
0
int fs_dir_make(const char *path) {
    return platform_mkdir(path, 0700);
}