MCPcopy Create free account
hub / github.com/demoth/jake2 / R_SetPalette

Method R_SetPalette

client/src/main/java/jake2/client/render/fast/Main.java:1439–1465  ·  view source on GitHub ↗

R_SetPalette

(byte[] palette)

Source from the content-addressed store, hash-verified

1437 * R_SetPalette
1438 */
1439 public void R_SetPalette(byte[] palette) {
1440 // 256 RGB values (768 bytes)
1441 // or null
1442 int i;
1443 int color = 0;
1444
1445 if (palette != null) {
1446 int j =0;
1447 for (i = 0; i < 256; i++) {
1448 color = (palette[j++] & 0xFF) << 0;
1449 color |= (palette[j++] & 0xFF) << 8;
1450 color |= (palette[j++] & 0xFF) << 16;
1451 color |= 0xFF000000;
1452 r_rawpalette[i] = color;
1453 }
1454 }
1455 else {
1456 for (i = 0; i < 256; i++) {
1457 r_rawpalette[i] = d_8to24table[i] | 0xff000000;
1458 }
1459 }
1460 GL_SetTexturePalette(r_rawpalette);
1461
1462 gl.glClearColor(0, 0, 0, 0);
1463 gl.glClear(GL_COLOR_BUFFER_BIT);
1464 gl.glClearColor(1f, 0f, 0.5f, 0.5f);
1465 }
1466
1467 static final int NUM_BEAM_SEGS = 6;
1468 float[][] start_points = new float[NUM_BEAM_SEGS][3];

Callers

nothing calls this directly

Calls 3

GL_SetTexturePaletteMethod · 0.95
glClearColorMethod · 0.65
glClearMethod · 0.65

Tested by

no test coverage detected