MCPcopy Create free account
hub / github.com/android/ndk-samples / _gen_wall_texture

Function _gen_wall_texture

endless-tunnel/app/src/main/cpp/play_scene.cpp:218–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218static unsigned char* _gen_wall_texture() {
219 static unsigned char pixel_data[WALL_TEXTURE_SIZE * WALL_TEXTURE_SIZE * 3];
220 unsigned char* p;
221 int x, y;
222 for (y = 0, p = pixel_data; y < WALL_TEXTURE_SIZE; y++) {
223 for (x = 0; x < WALL_TEXTURE_SIZE; x++, p += 3) {
224 p[0] = p[1] = p[2] = 128 + ((x > 2 && y > 2) ? Random(128) : 0);
225 }
226 }
227 return pixel_data;
228}
229
230void PlayScene::OnStartGraphics() {
231 // build shaders

Callers 1

OnStartGraphicsMethod · 0.85

Calls 1

RandomFunction · 0.85

Tested by

no test coverage detected