Esempio n. 1
0
  /** R_Register */
  protected void R_Register() {
    r_lefthand = Cvar.Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE);
    r_norefresh = Cvar.Get("r_norefresh", "0", 0);
    r_fullbright = Cvar.Get("r_fullbright", "0", 0);
    r_drawentities = Cvar.Get("r_drawentities", "1", 0);
    r_drawworld = Cvar.Get("r_drawworld", "1", 0);
    r_novis = Cvar.Get("r_novis", "0", 0);
    r_nocull = Cvar.Get("r_nocull", "0", 0);
    r_lerpmodels = Cvar.Get("r_lerpmodels", "1", 0);
    r_speeds = Cvar.Get("r_speeds", "0", 0);

    r_lightlevel = Cvar.Get("r_lightlevel", "1", 0);

    gl_nosubimage = Cvar.Get("gl_nosubimage", "0", 0);
    gl_allow_software = Cvar.Get("gl_allow_software", "0", 0);

    gl_particle_min_size = Cvar.Get("gl_particle_min_size", "2", Globals.CVAR_ARCHIVE);
    gl_particle_max_size = Cvar.Get("gl_particle_max_size", "40", Globals.CVAR_ARCHIVE);
    gl_particle_size = Cvar.Get("gl_particle_size", "40", Globals.CVAR_ARCHIVE);
    gl_particle_att_a = Cvar.Get("gl_particle_att_a", "0.01", Globals.CVAR_ARCHIVE);
    gl_particle_att_b = Cvar.Get("gl_particle_att_b", "0.0", Globals.CVAR_ARCHIVE);
    gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE);

    gl_modulate = Cvar.Get("gl_modulate", "1.5", Globals.CVAR_ARCHIVE);
    gl_log = Cvar.Get("gl_log", "0", 0);
    gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0);
    gl_mode = Cvar.Get("gl_mode", "3", Globals.CVAR_ARCHIVE); // 640x480
    gl_lightmap = Cvar.Get("gl_lightmap", "0", 0);
    gl_shadows = Cvar.Get("gl_shadows", "0", Globals.CVAR_ARCHIVE);
    gl_dynamic = Cvar.Get("gl_dynamic", "1", 0);
    gl_nobind = Cvar.Get("gl_nobind", "0", 0);
    gl_round_down = Cvar.Get("gl_round_down", "1", 0);
    gl_picmip = Cvar.Get("gl_picmip", "0", 0);
    gl_skymip = Cvar.Get("gl_skymip", "0", 0);
    gl_showtris = Cvar.Get("gl_showtris", "0", 0);
    gl_ztrick = Cvar.Get("gl_ztrick", "0", 0);
    gl_finish = Cvar.Get("gl_finish", "0", Globals.CVAR_ARCHIVE);
    gl_clear = Cvar.Get("gl_clear", "0", 0);
    gl_cull = Cvar.Get("gl_cull", "1", 0);
    gl_polyblend = Cvar.Get("gl_polyblend", "1", 0);
    gl_flashblend = Cvar.Get("gl_flashblend", "0", 0);
    gl_playermip = Cvar.Get("gl_playermip", "0", 0);
    gl_monolightmap = Cvar.Get("gl_monolightmap", "0", 0);
    gl_driver = Cvar.Get("gl_driver", "opengl32", Globals.CVAR_ARCHIVE);
    gl_texturemode = Cvar.Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Globals.CVAR_ARCHIVE);
    gl_texturealphamode = Cvar.Get("gl_texturealphamode", "default", Globals.CVAR_ARCHIVE);
    gl_texturesolidmode = Cvar.Get("gl_texturesolidmode", "default", Globals.CVAR_ARCHIVE);
    gl_lockpvs = Cvar.Get("gl_lockpvs", "0", 0);

    gl_vertex_arrays = Cvar.Get("gl_vertex_arrays", "1", Globals.CVAR_ARCHIVE);

    gl_ext_swapinterval = Cvar.Get("gl_ext_swapinterval", "1", Globals.CVAR_ARCHIVE);
    gl_ext_palettedtexture = Cvar.Get("gl_ext_palettedtexture", "0", Globals.CVAR_ARCHIVE);
    gl_ext_multitexture = Cvar.Get("gl_ext_multitexture", "1", Globals.CVAR_ARCHIVE);
    gl_ext_pointparameters = Cvar.Get("gl_ext_pointparameters", "1", Globals.CVAR_ARCHIVE);
    gl_ext_compiled_vertex_array =
        Cvar.Get("gl_ext_compiled_vertex_array", "1", Globals.CVAR_ARCHIVE);

    gl_drawbuffer = Cvar.Get("gl_drawbuffer", "GL_BACK", 0);
    gl_swapinterval = Cvar.Get("gl_swapinterval", "0", Globals.CVAR_ARCHIVE);

    gl_saturatelighting = Cvar.Get("gl_saturatelighting", "0", 0);

    gl_3dlabs_broken = Cvar.Get("gl_3dlabs_broken", "1", Globals.CVAR_ARCHIVE);

    vid_fullscreen = Cvar.Get("vid_fullscreen", "0", Globals.CVAR_ARCHIVE);
    vid_gamma = Cvar.Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE);
    vid_ref = Cvar.Get("vid_ref", "lwjgl", Globals.CVAR_ARCHIVE);

    Cmd.AddCommand(
        "imagelist",
        new xcommand_t() {
          public void execute() {
            GL_ImageList_f();
          }
        });

    Cmd.AddCommand(
        "screenshot",
        new xcommand_t() {
          public void execute() {
            GL_ScreenShot_f();
          }
        });
    Cmd.AddCommand(
        "modellist",
        new xcommand_t() {
          public void execute() {
            Mod_Modellist_f();
          }
        });
    Cmd.AddCommand(
        "gl_strings",
        new xcommand_t() {
          public void execute() {
            GL_Strings_f();
          }
        });
  }
