[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36495] branches/cycles/source: Cycles refactoring: put external engine code into separate file.

Brecht Van Lommel brechtvanlommel at pandora.be
Thu May 5 11:43:46 CEST 2011


Revision: 36495
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36495
Author:   blendix
Date:     2011-05-05 09:43:45 +0000 (Thu, 05 May 2011)
Log Message:
-----------
Cycles refactoring: put external engine code into separate file.

Modified Paths:
--------------
    branches/cycles/source/blender/blenloader/intern/readfile.c
    branches/cycles/source/blender/editors/render/render_shading.c
    branches/cycles/source/blender/editors/space_view3d/space_view3d.c
    branches/cycles/source/blender/editors/space_view3d/view3d_draw.c
    branches/cycles/source/blender/makesrna/intern/rna_render.c
    branches/cycles/source/blender/makesrna/intern/rna_scene.c
    branches/cycles/source/blender/render/CMakeLists.txt
    branches/cycles/source/blender/render/SConscript
    branches/cycles/source/blender/render/extern/include/RE_pipeline.h
    branches/cycles/source/blender/render/intern/include/renderpipeline.h
    branches/cycles/source/blender/windowmanager/intern/wm_draw.c
    branches/cycles/source/blender/windowmanager/intern/wm_init_exit.c
    branches/cycles/source/creator/creator.c

Added Paths:
-----------
    branches/cycles/source/blender/render/extern/include/RE_engine.h
    branches/cycles/source/blender/render/intern/pipeline/
    branches/cycles/source/blender/render/intern/pipeline/engine.c
    branches/cycles/source/blender/render/intern/source/pipeline.c

Removed Paths:
-------------
    branches/cycles/source/blender/render/intern/source/pipeline.c

Modified: branches/cycles/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/cycles/source/blender/blenloader/intern/readfile.c	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/blenloader/intern/readfile.c	2011-05-05 09:43:45 UTC (rev 36495)
@@ -139,7 +139,7 @@
 #include "BLO_undofile.h"
 #include "BLO_readblenfile.h" // streaming read pipe, for BLO_readblenfile BLO_readblenfilememory
 
-#include "RE_pipeline.h"
+#include "RE_engine.h"
 
 #include "readfile.h"
 

Modified: branches/cycles/source/blender/editors/render/render_shading.c
===================================================================
--- branches/cycles/source/blender/editors/render/render_shading.c	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/editors/render/render_shading.c	2011-05-05 09:43:45 UTC (rev 36495)
@@ -238,7 +238,7 @@
 #include "DNA_screen_types.h"
 #include "DNA_view3d_types.h"
 
-#include "RE_pipeline.h"
+#include "RE_engine.h"
 
 static void update_render_engines(Main *bmain, int tagged_only)
 {

Modified: branches/cycles/source/blender/editors/space_view3d/space_view3d.c
===================================================================
--- branches/cycles/source/blender/editors/space_view3d/space_view3d.c	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/editors/space_view3d/space_view3d.c	2011-05-05 09:43:45 UTC (rev 36495)
@@ -58,7 +58,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "RE_pipeline.h"
+#include "RE_engine.h"
 
 #include "RNA_access.h"
 

Modified: branches/cycles/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- branches/cycles/source/blender/editors/space_view3d/view3d_draw.c	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/editors/space_view3d/view3d_draw.c	2011-05-05 09:43:45 UTC (rev 36495)
@@ -63,6 +63,7 @@
 #include "BKE_scene.h"
 #include "BKE_unit.h"
 
+#include "RE_engine.h"
 #include "RE_pipeline.h"	// make_stars
 
 #include "IMB_imbuf_types.h"

Modified: branches/cycles/source/blender/makesrna/intern/rna_render.c
===================================================================
--- branches/cycles/source/blender/makesrna/intern/rna_render.c	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/makesrna/intern/rna_render.c	2011-05-05 09:43:45 UTC (rev 36495)
@@ -35,6 +35,7 @@
 
 #include "rna_internal.h"
 
+#include "RE_engine.h"
 #include "RE_pipeline.h"
 
 #include "BKE_utildefines.h"

Modified: branches/cycles/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/cycles/source/blender/makesrna/intern/rna_scene.c	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/makesrna/intern/rna_scene.c	2011-05-05 09:43:45 UTC (rev 36495)
@@ -41,6 +41,7 @@
 #include "DNA_userdef_types.h"
 
 /* Include for Bake Options */
+#include "RE_engine.h"
 #include "RE_pipeline.h"
 
 #ifdef WITH_QUICKTIME

Modified: branches/cycles/source/blender/render/CMakeLists.txt
===================================================================
--- branches/cycles/source/blender/render/CMakeLists.txt	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/render/CMakeLists.txt	2011-05-05 09:43:45 UTC (rev 36495)
@@ -77,7 +77,9 @@
 	intern/source/volumetric.c
 	intern/source/voxeldata.c
 	intern/source/zbuf.c
+	intern/pipeline/engine.c
 
+	extern/include/RE_engine.h
 	extern/include/RE_pipeline.h
 	extern/include/RE_render_ext.h
 	extern/include/RE_shader_ext.h

Modified: branches/cycles/source/blender/render/SConscript
===================================================================
--- branches/cycles/source/blender/render/SConscript	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/render/SConscript	2011-05-05 09:43:45 UTC (rev 36495)
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 Import ('env')
 
-sources = env.Glob('intern/source/*.c')
+sources = env.Glob('intern/source/*.c') + env.Glob('intern/pipeline/*.c')
 raysources = env.Glob('intern/raytrace/*.cpp')
 
 incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna'

Copied: branches/cycles/source/blender/render/extern/include/RE_engine.h (from rev 36407, branches/cycles/source/blender/render/extern/include/RE_pipeline.h)
===================================================================
--- branches/cycles/source/blender/render/extern/include/RE_engine.h	                        (rev 0)
+++ branches/cycles/source/blender/render/extern/include/RE_engine.h	2011-05-05 09:43:45 UTC (rev 36495)
@@ -0,0 +1,102 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file RE_engine.h
+ *  \ingroup render
+ */
+
+#ifndef RE_ENGINE_H
+#define RE_ENGINE_H
+
+#include "DNA_listBase.h"
+#include "DNA_vec_types.h"
+#include "RNA_types.h"
+
+struct Render;
+struct RenderEngine;
+struct RenderEngineType;
+struct RenderLayer;
+struct RenderResult;
+struct ReportList;
+struct Scene;
+
+/* External Engine */
+
+#define RE_INTERNAL			1
+#define RE_GAME				2
+#define RE_DO_PREVIEW		4
+#define RE_DO_ALL			8
+
+extern ListBase R_engines;
+
+typedef struct RenderEngineType {
+	struct RenderEngineType *next, *prev;
+
+	/* type info */
+	char idname[64]; // best keep the same size as BKE_ST_MAXNAME
+	char name[64];
+	int flag;
+
+	void (*render)(struct RenderEngine *engine, struct Scene *scene);
+	void (*draw)(struct RenderEngine *engine, struct Scene *scene);
+	void (*update)(struct RenderEngine *engine, struct Scene *scene);
+
+	/* RNA integration */
+	ExtensionRNA ext;
+} RenderEngineType;
+
+typedef struct RenderEngine {
+	RenderEngineType *type;
+	struct Render *re;
+	ListBase fullresult;
+	void *py_instance;
+	int do_draw;
+	int do_update;
+} RenderEngine;
+
+RenderEngine *RE_engine_create(RenderEngineType *type);
+void RE_engine_free(RenderEngine *engine);
+
+void RE_layer_load_from_file(struct RenderLayer *layer, struct ReportList *reports, const char *filename, int x, int y);
+void RE_result_load_from_file(struct RenderResult *result, struct ReportList *reports, const char *filename);
+
+LIBEXPORT struct RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h);
+LIBEXPORT void RE_engine_update_result(RenderEngine *engine, struct RenderResult *result);
+LIBEXPORT void RE_engine_end_result(RenderEngine *engine, struct RenderResult *result);
+
+LIBEXPORT int RE_engine_test_break(RenderEngine *engine);
+LIBEXPORT void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info);
+
+int RE_engine_render(struct Render *re, int do_all);
+
+void RE_engines_init(void);
+void RE_engines_exit(void);
+
+#endif /* RE_ENGINE_H */
+

