- for some reason navmesh wasnt drawing when VBO was enabled.

- fix navmesh crash (may well have been from own changes)
- changing VBO's now redraws all windows - useful for checking if VBO draws differently.
This commit is contained in:
Campbell Barton 2011-10-10 02:56:26 +00:00
parent bdd7c2d3f4
commit f0cd9f987d
4 changed files with 10 additions and 8 deletions

@ -3001,7 +3001,7 @@ static void navmesh_drawColored(DerivedMesh *dm)
glEnable(GL_LIGHTING);*/
glDisable(GL_LIGHTING);
if(GPU_buffer_legacy(dm) ) {
/* if(GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" );
//glShadeModel(GL_SMOOTH);
glBegin(glmode = GL_QUADS);
@ -3062,8 +3062,10 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm)
result = CDDM_copy(dm);
if (!CustomData_has_layer(&result->faceData, CD_RECAST)) {
int *sourceRecastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST);
CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE,
sourceRecastData, maxFaces, "recastData");
if (sourceRecastData) {
CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE,
sourceRecastData, maxFaces, "recastData");
}
}
recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST);

@ -946,6 +946,7 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
if (was_navmesh != (ob->gameflag & OB_NAVMESH)) {
if (ob->type == OB_MESH) {
/* this is needed to refresh the derived meshes draw func */
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data);
}
@ -1424,8 +1425,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "body_type");
RNA_def_property_enum_items(prop, body_type_items);
RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get",
"rna_GameObjectSettings_physics_type_set", NULL);
RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL);
RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation");
RNA_def_property_update(prop, NC_LOGIC, NULL);

@ -2661,8 +2661,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
RNA_def_property_ui_text(prop, "VBOs",
"Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
RNA_def_property_update(prop, NC_WINDOW, NULL); /* this isnt essential but nice to check if VBO draws any differently */
prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);

@ -102,7 +102,7 @@ SG_Controller *BL_CreateIPO(struct bAction *action, KX_GameObject* gameobj, KX_B
rotmode = "rotation_axis_angle";
drotmode = "delta_rotation_axis_angle";
break;
case ROT_MODE_QUAT:
case ROT_MODE_QUAT: /* XXX, this isnt working, currently only eulers are supported [#28853] */
rotmode = "rotation_quaternion";
drotmode = "delta_rotation_quaternion";
break;