Esempio n. 2
0
  /** R_BeginFrame */
  protected void R_BeginFrame(float camera_separation) {

    gl_state.camera_separation = camera_separation;

    /*
     ** change modes if necessary
     */
    if (gl_mode.modified || vid_fullscreen.modified) {
      // FIXME: only restart if CDS is required
      cvar_t ref;

      ref = Cvar.Get("vid_ref", "lwjgl", 0);
      ref.modified = true;
    }

    if (gl_log.modified) {
      GLimp_EnableLogging((gl_log.value != 0.0f));
      gl_log.modified = false;
    }

    if (gl_log.value != 0.0f) {
      GLimp_LogNewFrame();
    }

    /*
     ** update 3Dfx gamma -- it is expected that a user will do a vid_restart
     ** after tweaking this value
     */
    if (vid_gamma.modified) {
      vid_gamma.modified = false;

      if ((gl_config.renderer & GL_RENDERER_VOODOO) != 0) {
        // wird erstmal nicht gebraucht

        /*
        char envbuffer[1024];
        float g;

        g = 2.00 * ( 0.8 - ( vid_gamma->value - 0.5 ) ) + 1.0F;
        Com_sprintf( envbuffer, sizeof(envbuffer), "SSTV2_GAMMA=%f", g );
        putenv( envbuffer );
        Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g );
        putenv( envbuffer );
        */
        VID.Printf(Defines.PRINT_DEVELOPER, "gamma anpassung fuer VOODOO nicht gesetzt");
      }
    }

    GLimp_BeginFrame(camera_separation);

    /*
     ** go into 2D mode
     */
    GL11.glViewport(0, 0, vid.width, vid.height);
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    GL11.glOrtho(0, vid.width, vid.height, 0, -99999, 99999);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glColor4f(1, 1, 1, 1);

    /*
     ** draw buffer stuff
     */
    if (gl_drawbuffer.modified) {
      gl_drawbuffer.modified = false;

      if (gl_state.camera_separation == 0 || !gl_state.stereo_enabled) {
        if (gl_drawbuffer.string.equalsIgnoreCase("GL_FRONT")) GL11.glDrawBuffer(GL11.GL_FRONT);
        else GL11.glDrawBuffer(GL11.GL_BACK);
      }
    }

    /*
     ** texturemode stuff
     */
    if (gl_texturemode.modified) {
      GL_TextureMode(gl_texturemode.string);
      gl_texturemode.modified = false;
    }

    if (gl_texturealphamode.modified) {
      GL_TextureAlphaMode(gl_texturealphamode.string);
      gl_texturealphamode.modified = false;
    }

    if (gl_texturesolidmode.modified) {
      GL_TextureSolidMode(gl_texturesolidmode.string);
      gl_texturesolidmode.modified = false;
    }

    /*
     ** swapinterval stuff
     */
    GL_UpdateSwapInterval();

    //
    // clear screen if desired
    //
    R_Clear();
  }