Esempio n. 1
0
void Actor::ExportData(picojson::value& json){

	if (!mUniqueID){
		mUniqueID = gUniqueIDGenerator.CreateUniqueID();
	}

#define _KEY(x) io->func( x , #x)
	I_ioHelper* io = new MemoryOutputHelper(json);

	_KEY(mUniqueID);
	_KEY(mName);


	io->pushObject();

	for (const auto& cmp : mComponents.mComponent){
		io->pushObject();

		cmp.second->IO_Data(io);

		auto obj = io->popObject();
		io->func(obj, cmp.second->ClassName().c_str());
	}

	auto obj = io->popObject();
	io->func(obj, "components");

	delete io;
#undef _KEY
}
Esempio n. 2
0
void Actor::ExportData(const std::string& path, const std::string& fileName){

	if (!mUniqueID){
		mUniqueID = gUniqueIDGenerator.CreateUniqueID();
	}

#define _KEY(x) io->func( x , #x)
	I_ioHelper* io = new FileOutputHelper(path + "/" + fileName + ".json");

	_KEY(mUniqueID);
	_KEY(mName);


	io->pushObject();

	for (const auto& cmp : mComponents.mComponent){
		io->pushObject();

		cmp.second->IO_Data(io);

		auto obj = io->popObject();
		io->func(obj, cmp.second->ClassName().c_str());
	}

	auto obj = io->popObject();
	io->func(obj, "components");

	delete io;
#undef _KEY
}
Esempio n. 3
0
Object *ostring(ULONG maxlen, ULONG key, ULONG help)
{
    return StringObject,
        _KEY(key),
        _HELP(help),
        MUIA_CycleChain,         TRUE,
        StringFrame,
        MUIA_String_AdvanceOnCR, TRUE,
        MUIA_String_MaxLen,      maxlen,
    End;
}
Esempio n. 4
0
void Actor::ImportData(const std::string& fileName){

	mComponents.mComponent.clear();

#define _KEY(x) io->func( x , #x)
	I_ioHelper* io = new FileInputHelper(fileName);
	if (io->error){
		delete io;
		io = new FileInputHelper(fileName + ".json");
		if (io->error)return;
	}

	_KEY(mUniqueID);
	_KEY(mName);


	picojson::object components;
	io->func(components, "components");

	for (auto com : components){
		//if (!f.In(&temp))break;
		io->pushObject(com.second.get<picojson::object>());

		if (auto p = ComponentFactory::Create(com.first)){
			//p->ImportData(f);
			p->IO_Data(io);
			mComponents.AddComponent_NotInitialize(p);
			if (dynamic_cast<TransformComponent*>(p.Get())){
				mTransform = p;
			}
		}

		io->popObject();
	}

	delete io;
#undef _KEY
}
Esempio n. 5
0
void Actor::ImportDataAndNewID(picojson::value& json){

	mComponents.mComponent.clear();

#define _KEY(x) io->func( x , #x)
	I_ioHelper* io = new MemoryInputHelper(json);
	if (io->error){
		return;
	}

	_KEY(mUniqueID);
	mUniqueID = gUniqueIDGenerator.CreateUniqueID();
	_KEY(mName);


	picojson::object components;
	io->func(components, "components");

	for (auto com : components){
		//if (!f.In(&temp))break;
		io->pushObject(com.second.get<picojson::object>());

		if (auto p = ComponentFactory::Create(com.first)){
			//p->ImportData(f);
			p->IO_Data(io);
			mComponents.AddComponent_NotInitialize(p);
			if (dynamic_cast<TransformComponent*>(p.Get())){
				mTransform = p;
			}
		}

		io->popObject();
	}

	delete io;
#undef _KEY
}
Esempio n. 6
0
Object *otbutton(ULONG label, ULONG help)
{
    return TextObject,
        _KEY(label),
        _HELP(help),
        MUIA_CycleChain,    TRUE,
        MUIA_Font,          MUIV_Font_Button,
        MUIA_InputMode,     MUIV_InputMode_Toggle,
        ButtonFrame,
        MUIA_Background,    MUII_ButtonBack,
        MUIA_Text_Contents, getString(label),
        MUIA_Text_PreParse, MUIX_C,
        MUIA_Text_HiCharIdx, '_',
    End;
}
Esempio n. 7
0
int ExportaFuncs(EXPORTAFUNCS_PARAMS)
{
	_KEY(_esc) ;
	_KEY(_f1) ;
	_KEY(_f2) ;
	_KEY(_f3) ;
	_KEY(_f4) ;
	_KEY(_f5) ;
	_KEY(_f6) ;
	_KEY(_f7) ;
	_KEY(_f8) ;
	_KEY(_f9) ;
	_KEY(_f10) ;
	_KEY(_f11) ;
	_KEY(_f12) ;
	_KEY(_prn_scr ) ;
	_KEY(_scroll_lock ) ;
	_KEY(_wave) ;
	_KEY(_1) ;
	_KEY(_2) ;
	_KEY(_3) ;
	_KEY(_4) ;
	_KEY(_5) ;
	_KEY(_6) ;
	_KEY(_7) ;
	_KEY(_8) ;
	_KEY(_9) ;
	_KEY(_0) ;
	_KEY(_minus) ;
	_KEY(_plus) ;
	_KEY(_backspace) ;
	_KEY(_tab) ;
	_KEY(_q) ;
	_KEY(_w) ;
	_KEY(_e) ;
	_KEY(_r) ;
	_KEY(_t) ;
	_KEY(_y) ;
	_KEY(_u) ;
	_KEY(_i) ;
	_KEY(_o) ;
	_KEY(_p) ;
	_KEY(_l_brachet) ;
	_KEY(_r_brachet) ;
	_KEY(_enter) ;
	_KEY(_caps_lock ) ;
	_KEY(_a) ;
	_KEY(_s) ;
	_KEY(_d) ;
	_KEY(_f) ;
	_KEY(_g) ;
	_KEY(_h) ;
	_KEY(_j) ;
	_KEY(_k) ;
	_KEY(_l) ;
	_KEY(_semicolon) ;
	_KEY(_apostrophe) ;
	_KEY(_backslash) ;
	_KEY(_l_shift) ;
	_KEY(_z) ;
	_KEY(_x) ;
	_KEY(_c) ;
	_KEY(_v) ;
	_KEY(_b) ;
	_KEY(_n) ;
	_KEY(_m) ;
	_KEY(_comma) ;
	_KEY(_point) ;
	_KEY(_slash) ;
	_KEY(_r_shift) ;
	_KEY(_control) ;
	_KEY(_alt) ;
	_KEY(_space) ;
	_KEY(_ins) ;
	_KEY(_home) ;
	_KEY(_pgup) ;
	_KEY(_del) ;
	_KEY(_end) ;
	_KEY(_pgdn) ;
	_KEY(_up) ;
	_KEY(_down) ;
	_KEY(_left) ;
	_KEY(_right) ;
	_KEY(_num_lock) ;
	_KEY(_c_backslash) ;
	_KEY(_c_asterisk) ;
	_KEY(_c_minus) ;
	_KEY(_c_plus) ;
	_KEY(_c_enter) ;
	_KEY(_c_home) ;
	_KEY(_c_pgup) ;
	_KEY(_c_end) ;
	_KEY(_c_pgdn) ;
	_KEY(_c_up) ;
	_KEY(_c_down) ;
	_KEY(_c_left) ;
	_KEY(_c_right) ;
	_KEY(_c_center) ;
	_KEY(_c_ins) ;
	_KEY(_c_del) ;
	
	FUNCTION("key",1,eDiv_Key) ;

	GLOBAL_STRUCT("mouse",0);
		_INT("x",0);			/* Coordenada x */
		_INT("y",0);			/* Coordenada y */
		_INT("graph",0);		/* Gráfico */
		_INT("file",0);			/* FPG */
		_INT("z",-512);			/* Profundidad (TODO) */
		_INT("angle",0);		/* Ángulo (TODO) */
		_INT("size",100);		/* Tamaño (TODO) */
		_INT("flags",0);		/* Banderas (TODO) */
		_INT("region",0);		/* Región (TODO) */
		_INT("left",0);			/* Botón izquierdo */
		_INT("middle",0);		/* Botón central o de ruedecilla */
		_INT("right",0);		/* Botón derecho */
		_INT("wheelup",0);		/* Ruedecilla arriba (NUEVO) */
		_INT("wheeldown",0);	/* Ruedecilla abajo (NUEVO) */
		_INT("cursor",0);		/* Emulación con teclas de cursor (TODO) */
		_INT("speed",0);		/* Velocidad del ratón (TODO) */
		_INT("transparency",0); /* Transparencia (NUEVO) (TODO) */
	END_STRUCT;

	ENTRYPOINT(first_load) ;
	ENTRYPOINT(frame) ;

	return TRUE;
}
Esempio n. 8
0
void TextComponent::IO_Data(I_ioHelper* io){
#define _KEY(x) io->func( x , #x)
	_KEY(impl->mText);
#undef _KEY
}