[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57898] branches/soc-2013-bge/source/ blender/blenkernel: Changed BKE_object_lod_update to return a bool indicating if the lod level has changed .

Daniel Stokes kupomail at gmail.com
Mon Jul 1 11:10:06 CEST 2013


Revision: 57898
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57898
Author:   kupoman
Date:     2013-07-01 09:10:05 +0000 (Mon, 01 Jul 2013)
Log Message:
-----------
Changed BKE_object_lod_update to return a bool indicating if the lod level has changed.

Modified Paths:
--------------
    branches/soc-2013-bge/source/blender/blenkernel/BKE_object.h
    branches/soc-2013-bge/source/blender/blenkernel/intern/object.c

Modified: branches/soc-2013-bge/source/blender/blenkernel/BKE_object.h
===================================================================
--- branches/soc-2013-bge/source/blender/blenkernel/BKE_object.h	2013-07-01 09:07:21 UTC (rev 57897)
+++ branches/soc-2013-bge/source/blender/blenkernel/BKE_object.h	2013-07-01 09:10:05 UTC (rev 57898)
@@ -86,7 +86,7 @@
 
 void BKE_object_lod_add(struct Object *ob);
 void BKE_object_lod_remove(struct Object *ob, int level);
-void BKE_object_lod_update(struct Object *ob, float camera_position[3]);
+bool BKE_object_lod_update(struct Object *ob, float camera_position[3]);
 bool BKE_object_lod_check(struct Object *ob, struct Scene *scene);
 struct Object *BKE_object_lod_meshob_get(struct Object *ob);
 struct Object *BKE_object_lod_matob_get(struct Object *ob);

Modified: branches/soc-2013-bge/source/blender/blenkernel/intern/object.c
===================================================================
--- branches/soc-2013-bge/source/blender/blenkernel/intern/object.c	2013-07-01 09:07:21 UTC (rev 57897)
+++ branches/soc-2013-bge/source/blender/blenkernel/intern/object.c	2013-07-01 09:10:05 UTC (rev 57898)
@@ -1008,7 +1008,7 @@
 	return (ob->mode == OB_MODE_OBJECT || !active);
 }
 
-void BKE_object_lod_update(struct Object *ob, float camera_position[3])
+bool BKE_object_lod_update(struct Object *ob, float camera_position[3])
 {
 	LodLevel* cur_level = ob->currentlod;
 	LodLevel* new_level = lod_level_select(ob, camera_position);
@@ -1016,7 +1016,10 @@
 	if (new_level != cur_level) {
 		printf("Level Switch!\n");
 		ob->currentlod = new_level;
+		return true;
 	}
+
+	return false;
 }
 
 struct Object *BKE_object_lod_meshob_get(struct Object *ob)




More information about the Bf-blender-cvs mailing list