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/blenkernel/intern/world.c')
-rw-r--r--source/blender/blenkernel/intern/world.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index e4736b1f54c..88c98b6d9d8 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -31,6 +31,7 @@
#include <string.h>
+#include <stdlib.h>
#include <math.h>
#include "MEM_guardedalloc.h"
@@ -83,12 +84,10 @@ void BKE_world_free(World *wrld)
BKE_world_free_ex(wrld, true);
}
-World *add_world(Main *bmain, const char *name)
+void BKE_world_init(World *wrld)
{
- World *wrld;
+ BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(wrld, id));
- wrld = BKE_libblock_alloc(bmain, ID_WO, name);
-
wrld->horr = 0.05f;
wrld->horg = 0.05f;
wrld->horb = 0.05f;
@@ -113,6 +112,15 @@ World *add_world(Main *bmain, const char *name)
wrld->preview = NULL;
wrld->miststa = 5.0f;
wrld->mistdist = 25.0f;
+}
+
+World *add_world(Main *bmain, const char *name)
+{
+ World *wrld;
+
+ wrld = BKE_libblock_alloc(bmain, ID_WO, name);
+
+ BKE_world_init(wrld);
return wrld;
}