diff options
20 files changed, 17 insertions, 375 deletions
diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 0b8d8a45a08..0b6ce41eb5d 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -244,34 +244,6 @@ class WORLD_PT_mist(WorldButtonsPanel, Panel): layout.prop(world.mist_settings, "falloff") -class WORLD_PT_stars(WorldButtonsPanel, Panel): - bl_label = "Stars" - bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER'} - - def draw_header(self, context): - world = context.world - - self.layout.prop(world.star_settings, "use_stars", text="") - - def draw(self, context): - layout = self.layout - - world = context.world - - layout.active = world.star_settings.use_stars - - split = layout.split() - - col = split.column() - col.prop(world.star_settings, "size") - col.prop(world.star_settings, "color_random", text="Colors") - - col = split.column() - col.prop(world.star_settings, "distance_min", text="Min. Dist") - col.prop(world.star_settings, "average_separation", text="Separation") - - class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, Panel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} _context_path = "world" diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h index 028ff0f93d6..8f5ccf1087e 100644 --- a/source/blender/blenkernel/BKE_font.h +++ b/source/blender/blenkernel/BKE_font.h @@ -63,8 +63,6 @@ typedef struct EditFont { wchar_t *textbuf; struct CharInfo *textbufinfo; - wchar_t *oldstr; - struct CharInfo *oldstrinfo; float textcurs[4][2]; diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 4524b3ac7ac..bcf0eafaa65 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -104,10 +104,6 @@ void BKE_curve_editfont_free(Curve *cu) if (cu->editfont) { EditFont *ef = cu->editfont; - if (ef->oldstr) - MEM_freeN(ef->oldstr); - if (ef->oldstrinfo) - MEM_freeN(ef->oldstrinfo); if (ef->textbuf) MEM_freeN(ef->textbuf); if (ef->textbufinfo) @@ -120,6 +116,8 @@ void BKE_curve_editfont_free(Curve *cu) MEM_freeN(ef); cu->editfont = NULL; } + + MEM_SAFE_FREE(cu->selboxes); } void BKE_curve_editNurb_keyIndex_free(EditNurb *editnurb) diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index ecc4a03d255..8ef3b7ef23d 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -712,17 +712,6 @@ static const char *world_adrcodes_to_paths(int adrcode, int *array_index) return "mist.start"; case WO_MISTHI: return "mist.height"; - - case WO_STAR_R: - case WO_STAR_G: - case WO_STAR_B: - printf("WARNING: WO_STAR_R/G/B deprecated\n"); - return NULL; - - case WO_STARDIST: - return "stars.min_distance"; - case WO_STARSIZE: - return "stars.size"; default: /* for now, we assume that the others were MTex channels */ return mtex_adrcodes_to_paths(adrcode, array_index); diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 206f829eaa8..c5a932e4173 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -92,8 +92,6 @@ World *add_world(Main *bmain, const char *name) wrld->zeng = 0.01f; wrld->zenb = 0.01f; wrld->skytype = 0; - wrld->stardist = 15.0f; - wrld->starsize = 2.0f; wrld->exp = 0.0f; wrld->exposure = wrld->range = 1.0f; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 872d0a0274c..6c6ca96480b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3360,6 +3360,8 @@ static void lib_link_curve(FileData *fd, Main *main) cu->ipo = newlibadr_us(fd, cu->id.lib, cu->ipo); // XXX deprecated - old animation system cu->key = newlibadr_us(fd, cu->id.lib, cu->key); + + cu->selboxes = NULL; /* runtime, clear */ cu->id.flag -= LIB_NEED_LINK; } diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index dc58e84415c..8f536575a28 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1442,18 +1442,14 @@ void make_editText(Object *obedit) ef->textbufinfo = MEM_callocN((MAXTEXT + 4) * sizeof(CharInfo), "texteditbufinfo"); ef->copybuf = MEM_callocN((MAXTEXT + 4) * sizeof(wchar_t), "texteditcopybuf"); ef->copybufinfo = MEM_callocN((MAXTEXT + 4) * sizeof(CharInfo), "texteditcopybufinfo"); - ef->oldstr = MEM_callocN((MAXTEXT + 4) * sizeof(wchar_t), "oldstrbuf"); - ef->oldstrinfo = MEM_callocN((MAXTEXT + 4) * sizeof(CharInfo), "oldstrbuf"); } /* Convert the original text to wchar_t */ BLI_strncpy_wchar_from_utf8(ef->textbuf, cu->str, MAXTEXT + 4); /* length is bogus */ - wcscpy(ef->oldstr, ef->textbuf); cu->len = wcslen(ef->textbuf); memcpy(ef->textbufinfo, cu->strinfo, (cu->len) * sizeof(CharInfo)); - memcpy(ef->oldstrinfo, cu->strinfo, (cu->len) * sizeof(CharInfo)); if (cu->pos > cu->len) cu->pos = cu->len; @@ -1471,11 +1467,6 @@ void load_editText(Object *obedit) Curve *cu = obedit->data; EditFont *ef = cu->editfont; - MEM_freeN(ef->oldstr); - ef->oldstr = NULL; - MEM_freeN(ef->oldstrinfo); - ef->oldstrinfo = NULL; - update_string(cu); if (cu->strinfo) @@ -1484,13 +1475,6 @@ void load_editText(Object *obedit) memcpy(cu->strinfo, ef->textbufinfo, (cu->len) * sizeof(CharInfo)); cu->len = strlen(cu->str); - - /* this memory system is weak... */ - - if (cu->selboxes) { - MEM_freeN(cu->selboxes); - cu->selboxes = NULL; - } } void free_editText(Object *obedit) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 02cbc1060df..2e011493fce 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -351,7 +351,7 @@ static bool ED_object_editmode_load_ex(Object *obedit, const bool freedata) load_editNurb(obedit); if (freedata) free_editNurb(obedit); } - else if (obedit->type == OB_FONT && freedata) { + else if (obedit->type == OB_FONT) { load_editText(obedit); if (freedata) free_editText(obedit); } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 3fbb78ac016..b803a4a8473 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -843,14 +843,6 @@ static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmN case ND_WORLD_DRAW: /* handled by space_view3d_listener() for v3d access */ break; - case ND_WORLD_STARS: - { - RegionView3D *rv3d = ar->regiondata; - if (rv3d->persp == RV3D_CAMOB) { - ED_region_tag_redraw(ar); - } - break; - } } break; case NC_LAMP: diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 1bf137e5787..dc00e55e0f4 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -64,7 +64,6 @@ #include "BKE_movieclip.h" #include "RE_engine.h" -#include "RE_pipeline.h" /* make_stars */ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -107,21 +106,6 @@ extern void bl_debug_draw_quad_add(const float v0[3], const float v1[3], const f extern void bl_debug_draw_edge_add(const float v0[3], const float v1[3]); #endif -static void star_stuff_init_func(void) -{ - cpack(0xFFFFFF); - glPointSize(1.0); - glBegin(GL_POINTS); -} -static void star_stuff_vertex_func(const float vec[3]) -{ - glVertex3fv(vec); -} -static void star_stuff_term_func(void) -{ - glEnd(); -} - void circf(float x, float y, float rad) { GLUquadricObj *qobj = gluNewQuadric(); @@ -3279,14 +3263,6 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) { drawfloor(scene, v3d, grid_unit); } - if (rv3d->persp == RV3D_CAMOB) { - if (scene->world) { - if (scene->world->mode & WO_STARS) { - RE_make_stars(NULL, scene, star_stuff_init_func, star_stuff_vertex_func, - star_stuff_term_func); - } - } - } } else { if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) { diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 8df289ff917..4ba87eb8c39 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -930,9 +930,9 @@ static void setNearestAxis2d(TransInfo *t) static void setNearestAxis3d(TransInfo *t) { float zfac; - float mvec[3], axis[3], proj[3]; + float mvec[3], proj[3]; float len[3]; - int i, icoord[2]; + int i; /* calculate mouse movement */ mvec[0] = (float)(t->mval[0] - t->con.imval[0]); @@ -950,15 +950,16 @@ static void setNearestAxis3d(TransInfo *t) zfac = len_v3(t->persinv[0]) * 2.0f / t->ar->winx * zfac * 30.0f; for (i = 0; i < 3; i++) { + float axis[3], axis_2d[2]; + copy_v3_v3(axis, t->con.mtx[i]); mul_v3_fl(axis, zfac); /* now we can project to get window coordinate */ add_v3_v3(axis, t->con.center); - projectIntView(t, axis, icoord); + projectFloatView(t, axis, axis_2d); - axis[0] = (float)(icoord[0] - t->center2d[0]); - axis[1] = (float)(icoord[1] - t->center2d[1]); + sub_v2_v2v2(axis, axis_2d, t->center2d); axis[2] = 0.0f; if (normalize_v3(axis) != 0.0f) { diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index f1a2cd68f28..0141c4b61db 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -223,7 +223,7 @@ typedef struct Curve { float linewidth; char *str; - struct SelBox *selboxes; + struct SelBox *selboxes; /* runtime variable for drawing selections (editmode data) */ struct EditFont *editfont; char family[24]; diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h index 2699c6e576e..b4088cc5a5d 100644 --- a/source/blender/makesdna/DNA_ipo_types.h +++ b/source/blender/makesdna/DNA_ipo_types.h @@ -308,6 +308,7 @@ typedef struct Ipo { #define WO_MISTSTA 10 #define WO_MISTHI 11 +/* Stars are deprecated */ #define WO_STAR_R 12 #define WO_STAR_G 13 #define WO_STAR_B 14 diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h index a0863b18cca..3e01e159d6c 100644 --- a/source/blender/makesdna/DNA_world_types.h +++ b/source/blender/makesdna/DNA_world_types.h @@ -47,7 +47,7 @@ struct MTex; /** * World defines general modeling data such as a background fill, - * gravity, color model, stars, etc. It mixes game-data, rendering + * gravity, color model etc. It mixes game-data, rendering * data and modeling data. */ typedef struct World { ID id; @@ -96,8 +96,8 @@ typedef struct World { float misi, miststa, mistdist, misthi; float starr DNA_DEPRECATED, starg DNA_DEPRECATED, starb DNA_DEPRECATED, stark DNA_DEPRECATED; /* Deprecated */ - float starsize, starmindist; - float stardist, starcolnoise; + float starsize DNA_DEPRECATED, starmindist DNA_DEPRECATED; + float stardist DNA_DEPRECATED, starcolnoise DNA_DEPRECATED; /* unused now: DOF */ short dofsta, dofend, dofmin, dofmax; @@ -142,7 +142,7 @@ typedef struct World { /* mode */ #define WO_MIST 1 -#define WO_STARS 2 +#define WO_STARS 2 /* deprecated */ /*#define WO_DOF 4*/ #define WO_ACTIVITY_CULLING 8 #define WO_ENV_LIGHT 16 diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 79eb2945e5b..14859852714 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -661,7 +661,6 @@ extern StructRNA RNA_World; extern StructRNA RNA_WorldAmbientOcclusion; extern StructRNA RNA_WorldLighting; extern StructRNA RNA_WorldMistSettings; -extern StructRNA RNA_WorldStarsSettings; extern StructRNA RNA_WorldTextureSlot; extern StructRNA RNA_XnorController; extern StructRNA RNA_XorController; diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index b689a82c231..c7997bebedb 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -56,10 +56,6 @@ static PointerRNA rna_World_lighting_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_WorldLighting, ptr->id.data); } -static PointerRNA rna_World_stars_get(PointerRNA *ptr) -{ - return rna_pointer_inherit_refine(ptr, &RNA_WorldStarsSettings, ptr->id.data); -} static PointerRNA rna_World_mist_get(PointerRNA *ptr) { @@ -114,14 +110,6 @@ static void rna_World_draw_mist_update(Main *UNUSED(bmain), Scene *UNUSED(scene) WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); } -static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) -{ - World *wo = ptr->id.data; - - DAG_id_tag_update(&wo->id, 0); - WM_main_add_notifier(NC_WORLD | ND_WORLD_STARS, wo); -} - static void rna_World_use_nodes_update(bContext *C, PointerRNA *ptr) { World *wrld = (World *)ptr->data; @@ -450,46 +438,6 @@ static void rna_def_world_mist(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_World_update"); } -static void rna_def_world_stars(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "WorldStarsSettings", NULL); - RNA_def_struct_sdna(srna, "World"); - RNA_def_struct_nested(brna, srna, "World"); - RNA_def_struct_ui_text(srna, "World Stars", "Stars settings for a World data-block"); - - prop = RNA_def_property(srna, "use_stars", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS); - RNA_def_property_ui_text(prop, "Use Stars", "Enable starfield generation"); - RNA_def_property_update(prop, 0, "rna_World_stars_update"); - - prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "starsize"); - RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars"); - RNA_def_property_update(prop, 0, "rna_World_draw_update"); /* use normal update since this isn't visualized */ - - prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "starmindist"); - RNA_def_property_range(prop, 0, 1000); - RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars"); - RNA_def_property_update(prop, 0, "rna_World_stars_update"); - - prop = RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "stardist"); - RNA_def_property_range(prop, 2, 1000); - RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars"); - RNA_def_property_update(prop, 0, "rna_World_stars_update"); - - prop = RNA_def_property(srna, "color_random", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "starcolnoise"); - RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors"); - RNA_def_property_update(prop, 0, "rna_World_stars_update"); -} - void RNA_def_world(BlenderRNA *brna) { StructRNA *srna; @@ -568,12 +516,6 @@ void RNA_def_world(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Mist", "World mist settings"); - prop = RNA_def_property(srna, "star_settings", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "WorldStarsSettings"); - RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL, NULL); - RNA_def_property_ui_text(prop, "Stars", "World stars settings"); - /* nodes */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); @@ -588,7 +530,6 @@ void RNA_def_world(BlenderRNA *brna) rna_def_lighting(brna); rna_def_world_mist(brna); - rna_def_world_stars(brna); rna_def_world_mtex(brna); } diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 79826a63690..109524c9814 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -247,10 +247,6 @@ int RE_WriteEnvmapResult(struct ReportList *reports, struct Scene *scene, struct /* do a full sample buffer compo */ void RE_MergeFullSample(struct Render *re, struct Main *bmain, struct Scene *sce, struct bNodeTree *ntree); -/* ancient stars function... go away! */ -void RE_make_stars(struct Render *re, struct Scene *scenev3d, void (*initfunc)(void), - void (*vertexfunc)(const float *), void (*termfunc)(void)); - /* display and event callbacks */ void RE_display_init_cb (struct Render *re, void *handle, void (*f)(void *handle, RenderResult *rr)); void RE_display_clear_cb(struct Render *re, void *handle, void (*f)(void *handle, RenderResult *rr)); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index b4873e7d310..fb9f96b0ef7 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -135,201 +135,6 @@ #endif /* ------------------------------------------------------------------------- */ - -/* Stuff for stars. This sits here because it uses gl-things. Part of - * this code may move down to the converter. */ -/* ------------------------------------------------------------------------- */ -/* this is a bad beast, since it is misused by the 3d view drawing as well. */ - -static HaloRen *initstar(Render *re, ObjectRen *obr, const float vec[3], float hasize) -{ - HaloRen *har; - float hoco[4]; - - projectverto(vec, re->winmat, hoco); - - har= RE_findOrAddHalo(obr, obr->tothalo++); - - /* projectvert is done in function zbufvlaggen again, because of parts */ - copy_v3_v3(har->co, vec); - har->hasize= hasize; - - har->zd= 0.0; - har->pool = re->pool; - - return har; -} - -/* there must be a 'fixed' amount of stars generated between - * near and far - * all stars must by preference lie on the far and solely - * differ in clarity/color - */ - -void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void), - void (*vertexfunc)(const float *), void (*termfunc)(void)) -{ - extern unsigned char hash[512]; - ObjectRen *obr= NULL; - World *wrld= NULL; - HaloRen *har; - Scene *scene; - Object *camera; - Camera *cam; - RNG *rng; - double dblrand, hlfrand; - float vec[4], fx, fy, fz; - float fac, starmindist, clipend; - float mat[4][4], stargrid, maxrand, maxjit, force, alpha; - int x, y, z, sx, sy, sz, ex, ey, ez, done = FALSE; - unsigned int totstar= 0; - - if (initfunc) { - scene= scenev3d; - wrld= scene->world; - } - else { - scene= re->scene; - wrld= &(re->wrld); - } - - stargrid = wrld->stardist; /* distance between stars */ - maxrand = 2.0; /* amount a star can be shifted (in grid units) */ - maxjit = (wrld->starcolnoise); /* amount a color is being shifted */ - - /* size of stars */ - force = ( wrld->starsize ); - - /* minimal free space (starting at camera) */ - starmindist= wrld->starmindist; - - if (stargrid <= 0.10f) return; - - if (re) re->flag |= R_HALO; - else stargrid *= 1.0f; /* then it draws fewer */ - - if (re) invert_m4_m4(mat, re->viewmat); - else unit_m4(mat); - - /* BOUNDING BOX CALCULATION - * bbox goes from z = loc_near_var | loc_far_var, - * x = -z | +z, - * y = -z | +z - */ - - camera= re ? RE_GetCamera(re) : scene->camera; - - if (camera==NULL || camera->type != OB_CAMERA) - return; - - cam = camera->data; - clipend = cam->clipend; - - /* convert to grid coordinates */ - - sx = ((mat[3][0] - clipend) / stargrid) - maxrand; - sy = ((mat[3][1] - clipend) / stargrid) - maxrand; - sz = ((mat[3][2] - clipend) / stargrid) - maxrand; - - ex = ((mat[3][0] + clipend) / stargrid) + maxrand; - ey = ((mat[3][1] + clipend) / stargrid) + maxrand; - ez = ((mat[3][2] + clipend) / stargrid) + maxrand; - - dblrand = maxrand * stargrid; - hlfrand = 2.0 * dblrand; - - if (initfunc) { - initfunc(); - } - - if (re) /* add render object for stars */ - obr= RE_addRenderObject(re, NULL, NULL, 0, 0, 0); - - rng = BLI_rng_new(0); - - for (x = sx, fx = sx * stargrid; x <= ex; x++, fx += stargrid) { - for (y = sy, fy = sy * stargrid; y <= ey; y++, fy += stargrid) { - for (z = sz, fz = sz * stargrid; z <= ez; z++, fz += stargrid) { - - BLI_rng_seed(rng, (hash[z & 0xff] << 24) + (hash[y & 0xff] << 16) + (hash[x & 0xff] << 8)); - vec[0] = fx + (hlfrand * BLI_rng_get_double(rng)) - dblrand; - vec[1] = fy + (hlfrand * BLI_rng_get_double(rng)) - dblrand; - vec[2] = fz + (hlfrand * BLI_rng_get_double(rng)) - dblrand; - vec[3] = 1.0; - - if (vertexfunc) { - if (done & 1) vertexfunc(vec); - done++; - } - else { - if (re) - mul_m4_v3(re->viewmat, vec); - - /* in vec are global coordinates - * calculate distance to camera - * and using that, define the alpha - */ - alpha = len_v3(vec); - - if (alpha >= clipend) alpha = 0.0; - else if (alpha <= starmindist) alpha = 0.0; - else if (alpha <= 2.0f * starmindist) { - alpha = (alpha - starmindist) / starmindist; - } - else { - alpha -= 2.0f * starmindist; - alpha /= (clipend - 2.0f * starmindist); - alpha = 1.0f - alpha; - } - - - if (alpha != 0.0f) { - fac = force * BLI_rng_get_double(rng); - - har = initstar(re, obr, vec, fac); - - if (har) { - har->alfa = sqrt(sqrt(alpha)); - har->add= 255; - har->r = har->g = har->b = 1.0; - if (maxjit) { - har->r += ((maxjit * BLI_rng_get_double(rng)) ) - maxjit; - har->g += ((maxjit * BLI_rng_get_double(rng)) ) - maxjit; - har->b += ((maxjit * BLI_rng_get_double(rng)) ) - maxjit; - } - har->hard = 32; - har->lay= -1; - har->type |= HA_ONLYSKY; - done++; - } - } - } - - /* break out of the loop if generating stars takes too long */ - if (re && !(totstar % 1000000)) { - if (re->test_break(re->tbh)) { - x= ex + 1; - y= ey + 1; - z= ez + 1; - } - } - - totstar++; - } - /* do not call blender_test_break() here, since it is used in UI as well, confusing the callback system */ - /* main cause is G.is_break of course, a global again... (ton) */ - } - } - if (termfunc) termfunc(); - - if (obr) - re->tothalo += obr->tothalo; - - BLI_rng_free(rng); -} - - -/* ------------------------------------------------------------------------- */ /* tool functions/defines for ad hoc simplification and possible future * cleanup */ /* ------------------------------------------------------------------------- */ @@ -5368,15 +5173,7 @@ void RE_Database_Preprocess(Render *re) if (!re->test_break(re->tbh)) { int tothalo; - /* don't sort stars */ tothalo= re->tothalo; - if (!re->test_break(re->tbh)) { - if (re->wrld.mode & WO_STARS) { - re->i.infostr = IFACE_("Creating Starfield"); - re->stats_draw(re->sdh, &re->i); - RE_make_stars(re, NULL, NULL, NULL, NULL); - } - } sort_halos(re, tothalo); init_camera_inside_volumes(re); diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 43e052a6efc..feaf68a8c4a 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -289,7 +289,6 @@ int shadeHaloFloat(HaloRen *har, float col[4], int zz, if (R.wrld.mode & WO_MIST) { if (har->type & HA_ONLYSKY) { - /* stars but no mist */ alpha= har->alfa; } else { diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 6538272a43c..dabb90b2ba0 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -311,7 +311,6 @@ typedef struct wmNotifier { /* NC_WORLD World */ #define ND_WORLD_DRAW (45<<16) -#define ND_WORLD_STARS (46<<16) /* NC_TEXT Text */ #define ND_CURSOR (50<<16) |