diff options
author | Chris Want <cwant@ualberta.ca> | 2006-01-28 19:35:18 +0300 |
---|---|---|
committer | Chris Want <cwant@ualberta.ca> | 2006-01-28 19:35:18 +0300 |
commit | c8b48e70e626a351dc3d02122ea413d0046e98b7 (patch) | |
tree | 0b4777ce258d751f501ec7ce16c129f01f3d3307 /source/blender/src/header_oops.c | |
parent | 45c7b2c5c2bc20296a581e1b6a1cb3908f11732f (diff) | |
parent | db5f7bd8da580d05c31f6fa65bfea8042deac10e (diff) |
Final merge of HEAD (bf-blender) into the orange branch.
Here are my notes on things to look out for as potential problem
spots:
source/blender/blenkernel/intern/displist.c:
+ is initfastshade(void) supposed to be empty? I had
to make it empty to get the merged tree to compile.
source/blender/python/api2_2x/Armature.c:
+ went with the version that had Armature_getLayers()
source/blender/python/api2_2x/Object.c
+ went with the version of Object_getPose() from bf-blender.
(#ifdef 0-ed the other version)
source/blender/python/api2_2x/Pose.[ch]
+ had problems linking due to no Pose_Init() ... copied these
two files straight from bf-blender.
source/blender/src/drawview.c:
+ view3d_panel_properties() had things shifted a few things shifted
a few pixels, otherwise, things were painless
source/blender/src/splash.jpg.c:
+ went with bf-blender version (orange is dead)
source/gameengine:
+ went with bf-blender version -- does not compile due to IMB_rect* stuff,
Ton should look into this.
Diffstat (limited to 'source/blender/src/header_oops.c')
-rw-r--r-- | source/blender/src/header_oops.c | 70 |
1 files changed, 46 insertions, 24 deletions
diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c index a3f068dc5a5..f84cee782d7 100644 --- a/source/blender/src/header_oops.c +++ b/source/blender/src/header_oops.c @@ -72,26 +72,55 @@ void do_oops_buttons(short event) { float dx, dy; + /* used for maximize hack */ + int win_width, win_height; + float aspect_win, aspect_oops, oops_width, oops_height, oops_x_mid, oops_y_mid; + + if(curarea->win==0) return; - - switch(event) { - case B_OOPSHOME: - init_v2d_oops(curarea, curarea->spacedata.first); // forces min/max to be reset - boundbox_oops(0); - G.v2d->cur= G.v2d->tot; - dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin); - dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin); - G.v2d->cur.xmin-= dx; - G.v2d->cur.xmax+= dx; - G.v2d->cur.ymin-= dy; - G.v2d->cur.ymax+= dy; - test_view2d(G.v2d, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - break; - case B_OOPSVIEWSEL: + if (event == B_NEWOOPS) { + scrarea_queue_winredraw(curarea); + scrarea_queue_headredraw(curarea); + G.soops->lockpoin= 0; + } else { /* must be either B_OOPSHOME or B_OOPSVIEWSEL */ init_v2d_oops(curarea, curarea->spacedata.first); // forces min/max to be reset - boundbox_oops(1); + if (event == B_OOPSHOME) { + boundbox_oops(0); /* Test all oops blocks */ + } else { + boundbox_oops(1); /* Test only selected oops blocks */ + } + + + /* Hack to work with test_view2d in drawipo.c + Modify the bounding box so it is maximized to the window aspect + so viewing all oops blocks isnt limited to hoz/vert only. + Cant modify drawipo.c because many other functions use this hos/vert operation - Campbell*/ + + win_width= curarea->winrct.xmax - curarea->winrct.xmin; + win_height= curarea->winrct.ymax - curarea->winrct.ymin; + + oops_width = G.v2d->tot.xmax - G.v2d->tot.xmin; + oops_height = G.v2d->tot.ymax - G.v2d->tot.ymin; + + oops_x_mid = (G.v2d->tot.xmax + G.v2d->tot.xmin)*0.5; + oops_y_mid = (G.v2d->tot.ymax + G.v2d->tot.ymin)*0.5; + /* wide windows will be above 1, skinny below 1 */ + aspect_win= (float)win_width / (float)win_height; + aspect_oops = (float)oops_width / (float)oops_height; + if (aspect_win>aspect_oops) {/* the window is wider then the oops bounds, increase the oops width */ + G.v2d->tot.xmin = oops_x_mid - ((oops_x_mid-G.v2d->tot.xmin) * (aspect_win/aspect_oops) ); /* scale the min */ + G.v2d->tot.xmax = oops_x_mid + ((G.v2d->tot.xmax-oops_x_mid) * (aspect_win/aspect_oops) );/* scale the max */ + } else { /* the window is skinnier then the oops bounds, increase the oops height */ + G.v2d->tot.ymin = oops_y_mid - ((oops_y_mid-G.v2d->tot.ymin) * (aspect_oops/aspect_win) ); /* scale the min */ + G.v2d->tot.ymax = oops_y_mid + ((G.v2d->tot.ymax-oops_y_mid) * (aspect_oops/aspect_win) );/* scale the max */ + } + + /* maybe we should restore the correct values? - do next of its needed */ + /* end hack */ + + + G.v2d->cur= G.v2d->tot; dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin); dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin); @@ -101,13 +130,6 @@ void do_oops_buttons(short event) G.v2d->cur.ymax+= dy; test_view2d(G.v2d, curarea->winx, curarea->winy); scrarea_queue_winredraw(curarea); - break; - - case B_NEWOOPS: - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - G.soops->lockpoin= 0; - break; } } |