Ejemplo n.º 1
0
void mesh_vertex_array_set_koord_ati(GAME_MESH_OLD * p_mesh)
{
  VERTEX_ARRAYS *p_va = &p_mesh->varray;
  int handle = p_mesh->varray.ati_handle;
  int *p_int, ind;

  p_int = glstav_text_map_indicie;
  ind = *p_int++;
  ind = K_CHYBA;
  array_text_set_num(0);
  if (ind != K_CHYBA) {
    array_text_on();
    glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT, 0, handle,
      p_va->ati_start_text[ind]);
  }
  else {
    array_text_off();
  }
  ind = *p_int++;
  ind = K_CHYBA;
  if (array_text_set_num(1)) {
    if (ind != K_CHYBA) {
      array_text_on();
      glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT, 0, handle,
        p_va->ati_start_text[ind]);
    }
    else {
      array_text_off();
    }
  }
  ind = *p_int++;
  ind = K_CHYBA;
  if (array_text_set_num(2)) {
    if (ind != K_CHYBA) {
      array_text_on();
      glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT, 0, handle,
        p_va->ati_start_text[ind]);
    }
    else {
      array_text_off();
    }
  }
  ind = *p_int++;
  ind = K_CHYBA;
  if (array_text_set_num(3)) {
    if (ind != K_CHYBA) {
      array_text_on();
      glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT, 0, handle,
        p_va->ati_start_text[ind]);
    }
    else {
      array_text_off();
    }
  }
}
Ejemplo n.º 2
0
void mesh_vertex_array_set_ati(GAME_MESH_OLD * p_mesh)
{
  VERTEX_ARRAYS *p_va = &p_mesh->varray;
  int handle = p_mesh->varray.ati_handle;
  int m2flag = p_mesh->p_data->m2flag;
  int norm = glstav_pn_triangles
    || m2flag & (MAT2_CALC_MAP1 | MAT2_CALC_MAP2 | MAT2_CALC_MAP3 |
    MAT2_CALC_MAP4);

  glArrayObjectATI(GL_VERTEX_ARRAY, 3, GL_FLOAT, 0, handle,
    p_va->ati_start_pos);
  array_normal_off();
  array_diffuse_off();
  array_specular_off();

  if (norm) {
    array_normal_on();
    glArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT, 0, handle,
      p_va->ati_start_norm);
  }
  else {
    array_normal_off();
  }

  if (m2flag & MAT2_DIFFUSE) {
    array_diffuse_on();
    glArrayObjectATI(GL_COLOR_ARRAY, 4, GL_FLOAT, 0, handle,
      p_va->ati_start_diff);
  }
  else {
    array_diffuse_off();
  }

  if (m2flag & (MAT2_SPECULAR | MAT2_ENV_SPEC)
    || p_mesh->p_data->kflag & KONT_DRAW_SPEC) {
    array_specular_on();
    glArrayObjectATI(GL_SECONDARY_COLOR_ARRAY_EXT, 3, GL_FLOAT, 0, handle,
      p_va->ati_start_spec);
  }
  else {
    array_specular_off();
  }
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglArrayObjectATI(JNIEnv *env, jclass clazz, jint array, jint size, jint type, jint stride, jint buffer, jint offset, jlong function_pointer) {
	glArrayObjectATIPROC glArrayObjectATI = (glArrayObjectATIPROC)((intptr_t)function_pointer);
	glArrayObjectATI(array, size, type, stride, buffer, offset);
}
Ejemplo n.º 4
0
/* Navaze aktualni renderovaci pole na poly
*/
void poly_vertex_array_set_ati(EDIT_MESH_POLY * p_poly)
{
  int handle = p_poly->varray.ati_handle;
  int spec = p_poly->m2flag & (MAT2_SPECULAR | MAT2_ENV_SPEC)
    || p_poly->kflag & KONT_DRAW_SPEC;
  int norm = glstav_pn_triangles
    || p_poly->m2flag & (MAT2_CALC_MAP1 | MAT2_CALC_MAP2 | MAT2_CALC_MAP3 |
    MAT2_CALC_MAP4);
  int *p_int, ind;

  glArrayObjectATI(GL_VERTEX_ARRAY, 3, GL_FLOAT, sizeof(p_poly->p_koord[0]),
    handle, 0);

  array_diffuse_on();
  glArrayObjectATI(GL_COLOR_ARRAY, 4, GL_FLOAT, sizeof(p_poly->p_koord[0]),
    handle, 16 * sizeof(float));

  if (norm) {
    array_normal_on();
    glArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT,
      sizeof(p_poly->p_koord[0]), handle, 3 * sizeof(float));
  }
  else {
    array_normal_off();
  }

  if (spec) {
    array_specular_on();
    glArrayObjectATI(GL_SECONDARY_COLOR_ARRAY_EXT, 3, GL_FLOAT,
      sizeof(p_poly->p_koord[0]), handle, 24 * sizeof(float));
  }
  else {
    array_specular_off();
  }

  p_int = glstav_text_map_indicie;

  if (glstav_text_poly_indicie > 0) {
    array_text_set_num(0);
    if ((ind = *p_int) != K_CHYBA) {
      array_text_on();
      glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT,
        sizeof(p_poly->p_koord[0]), handle,
        (6 + ((ind) << 1)) * sizeof(float));
    }
    else {
      array_text_off();
    }
  }
  p_int++;

  if (glstav_text_poly_indicie > 1) {
    array_text_set_num(1);
    if ((ind = *p_int) != K_CHYBA) {
      array_text_on();
      glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT,
        sizeof(p_poly->p_koord[0]), handle,
        (6 + ((ind) << 1)) * sizeof(float));
    }
    else {
      array_text_off();
    }
  }
  p_int++;

  if (glstav_text_poly_indicie > 2) {
    array_text_set_num(2);
    if ((ind = *p_int) != K_CHYBA) {
      array_text_on();
      glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT,
        sizeof(p_poly->p_koord[0]), handle,
        (6 + ((ind) << 1)) * sizeof(float));
    }
    else {
      array_text_off();
    }
  }
  p_int++;


  if (glstav_text_poly_indicie > 3) {
    array_text_set_num(3);
    if ((ind = *p_int) != K_CHYBA) {
      array_text_on();
      glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT,
        sizeof(p_poly->p_koord[0]), handle,
        (6 + ((ind) << 1)) * sizeof(float));
    }
    else {
      array_text_off();
    }
  }

  array_text_set_num(glstav_text_poly_indicie);
  array_text_on();
  glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT,
    sizeof(p_poly->p_koord[0]), handle, 14 * sizeof(float));
}