MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / get_tile

Function get_tile

src/SB/Game/zDiscoFloor.cpp:141–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139 }
140
141 U32 get_tile(const U8* a, size_t b)
142 {
143 static S8 init;
144 static volatile S32 bit_index;
145 static S32 r;
146
147 U32 uVar1 = a[(b >> 2) & 0x1fffffff] >> ((b & 3) << 1) & 3;
148 if (uVar1 == 2)
149 {
150 if (init == 0)
151 {
152 bit_index = 0x20;
153 init = 1;
154 }
155 bit_index++;
156 if (bit_index >= 0x20)
157 {
158 bit_index = 0;
159 r = xrand();
160 }
161 uVar1 = r & 1 << bit_index;
162 uVar1 = (-uVar1 | uVar1) >> 0x1f;
163 }
164 return uVar1;
165 }
166
167 void set_tile(U8* r3, size_t r4, U32 r5)
168 {

Callers 2

translate_maskFunction · 0.85
refresh_stateFunction · 0.85

Calls 1

xrandFunction · 0.85

Tested by

no test coverage detected