コード例 #1
0
ファイル: Modifications.cpp プロジェクト: mmuman/dontworry
void ModificationsApp::DumpClass(CSLibrary *lib, const char *className)
{
	// on cherche si une description de la classe existe dans la blibliothèque
	CSClass *l_Class = lib->GetClass(className);
	
	if (l_Class == NULL)
		printf("\n\nClasse %s non trouvée.\n",className);
	else
	{
		DumpClass(lib,l_Class);
		delete l_Class;
	}
}
コード例 #2
0
	ActiveEffect* GetNthActiveEffect(Actor* thisActor, UInt32 n)
	{
		if(thisActor) {
			tList<ActiveEffect> * effects = thisActor->magicTarget.GetActiveEffects();
			if(effects) {
				UInt32 count = effects->Count();
				ActiveEffect * effect = effects->GetNthItem(n);
				_MESSAGE("Dumping n: %d Total: %d", n, count); // Test
				DumpClass(effect, 20);
				return (effects && n < count) ? effect : NULL;
			}
		}
		
		return NULL;
	}
コード例 #3
0
ファイル: Modifications.cpp プロジェクト: mmuman/dontworry
void ModificationsApp::DumpClass(CSLibrary *lib, CSClass *theClass)
{
	// première ligne avec le nom de la classe
	const char *l_HeaderPath = theClass->GetHeaderFile();
	if (l_HeaderPath == NULL)
		printf("\nclass %s\n{\n",theClass->GetName());
	else
		printf("\nclass %s\t(%s)\n{\n",theClass->GetName(),l_HeaderPath);	
	
	// on va parcourir les méthodes
	CSMethod *l_Method = theClass->GetFirstMethod(CSMT_PUBLIC|CSMT_PROTECTED|CSMT_PRIVATE);
	while (l_Method != NULL)
	{
		DumpMethod(l_Method);
		
		delete l_Method;
		l_Method = theClass->GetNextMethod();
	} 
	
	// on va parcourir les variables membre
	printf("\n");
	CSVariable *l_Variable = theClass->GetFirstMember(CSMT_PROTECTED);
	while (l_Variable != NULL)
	{
		DumpMemberVariable(l_Variable);
		
		// on passe à la suivante
		delete l_Variable;
		l_Variable = theClass->GetNextMember();
	}
	
	// fin de la classe
	printf("}\n\n");
	
	// recherche de classes pères
	CSClass *l_Father = theClass->GetFirstFather();
	while (l_Father != NULL)
	{
		printf("%s hérite de %s:\n",theClass->GetName(),l_Father->GetName());
		DumpClass(lib,l_Father);
		
		delete l_Father;
		l_Father = theClass->GetNextFather();
	}
}
コード例 #4
0
ファイル: CommandTable.cpp プロジェクト: robojan/RealPipboyNV
bool Cmd_tcmd3_Execute(COMMAND_ARGS)
{
	TESForm* pForm = NULL;
	_MESSAGE("tcmd3");

	if (ExtractArgs(EXTRACT_ARGS, &pForm)) {
		// we have a pForm
	} 
		
	if (!pForm && thisObj && thisObj->baseForm) {
		pForm = thisObj->baseForm;
	}

//	DataHandler* pDH = DataHandler::Get();
//	int x = 4;

//	GameSettingCollection* pGC = GameSettingCollection::GetSingleton();
//	IniSettingCollection* pISC = IniSettingCollection::GetIniSettings();
//	IniSettingCollection* pIPC = IniSettingCollection::GetIniPrefs();

	InterfaceManager* pIM = InterfaceManager::GetSingleton();
//	DumpClass(pIM);

//	UInt32 formID = 0x105228;
//	TESForm* pLookedUp = LookupFormByID(formID);
//	if(pLookedUp) {
//		UInt32 addr = 0x011B9C2C;
//		DumpClass((void*)pForm);
//	}

//	TESObjectWEAP* pWeap = DYNAMIC_CAST(pForm, TESForm, TESObjectWEAP);

	PlayerCharacter* pPC = PlayerCharacter::GetSingleton();
	if (pPC) {
		BaseProcess* pBaseProc = pPC->baseProcess;
		BaseProcess::AmmoInfo* pAmmoInfo = pBaseProc->GetAmmoInfo();
		DumpClass(pAmmoInfo);
		DumpClass(pAmmoInfo->unk00);
//		ExtraAmmo* pAmmo = GetByTypeCast(pPC->extraDataList, Ammo);
		int x = 4;
	}



//	MagicTarget* pTarget = DYNAMIC_CAST(pPC, PlayerCharacter, MagicTarget);
//	if(pTarget) {
//		EffectNode* pEffects = pTarget->GetEffectList();
//		UInt32 cnt = pEffects->Count();
//		ActiveEffect* pEffect = pEffects->GetNthItem(1);
//		UInt32 formID = 0x5C6C1;
//		TESForm* pForm = LookupFormByID(formID);
//		EffectSetting* pSetting = DYNAMIC_CAST(pForm, TESForm, EffectSetting);
//
//		int c = 0;
//
//		//pEffects->Visit(Dumper(32));
//
//	}


	return true;
}
コード例 #5
0
ファイル: CommandTable.cpp プロジェクト: robojan/RealPipboyNV
	bool Accept(void *addr) {
		if (addr) {
			DumpClass(addr, m_sizeToDump);
		}
		return true;
	}
コード例 #6
0
ファイル: Modifications.cpp プロジェクト: mmuman/dontworry
void ModificationsApp::ReadyToRun()
{
	printf("Début du test.\n");
	
	// détermination du répertoire de l'application
	app_info l_MyAppInfo;
	GetAppInfo(&l_MyAppInfo);
	BEntry l_Application(&l_MyAppInfo.ref);
	BDirectory l_AppDir;
	l_Application.GetParent(&l_AppDir);
	
	
	printf("Création du bloc mémoire...");
	
	BMallocIO *l_MyFile = new BMallocIO;
	printf("OK\n");
	
	printf("Création de la librarie...");
	CSLibrary *l_MyLibrary = new CSLibrary(l_MyFile);
	if (l_MyLibrary->InitCheck() == B_OK)
		printf("OK\n");
	else
	{
		printf("Erreur!\n");
		return;
	}
	
	printf("Début du parsing.\n");

	BPath l_MyPath(&l_AppDir,"Modifications.h");
	status_t l_Error;
	
	while(true)
	{
		l_Error = l_MyLibrary->Parse(l_MyPath.Path(),false,0,true);
		switch(l_Error)
		{
			case B_OK:
				printf("OK!\n");
				break;
			
			case CSP_NOT_MODIFIED:
				printf("Fichier non modifié\n");
				break;
			
			default:
				printf("Erreur!\n");
				break;
		}
			
		// restitution
		printf("Restitution.\n");
		
		DumpClass(l_MyLibrary,"ModificationsApp");
		
		printf("Appuyez sur une touche pour recommencer\n");
		getchar();
	}
		
	// destruction des objets
	printf("Desctruction...");
	delete l_MyLibrary;
	delete l_MyFile;
	printf("Fini!\n");
	
	Quit();
}