Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/39fa063830b61112778d to your computer and use it in GitHub Desktop.
Save anonymous/39fa063830b61112778d to your computer and use it in GitHub Desktop.
int __thiscall sub_434CA0(void* this, int a4, int a5, int a6)
{
int result; // eax@1
int v7; // esi@1
int v8; // ebp@1
int v9; // edx@1
int v10; // ecx@1
int v11; // eax@4
int v12; // ecx@4
int v13; // ebx@7
int v14; // eax@10
int v15; // edi@10
int v16; // eax@19
int v17; // edx@19
int v18; // eax@19
int v19; // eax@21
int v20; // edi@24
bool v21; // bl@26
int v22; // eax@28
int v23; // ecx@28
int v24; // ebx@29
int v25; // esi@36
int v26; // edx@36
int v27; // eax@36
int v28; // [sp+46h] [bp-98h]@7
int v29; // [sp+4Ah] [bp-94h]@7
int v30; // [sp+4Eh] [bp-90h]@0
int v31; // [sp+52h] [bp-8Ch]@0
int v32; // [sp+56h] [bp-88h]@0
int v33; // [sp+5Ah] [bp-84h]@13
char v34; // [sp+5Eh] [bp-80h]@4
char v35; // [sp+60h] [bp-7Eh]@20
char v36; // [sp+61h] [bp-7Dh]@24
int v37; // [sp+62h] [bp-7Ch]@28
char v38; // [sp+9Eh] [bp-40h]@20
char v39; // [sp+A6h] [bp-38h]@20
result = a4;
v7 = a1;
v8 = *(*(a4 + 520) + 4 * a6);
v9 = *(*(v8 + 2344) + 4);
v10 = *(v9 + 164);
if ( !(v10 & 0x10000) && !(v10 & 0xC) && !(*(*(v9 + 332) + 160) & 0x100) )
{
sub_4328A0(a4, v8, &v34);
v11 = *(v8 + 2344);
v12 = *(v11 + 4);
if ( !((*(*(v12 + 332) + 160) >> 31) & 1) || (BYTE2(v32) = 1, !*(v11 + 276)) )
BYTE2(v32) = 0;
v29 = a2;
v13 = (*(v12 + 164) >> 12) & 3;
v28 = a3;
if ( !dword_861A10 || (BYTE3(v32) = 1, !(*(*(v12 + 332) + 160) & 0x2000)) )
BYTE3(v32) = 0;
v14 = *(v7 + 1573504);
v15 = v7 + 4 * ((BYTE3(v32) != 0) + 2 * ((v13 > 0) + 2 * (BYTE2(v32) != 0) + 196694));
if ( v14 != *v15 )
{
if ( v14 )
{
(*(**(v7 + 1617780) + 264))(*(v7 + 1617780));
(*(**(v7 + 1617780) + 268))(*(v7 + 1617780));
}
*(v7 + 1573504) = *v15;
(*(**(v7 + 1617780) + 232))(*(v7 + 1617780), *v15);
(*(**(v7 + 1617780) + 252))(*(v7 + 1617780), &v33, 7);
(*(**(v7 + 1617780) + 256))(*(v7 + 1617780), 0);
}
if ( v13 && *(*(*(v8 + 2344) + 4) + 336) )
{
if ( v13 == 1 )
v33 = 8;
else
v33 = v13 != 2 ? 251 : 136;
v16 = *(v7 + 1617780);
v17 = *v16;
*&v33 = v33 / 255.0;
(*(v17 + 120))(v16, "alpha_ref", v33);
v18 = sub_453F30(*(*(*(v8 + 2344) + 4) + 336));
sub_41CB70(v18);
}
sub_433190(*(*(v8 + 2344) + 36));
D3DXMatrixMultiply(&v38, &v34, a5, v28, v29);
(*(**(v7 + 1617780) + 176))(*(v7 + 1617780), "matWorldViewProj", &v39);
if ( v35 )
{
v19 = *(v7 + 1617780);
if ( *(*(v8 + 2344) + 276) )
(*(*v19 + 184))(v19, "matWorldArray", *(*(v8 + 2344) + 276), *(*(v8 + 2344) + 272));
else
(*(*v19 + 184))(v19, "matWorldArray", *(v7 + 1573512), 32);
}
v20 = *(v8 + 2344);
v21 = v36 && (*(v8 + 2360) - *(v8 + 2356)) >> 2;
v22 = *(v20 + 52);
v23 = *(v20 + 56);
LOBYTE(v37) = v21;
sub_434240(*(v20 + 48), v23, v22, v21);
sub_434300(*(v20 + 72));
if ( v21 )
{
v24 = (*(v8 + 2360) - *(v8 + 2356)) >> 2;
if ( *(v7 + 32) != v24 )
{
(*(*dword_A6ECF8 + 408))(dword_A6ECF8, 0, v24 | 0x40000000);
*(v7 + 32) = v24;
}
(*(*dword_A6ECF8 + 400))(dword_A6ECF8, 1, *(v7 + 1617812), 4 * ((**(v8 + 2356) - v7 - 36) >> 2), 48);
if ( !*(v7 + 28) )
(*(*dword_A6ECF8 + 408))(dword_A6ECF8, 1, -2147483647);
*(v7 + 28) = 1;
}
else if ( *(v7 + 28) )
{
(*(*dword_A6ECF8 + 400))(dword_A6ECF8, 1, 0, 0, 0);
(*(*dword_A6ECF8 + 408))(dword_A6ECF8, 0, 1);
(*(*dword_A6ECF8 + 408))(dword_A6ECF8, 1, 1);
*(v7 + 28) = 0;
*(v7 + 32) = -1;
}
(*(**(v7 + 1617780) + 260))(*(v7 + 1617780), v30, v31, v32, v33, *&v34);
v25 = *dword_A6ECF8;
v26 = *(v20 + 76);
*&v34 = *(v20 + 2332) / 3;
v27 = *(v20 + 2328);
v33 = v26;
result = (*(v25 + 328))(dword_A6ECF8, 4, *(v20 + 60), 0, v27, v26, *&v34);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment