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:
authorTon Roosendaal <ton@blender.org>2008-12-22 12:43:29 +0300
committerTon Roosendaal <ton@blender.org>2008-12-22 12:43:29 +0300
commit42def9a351a2c2696912288d9f1aed8b658f097c (patch)
treea7b41a8e8bd918e558695a74f311d722814b8ae3 /source/blender/editors
parent6d31872298e2f6fd23d06a4ccb792647879163ca (diff)
2.5
Cleanup - for portablity we can keep the old ugly defines for retrieving active object, cfra and so on. But, they will use 'scene' not G.scene. - fixed code that uses those defines. - some unused variables/functions removed
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_draw.c4
-rw-r--r--source/blender/editors/animation/anim_markers.c1
-rw-r--r--source/blender/editors/interface/view2d.c14
-rw-r--r--source/blender/editors/screen/screen_edit.c10
-rw-r--r--source/blender/editors/space_time/space_time.c7
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c4
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c4
-rw-r--r--source/blender/editors/space_view3d/drawobject.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c1
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c7
10 files changed, 31 insertions, 25 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index aea4b0bbf1d..3765337f990 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -71,7 +71,7 @@ extern void ui_rasterpos_safe(float x, float y, float aspect);
/* CURRENT FRAME DRAWING */
/* Draw current frame number in a little green box beside the current frame indicator */
-static void draw_cfra_number (View2D *v2d, float cfra, short time)
+static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time)
{
float xscale, yscale, x, y;
char str[32];
@@ -147,7 +147,7 @@ void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag)
/* Draw current frame number in a little box */
if (flag & DRAWCFRA_SHOW_NUMBOX) {
UI_view2d_view_orthoSpecial(C, v2d, 1);
- draw_cfra_number(v2d, vec[0], (flag & DRAWCFRA_UNIT_SECONDS));
+ draw_cfra_number(scene, v2d, vec[0], (flag & DRAWCFRA_UNIT_SECONDS));
}
}
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index f7d13937075..e6f225dd0f7 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -362,6 +362,7 @@ int WM_modal_tweak_check(wmEvent *evt, int tweak_event)
static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
{
+ Scene *scene= CTX_data_scene(C);
MarkerMove *mm= op->customdata;
View2D *v2d= UI_view2d_fromcontext(C);
TimeMarker *marker, *selmarker=NULL;
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index d644a74e04b..8602b95ab19 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -867,6 +867,7 @@ static void step_to_grid(float *step, int *power, int unit)
*/
View2DGrid *UI_view2d_grid_calc(const bContext *C, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy)
{
+ Scene *scene= CTX_data_scene(C);
View2DGrid *grid;
float space, pixels, seconddiv;
int secondgrid;
@@ -1137,7 +1138,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
}
/* Print scale marking along a time scrollbar */
-static void scroll_printstr(View2DScrollers *scrollers, float x, float y, float val, int power, short unit, char dir)
+static void scroll_printstr(View2DScrollers *scrollers, Scene *scene, float x, float y, float val, int power, short unit, char dir)
{
int len;
char str[32];
@@ -1250,6 +1251,7 @@ static void scroll_printstr(View2DScrollers *scrollers, float x, float y, float
/* Draw scrollbars in the given 2d-region */
void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *vs)
{
+ Scene *scene= CTX_data_scene(C);
const short darker= -50, dark= -10, light= 20, lighter= 50;
rcti vert, hor, corner;
@@ -1355,12 +1357,12 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
for (; fac < hor.xmax; fac+=dfac, val+=grid->dx) {
switch (vs->xunits) {
case V2D_UNIT_FRAMES: /* frames (as whole numbers)*/
- scroll_printstr(vs, fac, 3.0+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_FRAMES, 'h');
+ scroll_printstr(vs, scene, fac, 3.0+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_FRAMES, 'h');
break;
case V2D_UNIT_SECONDS: /* seconds */
fac2= val/FPS;
- scroll_printstr(vs, fac, 3.0+(float)(hor.ymin), fac2, grid->powerx, V2D_UNIT_SECONDS, 'h');
+ scroll_printstr(vs, scene, fac, 3.0+(float)(hor.ymin), fac2, grid->powerx, V2D_UNIT_SECONDS, 'h');
break;
case V2D_UNIT_SECONDSSEQ: /* seconds with special calculations (only used for sequencer only) */
@@ -1371,13 +1373,13 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
time= floor(fac2);
fac2= fac2-time;
- scroll_printstr(vs, fac, 3.0+(float)(hor.ymin), time+FPS*fac2/100.0, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h');
+ scroll_printstr(vs, scene, fac, 3.0+(float)(hor.ymin), time+FPS*fac2/100.0, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h');
}
break;
case V2D_UNIT_DEGREES: /* IPO-Editor for rotation IPO-Drivers */
/* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */
- scroll_printstr(vs, fac, 3.0+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_DEGREES, 'v');
+ scroll_printstr(vs, scene, fac, 3.0+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_DEGREES, 'v');
break;
}
}
@@ -1484,7 +1486,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
/* draw vertical steps */
for (; fac < vert.ymax; fac+= dfac, val += grid->dy) {
- scroll_printstr(vs, (float)(vert.xmax)-14.0, fac, val, grid->powery, vs->yunits, 'v');
+ scroll_printstr(vs, scene, (float)(vert.xmax)-14.0, fac, val, grid->powery, vs->yunits, 'v');
}
}
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 4a60fc07a99..3c83792c5f9 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1267,11 +1267,11 @@ void ed_screen_fullarea(bContext *C)
void ED_animation_timer(wmWindow *win, int enable)
{
- if(win->animtimer)
- WM_event_remove_window_timer(win, win->animtimer);
- win->animtimer= NULL;
+// if(win->animtimer)
+// WM_event_remove_window_timer(win, win->animtimer);
+// win->animtimer= NULL;
- if(enable)
- win->animtimer= WM_event_add_window_timer(win, (int)(1000/FPS), (int)(1000/FPS));
+// if(enable)
+// win->animtimer= WM_event_add_window_timer(win, (int)(1000/FPS), (int)(1000/FPS));
}
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 54ab83e6de8..fdba1829410 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -86,7 +86,7 @@ static void time_draw_cfra_time(const bContext *C, SpaceTime *stime, ARegion *ar
static void time_draw_sfra_efra(const bContext *C, SpaceTime *stime, ARegion *ar)
{
View2D *v2d= UI_view2d_fromcontext(C);
- //Scene *scene= CTX_data_scene(C);
+ Scene *scene= CTX_data_scene(C);
/* draw darkened area outside of active timeline
* frame range used is preview range or scene range */
@@ -229,9 +229,10 @@ static SpaceLink *time_new(void)
BLI_addtail(&stime->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- ar->v2d.tot.xmin= (float)(SFRA - 4);
+ /* XXX here sfra and efra was used.... */
+ ar->v2d.tot.xmin= (float)(- 4);
ar->v2d.tot.ymin= 0.0f;
- ar->v2d.tot.xmax= (float)(EFRA + 4);
+ ar->v2d.tot.xmax= (float)(250 + 4);
ar->v2d.tot.ymax= 50.0f;
ar->v2d.cur= ar->v2d.tot;
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 1eb0b8c2b86..c9307f8e1fb 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -2022,7 +2022,7 @@ static void draw_ebones(View3D *v3d, Object *ob, int dt)
/* draw bone paths
* - in view space
*/
-static void draw_pose_paths(View3D *v3d, Object *ob)
+static void draw_pose_paths(Scene *scene, View3D *v3d, Object *ob)
{
bArmature *arm= ob->data;
bPoseChannel *pchan;
@@ -2547,7 +2547,7 @@ int draw_armature(Scene *scene, View3D *v3d, Base *base, int dt, int flag)
else if(G.f & G_WEIGHTPAINT)
arm->flag |= ARM_POSEMODE;
- draw_pose_paths(v3d, ob);
+ draw_pose_paths(scene, v3d, ob);
}
}
}
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 58a9c126324..bbe89afd411 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -452,7 +452,7 @@ static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmoot
return 1;
}
-void draw_mesh_text(Object *ob, int glsl)
+void draw_mesh_text(Scene *scene, Object *ob, int glsl)
{
Mesh *me = ob->data;
DerivedMesh *ddm;
@@ -561,7 +561,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, Object *ob, DerivedMesh *dm,
/* draw game engine text hack */
if(get_ob_property(ob, "Text"))
- draw_mesh_text(ob, 0);
+ draw_mesh_text(scene, ob, 0);
draw_textured_end();
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index bcb2b8b8e35..a1d6a9d13cb 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2824,7 +2824,7 @@ static int drawDispList(Scene *scene, View3D *v3d, Base *base, int dt)
/* 5. start filling the arrays */
/* 6. draw the arrays */
/* 7. clean up */
-static void draw_new_particle_system(View3D *v3d, Base *base, ParticleSystem *psys, int dt)
+static void draw_new_particle_system(Scene *scene, View3D *v3d, Base *base, ParticleSystem *psys, int dt)
{
Object *ob=base->object;
ParticleSystemModifierData *psmd;
@@ -5069,7 +5069,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
glDepthMask(GL_FALSE);
for(psys=ob->particlesystem.first; psys; psys=psys->next)
- draw_new_particle_system(v3d, base, psys, dt);
+ draw_new_particle_system(scene, v3d, base, psys, dt);
if(G.f & G_PARTICLEEDIT && ob==OBACT) {
psys= NULL; // XXX PE_get_current(ob);
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 674291e7e5d..6c20285654e 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -233,6 +233,7 @@ void do_layer_buttons(bContext *C, short event)
static void do_view3d_view_camerasmenu(bContext *C, void *arg, int event)
{
+ Scene *scene= CTX_data_scene(C);
View3D *v3d;
Base *base;
int i=1;
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 0d9a92c86c3..69bcf2e0395 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -723,7 +723,7 @@ void mouse_cursor(Scene *scene, ARegion *ar, View3D *v3d, short mx, short my)
}
-void deselectall(View3D *v3d) /* is toggle */
+void deselectall(Scene *scene, View3D *v3d) /* is toggle */
{
Base *base;
int a=0, ok=0;
@@ -806,7 +806,7 @@ void selectrandom(Scene *scene, View3D *v3d)
}
/* selects all objects of a particular type, on currently visible layers */
-void selectall_type(View3D *v3d, short obtype)
+void selectall_type(Scene *scene, View3D *v3d, short obtype)
{
Base *base;
@@ -825,7 +825,7 @@ void selectall_type(View3D *v3d, short obtype)
BIF_undo_push("Select all per type");
}
/* selects all objects on a particular layer */
-void selectall_layer(unsigned int layernum)
+void selectall_layer(Scene *scene, unsigned int layernum)
{
Base *base;
@@ -1863,6 +1863,7 @@ static int view3d_circle_select(bContext *C, wmOperator *op)
{
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
+ Scene *scene= CTX_data_scene(C);
View3D *v3d= sa->spacedata.first;
Base *base;