// // GJBaseGameLayer::updateCamera from 0x4860b4 to 0x4878ce (6170 bytes) // // 7 xrefs: // > PlayLayer::setupHasCompleted @ 0x31bf32 // > PlayLayer::setupHasCompleted @ 0x31c1fc // > PlayLayer::resetLevel @ 0x31fd0e // > LevelEditorLayer::onPlaytest @ 0x36ebc0 // > LevelEditorLayer::onPlaytest @ 0x36ed0a // > GJBaseGameLayer::checkCameraLimitAfterTeleport @ 0x48795a // > GJBaseGameLayer::update @ 0x497a9a // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // void GJBaseGameLayer::updateCamera(GJBaseGameLayer *a1, float a2) { cocos2d::CCDirector *v4; // r0 float m_cameraZoom; // s20 float width; // s28 float height; // s27 float v8; // s25 float m_unkFloat4; // s17 float v10; // s20 float v11; // s23 float CameraEdgeValue; // s21 float v13; // s18 float v14; // r5 float v15; // s15 LevelSettingsObject *m_levelSettings; // r3 _BOOL4 v17; // r0 PlayerObject *m_player1; // r3 _BOOL4 m_isSideways; // r8 _BOOL4 v20; // r1 _BOOL4 v21; // r2 float v22; // s15 float v23; // s23 float v24; // s23 float v25; // s18 float v26; // s23 float v27; // s18 int v28; // s24 int v29; // r2 bool v30; // r3 int v31; // r2 bool v32; // r3 int v33; // s23 const cocos2d::CCPoint *v34; // r0 const cocos2d::CCPoint *v35; // r5 const cocos2d::CCPoint *LastPosition; // r0 int v37; // r2 bool v38; // r3 int v39; // s15 float v40; // r1 float y; // r2 _BOOL4 v42; // r3 float v43; // s15 float x; // s12 float v45; // s13 float v46; // s12 float v47; // s14 int v48; // r5 int v49; // r2 float v50; // r3 float v51; // s17 float v52; // s17 float v53; // s15 _BOOL4 v54; // r9 float v55; // s15 _BOOL4 v56; // r10 int v57; // r2 bool v58; // r3 float v59; // s15 GameObject *MainObject; // r0 cocos2d::CCPoint *p_m_unkPoint7; // r1 float v62; // s14 float v63; // s15 float v64; // s14 float v65; // r3 float v66; // r3 float v67; // s15 float v68; // s15 float v69; // s12 float v70; // s14 float v71; // s11 float v72; // s14 float v73; // s13 float v74; // s15 float v75; // s14 float v76; // s15 float v77; // s15 int v78; // r9 float v79; // s15 float v80; // s13 float v81; // s14 float v82; // s12 float v83; // s12 float v84; // s14 float v85; // s14 float v86; // s14 float v87; // s15 float v88; // s15 int v89; // r10 float v90; // s15 float v91; // s14 float v92; // s14 float v93; // s15 float v94; // s14 float v95; // s14 float v96; // s15 float v97; // s15 float v98; // s15 float v99; // s14 float v100; // s17 float v101; // s15 float v102; // s14 float v103; // s15 float v104; // s14 float v105; // s15 float v106; // s14 float v107; // s14 float v108; // s15 float v109; // s15 float v110; // s15 float v111; // s12 double v112; // d7 float v113; // s12 double v114; // d6 float v115; // s14 float v116; // s12 double v117; // d6 float v118; // s14 double v119; // d7 double v120; // d6 float v121; // s14 double v122; // d7 float v123; // s12 float v124; // s14 float v125; // s12 double v126; // d6 float v127; // s14 float v128; // s15 float v129; // s15 float v130; // s14 float v131; // s15 float v132; // s15 float v133; // s14 float v134; // s15 float v135; // s14 float v136; // s15 float *p_m_unkUint13; // r3 int v138; // r2 bool v139; // r3 float v140; // s14 float v141; // s15 float v142; // s14 float v143; // s15 float m_levelFlipping; // s15 int v145; // r5 float v146; // s14 float v147; // r1 int v148; // r1 float v149; // r3 float v150; // r1 int v151; // r3 float v152; // s15 float v153; // r3 int v154; // s15 float v155; // r2 float v156; // s15 float v157; // r3 int v158; // r1 float v159; // s15 GJGameState *p_m_gameState; // r0 int v161; // r3 int v162; // s15 float v163; // r2 float v164; // r3 float v165; // r3 int v166; // r2 bool v167; // r3 int v168; // r2 bool v169; // r3 int v170; // r2 bool v171; // r3 void (*setScaleX)(void); // r3 cocos2d::CCLayer *m_objectLayer; // r11 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10 cocos2d::CCPoint v175; // r1 float v176; // r3 float v177; // r3 int v178; // r2 bool v179; // r3 int v180; // r2 bool v181; // r3 int v182; // r2 bool v183; // r3 int v184; // r2 bool v185; // r3 float v186; // s14 float v187; // s15 float v188; // s15 float v189; // s15 float v190; // s17 float v191; // s17 float v192; // s15 float v193; // s17 float v194; // s15 float v195; // s13 float v196; // s14 float v197; // s12 float v198; // s15 float v199; // s17 float v200; // s15 float v201; // s14 float v202; // s17 float v203; // s13 float v204; // s15 float v205; // s13 float v206; // s14 float v207; // s13 float v208; // s15 float v209; // s15 float v210; // s14 float v211; // s14 float v212; // s15 float v213; // s14 float v214; // s14 float v215; // s13 float v216; // s12 float v217; // s14 float v218; // s13 float v219; // s15 float v220; // s15 float v221; // s14 float v222; // s15 float v223; // s14 bool *p_m_isPlatformer; // [sp+18h] [bp-D4h] _BOOL4 v225; // [sp+1Ch] [bp-D0h] int m_isGoingLeft; // [sp+20h] [bp-CCh] _BOOL4 m_isUpsideDown; // [sp+24h] [bp-C8h] _BOOL4 v228; // [sp+2Ch] [bp-C0h] cocos2d::CCSize v229; // [sp+44h] [bp-A8h] BYREF cocos2d::CCPoint v230; // [sp+4Ch] [bp-A0h] BYREF cocos2d::CCPoint v231; // [sp+54h] [bp-98h] BYREF cocos2d::CCPoint v232; // [sp+5Ch] [bp-90h] BYREF cocos2d::CCPoint v233; // [sp+64h] [bp-88h] BYREF cocos2d::CCPoint v234; // [sp+6Ch] [bp-80h] BYREF cocos2d::CCPoint v235; // [sp+74h] [bp-78h] BYREF cocos2d::CCPoint v236; // [sp+7Ch] [bp-70h] BYREF float v237; // [sp+84h] [bp-68h] BYREF float v238; // [sp+88h] [bp-64h] cocos2d::CCPoint v239; // [sp+8Ch] [bp-60h] BYREF cocos2d::CCPoint v240; // [sp+94h] [bp-58h] BYREF cocos2d::CCPoint v241; // [sp+9Ch] [bp-50h] BYREF cocos2d::CCPoint v242; // [sp+A4h] [bp-48h] BYREF cocos2d::CCPoint v243; // [sp+ACh] [bp-40h] BYREF cocos2d::CCPoint v244; // [sp+B4h] [bp-38h] BYREF _DWORD v245[2]; // [sp+BCh] [bp-30h] BYREF cocos2d::CCPoint v246; // [sp+C4h] [bp-28h] BYREF cocos2d::CCPoint v247; // [sp+CCh] [bp-20h] BYREF cocos2d::CCPoint v248; // [sp+D4h] [bp-18h] BYREF cocos2d::CCPoint v249; // [sp+DCh] [bp-10h] BYREF v4 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(&v229, v4); m_cameraZoom = a1->m_gameState.m_cameraZoom; width = v229.width; height = v229.height; v8 = v229.width / m_cameraZoom; m_unkFloat4 = a1->m_gameState.m_unkFloat4; v10 = v229.height / m_cameraZoom; if ( a1->m_gameState.m_cameraEdgeValue1 <= 0 ) v11 = -99999.0; else v11 = GJBaseGameLayer::getCameraEdgeValue(a1, 2) - v8; if ( a1->m_gameState.m_cameraEdgeValue0 <= 0 ) CameraEdgeValue = -99999.0; else CameraEdgeValue = GJBaseGameLayer::getCameraEdgeValue(a1, 1); if ( a1->m_gameState.m_cameraEdgeValue2 <= 0 ) v13 = (float)(a1->m_maxGameplayY - 150.0) - v10; else v13 = GJBaseGameLayer::getCameraEdgeValue(a1, 3) - v10; if ( GJBaseGameLayer::getCameraEdgeValue(a1, 4) <= 0.0 ) v14 = 0.0; else v14 = GJBaseGameLayer::getCameraEdgeValue(a1, 4); cocos2d::CCPoint::CCPoint(&v230, (float)a1->m_gameState.m_cameraEdgeValue0, (float)a1->m_gameState.m_cameraEdgeValue3); cocos2d::CCPoint::CCPoint(&v231, (float)a1->m_gameState.m_cameraEdgeValue1, (float)a1->m_gameState.m_cameraEdgeValue2); if ( a1->m_endPortal ) { v15 = (float)(a1->m_levelLength - (float)(v229.width / a1->m_gameState.m_cameraZoom)) - a1->m_gameState.m_cameraOffset.x; if ( v11 == -99999.0 || v15 < v11 ) { v231.x = 1.0; v11 = v15; } } m_levelSettings = a1->m_levelSettings; if ( (m_levelSettings->m_propertykA23 || a1->m_unk322a && !a1->m_isTestMode) && !m_levelSettings->m_propertykA24 && CameraEdgeValue <= 15.0 ) { CameraEdgeValue = 15.0; } cocos2d::CCPoint::CCPoint(&v232, v11, v13); cocos2d::CCPoint::CCPoint(&v233, CameraEdgeValue, v14); v17 = PlayerObject::isInBasicMode(a1->m_player1); m_player1 = a1->m_player1; m_isSideways = m_player1->m_isSideways; m_isGoingLeft = m_player1->m_isGoingLeft; m_isUpsideDown = m_player1->m_isUpsideDown; v228 = v17; if ( a1->m_skipArtReload || a2 == 0.0 ) { v20 = 1; v21 = 1; } else { v20 = a1->m_gameState.m_unkBool28 || a1->m_gameState.m_unkPoint18.x != 0.0; v21 = a1->m_gameState.m_unkBool29 || a1->m_gameState.m_unkPoint18.y != 0.0; } cocos2d::CCPoint::CCPoint(&v234, (float)v20, (float)v21); if ( a1->m_gameState.m_unkBool20 != m_isSideways && a2 > 0.0 ) { if ( a1->m_gameState.m_unkPoint17.x == 0.0 && v234.x == 0.0 ) { a1->m_gameState.m_unkPoint18.x = 1.0; a1->m_gameState.m_unkPoint22.x = 0.0; a1->m_gameState.m_unkPoint19.x = 1.0; a1->m_gameState.m_unkPoint21.x = 1.0; a1->m_gameState.m_unkPoint20.x = 2.0; } if ( a1->m_gameState.m_unkPoint17.y == 0.0 && v234.y == 0.0 ) { a1->m_gameState.m_unkPoint18.y = 1.0; a1->m_gameState.m_unkPoint22.y = 0.0; a1->m_gameState.m_unkPoint19.y = 1.0; a1->m_gameState.m_unkPoint21.y = 1.0; a1->m_gameState.m_unkPoint20.y = 2.0; } } if ( a1->m_gameState.m_unkBool28 || a1->m_gameState.m_unkBool29 ) { a1->m_gameState.m_unkBool28 = 0; a1->m_gameState.m_unkBool29 = 0; a1->m_gameState.m_unkUint13 = 0.0; } v22 = 1.0; v23 = -1.0; if ( !m_isGoingLeft ) v23 = 1.0; if ( m_isSideways ) { v27 = (float)a1->m_gameState.m_unkInt2 * v23; if ( !a1->m_gameState.m_unkBool3 ) v22 = a1->m_gameState.m_cameraZoom; v26 = 0.0; v25 = v27 / v22; } else { v24 = (float)a1->m_gameState.m_unkInt1 * v23; if ( !a1->m_gameState.m_unkBool2 ) v22 = a1->m_gameState.m_cameraZoom; v25 = 0.0; v26 = v24 / v22; } cocos2d::CCPoint::operator-(&v249, &a1->m_gameState.m_cameraPosition, &a1->m_gameState.m_unkPoint9); *(float *)&v28 = 40.0; cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_gameState.m_cameraPosition, COERCE_FLOAT(&v249), v29, v30); cocos2d::CCPoint::operator-(&v248, &a1->m_gameState.m_cameraOffset, &a1->m_gameState.m_unkPoint3); cocos2d::CCPoint::operator+(&v249, &a1->m_gameState.m_cameraPosition, &v248); cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_gameState.m_cameraPosition, COERCE_FLOAT(&v249), v31, v32); cocos2d::CCPoint::CCPoint(&v235, v26, v25); *(float *)&v33 = 70.0; v34 = a1->m_player1->getPosition(a1->m_player1); cocos2d::CCPoint::CCPoint(&v236, v34); v35 = a1->m_player1->getPosition(a1->m_player1); LastPosition = GameObject::getLastPosition(a1->m_player1); cocos2d::CCPoint::operator-(&v237, v35, LastPosition); cocos2d::CCPoint::CCPoint(&v239, &a1->m_gameState.m_cameraPosition); cocos2d::CCPoint::CCPoint(&v240, v229.width * 0.5, v229.height * 0.5); cocos2d::CCPoint::CCPoint(&v241, (float)(v229.width * 0.5) - 2.0, (float)(v229.height * 0.5) - 2.0); cocos2d::CCPoint::CCPoint( &v242, (float)(v229.width * 0.5) - (float)((float)(a1->m_gameState.m_unkFloat2 * (float)(v241.x - 30.0)) + 30.0), (float)(v229.height * 0.5) - (float)((float)(a1->m_gameState.m_unkFloat2 * (float)(v241.y - 30.0)) + 30.0)); cocos2d::CCPoint::operator*(&v249, &v242, 1.0 / a1->m_gameState.m_cameraZoom); cocos2d::CCPoint::operator=((PlayerObject *)&v242, COERCE_FLOAT(&v249), v37, v38); if ( a1->m_isPlatformer ) { *(float *)&v28 = 27.5; *(float *)&v33 = 55.0; } if ( a1->m_player1->m_isUpsideDown ) { v39 = v33; v33 = v28; v28 = v39; } if ( a1->m_isPlatformer ) v40 = 8.0; else v40 = 1.0; cocos2d::CCPoint::CCPoint(&v243, v40, 10.0); if ( m_isSideways ) { y = v243.y; v243.y = v243.x; v243.x = y; LABEL_66: v42 = 0; goto LABEL_67; } if ( m_isUpsideDown ) goto LABEL_66; cocos2d::CCPoint::CCPoint(&v249, &a1->m_player1->m_lastGroundedPos); if ( v249.y != 105.0 || a1->m_gameState.m_unkFloat4 >= a1->m_gameState.m_cameraZoom || PlayerObject::isFlying(a1->m_player1) ) { goto LABEL_66; } v42 = v236.y <= (float)(v10 - (float)(90.0 / a1->m_gameState.m_cameraZoom)); LABEL_67: v225 = v42; if ( a1->m_gameState.m_cameraZoom != a1->m_gameState.m_unkFloat4 ) { v43 = (float)((float)((float)(width / m_unkFloat4) * 0.5) - (float)(v8 * 0.5)) + v239.x; v239.x = v43; if ( !v42 ) v239.y = v239.y + (float)((float)((float)(height / m_unkFloat4) * 0.5) - (float)(v10 * 0.5)); if ( a1->m_isPlatformer ) { if ( m_isSideways ) { v205 = a1->m_gameState.m_unkPoint27.y; if ( v205 != 0.0 && a1->m_gameState.m_unkPoint17.y == 0.0 ) { v206 = a1->m_gameState.m_unkPoint26.y; v207 = v206 / v205; if ( v207 <= 1.0 ) { if ( (v208 = v235.y * v207, v206 >= 0.0) && v208 >= 0.0 || v206 < 0.0 && v208 < 0.0 ) { v209 = v208 - v206; a1->m_gameState.m_unkPoint26.y = v206 + v209; v239.y = v239.y + v209; } } } } else { x = a1->m_gameState.m_unkPoint27.x; if ( x != 0.0 && a1->m_gameState.m_unkPoint17.x == 0.0 ) { v45 = a1->m_gameState.m_unkPoint26.x; v46 = v45 / x; if ( v46 <= 1.0 ) { if ( (v47 = v235.x * v46, v45 >= 0.0) && v47 >= 0.0 || v45 < 0.0 && v47 < 0.0 ) { v186 = v47 - v45; a1->m_gameState.m_unkPoint26.x = v45 + v186; v239.x = v43 + v186; } } } } } } v48 = 0; cocos2d::CCPoint::CCPoint(&v244, &v239); LOBYTE(v50) = (_BYTE)a1 + 18; p_m_isPlatformer = &a1->m_isPlatformer; while ( 1 ) { v51 = v48 == 1 ? v10 : v8; v52 = v51 * 0.5; if ( v48 ) { PlayerObject::getYVelocity(a1->m_player1); if ( a1->m_gameState.m_unkPoint17.y != 0.0 ) { v53 = a1->m_gameState.m_unkPoint15.y; LABEL_89: v54 = v53 != 0.0; if ( v48 ) v55 = a1->m_gameState.m_unkPoint22.y; else v55 = a1->m_gameState.m_unkPoint22.x; v56 = v55 != 0.0; if ( !v54 && v55 == 0.0 ) { if ( !v48 ) { v243.x = 1.0; LABEL_119: v68 = a1->m_gameState.m_unkPoint6.x; LABEL_129: v74 = v68 - v52; if ( v48 ) v75 = a1->m_gameState.m_cameraOffset.y; else v75 = a1->m_gameState.m_cameraOffset.x; v76 = v74 + v75; LABEL_139: if ( !v48 ) { v244.x = v76; goto LABEL_303; } v244.y = v76; LABEL_305: v128 = v232.y; goto LABEL_306; } v243.y = 1.0; LABEL_121: LOBYTE(v50) = a1->m_gameState.m_unkBool7; v68 = a1->m_gameState.m_unkPoint6.y; if ( LOBYTE(v50) ) { v69 = a1->m_gameState.m_unkPoint7.y; v70 = (float)((float)(*(float *)&a1->m_gameState.m_unkInt11 * 0.5) / a1->m_gameState.m_cameraZoom) + 90.0; if ( v69 < v70 ) { v71 = a1->m_gameState.m_unkPoint5.y; v72 = v70 - v69; if ( v69 == v71 ) v73 = 0.0; else v73 = v69 - v68; if ( v69 != v71 ) v73 = v73 / (float)(v69 - v71); v68 = v68 + (float)(v72 * (float)(1.0 - v73)); } } goto LABEL_129; } cocos2d::CCPoint::CCPoint(&v246); if ( v54 ) { if ( v48 ) v59 = a1->m_gameState.m_unkPoint16.y; else v59 = a1->m_gameState.m_unkPoint16.x; MainObject = GJBaseGameLayer::tryGetMainObject(a1, (int)v59); MainObject->getRealPosition(&v249, MainObject); p_m_unkPoint7 = &v249; } else { p_m_unkPoint7 = &a1->m_gameState.m_unkPoint7; } cocos2d::CCPoint::operator=((PlayerObject *)&v246, *(float *)&p_m_unkPoint7, v57, v58); if ( v48 ) { v64 = a1->m_gameState.m_unkPoint12.y; v63 = v246.y; if ( v64 >= 1.0 ) { a1->m_gameState.m_unkPoint6.y = v246.y; goto LABEL_523; } if ( v56 ) { LABEL_109: cocos2d::CCPoint::CCPoint( &v247, (float)((float)(a1->m_gameState.m_unkPoint10.x * a1->m_gameState.m_unkPoint11.x) / 3.0) + a1->m_gameState.m_unkPoint5.x, (float)((float)(a1->m_gameState.m_unkPoint10.y * a1->m_gameState.m_unkPoint11.y) / 3.0) + a1->m_gameState.m_unkPoint5.y); if ( v48 ) v65 = a1->m_gameState.m_unkPoint23.y; else v65 = a1->m_gameState.m_unkPoint23.x; lerp(&v248, &v246, &v247.x, v65); if ( v48 ) v66 = a1->m_gameState.m_unkPoint12.y; else v66 = a1->m_gameState.m_unkPoint12.x; cubicBezier(&v249, &a1->m_gameState.m_unkPoint5, &v247, &v248, &v246.x, v66); if ( v48 ) { LOBYTE(v50) = LOBYTE(v249.y); a1->m_gameState.m_unkPoint6.y = v249.y; } else { LOBYTE(v50) = LOBYTE(v249.x); a1->m_gameState.m_unkPoint6.x = v249.x; } if ( !v54 ) goto LABEL_116; if ( !v48 ) { LABEL_522: v220 = a1->m_gameState.m_unkPoint14.x; v221 = a1->m_gameState.m_unkPoint12.x; goto LABEL_525; } LABEL_524: v220 = a1->m_gameState.m_unkPoint14.y; v221 = a1->m_gameState.m_unkPoint12.y; LABEL_525: if ( (float)(v220 * v221) > 1.0 ) { if ( v48 ) { v222 = a1->m_gameState.m_unkPoint14.y; v223 = a1->m_gameState.m_unkPoint12.y; } else { v222 = a1->m_gameState.m_unkPoint14.x; v223 = a1->m_gameState.m_unkPoint12.x; } v67 = v222 * v223; goto LABEL_117; } LABEL_116: v67 = 1.0; LABEL_117: if ( !v48 ) { v243.x = v67; goto LABEL_119; } v243.y = v67; goto LABEL_121; } if ( v64 == a1->m_gameState.m_unkPoint13.y ) { LABEL_523: if ( !v54 ) goto LABEL_116; goto LABEL_524; } v211 = a1->m_gameState.m_unkPoint6.y; } else { v62 = a1->m_gameState.m_unkPoint12.x; v63 = v246.x; if ( v62 >= 1.0 ) { a1->m_gameState.m_unkPoint6.x = v246.x; goto LABEL_530; } if ( v56 ) goto LABEL_109; if ( v62 == a1->m_gameState.m_unkPoint13.x ) { LABEL_530: if ( !v54 ) goto LABEL_116; goto LABEL_522; } v211 = a1->m_gameState.m_unkPoint6.x; } v212 = v63 - v211; if ( v48 ) v213 = a1->m_gameState.m_unkPoint13.y; else v213 = a1->m_gameState.m_unkPoint13.x; v214 = 1.0 - v213; if ( v48 ) { v215 = a1->m_gameState.m_unkPoint12.y; v216 = a1->m_gameState.m_unkPoint13.y; } else { v215 = a1->m_gameState.m_unkPoint12.x; v216 = a1->m_gameState.m_unkPoint13.x; } v217 = v214 / (float)(v215 - v216); if ( v48 ) v218 = a1->m_gameState.m_unkPoint6.y; else v218 = a1->m_gameState.m_unkPoint6.x; v219 = v218 + (float)(v212 / v217); if ( !v48 ) { v50 = a1->m_gameState.m_unkPoint12.x; a1->m_gameState.m_unkPoint6.x = v219; a1->m_gameState.m_unkPoint13.x = v50; goto LABEL_530; } v50 = a1->m_gameState.m_unkPoint12.y; a1->m_gameState.m_unkPoint6.y = v219; a1->m_gameState.m_unkPoint13.y = v50; goto LABEL_523; } } else if ( a1->m_gameState.m_unkPoint17.x != 0.0 ) { v53 = a1->m_gameState.m_unkPoint15.x; goto LABEL_89; } if ( v48 != 1 ) { if ( !m_isSideways ) goto LABEL_249; v78 = m_isUpsideDown; } else { LOBYTE(v50) = v225; if ( v225 ) { if ( v48 ) v77 = a1->m_gameState.m_cameraOffset.y; else v77 = a1->m_gameState.m_cameraOffset.x; v76 = v77 + 0.0; goto LABEL_139; } if ( m_isSideways ) { LABEL_249: if ( v48 ) { v110 = a1->m_gameState.m_unkPoint30.y; v50 = v235.y; a1->m_gameState.m_unkPoint27.y = v235.y; if ( v110 == 0.0 ) goto LABEL_253; goto LABEL_263; } v109 = a1->m_gameState.m_unkPoint30.x; v50 = v235.x; a1->m_gameState.m_unkPoint27.x = v235.x; if ( v109 != 0.0 ) { LABEL_261: a1->m_gameState.m_unkPoint26.x = v50; goto LABEL_420; } LABEL_253: if ( a1->m_gameState.m_cameraZoom == a1->m_gameState.m_unkFloat4 ) { LABEL_264: if ( !v48 ) goto LABEL_265; } else { if ( !v48 ) { if ( a1->m_gameState.m_unkPoint26.x != a1->m_gameState.m_unkPoint28.x ) { LABEL_265: v111 = a1->m_gameState.m_unkPoint26.x; if ( v235.x <= v111 ) { v111 = a1->m_gameState.m_unkPoint26.x; goto LABEL_282; } LABEL_268: v112 = v111; if ( v48 ) v113 = v238; else v113 = v237; v114 = v112 + fabsf(v113); if ( v48 ) v115 = v235.y; else v115 = v235.x; if ( v114 <= v115 ) { if ( v48 ) v116 = a1->m_gameState.m_unkPoint26.y; else v116 = a1->m_gameState.m_unkPoint26.x; v117 = v116; if ( v48 ) v118 = v238; else v118 = v237; v119 = v117 + fabsf(v118); LABEL_299: v124 = v119; if ( !v48 ) { LABEL_300: a1->m_gameState.m_unkPoint26.x = v124; LABEL_420: v187 = v234.x; LABEL_421: if ( v187 == 0.0 ) { if ( v48 ) goto LABEL_427; LABEL_426: v188 = v236.x; } else { if ( !v48 ) { LOBYTE(v50) = LOBYTE(v235.x); a1->m_gameState.m_unkPoint26.x = v235.x; goto LABEL_426; } LOBYTE(v50) = LOBYTE(v235.y); a1->m_gameState.m_unkPoint26.y = v235.y; LABEL_427: v188 = v236.y; } v189 = v188 - v52; if ( v48 ) v190 = a1->m_gameState.m_unkPoint26.y; else v190 = a1->m_gameState.m_unkPoint26.x; v191 = v189 + v190; if ( v48 ) v192 = a1->m_gameState.m_cameraOffset.y; else v192 = a1->m_gameState.m_cameraOffset.x; v193 = v191 + v192; if ( !v48 ) { v244.x = v193; goto LABEL_303; } v244.y = v193; goto LABEL_305; } LABEL_301: a1->m_gameState.m_unkPoint26.y = v124; LABEL_436: v187 = v234.y; goto LABEL_421; } LABEL_289: if ( !v48 ) { v124 = v235.x; goto LABEL_300; } v124 = v235.y; goto LABEL_301; } LABEL_258: LODWORD(v50) = a1->m_gameState.m_unkBool21; v49 = m_isGoingLeft; if ( LODWORD(v50) == m_isGoingLeft ) { if ( !v48 ) { v50 = v235.x; goto LABEL_261; } v50 = v235.y; LABEL_263: a1->m_gameState.m_unkPoint26.y = v50; goto LABEL_436; } goto LABEL_264; } if ( a1->m_gameState.m_unkPoint26.y == a1->m_gameState.m_unkPoint28.y ) goto LABEL_258; } v111 = a1->m_gameState.m_unkPoint26.y; if ( v235.y > v111 ) goto LABEL_268; LABEL_282: v120 = v111; if ( v48 ) v121 = v238; else v121 = v237; v122 = v120 - fabsf(v121); if ( v48 ) v123 = v235.y; else v123 = v235.x; if ( v122 >= v123 ) { if ( v48 ) v125 = a1->m_gameState.m_unkPoint26.y; else v125 = a1->m_gameState.m_unkPoint26.x; v126 = v125; if ( v48 ) v127 = v238; else v127 = v237; v119 = v126 - fabsf(v127); goto LABEL_299; } goto LABEL_289; } v78 = !m_isUpsideDown; } if ( v228 ) { v80 = *(float *)&v28; v79 = *(float *)&v33; if ( !v48 ) goto LABEL_154; } else { if ( v48 ) v79 = v242.y; else v79 = v242.x; if ( !v48 ) { v243.x = a1->m_gameState.m_unkFloat3; v80 = v79; LABEL_154: v81 = v236.x; v82 = a1->m_gameState.m_cameraOffset.x; goto LABEL_156; } v243.y = a1->m_gameState.m_unkFloat3; v80 = v79; } v81 = v236.y; v82 = a1->m_gameState.m_cameraOffset.y; LABEL_156: v83 = v81 + v82; if ( v48 ) v84 = v239.y; else v84 = v239.x; if ( v83 <= (float)((float)(v84 + v52) + v79) ) { if ( v48 ) { v90 = v236.y; v91 = a1->m_gameState.m_cameraOffset.y; } else { v90 = v236.x; v91 = a1->m_gameState.m_cameraOffset.x; } v92 = v90 + v91; if ( v48 ) v93 = v239.y; else v93 = v239.x; if ( v92 >= (float)((float)(v93 + v52) - v80) ) { v89 = 0; } else { if ( v48 ) v94 = v236.y; else v94 = v236.x; v95 = (float)(v94 - v52) + v80; if ( v48 ) v96 = a1->m_gameState.m_cameraOffset.y; else v96 = a1->m_gameState.m_cameraOffset.x; v97 = v95 + v96; if ( v48 ) v244.y = v97; else v244.x = v97; v89 = v78; } } else { if ( v48 ) v85 = v236.y; else v85 = v236.x; v86 = (float)(v85 - v52) - v79; if ( v48 ) v87 = a1->m_gameState.m_cameraOffset.y; else v87 = a1->m_gameState.m_cameraOffset.x; v88 = v86 + v87; if ( v48 ) v244.y = v88; else v244.x = v88; v89 = v78 ^ 1; } LOBYTE(v50) = *p_m_isPlatformer; if ( !*p_m_isPlatformer ) goto LABEL_302; LOBYTE(v50) = v228; if ( !v228 ) goto LABEL_302; cocos2d::CCPoint::CCPoint(&v249, &a1->m_player1->m_lastGroundedPos); if ( v48 ) { v98 = v249.y; v99 = a1->m_gameState.m_cameraOffset.y; if ( v89 ) goto LABEL_224; } else { v98 = v249.x; v99 = a1->m_gameState.m_cameraOffset.x; if ( v89 ) goto LABEL_223; } v100 = (float)(v98 - v52) + v99; if ( v78 ) { if ( !v48 ) { if ( v100 <= v244.x || v239.x >= v100 || v236.x < v98 ) goto LABEL_223; goto LABEL_221; } if ( v100 > v244.y && v239.y < v100 && v236.y >= v98 ) goto LABEL_222; } else { if ( !v48 ) { if ( v100 >= v244.x || v239.x <= v100 || v236.x > v98 ) goto LABEL_223; LABEL_221: v244.x = v100; v243.x = 30.0; LABEL_223: v101 = v244.x; v102 = v239.x; goto LABEL_225; } if ( v100 < v244.y && v239.y > v100 && v236.y <= v98 ) { LABEL_222: v244.y = v100; v243.y = 30.0; } } LABEL_224: v101 = v244.y; v102 = v239.y; LABEL_225: v103 = fabsf(v101 - v102); v104 = v48 ? v243.y : v243.x; LODWORD(v50) = &a1->m_gameState.m_unkPoint32; v105 = 30.0 - (float)((float)(v103 / 100.0) * 20.0); if ( v105 < 30.0 ) { if ( v104 < v105 ) goto LABEL_237; } else if ( v104 < 30.0 ) { if ( v105 >= 30.0 ) v105 = 30.0; LABEL_237: if ( !v48 ) goto LABEL_238; goto LABEL_239; } if ( !v48 ) { v105 = v243.x; LABEL_238: v243.x = v105; v106 = *(float *)LODWORD(v50); goto LABEL_240; } v105 = v243.y; LABEL_239: v243.y = v105; v106 = a1->m_gameState.m_unkPoint32.y; LABEL_240: if ( v105 < v106 ) { if ( v48 ) { v107 = a1->m_gameState.m_unkPoint32.y; v108 = v243.y; if ( a2 <= 0.0 ) { v210 = v107 + (float)((float)(v243.y - v107) / 10.0); LABEL_248: v243.y = v210; goto LABEL_305; } } else { v107 = *(float *)LODWORD(v50); v108 = v243.x; if ( a2 <= 0.0 ) { v210 = v107 + (float)((float)(v243.x - v107) / 10.0); LABEL_246: v243.x = v210; goto LABEL_303; } } v210 = v107 + (float)((float)(v108 - v107) / (float)(10.0 / a2)); if ( v48 ) goto LABEL_248; goto LABEL_246; } LABEL_302: if ( v48 ) goto LABEL_305; LABEL_303: v128 = v232.x; LABEL_306: if ( v128 == -99999.0 ) goto LABEL_319; if ( v48 ) { if ( v244.y > v232.y ) v244.y = v232.y; v129 = v231.y; } else { if ( v244.x > v232.x ) v244.x = v232.x; v129 = v231.x; } if ( (v129 > 0.0 || (LOBYTE(v50) = *p_m_isPlatformer) != 0) && (v48 ? (v130 = v244.y, v131 = v232.y) : (v130 = v244.x, v131 = v232.x), v130 > (float)(v131 - 60.0)) ) { if ( v48 ) { v133 = v244.y; if ( v244.y < a1->m_gameState.m_unkPoint2.y && v244.y < v239.y ) goto LABEL_324; v194 = v243.y; if ( v243.y >= 24.0 || v243.y == 1.0 && a1->m_gameState.m_unkPoint17.y != 0.0 ) goto LABEL_324; v195 = v232.y; } else { v133 = v244.x; if ( v244.x < a1->m_gameState.m_unkPoint2.x && v244.x < v239.x ) goto LABEL_320; v194 = v243.x; if ( v243.x >= 24.0 || v243.x == 1.0 && a1->m_gameState.m_unkPoint17.x != 0.0 ) goto LABEL_320; v195 = v232.x; } v196 = 1.0 - (float)((float)(v195 - v133) / 60.0); if ( v48 ) v197 = v243.y; else v197 = v243.x; v198 = v194 + (float)(v196 * (float)(24.0 - v197)); if ( v48 ) { v243.y = v198; LABEL_324: v132 = v233.y; goto LABEL_325; } v243.x = v198; } else { LABEL_319: if ( v48 ) goto LABEL_324; } LABEL_320: v132 = v233.x; LABEL_325: if ( v132 == -99999.0 ) goto LABEL_338; if ( v48 ) { if ( v244.y < v233.y ) v244.y = v233.y; v134 = v230.y; } else { if ( v244.x < v233.x ) v244.x = v233.x; v134 = v230.x; } if ( v134 <= 0.0 ) { LOBYTE(v50) = *p_m_isPlatformer; if ( !*p_m_isPlatformer ) goto LABEL_338; } if ( v48 ) { v135 = v244.y; v136 = v233.y; } else { v135 = v244.x; v136 = v233.x; } if ( v135 >= (float)(v136 + 60.0) ) goto LABEL_338; if ( v48 ) break; v199 = v244.x; if ( v244.x <= a1->m_gameState.m_unkPoint2.x || v244.x <= v239.x ) { v200 = v243.x; if ( v243.x < 24.0 && (v243.x != 1.0 || a1->m_gameState.m_unkPoint17.x == 0.0) ) { v201 = v233.x; goto LABEL_484; } } LABEL_339: v48 = 1; } v199 = v244.y; if ( v244.y > a1->m_gameState.m_unkPoint2.y && v244.y > v239.y ) goto LABEL_338; v200 = v243.y; if ( v243.y >= 24.0 || v243.y == 1.0 && a1->m_gameState.m_unkPoint17.y != 0.0 ) goto LABEL_338; v201 = v233.y; LABEL_484: v202 = 1.0 - (float)((float)(v199 - v201) / 60.0); if ( v48 ) v203 = v243.y; else v203 = v243.x; v204 = v200 + (float)(v202 * (float)(24.0 - v203)); if ( !v48 ) { v243.x = v204; goto LABEL_339; } v243.y = v204; LABEL_338: if ( !v48 ) goto LABEL_339; cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_gameState.m_unkPoint2, COERCE_FLOAT(&v244), v49, SLOBYTE(v50)); p_m_unkUint13 = &a1->m_gameState.m_unkUint13; if ( v234.y == 0.0 ) { if ( *p_m_unkUint13 > 0.0 ) { *p_m_unkUint13 = *p_m_unkUint13 - (float)(a2 / 60.0); v243.y = 30.0; } } else { v243.y = 1.0; *p_m_unkUint13 = 0.0; } if ( v234.x != 0.0 ) v243.x = 1.0; cocos2d::CCPoint::CCPoint(&v248, &v232); cocos2d::CCPoint::CCPoint(&v249, &v233); limitCamera(&v244.x, &v248.x, &v249.x); v140 = v243.x; v141 = v244.x; if ( v243.x > 1.0 ) { if ( a2 > 0.0 ) v140 = v243.x / a2; v141 = v239.x + (float)((float)(v244.x - v239.x) / v140); } v142 = v243.y; v239.x = v141; v143 = v244.y; if ( v243.y > 1.0 ) { if ( a2 > 0.0 ) v142 = v243.y / a2; v143 = v239.y + (float)((float)(v244.y - v239.y) / v142); } v239.y = v143; cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_gameState.m_unkPoint32, COERCE_FLOAT(&v243), v138, v139); cocos2d::CCPoint::CCPoint(&v248, &v232); cocos2d::CCPoint::CCPoint(&v249, &v233); limitCamera(&v239.x, &v248.x, &v249.x); m_levelFlipping = a1->m_gameState.m_levelFlipping; if ( m_levelFlipping == 1.0 ) { if ( a1->m_cameraFlip != -1.0 ) a1->m_resetActiveObjects = 1; a1->m_cameraFlip = -1.0; a1->flipArt(a1, 1); } else if ( m_levelFlipping == 0.0 ) { if ( a1->m_cameraFlip != 1.0 ) a1->m_resetActiveObjects = 1; a1->m_cameraFlip = 1.0; a1->flipArt(a1, 0); } cocos2d::CCPoint::operator-(v245, &a1->m_gameState.m_cameraPosition2, &v239); v145 = 0; if ( a1->m_gameState.m_unkPoint18.x != 0.0 ) { v146 = a1->m_gameState.m_unkPoint19.x; v147 = *(float *)v245; a1->m_gameState.m_unkPoint18.x = 0.0; a1->m_gameState.m_unkPoint8.x = v147; if ( v146 > 0.0 ) { if ( a1->m_gameState.m_unkPoint22.x != 0.0 ) goto LABEL_365; p_m_gameState = &a1->m_gameState; v159 = a1->m_gameState.m_unkPoint21.x; v161 = 12; goto LABEL_391; } goto LABEL_382; } while ( 2 ) { v156 = a1->m_gameState.m_unkPoint17.x; LABEL_377: v157 = 0.0; if ( v156 == 0.0 ) { if ( v145 ) { if ( a1->m_gameState.m_unkPoint22.y != 0.0 ) { if ( a1->m_gameState.m_unkPoint12.y < 1.0 ) goto LABEL_400; a1->m_gameState.m_unkPoint22.y = 0.0; goto LABEL_412; } } else { if ( a1->m_gameState.m_unkPoint22.x == 0.0 ) { LABEL_380: v145 = 1; if ( a1->m_gameState.m_unkPoint18.y != 0.0 ) { v146 = a1->m_gameState.m_unkPoint19.y; v147 = *(float *)&v245[1]; a1->m_gameState.m_unkPoint18.y = 0.0; a1->m_gameState.m_unkPoint8.y = v147; if ( v146 > 0.0 ) { if ( a1->m_gameState.m_unkPoint22.y == 0.0 ) { v159 = a1->m_gameState.m_unkPoint21.y; p_m_gameState = &a1->m_gameState; v161 = 13; LABEL_391: v162 = (int)v159; if ( v145 ) v163 = a1->m_gameState.m_unkPoint20.y; else v163 = a1->m_gameState.m_unkPoint20.x; GJGameState::tweenValue(p_m_gameState, v147, 0.0, v161, v146, v162, v163, -1, -1); } else { LABEL_365: if ( v145 ) v148 = 13; else v148 = 12; GJGameState::stopTweenAction(&a1->m_gameState, v148); if ( v145 ) { v153 = a1->m_gameState.m_unkPoint8.y; a1->m_gameState.m_unkPoint12.y = 0.0; v150 = a1->m_gameState.m_unkPoint19.y; a1->m_gameState.m_unkPoint24.y = v153; v151 = 22; v152 = a1->m_gameState.m_unkPoint21.y; } else { v149 = a1->m_gameState.m_unkPoint8.x; a1->m_gameState.m_unkPoint12.x = 0.0; v150 = a1->m_gameState.m_unkPoint19.x; a1->m_gameState.m_unkPoint24.x = v149; v151 = 21; v152 = a1->m_gameState.m_unkPoint21.x; } v154 = (int)v152; if ( v145 ) v155 = a1->m_gameState.m_unkPoint20.y; else v155 = a1->m_gameState.m_unkPoint20.x; GJGameState::tweenValue(&a1->m_gameState, 0.0, 1.0, v151, v150, v154, v155, -1, -1); } if ( !v145 ) continue; } else { LABEL_382: if ( v145 ) v158 = 13; else v158 = 12; GJGameState::stopTweenAction(&a1->m_gameState, v158); if ( !v145 ) { a1->m_gameState.m_unkPoint8.x = 0.0; continue; } a1->m_gameState.m_unkPoint8.y = 0.0; } } v156 = a1->m_gameState.m_unkPoint17.y; goto LABEL_377; } if ( a1->m_gameState.m_unkPoint12.x >= 1.0 ) { a1->m_gameState.m_unkPoint22.x = 0.0; goto LABEL_410; } LABEL_400: cocos2d::CCPoint::CCPoint( &v247, (float)((float)(a1->m_gameState.m_unkPoint10.x * a1->m_gameState.m_unkPoint19.x) / 3.0) + a1->m_gameState.m_unkPoint24.x, (float)((float)(a1->m_gameState.m_unkPoint10.y * a1->m_gameState.m_unkPoint19.y) / 3.0) + a1->m_gameState.m_unkPoint24.y); if ( v145 ) v164 = a1->m_gameState.m_unkPoint23.y; else v164 = a1->m_gameState.m_unkPoint23.x; lerp(&v248, &stru_AC68C0, &v247.x, v164); if ( v145 ) v165 = a1->m_gameState.m_unkPoint12.y; else v165 = a1->m_gameState.m_unkPoint12.x; cubicBezier(&v249, &a1->m_gameState.m_unkPoint24, &v247, &v248, &stru_AC68C0.x, v165); if ( !v145 ) { v157 = v249.x; LABEL_410: a1->m_gameState.m_unkPoint8.x = v157; goto LABEL_380; } v157 = v249.y; LABEL_412: a1->m_gameState.m_unkPoint8.y = v157; } } break; } if ( !v145 ) goto LABEL_380; cocos2d::CCPoint::CCPoint(&v246, &v239); cocos2d::CCPoint::operator+(&v249, &v239, &a1->m_gameState.m_unkPoint8); cocos2d::CCPoint::operator=((PlayerObject *)&v239, COERCE_FLOAT(&v249), v166, v167); cocos2d::CCPoint::CCPoint(&v248, &v232); cocos2d::CCPoint::CCPoint(&v249, &v233); limitCamera(&v239.x, &v248.x, &v249.x); cocos2d::CCPoint::operator-(&v249, &v239, &v246); cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_gameState.m_unkPoint9, COERCE_FLOAT(&v249), v168, v169); cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_gameState.m_cameraPosition, COERCE_FLOAT(&v239), v170, v171); cocos2d::CCPoint::CCPoint(&v247, &a1->m_gameState.m_cameraPosition); if ( a1->m_gameState.m_cameraShakeEnabled ) GJBaseGameLayer::applyShake(a1, &v247); setScaleX = (void (*)(void))a1->m_objectLayer->setScaleX; if ( a1->m_cameraFlip == -1.0 ) v247.x = (float)-v247.x - v8; setScaleX(); ((void (__fastcall *)(cocos2d::CCLayer *, _DWORD))a1->m_objectLayer->setScaleY)( a1->m_objectLayer, LODWORD(a1->m_gameState.m_cameraZoom)); m_objectLayer = a1->m_objectLayer; setPosition = m_objectLayer->setPosition; cocos2d::CCPoint::operator-(&v248, &v247); cocos2d::CCPoint::operator*(&v249, &v248, LODWORD(a1->m_gameState.m_cameraZoom)); setPosition(m_objectLayer, &v249); cocos2d::CCPoint::CCPoint(&v249, &a1->m_gameState.m_cameraPosition); LODWORD(v175.x) = &v249; v175.y = a1->m_gameState.m_cameraZoom; GJBaseGameLayer::updateCameraBGArt(a1, v175, v176); v177 = a1->m_gameState.m_cameraZoom; a1->m_gameState.m_unkBool20 = m_isSideways; a1->m_gameState.m_unkFloat4 = v177; a1->m_gameState.m_unkBool21 = m_isGoingLeft; cocos2d::CCPoint::operator-(&v248, &a1->m_gameState.m_cameraPosition, &a1->m_gameState.m_cameraPosition2); cocos2d::CCPoint::operator*(&v249, &v248, 1131413504); cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_gameState.m_unkPoint4, COERCE_FLOAT(&v249), v178, v179); cocos2d::CCPoint::operator=( (PlayerObject *)&a1->m_gameState.m_cameraPosition2, COERCE_FLOAT((GJBaseGameLayer *)&a1->m_gameState.m_cameraPosition), v180, v181); *(float *)&a1->m_gameState.m_unkInt12 = (float)(v239.y + (float)(v10 * 0.5)) - a1->m_gameState.m_cameraOffset.y; cocos2d::CCPoint::operator=( (PlayerObject *)&a1->m_gameState.m_unkPoint3, COERCE_FLOAT((GJBaseGameLayer *)&a1->m_gameState.m_cameraOffset), v182, v183); cocos2d::CCPoint::operator=( (PlayerObject *)&a1->m_gameState.m_unkPoint28, COERCE_FLOAT((GJBaseGameLayer *)&a1->m_gameState.m_unkPoint27), v184, v185); a1->m_gameState.m_unkPoint30.x = 0.0; a1->m_gameState.m_unkPoint30.y = 0.0; GJBaseGameLayer::updateExtraGameLayers(a1); }
GD Web Decomp Icon

GD Web Decomp

Raw Source