[Bf-blender-cvs] [0c6a01c] master: Use includes for blenderplayer stubs

Campbell Barton noreply at git.blender.org
Mon Jan 27 16:02:38 CET 2014


Commit: 0c6a01ca0072d8444309ec094bdc87d10695fc0d
Author: Campbell Barton
Date:   Tue Jan 28 01:55:10 2014 +1100
https://developer.blender.org/rB0c6a01ca0072d8444309ec094bdc87d10695fc0d

Use includes for blenderplayer stubs

exposes many incorrect and redundant stubs

===================================================================

M	source/blender/blenkernel/BKE_text.h
M	source/blender/blenkernel/intern/text.c
M	source/blender/collada/collada.h
M	source/blender/editors/include/ED_clip.h
M	source/blender/editors/include/ED_node.h
M	source/blender/editors/space_text/text_ops.c
M	source/blender/makesrna/intern/rna_text.c
M	source/blenderplayer/bad_level_call_stubs/stubs.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index 67c1b68..eb89216 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -55,6 +55,8 @@ struct Text    *BKE_text_copy		(struct Text *ta);
 void			BKE_text_unlink		(struct Main *bmain, struct Text *text);
 void			BKE_text_clear      (struct Text *text);
 void			BKE_text_write      (struct Text *text, const char *str);
+int             BKE_text_file_modified_check(struct Text *text);
+void            BKE_text_file_modified_ignore(struct Text *text);
 
 char   *txt_to_buf			(struct Text *text);
 void	txt_clean_text		(struct Text *text);
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index efe3e98..145f832 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -659,6 +659,62 @@ void BKE_text_write(Text *text, const char *str) /* called directly from rna */
 	txt_make_dirty(text);
 }
 
+
+/* returns 0 if file on disk is the same or Text is in memory only
+ * returns 1 if file has been modified on disk since last local edit
+ * returns 2 if file on disk has been deleted
+ * -1 is returned if an error occurs */
+
+int BKE_text_file_modified_check(Text *text)
+{
+	struct stat st;
+	int result;
+	char file[FILE_MAX];
+
+	if (!text || !text->name)
+		return 0;
+
+	BLI_strncpy(file, text->name, FILE_MAX);
+	BLI_path_abs(file, G.main->name);
+
+	if (!BLI_exists(file))
+		return 2;
+
+	result = BLI_stat(file, &st);
+
+	if (result == -1)
+		return -1;
+
+	if ((st.st_mode & S_IFMT) != S_IFREG)
+		return -1;
+
+	if (st.st_mtime > text->mtime)
+		return 1;
+
+	return 0;
+}
+
+void BKE_text_file_modified_ignore(Text *text)
+{
+	struct stat st;
+	int result;
+	char file[FILE_MAX];
+
+	if (!text || !text->name) return;
+
+	BLI_strncpy(file, text->name, FILE_MAX);
+	BLI_path_abs(file, G.main->name);
+
+	if (!BLI_exists(file)) return;
+
+	result = BLI_stat(file, &st);
+
+	if (result == -1 || (st.st_mode & S_IFMT) != S_IFREG)
+		return;
+
+	text->mtime = st.st_mtime;
+}
+
 /*****************************/
 /* Editing utility functions */
 /*****************************/
diff --git a/source/blender/collada/collada.h b/source/blender/collada/collada.h
index e96bc2e..524c704 100644
--- a/source/blender/collada/collada.h
+++ b/source/blender/collada/collada.h
@@ -53,11 +53,11 @@ struct Scene;
 /*
  * both return 1 on success, 0 on error
  */
