Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp')
-rw-r--r--source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
index 2244e9196de..c18c5dad376 100644
--- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
+++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
@@ -68,6 +68,8 @@ extern "C" {
#define DEFAULT_SPHERE_RADIUS 1.0f
#define DEFAULT_DKR_EPSILON 0.0f
+struct FreestyleGlobals g_freestyle;
+
// Freestyle configuration
static bool freestyle_is_initialized = false;
static Config::Path *pathconfig = NULL;
@@ -78,14 +80,6 @@ static AppView *view = NULL;
static FreestyleLineSet lineset_buffer;
static bool lineset_copied = false;
-// camera information
-float freestyle_viewpoint[3];
-float freestyle_mv[4][4];
-float freestyle_proj[4][4];
-int freestyle_viewport[4];
-
-// current scene
-Scene *freestyle_scene;
static void load_post_callback(struct Main * /*main*/, struct ID * /*id*/, void * /*arg*/)
{
@@ -113,7 +107,7 @@ void FRS_initialize()
view = new AppView;
controller->setView(view);
controller->Clear();
- freestyle_scene = NULL;
+ g_freestyle.scene = NULL;
lineset_copied = false;
BLI_callback_add(&load_post_callback_funcstore, BLI_CB_EVT_LOAD_POST);
@@ -159,9 +153,9 @@ static void init_view(Render *re)
break;
}
- freestyle_viewport[0] = freestyle_viewport[1] = 0;
- freestyle_viewport[2] = width;
- freestyle_viewport[3] = height;
+ g_freestyle.viewport[0] = g_freestyle.viewport[1] = 0;
+ g_freestyle.viewport[2] = width;
+ g_freestyle.viewport[3] = height;
view->setWidth(width);
view->setHeight(height);
@@ -184,17 +178,15 @@ static void init_camera(Render *re)
// Therefore, the view point (i.e., camera position) is at the origin, and
// the model-view matrix is simply the identity matrix.
- freestyle_viewpoint[0] = 0.0;
- freestyle_viewpoint[1] = 0.0;
- freestyle_viewpoint[2] = 0.0;
+ zero_v3(g_freestyle.viewpoint);
- unit_m4(freestyle_mv);
+ unit_m4(g_freestyle.mv);
- copy_m4_m4(freestyle_proj, re->winmat);
+ copy_m4_m4(g_freestyle.proj, re->winmat);
#if 0
- print_m4("mv", freestyle_mv);
- print_m4("proj", freestyle_proj);
+ print_m4("mv", g_freestyle.mv);
+ print_m4("proj", g_freestyle.proj);
#endif
}
@@ -633,11 +625,11 @@ Render *FRS_do_stroke_rendering(Render *re, SceneRenderLayer *srl, int render)
re->i.infostr = "Freestyle: Stroke rendering";
re->stats_draw(re->sdh, &re->i);
re->i.infostr = NULL;
- freestyle_scene = re->scene;
+ g_freestyle.scene = re->scene;
controller->DrawStrokes();
freestyle_render = controller->RenderStrokes(re, true);
controller->CloseFile();
- freestyle_scene = NULL;
+ g_freestyle.scene = NULL;
// composite result
FRS_composite_result(re, srl, freestyle_render);