Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void engine() {
- activeCamera = CAM_fn_hGetActiveCamera(0);
- targetedSuperObject = CAM_fn_hCineInfoGetSuperObjectTargeted(*(*(*(activeCamera + 4))));
- treatDynamicHierarchyOfPlatforms(gp_stDynamicWorld);
- treatDynamicHierarchy(gp_stDynamicWorld, targetedSuperObject, targetedSuperObject.matrix.position);
- }
- void treatDynamicHierarchyOfPlatforms(superobject * spo) {
- targeted = null;
- activeCam = CAM_fn_hGetActiveCamera(0);
- if (activeCam) {
- targeted = CAM_fn_hCineInfoGetSuperObjectTargeted(*(*(*(activeCam + 4) + 16) + 4));
- }
- pushMatrix(spo);
- foreach(child in spo.children) {
- if (child.type == perso) {
- stdGame = child.pero.stdGame;
- // field_0x29 bit ? set AND (engine not frozen OR bit 0 of field_0x20 set)
- if ( (*(stdGame + 41) & 4) == 4 && (!engineIsFrozen || *(stdGame + 32) == 0x100000) ) {
- if (!stdGame.isPlatform) {
- popMatrix();
- return;
- }
- if (stdGame.field_0x14 != someEngineDWord) {
- if (child == targeted) {
- stdGame.field_0x29 &= 0x7FU; // unset bit 0 of field_0x29;
- } else if ((&loc_4BFFFC + 4) & *(stdGame + 32)) { // too far or something
- updateTooFarFlag()
- }
- pushMatrix(child);
- treatCharactersInSector(child);
- popMatrix();
- }
- }
- }
- popMatrix(spo);
- }
- void treatDynamicHierarchy(superobject * spo, superobject * targetedSpo, Vector3 * vector) {
- // Sector
- if (spo.type != perso) {
- pushMatrix(spo);
- foreach(child in spo.children) {
- if (child.type == perso && !child.isCamera)
- treatDynamicHierarchy(child);
- }
- popmatrix();
- } else {
- perso = spo.data;
- stdGame = perso.stdGame; // field_0x28
- if (!stdGame) {
- return;
- }
- if (!stdGame.isPlatform) {
- pushMatrix(spo);
- // engine not frozen OR bit 0 of field_0x20 set
- if (!engineIsFrozen || stdGame.field_0x20 & 0x100000) {
- if (perso == targetedSpo) {
- stdGame.field_0x29 &= 0x7FU; // unset bit 0 of field_0x29
- } else if ((&loc_4BFFFC + 4) & *(stdGame + 32)) { // too far or something
- updateTooFarFlag()
- }
- treatCharactersInSector(spo);
- }
- // IF RAYMAN 3
- popMatrix()
- pushMatrix(spo);
- if (spo == mainCharacter) {
- foreach(child in spo.children) {
- if (child.type == perso && !child.isCameraamera)
- treatDynamicHierarchy(child);
- }
- }
- // ENDIF RAYMAN 3
- popMatrix();
- } else {
- pushMatrix(spo);
- foreach(child in spo.children) {
- if (child.type == perso && !child.isCamera)
- treatDynamicHierarchy(child);
- }
- popMatrix();
- }
- }
- }
Add Comment
Please, Sign In to add comment