-int collada_import(bContext *C,
+int collada_import(struct bContext *C,
                    const char *filepath,
                    int import_units);
 
-int collada_export(Scene *sce,
+int collada_export(struct Scene *sce,
                    const char *filepath,
                    int apply_modifiers,
                    BC_export_mesh_type export_mesh_type,
diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h
index 27e6292..91f8b39 100644
--- a/source/blender/editors/include/ED_clip.h
+++ b/source/blender/editors/include/ED_clip.h
@@ -50,7 +50,7 @@ int ED_space_clip_view_clip_poll(struct bContext *C);
 
 int ED_space_clip_tracking_poll(struct bContext *C);
 int ED_space_clip_maskedit_poll(struct bContext *C);
-int ED_space_clip_maskedit_mask_poll(bContext *C);
+int ED_space_clip_maskedit_mask_poll(struct bContext *C);
 
 void ED_space_clip_get_size(struct SpaceClip *sc, int *width, int *height);
 void ED_space_clip_get_size_fl(struct SpaceClip *sc, float size[2]);
@@ -85,4 +85,4 @@ void ED_space_clip_set_mask(struct bContext *C, struct SpaceClip *sc, struct Mas
 /* ** clip_ops.c ** */
 void ED_operatormacros_clip(void);
 
-#endif /* ED_CLIP_H */
+#endif /* __ED_CLIP_H__ */
diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h
index 2f4528c..5fe2dd6 100644
--- a/source/blender/editors/include/ED_node.h
+++ b/source/blender/editors/include/ED_node.h
@@ -102,7 +102,7 @@ bool ED_node_select_check(ListBase *lb);
 void ED_node_post_apply_transform(struct bContext *C, struct bNodeTree *ntree);
 void ED_node_set_active(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node);
 
-void ED_node_composite_job(const bContext *C, struct bNodeTree *nodetree, struct Scene *scene_owner);
+void ED_node_composite_job(const struct bContext *C, struct bNodeTree *nodetree, struct Scene *scene_owner);
 
 /* node_ops.c */
 void ED_operatormacros_node(void);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 752cda8..24cb03d 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -3107,61 +3107,6 @@ static EnumPropertyItem resolution_items[] = {
 	{0, NULL, 0, NULL, NULL}
 };
 
-/* returns 0 if file on disk is the same or Text is in memory only
- * returns 1 if file has been modified on disk since last local edit
- * returns 2 if file on disk has been deleted
- * -1 is returned if an error occurs */
-
-int text_file_modified(Text *text)
-{
-	struct stat st;
-	int result;
-	char file[FILE_MAX];
-
-	if (!text || !text->name)
-		return 0;
-
-	BLI_strncpy(file, text->name, FILE_MAX);
-	BLI_path_abs(file, G.main->name);
-
-	if (!BLI_exists(file))
-		return 2;
-
-	result = BLI_stat(file, &st);
-	
-	if (result == -1)
-		return -1;
-
-	if ((st.st_mode & S_IFMT) != S_IFREG)
-		return -1;
-
-	if (st.st_mtime > text->mtime)
-		return 1;
-
-	return 0;
-}
-
-static void text_ignore_modified(Text *text)
-{
-	struct stat st;
-	int result;
-	char file[FILE_MAX];
-
-	if (!text || !text->name) return;
-
-	BLI_strncpy(file, text->name, FILE_MAX);
-	BLI_path_abs(file, G.main->name);
-
-	if (!BLI_exists(file)) return;
-
-	result = BLI_stat(file, &st);
-	
-	if (result == -1 || (st.st_mode & S_IFMT) != S_IFREG)
-		return;
-
-	text->mtime = st.st_mtime;
-}
-
 static int text_resolve_conflict_exec(bContext *C, wmOperator *op)
 {
 	Text *text = CTX_data_edit_text(C);
@@ -3175,7 +3120,7 @@ static int text_resolve_conflict_exec(bContext *C, wmOperator *op)
 		case RESOLVE_MAKE_INTERNAL:
 			return text_make_internal_exec(C, op);
 		case RESOLVE_IGNORE:
-			text_ignore_modified(text);
+			BKE_text_file_modified_ignore(text);
 			return OPERATOR_FINISHED;
 	}
 
@@ -3188,7 +3133,7 @@ static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEve
 	uiPopupMenu *pup;
 	uiLayout *layout;
 
-	switch (text_file_modified(text)) {
+	switch (BKE_text_file_modified_check(text)) {
 		case 1:
 			if (text->flags & TXT_ISDIRTY) {
 				/* modified locally and externally, ahhh. offer more possibilites. */
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index b1672da..4647700 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -44,8 +44,6 @@
 
 #ifdef RNA_RUNTIME
 
-int text_file_modified(Text *text); /* XXX bad level call */
-
 static void rna_Text_filename_get(PointerRNA *ptr, char *value)
 {
 	Text *text = (Text *)ptr->data;
@@ -78,7 +76,7 @@ static void rna_Text_filename_set(PointerRNA *ptr, const char *value)
 static int rna_Text_modified_get(PointerRNA *ptr)
 {
 	Text *text = (Text *)ptr->data;
-	return text_file_modified(text);
+	return BKE_text_file_modified_check(text) != 0;
 }
 
 static int rna_Text_current_line_index_get(PointerRNA *ptr)
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 45b0319..0d52e9c 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -32,14 +32,9 @@
 
 
 #ifdef WITH_GAMEENGINE
-#include <stdlib.h>
-#include "DNA_listBase.h"
-#include "BLI_utildefines.h"
-#include "RNA_types.h"
 
 #define ASSERT_STUBS 0
 #if ASSERT_STUBS
-#include <assert.h>
 #define STUB_ASSERT(x) (assert(x))
 #else
 #define STUB_ASSERT(x)
@@ -139,484 +134,565 @@ struct wmOperatorType;
 struct wmWindow;
 struct wmWindowManager;
 
+
+/* -------------------------------------------------------------------- */
+/* Declarations */
+
+/* may cause troubles... enable for now so args match for certain */
+#if 1
+#ifdef __GNUC__
+#  pragma GCC diagnostic error "-Wmissing-prototypes"
+#endif
+
+#include "../../intern/cycles/blender/CCL_api.h"
+#include "../../intern/dualcon/dualcon.h"
+#include "../../intern/elbeem/extern/elbeem.h"
+#include "../blender/blenkernel/BKE_modifier.h"
+#include "../blender/collada/collada.h"
+#include "../blender/compositor/COM_compositor.h"
+#include "../blender/editors/include/ED_armature.h"
+#include "../blender/editors/include/ED_buttons.h"
+#include "../blender/editors/include/ED_clip.h"
+#include "../blender/editors/include/ED_curve.h"
+#include "../blender/editors/include/ED_fileselect.h"
+#include "../blender/editors/include/ED_image.h"
+#include "../blender/editors/include/ED_info.h"
+#include "../blender/editors/include/ED_keyframes_edit.h"
+#include "../blender/editors/include/ED_keyframing.h"
+#include "../blender/editors/include/ED_lattice.h"
+#include "../blender/editors/include/ED_mball.h"
+#include "../blender/editors/include/ED_mesh.h"
+#include "../blender/editors/include/ED_node.h"
+#include "../blender/editors/include/ED_object.h"
+#include "../blender/editors/include/ED_particle.h"
+#include "../blender/editors/include/ED_render.h"
+#include "../blender/editors/include/ED_screen.h"
+#include "../blender/editors/include/ED_space_api.h"
+#include "../blender/editors/include/ED_transform.h"
+#include "../blender/editors/include/ED_view3d.h"
+#include "../blender/editors/include/UI_interface.h"
+#include "../blender/editors/include/UI_interface_icons.h"
+#include "../blender/editors/include/UI_resources.h"
+#include "../blender/editors/include/UI_view2d.h"
+#include "../blender/python/BPY_extern.h"
+#include "../blender/render/extern/include/RE_engine.h"
+#include "../blender/render/extern/include/RE_pipeline.h"
+#include "../blender/render/extern/include/RE_render_ext.h"
+#include "../blender/render/extern/include/RE_shader_ext.h"
+#include "../blender/windowmanager/WM_api.h"
+
+
+/* -------------------------------------------------------------------- */
+/* Externs
+ * 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list