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

Method GL_InitImages

client/src/main/java/jake2/client/render/fast/Image.java:1594–1642  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1592 ===============
1593 */
1594 void GL_InitImages() {
1595 int i, j;
1596 float g = vid_gamma.value;
1597
1598 registration_sequence = 1;
1599
1600 // init intensity conversions
1601 intensity = Cvar.getInstance().Get("intensity", "2", 0);
1602
1603 if (intensity.value <= 1)
1604 Cvar.getInstance().Set("intensity", "1");
1605
1606 gl_state.inverse_intensity = 1 / intensity.value;
1607
1608 Draw_GetPalette();
1609
1610 if (qglColorTableEXT) {
1611 gl_state.d_16to8table = FS.LoadFile("pics/16to8.dat");
1612 if (gl_state.d_16to8table == null)
1613 Com.Error(Defines.ERR_FATAL, "Couldn't load pics/16to8.pcx");
1614 }
1615
1616 if ((gl_config.renderer & (GL_RENDERER_VOODOO | GL_RENDERER_VOODOO2)) != 0) {
1617 g = 1.0F;
1618 }
1619
1620 for (i = 0; i < 256; i++) {
1621
1622 if (g == 1.0f) {
1623 gammatable[i] = (byte) i;
1624 }
1625 else {
1626
1627 int inf = (int) (255.0f * Math.pow((i + 0.5) / 255.5, g) + 0.5);
1628 if (inf < 0)
1629 inf = 0;
1630 if (inf > 255)
1631 inf = 255;
1632 gammatable[i] = (byte) inf;
1633 }
1634 }
1635
1636 for (i = 0; i < 256; i++) {
1637 j = (int) (i * intensity.value);
1638 if (j > 255)
1639 j = 255;
1640 intensitytable[i] = (byte) j;
1641 }
1642 }
1643
1644 /*
1645 ===============

Callers

nothing calls this directly

Calls 6

getInstanceMethod · 0.95
Draw_GetPaletteMethod · 0.95
LoadFileMethod · 0.95
ErrorMethod · 0.95
GetMethod · 0.80
SetMethod · 0.80

Tested by

no test coverage detected