Modified: branches/cycles/source/blender/render/extern/include/RE_pipeline.h
===================================================================
--- branches/cycles/source/blender/render/extern/include/RE_pipeline.h	2011-05-05 08:36:14 UTC (rev 36494)
+++ branches/cycles/source/blender/render/extern/include/RE_pipeline.h	2011-05-05 09:43:45 UTC (rev 36495)
@@ -36,7 +36,6 @@
 
 #include "DNA_listBase.h"
 #include "DNA_vec_types.h"
-#include "RNA_types.h"
 
 struct bNodeTree;
 struct Image;
@@ -44,11 +43,8 @@
 struct NodeBlurData;
 struct Object;
 struct RenderData;
-struct RenderEngine;
-struct RenderEngineType;
 struct RenderResult;
 struct ReportList;
-struct ReportList;
 struct Scene;
 struct SceneRenderLayer;
 
@@ -263,56 +259,6 @@
 void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, float mat[][4]);
 struct Scene *RE_GetScene(struct Render *re);
 
-/* External Engine */
-
-#define RE_INTERNAL			1
-#define RE_GAME				2
-#define RE_DO_PREVIEW		4
-#define RE_DO_ALL			8
-
-extern ListBase R_engines;
-
-typedef struct RenderEngineType {
-	struct RenderEngineType *next, *prev;
-
-	/* type info */
-	char idname[64]; // best keep the same size as BKE_ST_MAXNAME
-	char name[64];
-	int flag;
-
-	void (*render)(struct RenderEngine *engine, struct Scene *scene);
-	void (*draw)(struct RenderEngine *engine, struct Scene *scene);
-	void (*update)(struct RenderEngine *engine, struct Scene *scene);
-
-	/* RNA integration */
-	ExtensionRNA ext;
-} RenderEngineType;
-
-typedef struct RenderEngine {
-	RenderEngineType *type;
-	struct Render *re;
-	ListBase fullresult;
-	void *py_instance;
-	int do_draw;
-	int do_update;
-} RenderEngine;
-
-RenderEngine *RE_engine_create(RenderEngineType *type);
-void RE_engine_free(RenderEngine *engine);
-
-void RE_layer_load_from_file(RenderLayer *layer, struct ReportList *reports, const char *filename, int x, int y);
-void RE_result_load_from_file(RenderResult *result, struct ReportList *reports, const char *filename);
-
-LIBEXPORT struct RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h);
-LIBEXPORT void RE_engine_update_result(RenderEngine *engine, struct RenderResult *result);
-LIBEXPORT void RE_engine_end_result(RenderEngine *engine, struct RenderResult *result);
-
-LIBEXPORT int RE_engine_test_break(RenderEngine *engine);
-LIBEXPORT void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info);
-
-void RE_engines_init(void);
-void RE_engines_exit(void);
-
 int RE_is_rendering_allowed(struct Scene *scene, void *erh, void (*error)(void *handle, const char *str));
 
 #endif /* RE_PIPELINE_H */

Modified: branches/cycles/source/blender/render/intern/include/renderpipeline.h

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list