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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2003-10-07 22:24:02 +0400
committerTon Roosendaal <ton@blender.org>2003-10-07 22:24:02 +0400
commitf234b44d474ad45e07e4a9b2416a19a37c2e35ee (patch)
tree90482479c494adf505234952a13e09893fffa78e /source
parent39b1ceb66915b851b06bd544aa7b476a6a1010a2 (diff)
- another huge commit! read this!
- removed src/buttons.c and include/BIF_buttons.h - added src/buttons.txt, which is the old buttons.c for review and adding code to new panels structure - changed internal events to match new buttonspace structure - added tabs for new shading group of buttons - removed loads of little warnings, -Wall now compiles src/ almost without error (hint: setenv NAN_QUIET to see it all better) Now I'm ready to do actual buttons -> panels conversion. I will do the raw versions first, others then can cleanup
Diffstat (limited to 'source')
-rw-r--r--source/blender/include/BIF_butspace.h14
-rw-r--r--source/blender/include/BIF_buttons.h41
-rw-r--r--source/blender/include/BIF_toolbox.h1
-rw-r--r--source/blender/include/BSE_buttons.h8
-rw-r--r--source/blender/include/BSE_headerbuttons.h1
-rw-r--r--source/blender/include/mydevice.h47
-rw-r--r--source/blender/src/butspace.c445
-rw-r--r--source/blender/src/buttons.txt (renamed from source/blender/src/buttons.c)151
-rw-r--r--source/blender/src/buttons_scene.c52
-rw-r--r--source/blender/src/drawimage.c3
-rw-r--r--source/blender/src/drawtext.c1
-rw-r--r--source/blender/src/drawview.c4
-rw-r--r--source/blender/src/editaction.c6
-rw-r--r--source/blender/src/editarmature.c46
-rw-r--r--source/blender/src/editcurve.c2
-rw-r--r--source/blender/src/editface.c9
-rw-r--r--source/blender/src/editgroup.c4
-rw-r--r--source/blender/src/editimasel.c6
-rw-r--r--source/blender/src/editipo.c287
-rw-r--r--source/blender/src/editmball.c3
-rw-r--r--source/blender/src/editmesh.c4
-rw-r--r--source/blender/src/editnla.c22
-rw-r--r--source/blender/src/editobject.c14
-rw-r--r--source/blender/src/editoops.c3
-rw-r--r--source/blender/src/editsca.c41
-rw-r--r--source/blender/src/editscreen.c1
-rw-r--r--source/blender/src/editseq.c2
-rw-r--r--source/blender/src/editview.c14
-rw-r--r--source/blender/src/eventdebug.c16
-rw-r--r--source/blender/src/filesel.c7
-rw-r--r--source/blender/src/headerbuttons.c228
-rw-r--r--source/blender/src/imasel.c1
-rw-r--r--source/blender/src/interface.c2
-rw-r--r--source/blender/src/language.c2
-rw-r--r--source/blender/src/mywindow.c2
-rw-r--r--source/blender/src/previewrender.c74
-rw-r--r--source/blender/src/seqaudio.c4
-rw-r--r--source/blender/src/space.c84
-rw-r--r--source/blender/src/toets.c3
-rw-r--r--source/blender/src/toolbox.c3
-rw-r--r--source/blender/src/vpaint.c4
41 files changed, 932 insertions, 730 deletions
diff --git a/source/blender/include/BIF_butspace.h b/source/blender/include/BIF_butspace.h
index 3cca3dd9008..b2c9aec0f83 100644
--- a/source/blender/include/BIF_butspace.h
+++ b/source/blender/include/BIF_butspace.h
@@ -33,8 +33,22 @@
#define BIF_BUTSPACE_H
/* all internal calls and event codes for buttons space */
+struct Base;
+struct ID;
extern void render_panels(void);
+extern void do_render_panels(unsigned short event);
+
+extern void do_butspace(unsigned short event);
+
+extern void redraw_test_buttons(struct Base *new);
+
+void test_meshpoin_but(char *name, struct ID **idpp);
+void test_obpoin_but(char *name, struct ID **idpp);
+void test_scenepoin_but(char *name, struct ID **idpp);
+void test_matpoin_but(char *name, struct ID **idpp);
+void test_scriptpoin_but(char *name, struct ID **idpp);
+void test_actionpoin_but(char *name, ID **idpp);
/* -------------- event defines ------------ */
diff --git a/source/blender/include/BIF_buttons.h b/source/blender/include/BIF_buttons.h
deleted file mode 100644
index 2f3a87baf5e..00000000000
--- a/source/blender/include/BIF_buttons.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
- */
-#ifndef BIF_BUTTONS_H
-#define BIF_BUTTONS_H
-
-struct Base;
-
-extern void do_blenderbuttons(unsigned short event);
-extern void redraw_test_buttons(struct Base *new);
-
-#endif
-
diff --git a/source/blender/include/BIF_toolbox.h b/source/blender/include/BIF_toolbox.h
index 7807aa3f7b0..1d5d4fb3faf 100644
--- a/source/blender/include/BIF_toolbox.h
+++ b/source/blender/include/BIF_toolbox.h
@@ -115,6 +115,7 @@ short sbutton (char *var, float min, float max, char *str); /* __NLA */
int movetolayer_buts (unsigned int *lay);
void draw_numbuts_tip (char *str, int x1, int y1, int x2, int y2);
int do_clever_numbuts (char *name, int tot, int winevent);
+void clever_numbuts_buts(void);
void add_numbut (int nr, int type, char *str, float min, float max, void *poin, char *tip);
void clever_numbuts (void);
void replace_names_but (void);
diff --git a/source/blender/include/BSE_buttons.h b/source/blender/include/BSE_buttons.h
index dd2332fbec2..63ac472f032 100644
--- a/source/blender/include/BSE_buttons.h
+++ b/source/blender/include/BSE_buttons.h
@@ -33,14 +33,6 @@
#ifndef BSE_BUTTONS_H
#define BSE_BUTTONS_H
-struct ID;
-
-void test_meshpoin_but(char *name, struct ID **idpp);
-void test_obpoin_but(char *name, struct ID **idpp);
-void test_scenepoin_but(char *name, struct ID **idpp);
-void test_matpoin_but(char *name, struct ID **idpp);
-void test_scriptpoin_but(char *name, struct ID **idpp);
-void test_actionpoin_but(char *name, ID **idpp); /* __ NLA */
void clever_numbuts_buts();
#endif /* BSE_BUTTONS_H */
diff --git a/source/blender/include/BSE_headerbuttons.h b/source/blender/include/BSE_headerbuttons.h
index 3399911e189..b2f7fb18ca3 100644
--- a/source/blender/include/BSE_headerbuttons.h
+++ b/source/blender/include/BSE_headerbuttons.h
@@ -36,6 +36,7 @@
struct uiBlock;
struct ID;
+void update_for_newframe_muted(void);
void free_matcopybuf(void);
void clear_matcopybuf(void);
void write_videoscape_fs(void);
diff --git a/source/blender/include/mydevice.h b/source/blender/include/mydevice.h
index 1e3e94ef011..4b76133ca01 100644
--- a/source/blender/include/mydevice.h
+++ b/source/blender/include/mydevice.h
@@ -202,24 +202,26 @@
/* REDRAWVIEW3D has to be the first one (lowest number) for buttons! */
#define REDRAWVIEW3D 0x4010
+#define REDRAWVIEWCAM 0x4011
+#define REDRAWVIEW3D_Z 0x4012
+
+#define REDRAWALL 0x4013
+#define REDRAWHEADERS 0x4014
+
+#define REDRAWBUTSHEAD 0x4015
+#define REDRAWBUTSALL 0x4016
+
+#define REDRAWBUTSSCENE 0x4017
+#define REDRAWBUTSOBJECT 0x4018
+#define REDRAWBUTSTYPES 0x4019
+#define REDRAWBUTSSHADING 0x401A
+#define REDRAWBUTSEDIT 0x401B
+#define REDRAWBUTSSCRIPT 0x401C
+#define REDRAWBUTSLOGIC 0x401D
+/* can be in 2 places... */
+#define REDRAWBUTSLAMP 0x401F
+
-#define REDRAWBUTSHEAD 0x4011
-#define REDRAWBUTSALL 0x4012
-#define REDRAWBUTSVIEW 0x4013
-#define REDRAWBUTSLAMP 0x4014
-#define REDRAWBUTSMAT 0x4015
-#define REDRAWBUTSTEX 0x4016
-#define REDRAWBUTSANIM 0x4017
-#define REDRAWBUTSWORLD 0x4018
-#define REDRAWBUTSRENDER 0x4019
-#define REDRAWBUTSEDIT 0x401A
-#define REDRAWVIEWCAM 0x401B
-#define REDRAWHEADERS 0x401C
-#define REDRAWBUTSGAME 0x401D
-#define REDRAWBUTSRADIO 0x401E
-#define REDRAWVIEW3D_Z 0x401F
-
-#define REDRAWALL 0x4020
#define REDRAWINFO 0x4021
#define RENDERPREVIEW 0x4022
#define REDRAWIPO 0x4023
@@ -233,13 +235,10 @@
#define AFTERIMAWRITE 0x402B
#define IMALEFTMOUSE 0x402C
#define AFTERPIBREAD 0x402D
-#define REDRAWTEXT 0x402F
-#define REDRAWBUTSSCRIPT 0x4030
-#define REDRAWSOUND 0x4031
-#define REDRAWBUTSSOUND 0x4032
-#define REDRAWACTION 0x4033
-#define REDRAWBUTSCONSTRAINT 0x4034
-#define REDRAWNLA 0x4035
+#define REDRAWTEXT 0x402E
+#define REDRAWSOUND 0x402F
+#define REDRAWACTION 0x4030
+#define REDRAWNLA 0x4031
#endif /* !__MYDEVICE_H__ */
diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c
index c0c542b4e49..0164df2cc96 100644
--- a/source/blender/src/butspace.c
+++ b/source/blender/src/butspace.c
@@ -44,11 +44,58 @@
#endif
#include "MEM_guardedalloc.h"
+#include "DNA_action_types.h"
+#include "DNA_armature_types.h"
+#include "DNA_camera_types.h"
+#include "DNA_constraint_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_effect_types.h"
+#include "DNA_group_types.h"
+#include "DNA_ika_types.h"
+#include "DNA_image_types.h"
+#include "DNA_key_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_material_types.h"
+#include "DNA_meta_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
+#include "DNA_packedFile_types.h"
+#include "DNA_radio_types.h"
+#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "DNA_sound_types.h"
#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-
+#include "DNA_texture_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_vfont_types.h"
+#include "DNA_view3d_types.h"
+#include "DNA_world_types.h"
+
+#include "BKE_anim.h"
+#include "BKE_armature.h"
+#include "BKE_constraint.h"
+#include "BKE_curve.h"
+#include "BKE_displist.h"
+#include "BKE_effect.h"
+#include "BKE_font.h"
#include "BKE_global.h"
+#include "BKE_ika.h"
+#include "BKE_image.h"
+#include "BKE_ipo.h"
+#include "BKE_lattice.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_material.h"
+#include "BKE_mball.h"
+#include "BKE_mesh.h"
+#include "BKE_object.h"
+#include "BKE_packedFile.h"
+#include "BKE_plugin_types.h"
+#include "BKE_sound.h"
+#include "BKE_texture.h"
+#include "BKE_utildefines.h"
+#include "BKE_writeavi.h"
#include "BLI_blenlib.h"
@@ -62,8 +109,292 @@
#include "BIF_space.h"
#include "BIF_glutil.h"
#include "BIF_interface.h"
-
+#include "BIF_editsca.h"
#include "BIF_butspace.h"
+#include "BIF_previewrender.h"
+#include "BIF_toolbox.h"
+
+#include "BSE_headerbuttons.h"
+
+#include "mydevice.h"
+
+
+/* Local vars ---------------------------------------------------------- */
+short bgpicmode=0, near=1000, far=1000;
+short degr= 90, step= 9, turn= 1, editbutflag= 1;
+float hspeed=0.1f, prspeed=0.0f, prlen=0.0f, doublimit= 0.001f;
+int decim_faces=0;
+
+float editbutvweight=1;
+float extr_offs= 1.0, editbutweight=1.0, editbutsize=0.1, cumapsize= 1.0;
+MTex emptytex;
+MTex mtexcopybuf;
+
+char texstr[15][8]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend",
+ "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "",
+ "" , "" , ""};
+/* ---------------------------------------------------------------------- */
+
+
+void test_scriptpoin_but(char *name, ID **idpp)
+{
+ ID *id;
+
+ id= G.main->text.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= 0;
+}
+
+void test_actionpoin_but(char *name, ID **idpp)
+{
+ ID *id;
+
+ id= G.main->action.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= 0;
+}
+
+
+void test_obpoin_but(char *name, ID **idpp)
+{
+ ID *id;
+
+ if(idpp == (ID **)&(emptytex.object)) {
+ error("You must add a Texture first!");
+ *idpp= 0;
+ return;
+ }
+
+ id= G.main->object.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= 0;
+}
+
+void test_obcurpoin_but(char *name, ID **idpp)
+{
+ ID *id;
+
+ if(idpp == (ID **)&(emptytex.object)) {
+ error("You must add a Texture first!");
+ *idpp= 0;
+ return;
+ }
+
+ id= G.main->object.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ if (((Object *)id)->type != OB_CURVE) {
+ error ("Bevel object must be a Curve.");
+ break;
+ }
+ *idpp= id;
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= 0;
+}
+
+void test_meshpoin_but(char *name, ID **idpp)
+{
+ ID *id;
+
+ if( *idpp ) (*idpp)->us--;
+
+ id= G.main->mesh.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ id_us_plus(id);
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= 0;
+}
+
+void test_matpoin_but(char *name, ID **idpp)
+{
+ ID *id;
+
+ if( *idpp ) (*idpp)->us--;
+
+ id= G.main->mat.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ id_us_plus(id);
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= 0;
+}
+
+void test_scenepoin_but(char *name, ID **idpp)
+{
+ ID *id;
+
+ if( *idpp ) (*idpp)->us--;
+
+ id= G.main->scene.first;
+ while(id) {
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ id_us_plus(id);
+ return;
+ }
+ id= id->next;
+ }
+ *idpp= 0;
+}
+
+
+/* --------------------------------- */
+
+
+
+
+void do_butspace(unsigned short event)
+{
+ SpaceButs *buts;
+
+ /* redraw windows of the same type? */
+ buts= curarea->spacedata.first;
+ if(buts->mainb==CONTEXT_SCENE) allqueue(REDRAWBUTSSCENE, curarea->win);
+ if(buts->mainb==CONTEXT_OBJECT) allqueue(REDRAWBUTSOBJECT, curarea->win);
+ if(buts->mainb==CONTEXT_TYPES) allqueue(REDRAWBUTSTYPES, curarea->win);
+ if(buts->mainb==CONTEXT_SHADING) allqueue(REDRAWBUTSSHADING, curarea->win);
+ if(buts->mainb==CONTEXT_EDITING) allqueue(REDRAWBUTSEDIT, curarea->win);
+ if(buts->mainb==CONTEXT_SCRIPT) allqueue(REDRAWBUTSSCRIPT, curarea->win);
+ if(buts->mainb==CONTEXT_LOGIC) allqueue(REDRAWBUTSLOGIC, curarea->win);
+
+ if(event<=100) {
+ do_global_buttons(event);
+ }
+ else if(event<=B_VIEWBUTS) {
+ //do_viewbuts(event);
+ }
+ else if(event<=B_LAMPBUTS) {
+ //do_lampbuts(event);
+ }
+ else if(event<=B_MATBUTS) {
+ //do_matbuts(event);
+ }
+ else if(event<=B_TEXBUTS) {
+ //do_texbuts(event);
+ }
+ else if(event<=B_ANIMBUTS) {
+ //do_animbuts(event);
+ }
+ else if(event<=B_WORLDBUTS) {
+ //do_worldbuts(event);
+ }
+ else if(event<=B_RENDERBUTS) {
+ do_render_panels(event); // buttons_scene.c
+ }
+ else if(event<=B_COMMONEDITBUTS) {
+ //do_common_editbuts(event);
+ }
+ else if(event<=B_MESHBUTS) {
+ //do_meshbuts(event);
+ }
+ else if(event<=B_CURVEBUTS) {
+ //do_curvebuts(event);
+ }
+ else if(event<=B_FONTBUTS) {
+ //do_fontbuts(event);
+ }
+ else if(event<=B_IKABUTS) {
+ //do_ikabuts(event);
+ }
+ else if(event<=B_CAMBUTS) {
+ ;
+ }
+ else if(event<=B_MBALLBUTS) {
+ //do_mballbuts(event);
+ }
+ else if(event<=B_LATTBUTS) {
+ //do_latticebuts(event);
+ }
+ else if(event<=B_GAMEBUTS) {
+ //do_gamebuts(event);
+ }
+ else if(event<=B_FPAINTBUTS) {
+ //do_fpaintbuts(event);
+ }
+ else if(event<=B_RADIOBUTS) {
+ //do_radiobuts(event);
+ }
+ else if(event<=B_SCRIPTBUTS) {
+ //do_scriptbuts(event);
+ }
+ else if(event<=B_SOUNDBUTS) {
+ //do_soundbuts(event);
+ }
+ else if(event<=B_CONSTRAINTBUTS) {
+ //do_constraintbuts(event);
+ }
+ else if(event>=REDRAWVIEW3D) allqueue(event, 0);
+}
+
+/* new active object */
+void redraw_test_buttons(Base *new)
+{
+ ScrArea *sa;
+ SpaceButs *buts;
+
+ sa= G.curscreen->areabase.first;
+ while(sa) {
+ if(sa->spacetype==SPACE_BUTS) {
+ buts= sa->spacedata.first;
+
+ if(ELEM5(buts->mainb, CONTEXT_OBJECT, CONTEXT_TYPES, CONTEXT_EDITING, CONTEXT_SHADING, CONTEXT_LOGIC)) {
+ addqueue(sa->win, REDRAW, 1);
+ }
+
+ if(buts->mainb==CONTEXT_SHADING) {
+ // change type automatically
+
+ if(new) {
+ if(buts->tab[CONTEXT_SHADING] == TAB_SHADING_WORLD);
+ else if(buts->tab[CONTEXT_SHADING] == TAB_SHADING_TEX);
+ else if(new->object->type==OB_LAMP) {
+ buts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP;
+ BIF_preview_changed(buts);
+ addqueue(sa->win, REDRAW, 1);
+ }
+ else {
+ buts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
+ BIF_preview_changed(buts);
+ addqueue(sa->win, REDRAW, 1);
+ }
+ }
+ }
+ }
+ sa= sa->next;
+ }
+}
+
+
/* here the calls for building the button main/tabs tree */
@@ -108,7 +439,8 @@ static void context_editing_buttons(ScrArea *sa, SpaceButs *sbuts)
static void context_logic_buttons(ScrArea *sa, SpaceButs *sbuts)
{
- /* select tabs */
+ /* no tabs */
+ gamebuts(); /* (editsca.c) */
}
@@ -168,3 +500,108 @@ void drawbutspace(ScrArea *sa, void *spacedata)
sa->win_swap= WIN_BACK_OK;
}
+void clever_numbuts_buts()
+{
+}
+
+#if 0
+ bring back in buttons_shading.c!
+
+void clever_numbuts_buts()
+{
+ Material *ma;
+ Lamp *la;
+ World *wo;
+ static char hexrgb[8]; /* Uh... */
+ static char hexspec[8]; /* Uh... */
+ static char hexmir[8]; /* Uh... */
+ static char hexho[8];
+ static char hexze[8];
+ int rgb[3];
+
+ switch (G.buts->mainb){
+ case BUTS_FPAINT:
+
+ sprintf(hexrgb, "%02X%02X%02X", (int)(Gvp.r*255), (int)(Gvp.g*255), (int)(Gvp.b*255));
+
+ add_numbut(0, TEX, "RGB:", 0, 6, hexrgb, "HTML Hex value for the RGB color");
+ do_clever_numbuts("Vertex Paint RGB Hex Value", 1, REDRAW);
+
+ /* Assign the new hex value */
+ sscanf(hexrgb, "%02X%02X%02X", &rgb[0], &rgb[1], &rgb[2]);
+ Gvp.r= (rgb[0]/255.0 >= 0.0 && rgb[0]/255.0 <= 1.0 ? rgb[0]/255.0 : 0.0) ;
+ Gvp.g = (rgb[1]/255.0 >= 0.0 && rgb[1]/255.0 <= 1.0 ? rgb[1]/255.0 : 0.0) ;
+ Gvp.b = (rgb[2]/255.0 >= 0.0 && rgb[2]/255.0 <= 1.0 ? rgb[2]/255.0 : 0.0) ;
+
+ break;
+ case BUTS_LAMP:
+ la= G.buts->lockpoin;
+ if (la){
+ sprintf(hexrgb, "%02X%02X%02X", (int)(la->r*255), (int)(la->g*255), (int)(la->b*255));
+ add_numbut(0, TEX, "RGB:", 0, 6, hexrgb, "HTML Hex value for the lamp color");
+ do_clever_numbuts("Lamp RGB Hex Values", 1, REDRAW);
+ sscanf(hexrgb, "%02X%02X%02X", &rgb[0], &rgb[1], &rgb[2]);
+ la->r = (rgb[0]/255.0 >= 0.0 && rgb[0]/255.0 <= 1.0 ? rgb[0]/255.0 : 0.0) ;
+ la->g = (rgb[1]/255.0 >= 0.0 && rgb[1]/255.0 <= 1.0 ? rgb[1]/255.0 : 0.0) ;
+ la->b = (rgb[2]/255.0 >= 0.0 && rgb[2]/255.0 <= 1.0 ? rgb[2]/255.0 : 0.0) ;
+ BIF_preview_changed(G.buts);
+ }
+ break;
+ case BUTS_WORLD:
+ wo= G.buts->lockpoin;
+ if (wo){
+ sprintf(hexho, "%02X%02X%02X", (int)(wo->horr*255), (int)(wo->horg*255), (int)(wo->horb*255));
+ sprintf(hexze, "%02X%02X%02X", (int)(wo->zenr*255), (int)(wo->zeng*255), (int)(wo->zenb*255));
+ add_numbut(0, TEX, "Zen:", 0, 6, hexze, "HTML Hex value for the Zenith color");
+ add_numbut(1, TEX, "Hor:", 0, 6, hexho, "HTML Hex value for the Horizon color");
+ do_clever_numbuts("World RGB Hex Values", 2, REDRAW);
+
+ sscanf(hexho, "%02X%02X%02X", &rgb[0], &rgb[1], &rgb[2]);
+ wo->horr = (rgb[0]/255.0 >= 0.0 && rgb[0]/255.0 <= 1.0 ? rgb[0]/255.0 : 0.0) ;
+ wo->horg = (rgb[1]/255.0 >= 0.0 && rgb[1]/255.0 <= 1.0 ? rgb[1]/255.0 : 0.0) ;
+ wo->horb = (rgb[2]/255.0 >= 0.0 && rgb[2]/255.0 <= 1.0 ? rgb[2]/255.0 : 0.0) ;
+ sscanf(hexze, "%02X%02X%02X", &rgb[0], &rgb[1], &rgb[2]);
+ wo->zenr = (rgb[0]/255.0 >= 0.0 && rgb[0]/255.0 <= 1.0 ? rgb[0]/255.0 : 0.0) ;
+ wo->zeng = (rgb[1]/255.0 >= 0.0 && rgb[1]/255.0 <= 1.0 ? rgb[1]/255.0 : 0.0) ;
+ wo->zenb = (rgb[2]/255.0 >= 0.0 && rgb[2]/255.0 <= 1.0 ? rgb[2]/255.0 : 0.0) ;
+ BIF_preview_changed(G.buts);
+
+ }
+ break;
+ case BUTS_MAT:
+
+ ma= G.buts->lockpoin;
+
+ /* Build a hex value */
+ if (ma){
+ sprintf(hexrgb, "%02X%02X%02X", (int)(ma->r*255), (int)(ma->g*255), (int)(ma->b*255));
+ sprintf(hexspec, "%02X%02X%02X", (int)(ma->specr*255), (int)(ma->specg*255), (int)(ma->specb*255));
+ sprintf(hexmir, "%02X%02X%02X", (int)(ma->mirr*255), (int)(ma->mirg*255), (int)(ma->mirb*255));
+
+ add_numbut(0, TEX, "Col:", 0, 6, hexrgb, "HTML Hex value for the RGB color");
+ add_numbut(1, TEX, "Spec:", 0, 6, hexspec, "HTML Hex value for the Spec color");
+ add_numbut(2, TEX, "Mir:", 0, 6, hexmir, "HTML Hex value for the Mir color");
+ do_clever_numbuts("Material RGB Hex Values", 3, REDRAW);
+
+ /* Assign the new hex value */
+ sscanf(hexrgb, "%02X%02X%02X", &rgb[0], &rgb[1], &rgb[2]);
+ ma->r = (rgb[0]/255.0 >= 0.0 && rgb[0]/255.0 <= 1.0 ? rgb[0]/255.0 : 0.0) ;
+ ma->g = (rgb[1]/255.0 >= 0.0 && rgb[1]/255.0 <= 1.0 ? rgb[1]/255.0 : 0.0) ;
+ ma->b = (rgb[2]/255.0 >= 0.0 && rgb[2]/255.0 <= 1.0 ? rgb[2]/255.0 : 0.0) ;
+ sscanf(hexspec, "%02X%02X%02X", &rgb[0], &rgb[1], &rgb[2]);
+ ma->specr = (rgb[0]/255.0 >= 0.0 && rgb[0]/255.0 <= 1.0 ? rgb[0]/255.0 : 0.0) ;
+ ma->specg = (rgb[1]/255.0 >= 0.0 && rgb[1]/255.0 <= 1.0 ? rgb[1]/255.0 : 0.0) ;
+ ma->specb = (rgb[2]/255.0 >= 0.0 && rgb[2]/255.0 <= 1.0 ? rgb[2]/255.0 : 0.0) ;
+ sscanf(hexmir, "%02X%02X%02X", &rgb[0], &rgb[1], &rgb[2]);
+ ma->mirr = (rgb[0]/255.0 >= 0.0 && rgb[0]/255.0 <= 1.0 ? rgb[0]/255.0 : 0.0) ;
+ ma->mirg = (rgb[1]/255.0 >= 0.0 && rgb[1]/255.0 <= 1.0 ? rgb[1]/255.0 : 0.0) ;
+ ma->mirb = (rgb[2]/255.0 >= 0.0 && rgb[2]/255.0 <= 1.0 ? rgb[2]/255.0 : 0.0) ;
+
+ BIF_preview_changed(G.buts);
+ }
+ break;
+ }
+}
+
+#endif
+
diff --git a/source/blender/src/buttons.c b/source/blender/src/buttons.txt
index ae384661a1d..b32ad5ea201 100644
--- a/source/blender/src/buttons.c
+++ b/source/blender/src/buttons.txt
@@ -7415,157 +7415,6 @@ void drawbutspace_old(ScrArea *sa, void *spacedata)
curarea->win_swap= WIN_BACK_OK;
}
-void do_blenderbuttons(unsigned short event)
-{
- SpaceButs *buts;
-
- /* redraw windows of the same type? */
- buts= curarea->spacedata.first;
- if(buts->mainb==BUTS_VIEW) allqueue(REDRAWBUTSVIEW, curarea->win);
- else if(buts->mainb==BUTS_LAMP) allqueue(REDRAWBUTSLAMP, curarea->win);
- else if(buts->mainb==BUTS_MAT || buts->mainb==BUTS_TEX) {
- allqueue(REDRAWBUTSMAT, curarea->win);
- allqueue(REDRAWBUTSTEX, curarea->win);
- }
- else if(buts->mainb==BUTS_WORLD) allqueue(REDRAWBUTSWORLD, curarea->win);
- else if(buts->mainb==BUTS_ANIM) allqueue(REDRAWBUTSANIM, curarea->win);
- else if(buts->mainb==BUTS_RENDER) allqueue(REDRAWBUTSRENDER, curarea->win);
- else if(buts->mainb==BUTS_EDIT) allqueue(REDRAWBUTSEDIT, curarea->win);
- else if(buts->mainb==BUTS_FPAINT) allqueue(REDRAWBUTSGAME, curarea->win);
- else if(buts->mainb==BUTS_RADIO) allqueue(REDRAWBUTSRADIO, curarea->win);
- else if(buts->mainb==BUTS_SCRIPT) allqueue(REDRAWBUTSSCRIPT, curarea->win);
- else if(buts->mainb==BUTS_SOUND) allqueue(REDRAWBUTSSOUND, curarea->win);
- else if(buts->mainb==BUTS_CONSTRAINT) allqueue(REDRAWBUTSCONSTRAINT, curarea->win);
-
- if(event<=100) {
- do_global_buttons(event);
- }
- else if(event<=B_VIEWBUTS) {
- do_viewbuts(event);
- }
- else if(event<=B_LAMPBUTS) {
- do_lampbuts(event);
- }
- else if(event<=B_MATBUTS) {
- do_matbuts(event);
- }
- else if(event<=B_TEXBUTS) {
- do_texbuts(event);
- }
- else if(event<=B_ANIMBUTS) {
- do_animbuts(event);
- }
- else if(event<=B_WORLDBUTS) {
- do_worldbuts(event);
- }
- else if(event<=B_RENDERBUTS) {
- do_renderbuts(event);
- }
- else if(event<=B_COMMONEDITBUTS) {
- do_common_editbuts(event);
- }
- else if(event<=B_MESHBUTS) {
- do_meshbuts(event);
- }
- else if(event<=B_CURVEBUTS) {
- do_curvebuts(event);
- }
- else if(event<=B_FONTBUTS) {
- do_fontbuts(event);
- }
- else if(event<=B_IKABUTS) {
- do_ikabuts(event);
- }
- else if(event<=B_CAMBUTS) {
- ;
- }
- else if(event<=B_MBALLBUTS) {
- do_mballbuts(event);
- }
- else if(event<=B_LATTBUTS) {
- do_latticebuts(event);
- }
- else if(event<=B_GAMEBUTS) {
- do_gamebuts(event);
- }
- else if(event<=B_FPAINTBUTS) {
- do_fpaintbuts(event);
- }
- else if(event<=B_RADIOBUTS) {
- do_radiobuts(event);
- }
- else if(event<=B_SCRIPTBUTS) {
- do_scriptbuts(event);
- }
- else if(event<=B_SOUNDBUTS) {
- do_soundbuts(event);
- }
- else if(event<=B_CONSTRAINTBUTS) {
- do_constraintbuts(event);
- }
- else if(event>=REDRAWVIEW3D) allqueue(event, 0);
-}
-
-
-void redraw_test_buttons(Base *new)
-{
- ScrArea *sa;
- SpaceButs *buts;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
-
- if(buts->mainb==BUTS_LAMP) {
- // change type automatically
- if(new && new->object->type!=OB_LAMP) {
- buts->mainb= BUTS_MAT;
- allqueue(REDRAWBUTSMAT, 0);
- }
- else allqueue(REDRAWBUTSLAMP, 0);
- BIF_preview_changed(buts);
- }
- else if(buts->mainb==BUTS_MAT) {
- // change type automatically
- if(new && new->object->type==OB_LAMP) {
- buts->mainb= BUTS_LAMP;
- allqueue(REDRAWBUTSLAMP, 0);
- }
- else allqueue(REDRAWBUTSMAT, 0);
- BIF_preview_changed(buts);
- }
- else if(buts->mainb==BUTS_TEX) {
- allqueue(REDRAWBUTSTEX, 0);
- if(new && new->object->type==OB_LAMP) buts->texfrom= 2;
- else buts->texfrom= 0;
- BIF_preview_changed(buts);
- }
- else if(buts->mainb==BUTS_ANIM) {
- allqueue(REDRAWBUTSANIM, 0);
- }
- else if(buts->mainb==BUTS_EDIT) {
- allqueue(REDRAWBUTSEDIT, 0);
- }
- else if(buts->mainb==BUTS_GAME) {
- allqueue(REDRAWBUTSGAME, 0);
- }
- else if(buts->mainb==BUTS_FPAINT) {
- allqueue(REDRAWBUTSGAME, 0);
- }
- else if(buts->mainb==BUTS_SCRIPT) {
- allqueue(REDRAWBUTSSCRIPT, 0);
- }
- else if(buts->mainb==BUTS_SOUND) {
- allqueue(REDRAWBUTSSOUND, 0);
- }
- else if(buts->mainb==BUTS_CONSTRAINT) {
- allqueue(REDRAWBUTSCONSTRAINT, 0);
- }
- }
- sa= sa->next;
- }
-}
void clever_numbuts_buts()
{
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c
index 0136ece7af8..19384c78cae 100644
--- a/source/blender/src/buttons_scene.c
+++ b/source/blender/src/buttons_scene.c
@@ -98,7 +98,7 @@
static void output_pic(char *name)
{
strcpy(G.scene->r.pic, name);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
}
static void backbuf_pic(char *name)
@@ -106,7 +106,7 @@ static void backbuf_pic(char *name)
Image *ima;
strcpy(G.scene->r.backbuf, name);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
ima= add_image(name);
if(ima) {
@@ -118,7 +118,7 @@ static void backbuf_pic(char *name)
static void ftype_pic(char *name)
{
strcpy(G.scene->r.ftype, name);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
}
@@ -126,7 +126,7 @@ static void scene_change_set(Scene *sc, Scene *set) {
if (sc->set!=set) {
sc->set= set;
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
allqueue(REDRAWVIEW3D, 0);
}
}
@@ -216,13 +216,13 @@ void do_render_panels(unsigned short event)
G.scene->r.xparts= G.scene->r.yparts= 1;
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
allqueue(REDRAWVIEWCAM, 0);
break;
#ifdef WITH_QUICKTIME
case B_FILETYPEMENU:
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
#if defined (_WIN32) || defined (__APPLE__)
// fall through to codec settings if this is the first
// time R_AVICODEC is selected for this scene.
@@ -286,7 +286,7 @@ void do_render_panels(unsigned short event)
G.scene->r.qtcodecdata->fourcc = qtcodecidx_to_fcc(qtcodec_idx-1);
/* if the selected codec differs from the previous one, reinit it */
qt_init_codecdata(G.scene->r.qtcodecdata);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
#endif /* _WIN32 || __APPLE__ */
break;
#endif /* WITH_QUICKTIME */
@@ -301,7 +301,7 @@ void do_render_panels(unsigned short event)
G.scene->r.xparts= G.scene->r.yparts= 1;
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
allqueue(REDRAWVIEWCAM, 0);
break;
case B_PR_PRV:
@@ -315,7 +315,7 @@ void do_render_panels(unsigned short event)
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PR_CDI:
G.scene->r.xsch= 384;
@@ -328,7 +328,7 @@ void do_render_panels(unsigned short event)
BLI_init_rctf(&G.scene->r.safety, 0.15, 0.85, 0.15, 0.85);
allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PR_PAL169:
G.scene->r.xsch= 720;
@@ -342,7 +342,7 @@ void do_render_panels(unsigned short event)
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PR_D2MAC:
G.scene->r.xsch= 1024;
@@ -355,7 +355,7 @@ void do_render_panels(unsigned short event)
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PR_MPEG:
G.scene->r.xsch= 368;
@@ -368,7 +368,7 @@ void do_render_panels(unsigned short event)
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PR_PC:
G.scene->r.xsch= 640;
@@ -381,7 +381,7 @@ void do_render_panels(unsigned short event)
BLI_init_rctf(&G.scene->r.safety, 0.0, 1.0, 0.0, 1.0);
allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PR_PRESET:
G.scene->r.xsch= 720;
@@ -395,7 +395,7 @@ void do_render_panels(unsigned short event)
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PR_PANO:
G.scene->r.xsch= 36;
@@ -409,7 +409,7 @@ void do_render_panels(unsigned short event)
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PR_NTSC:
G.scene->r.xsch= 720;
@@ -422,7 +422,7 @@ void do_render_panels(unsigned short event)
G.scene->r.xparts= G.scene->r.yparts= 1;
BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
allqueue(REDRAWVIEWCAM, 0);
break;
@@ -635,24 +635,6 @@ static char *avicodec_str(void)
}
#endif
-static void test_scenepoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- if( *idpp ) (*idpp)->us--;
-
- id= G.main->scene.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- id_us_plus(id);
- return;
- }
- id= id->next;
- }
- *idpp= 0;
-}
-
static void render_panel_output()
{
ID *id;
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c
index cd30fa29d62..29b9c504643 100644
--- a/source/blender/src/drawimage.c
+++ b/source/blender/src/drawimage.c
@@ -31,6 +31,7 @@
*/
#include <math.h>
+#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -258,7 +259,7 @@ void image_changed(SpaceImage *sima, int dotile)
tface++;
}
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
}
}
}
diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c
index 35b80755c7c..4b83323f941 100644
--- a/source/blender/src/drawtext.c
+++ b/source/blender/src/drawtext.c
@@ -33,6 +33,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
+#include <ctype.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
index 3970f70ed5b..bb7ead592d6 100644
--- a/source/blender/src/drawview.c
+++ b/source/blender/src/drawview.c
@@ -86,7 +86,7 @@
#include "BIF_screen.h"
#include "BIF_interface.h"
#include "BIF_space.h"
-#include "BIF_buttons.h"
+#include "BIF_butspace.h"
#include "BIF_drawimage.h"
#include "BIF_editgroup.h"
#include "BIF_mywindow.h"
@@ -1674,7 +1674,7 @@ int play_anim(int mode)
}
/* speed button */
- allqueue(REDRAWBUTSANIM, 0);
+ // allqueue(REDRAWBUTSOBJECT, 0);
/* groups could have changed ipo */
allspace(REMAKEIPO, 0);
allqueue(REDRAWIPO, 0);
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
index 7d41fc643ad..5ebe463e40a 100644
--- a/source/blender/src/editaction.c
+++ b/source/blender/src/editaction.c
@@ -77,7 +77,7 @@
#include "BIF_toolbox.h"
#include "BIF_screen.h"
#include "BIF_space.h"
-#include "BIF_buttons.h"
+#include "BIF_butspace.h"
#include "BIF_interface.h"
#include "BIF_editview.h"
#include "BIF_poseobject.h"
@@ -1790,7 +1790,7 @@ static void delete_actionchannel_keys(void)
}
static void delete_actionchannels (void)
{
- bConstraintChannel *conchan, *nextconchan;
+ bConstraintChannel *conchan=NULL, *nextconchan;
bActionChannel *chan, *next;
bAction *act;
int freechan;
@@ -2165,7 +2165,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
switch(event) {
case UI_BUT_EVENT:
- do_blenderbuttons(val);
+ do_butspace(val); // abuse!
break;
case HOMEKEY:
do_action_buttons(B_ACTHOME);
diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c
index 18a2f6194b9..90a15fc6d1a 100644
--- a/source/blender/src/editarmature.c
+++ b/source/blender/src/editarmature.c
@@ -692,7 +692,7 @@ void delete_armature(void)
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
countall();
}
@@ -722,7 +722,7 @@ static void delete_bone(EditBone* exBone)
}
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
allqueue(REDRAWBUTSEDIT, 0);
BLI_freelinkN (&G.edbo,exBone);
@@ -735,7 +735,7 @@ void remake_editArmature(void)
make_editArmature();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
allqueue(REDRAWBUTSEDIT, 0);
}
@@ -758,7 +758,7 @@ void mouse_armature(void)
}
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
};
countall();
rightmouse_transform();
@@ -1976,7 +1976,7 @@ void deselectall_armature(void)
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
countall();
}
@@ -2173,7 +2173,7 @@ void extrude_armature(void)
countall();
transform('g');
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
}
void addvert_armature(void)
@@ -2267,7 +2267,7 @@ void adduplicate_armature(void)
transform('g');
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
}
/*
@@ -2362,7 +2362,7 @@ void mousepose_armature(void)
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWIPO, 0); /* To force action ipo update */
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
// countall();
rightmouse_transform();
@@ -2653,20 +2653,6 @@ int bone_looper(Object *ob, Bone *bone, void *data,
return count;
}
-int add_defgroup_unique_bone(Object *ob, Bone *bone, void *data) {
- /* This group creates a vertex group to ob that has the
- * same name as bone (provided the bone is skinnable).
- * If such a vertex group aleady exist the routine exits.
- */
- if ( bone_skinnable(ob, bone, NULL) ) {
- if (!get_named_vertexgroup(ob,bone->name)) {
- add_defgroup_name(ob, bone->name);
- return 1;
- }
- }
- return 0;
-}
-
int bone_skinnable(Object *ob, Bone *bone, void *data)
{
/* Bones that are not of boneclass BONE_UNSKINNABLE
@@ -2704,6 +2690,20 @@ int bone_skinnable(Object *ob, Bone *bone, void *data)
return 0;
}
+int add_defgroup_unique_bone(Object *ob, Bone *bone, void *data) {
+ /* This group creates a vertex group to ob that has the
+ * same name as bone (provided the bone is skinnable).
+ * If such a vertex group aleady exist the routine exits.
+ */
+ if ( bone_skinnable(ob, bone, NULL) ) {
+ if (!get_named_vertexgroup(ob,bone->name)) {
+ add_defgroup_name(ob, bone->name);
+ return 1;
+ }
+ }
+ return 0;
+}
+
int dgroup_skinnable(Object *ob, Bone *bone, void *data) {
/* Bones that are not of boneclass BONE_UNSKINNABLE
* are regarded to be "skinnable" and are eligible for
@@ -2815,7 +2815,7 @@ void add_verts_to_closest_dgroup(Object *ob, Object *par)
/* Is subsurf on? Lets use the verts on the limit surface then */
if ( (mesh->flag&ME_SUBSURF) && (mesh->subdiv > 0) ) {
subverts = MEM_mallocN(3*mesh->totvert*sizeof(float), "subverts");
- subsurf_calculate_limit_positions(mesh, subverts);
+ subsurf_calculate_limit_positions(mesh, (void *)subverts); /* (ton) made void*, dunno how to cast */
}
/* for each vertex in the mesh ...
diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c
index 927f02999d7..e04a4355ce2 100644
--- a/source/blender/src/editcurve.c
+++ b/source/blender/src/editcurve.c
@@ -31,6 +31,7 @@
*/
#include <math.h>
+#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -3376,7 +3377,6 @@ Nurb *addNurbprim(int type, int stype, int newname)
nu->type= type;
nu->resolu= 12;
nu->resolv= 12;
- /* if(G.obedit && (G.mainb==5 || G.mainb==9)) nu->col= 0; */
}
switch(stype) {
diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c
index 290c9b2aa9e..68059e4d0f2 100644
--- a/source/blender/src/editface.c
+++ b/source/blender/src/editface.c
@@ -32,6 +32,7 @@
#include <math.h>
+#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -517,7 +518,7 @@ void face_select()
/* image window redraw */
allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWVIEW3D, 0);
}
@@ -937,7 +938,6 @@ void set_faceselect() /* toggle */
}
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSGAME, 0);
allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWIMAGE, 0);
@@ -1199,7 +1199,7 @@ int face_pick_uv(Object* object, Mesh* mesh, TFace* face, short x, short y, floa
* If face is a quad, there are two triangles to check.
*/
result = triangle_ray_intersect(v2, v1, v3, org, dir, ab);
- if ((num_verts == 3) || (num_verts == 4) && (result > 1)) {
+ if ( ((num_verts == 3) || (num_verts == 4)) && (result > 1) ) {
/* Face is a triangle or a quad with a hit on the first triangle */
face_get_uv(face, 1, 0, 2, ab[0], ab[1], u, v);
/* printf("triangle 1, texture (u,v)=(%f, %f)\n", *u, *v); */
@@ -1224,7 +1224,7 @@ void face_draw()
TFace *face, *face_old = 0;
short xy[2], xy_old[2];
//int a, index;
- Image *img, *img_old = 0;
+ Image *img=NULL, *img_old = NULL;
IMG_BrushPtr brush;
IMG_CanvasPtr canvas = 0;
int rowBytes;
@@ -1425,7 +1425,6 @@ void get_same_uv(void)
/* image window redraw */
allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSGAME, 0);
allqueue(REDRAWVIEW3D, 0);
}
#endif /* NAN_TPT */
diff --git a/source/blender/src/editgroup.c b/source/blender/src/editgroup.c
index 2a43f6e6f47..194e9671088 100644
--- a/source/blender/src/editgroup.c
+++ b/source/blender/src/editgroup.c
@@ -118,7 +118,7 @@ void add_selected_to_group(void)
}
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
}
void rem_selected_from_group(void)
@@ -143,7 +143,7 @@ void rem_selected_from_group(void)
}
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
}
void prev_group_key(Group *group)
diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c
index 6cb680d16d9..fbe6e1b3f2a 100644
--- a/source/blender/src/editimasel.c
+++ b/source/blender/src/editimasel.c
@@ -79,12 +79,6 @@
/* GLOBALS */
extern char *fsmenu;
-
-static void draw_icon_imasel(void)
-{
- scrarea_queue_winredraw(curarea);
-}
-
void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
{
unsigned short event= evt->event;
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
index fb483365cd5..f870173004a 100644
--- a/source/blender/src/editipo.c
+++ b/source/blender/src/editipo.c
@@ -91,7 +91,7 @@
#include "BKE_global.h"
#include "BKE_group.h"
-#include "BIF_buttons.h"
+#include "BIF_butspace.h"
#include "BIF_editkey.h"
#include "BIF_editseq.h"
#include "BIF_editview.h"
@@ -627,7 +627,7 @@ void editipo_changed(SpaceIpo *si, int doredraw)
allqueue(REDRAWIPO, 0);
allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
if(si->blocktype==ID_OB) {
Object *ob= (Object *)si->from;
@@ -636,10 +636,10 @@ void editipo_changed(SpaceIpo *si, int doredraw)
allqueue(REDRAWNLA, 0);
}
- else if(si->blocktype==ID_MA) allqueue(REDRAWBUTSMAT, 0);
- else if(si->blocktype==ID_WO) allqueue(REDRAWBUTSWORLD, 0);
+ else if(si->blocktype==ID_MA) allqueue(REDRAWBUTSSHADING, 0);
+ else if(si->blocktype==ID_WO) allqueue(REDRAWBUTSSHADING, 0);
else if(si->blocktype==ID_LA) allqueue(REDRAWBUTSLAMP, 0);
- else if(si->blocktype==ID_SO) allqueue(REDRAWBUTSSOUND, 0);
+// else if(si->blocktype==ID_SO) allqueue(REDRAWBUTSSOUND, 0);
else if(si->blocktype==ID_CA) {
allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWVIEW3D, 0);
@@ -788,15 +788,11 @@ Ipo *get_ipo_to_edit(ID **from)
}
else if(G.sipo->blocktype==ID_SO) {
- if (G.buts && G.buts->mainb == BUTS_SOUND) {
-
- bSound *sound = G.buts->lockpoin;
-
- *from= (ID *)sound;
-
- if(sound) return sound->ipo;
-
- }
+// if (G.buts && G.buts->mainb == BUTS_SOUND) {
+// bSound *sound = G.buts->lockpoin;
+// *from= (ID *)sound;
+// if(sound) return sound->ipo;
+// }
}
return NULL;
@@ -3630,140 +3626,143 @@ void common_insertkey()
insertkey_editipo();
}
else if(curarea->spacetype==SPACE_BUTS) {
-
- if(G.buts->mainb==BUTS_MAT) {
- id= G.buts->lockpoin;
- ma= G.buts->lockpoin;
- if(id) {
- event= pupmenu("Insert Key %t|RGB%x0|Alpha%x1|HaSize%x2|Mode %x3|All Color%x10|Ofs%x12|Size%x13|All Mapping%x11");
- if(event== -1) return;
-
- map= texchannel_to_adrcode(ma->texact);
-
- if(event==0 || event==10) {
- insertkey(id, MA_COL_R);
- insertkey(id, MA_COL_G);
- insertkey(id, MA_COL_B);
- }
- if(event==1 || event==10) {
- insertkey(id, MA_ALPHA);
- }
- if(event==2 || event==10) {
- insertkey(id, MA_HASIZE);
- }
- if(event==3 || event==10) {
- insertkey(id, MA_MODE);
- }
- if(event==10) {
- insertkey(id, MA_SPEC_R);
- insertkey(id, MA_SPEC_G);
- insertkey(id, MA_SPEC_B);
- insertkey(id, MA_REF);
- insertkey(id, MA_EMIT);
- insertkey(id, MA_AMB);
- insertkey(id, MA_SPEC);
- insertkey(id, MA_HARD);
- insertkey(id, MA_MODE);
- }
- if(event==12 || event==11) {
- insertkey(id, map+MAP_OFS_X);
- insertkey(id, map+MAP_OFS_Y);
- insertkey(id, map+MAP_OFS_Z);
- }
- if(event==13 || event==11) {
- insertkey(id, map+MAP_SIZE_X);
- insertkey(id, map+MAP_SIZE_Y);
- insertkey(id, map+MAP_SIZE_Z);
- }
- if(event==11) {
- insertkey(id, map+MAP_R);
- insertkey(id, map+MAP_G);
- insertkey(id, map+MAP_B);
- insertkey(id, map+MAP_DVAR);
- insertkey(id, map+MAP_COLF);
- insertkey(id, map+MAP_NORF);
- insertkey(id, map+MAP_VARF);
+ if(G.buts->mainb==CONTEXT_SHADING) {
+ int tab= G.buts->tab[CONTEXT_SHADING];
+
+ if(tab==TAB_SHADING_MAT) {
+ id= G.buts->lockpoin;
+ ma= G.buts->lockpoin;
+ if(id) {
+ event= pupmenu("Insert Key %t|RGB%x0|Alpha%x1|HaSize%x2|Mode %x3|All Color%x10|Ofs%x12|Size%x13|All Mapping%x11");
+ if(event== -1) return;
+
+ map= texchannel_to_adrcode(ma->texact);
+
+ if(event==0 || event==10) {
+ insertkey(id, MA_COL_R);
+ insertkey(id, MA_COL_G);
+ insertkey(id, MA_COL_B);
+ }
+ if(event==1 || event==10) {
+ insertkey(id, MA_ALPHA);
+ }
+ if(event==2 || event==10) {
+ insertkey(id, MA_HASIZE);
+ }
+ if(event==3 || event==10) {
+ insertkey(id, MA_MODE);
+ }
+ if(event==10) {
+ insertkey(id, MA_SPEC_R);
+ insertkey(id, MA_SPEC_G);
+ insertkey(id, MA_SPEC_B);
+ insertkey(id, MA_REF);
+ insertkey(id, MA_EMIT);
+ insertkey(id, MA_AMB);
+ insertkey(id, MA_SPEC);
+ insertkey(id, MA_HARD);
+ insertkey(id, MA_MODE);
+ }
+ if(event==12 || event==11) {
+ insertkey(id, map+MAP_OFS_X);
+ insertkey(id, map+MAP_OFS_Y);
+ insertkey(id, map+MAP_OFS_Z);
+ }
+ if(event==13 || event==11) {
+ insertkey(id, map+MAP_SIZE_X);
+ insertkey(id, map+MAP_SIZE_Y);
+ insertkey(id, map+MAP_SIZE_Z);
+ }
+ if(event==11) {
+ insertkey(id, map+MAP_R);
+ insertkey(id, map+MAP_G);
+ insertkey(id, map+MAP_B);
+ insertkey(id, map+MAP_DVAR);
+ insertkey(id, map+MAP_COLF);
+ insertkey(id, map+MAP_NORF);
+ insertkey(id, map+MAP_VARF);
+ }
}
}
- }
- else if(G.buts->mainb==BUTS_WORLD) {
- id= G.buts->lockpoin;
- wo= G.buts->lockpoin;
- if(id) {
- event= pupmenu("Insert Key %t|ZenRGB%x0|HorRGB%x1|Mist%x2|stars %x3|Ofs%x12|Size%x13");
- if(event== -1) return;
-
- map= texchannel_to_adrcode(wo->texact);
-
- if(event==0) {
- insertkey(id, WO_ZEN_R);
- insertkey(id, WO_ZEN_G);
- insertkey(id, WO_ZEN_B);
- }
- if(event==1) {
- insertkey(id, WO_HOR_R);
- insertkey(id, WO_HOR_G);
- insertkey(id, WO_HOR_B);
- }
- if(event==2) {
- insertkey(id, WO_MISI);
- insertkey(id, WO_MISTDI);
- insertkey(id, WO_MISTSTA);
- insertkey(id, WO_MISTHI);
- }
- if(event==3) {
- insertkey(id, WO_STAR_R);
- insertkey(id, WO_STAR_G);
- insertkey(id, WO_STAR_B);
- insertkey(id, WO_STARDIST);
- insertkey(id, WO_STARSIZE);
- }
- if(event==12) {
- insertkey(id, map+MAP_OFS_X);
- insertkey(id, map+MAP_OFS_Y);
- insertkey(id, map+MAP_OFS_Z);
- }
- if(event==13) {
- insertkey(id, map+MAP_SIZE_X);
- insertkey(id, map+MAP_SIZE_Y);
- insertkey(id, map+MAP_SIZE_Z);
+ else if(tab==TAB_SHADING_WORLD) {
+ id= G.buts->lockpoin;
+ wo= G.buts->lockpoin;
+ if(id) {
+ event= pupmenu("Insert Key %t|ZenRGB%x0|HorRGB%x1|Mist%x2|stars %x3|Ofs%x12|Size%x13");
+ if(event== -1) return;
+
+ map= texchannel_to_adrcode(wo->texact);
+
+ if(event==0) {
+ insertkey(id, WO_ZEN_R);
+ insertkey(id, WO_ZEN_G);
+ insertkey(id, WO_ZEN_B);
+ }
+ if(event==1) {
+ insertkey(id, WO_HOR_R);
+ insertkey(id, WO_HOR_G);
+ insertkey(id, WO_HOR_B);
+ }
+ if(event==2) {
+ insertkey(id, WO_MISI);
+ insertkey(id, WO_MISTDI);
+ insertkey(id, WO_MISTSTA);
+ insertkey(id, WO_MISTHI);
+ }
+ if(event==3) {
+ insertkey(id, WO_STAR_R);
+ insertkey(id, WO_STAR_G);
+ insertkey(id, WO_STAR_B);
+ insertkey(id, WO_STARDIST);
+ insertkey(id, WO_STARSIZE);
+ }
+ if(event==12) {
+ insertkey(id, map+MAP_OFS_X);
+ insertkey(id, map+MAP_OFS_Y);
+ insertkey(id, map+MAP_OFS_Z);
+ }
+ if(event==13) {
+ insertkey(id, map+MAP_SIZE_X);
+ insertkey(id, map+MAP_SIZE_Y);
+ insertkey(id, map+MAP_SIZE_Z);
+ }
}
}
- }
- else if(G.buts->mainb==BUTS_LAMP) {
- id= G.buts->lockpoin;
- la= G.buts->lockpoin;
- if(id) {
- event= pupmenu("Insert Key %t|RGB%x0|Energy%x1|Spotsi%x2|Ofs%x12|Size%x13");
- if(event== -1) return;
-
- map= texchannel_to_adrcode(la->texact);
-
- if(event==0) {
- insertkey(id, LA_COL_R);
- insertkey(id, LA_COL_G);
- insertkey(id, LA_COL_B);
- }
- if(event==1) {
- insertkey(id, LA_ENERGY);
- }
- if(event==2) {
- insertkey(id, LA_SPOTSI);
- }
- if(event==12) {
- insertkey(id, map+MAP_OFS_X);
- insertkey(id, map+MAP_OFS_Y);
- insertkey(id, map+MAP_OFS_Z);
- }
- if(event==13) {
- insertkey(id, map+MAP_SIZE_X);
- insertkey(id, map+MAP_SIZE_Y);
- insertkey(id, map+MAP_SIZE_Z);
+ else if(tab==TAB_SHADING_LAMP) {
+ id= G.buts->lockpoin;
+ la= G.buts->lockpoin;
+ if(id) {
+ event= pupmenu("Insert Key %t|RGB%x0|Energy%x1|Spotsi%x2|Ofs%x12|Size%x13");
+ if(event== -1) return;
+
+ map= texchannel_to_adrcode(la->texact);
+
+ if(event==0) {
+ insertkey(id, LA_COL_R);
+ insertkey(id, LA_COL_G);
+ insertkey(id, LA_COL_B);
+ }
+ if(event==1) {
+ insertkey(id, LA_ENERGY);
+ }
+ if(event==2) {
+ insertkey(id, LA_SPOTSI);
+ }
+ if(event==12) {
+ insertkey(id, map+MAP_OFS_X);
+ insertkey(id, map+MAP_OFS_Y);
+ insertkey(id, map+MAP_OFS_Z);
+ }
+ if(event==13) {
+ insertkey(id, map+MAP_SIZE_X);
+ insertkey(id, map+MAP_SIZE_Y);
+ insertkey(id, map+MAP_SIZE_Z);
+ }
+
}
-
}
}
- else if(G.buts->mainb==BUTS_EDIT) {
+ else if(G.buts->mainb==CONTEXT_TYPES) {
ob= OBACT;
if(ob && ob->type==OB_CAMERA) {
id= G.buts->lockpoin;
@@ -3781,7 +3780,7 @@ void common_insertkey()
}
}
}
- else if(G.buts->mainb==BUTS_SOUND) {
+ else if(FALSE /* && G.buts->mainb==BUTS_SOUND */) {
if(G.ssound) {
id= G.buts->lockpoin;
if(id) {
@@ -3846,7 +3845,7 @@ void common_insertkey()
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
return;
}
@@ -3854,7 +3853,7 @@ void common_insertkey()
Group *group= find_group(ob);
if(group) {
add_group_key(group);
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
}
}
diff --git a/source/blender/src/editmball.c b/source/blender/src/editmball.c
index 17c669a4048..d5c2a943459 100644
--- a/source/blender/src/editmball.c
+++ b/source/blender/src/editmball.c
@@ -237,8 +237,7 @@ void mouse_mball()
static MetaElem *startelem=0;
MetaElem *ml, *act=0;
int a, hits;
- /* was IGLuint ... but is stupid */
- GLuint buffer[MAXPICKBUF];
+ unsigned int buffer[MAXPICKBUF];
hits= selectprojektie(buffer, 0, 0, 0, 0);
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c
index dabf440cfb8..81024270d63 100644
--- a/source/blender/src/editmesh.c
+++ b/source/blender/src/editmesh.c
@@ -3772,7 +3772,7 @@ void separate_mesh_loose(void)
ListBase edve, eded, edvl;
float trans[9];
int ok, vertsep=0, flag;
- short sel,toggle=0, done=0, check=1, loop=0;
+ short done=0, check=1;
TEST_EDITMESH
waitcursor(1);
@@ -5919,7 +5919,7 @@ void join_mesh(void)
exit_editmode(1);
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSMAT, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
makeDispList(G.obedit);
}
diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c
index 94bbcabbcce..712fc93c626 100644
--- a/source/blender/src/editnla.c
+++ b/source/blender/src/editnla.c
@@ -46,14 +46,6 @@
#include "BKE_nla.h"
#include "BKE_action.h"
-#include "BIF_screen.h"
-#include "BIF_interface.h"
-#include "BIF_buttons.h"
-#include "BIF_space.h"
-#include "BIF_mywindow.h"
-#include "BIF_editview.h"
-#include "BIF_toolbox.h"
-
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
@@ -69,6 +61,14 @@
#include "DNA_nla_types.h"
#include "DNA_constraint_types.h"
+#include "BIF_screen.h"
+#include "BIF_interface.h"
+#include "BIF_butspace.h"
+#include "BIF_space.h"
+#include "BIF_mywindow.h"
+#include "BIF_editview.h"
+#include "BIF_toolbox.h"
+
#include "BSE_editipo.h"
#include "BSE_editnla_types.h"
#include "BSE_headerbuttons.h"
@@ -131,7 +131,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
switch(event) {
case UI_BUT_EVENT:
- do_blenderbuttons(val);
+ do_butspace(val); // abuse!
break;
case HOMEKEY:
do_nla_buttons(B_NLAHOME);
@@ -347,7 +347,7 @@ static void add_nla_block(short event)
}
-static void add_nla_databrowse_callback(int val)
+static void add_nla_databrowse_callback(unsigned short val)
{
/* val is not used, databrowse needs it to optional pass an event */
short event;
@@ -1217,7 +1217,7 @@ static Base *get_nearest_nlastrip (bActionStrip **rstrip, short *sel)
short foundsel = 0;
rctf rectf;
float ymin, ymax;
- bActionStrip *strip, *firststrip, *foundstrip;
+ bActionStrip *strip, *firststrip=NULL, *foundstrip=NULL;
getmouseco_areawin (mval);
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
index 7d14d7f476f..099f8dc2458 100644
--- a/source/blender/src/editobject.c
+++ b/source/blender/src/editobject.c
@@ -117,7 +117,7 @@
#include "BIF_screen.h"
#include "BIF_space.h"
#include "BIF_toets.h"
-#include "BIF_buttons.h"
+#include "BIF_butspace.h"
#include "BIF_editdeform.h"
#include "BIF_editfont.h"
#include "BIF_editika.h"
@@ -915,7 +915,7 @@ void enter_editmode(void)
ok= 1;
G.obedit= ob;
make_editMesh();
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
if (ob->type==OB_ARMATURE){
arm=base->object->data;
@@ -1069,7 +1069,7 @@ void exit_editmode(int freedata) /* freedata==0 at render */
countall();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
else {
G.obedit= ob;
@@ -1430,7 +1430,7 @@ void special_editmenu(void)
}
}
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
else if(G.f & G_VERTEXPAINT) {
Mesh *me= get_mesh(OBACT);
@@ -2063,7 +2063,7 @@ void copymenu()
allqueue(REDRAWVIEW3D, 0);
if(event==20) {
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
}
}
@@ -5785,7 +5785,7 @@ void set_ob_ipoflags(void)
base= base->next;
}
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
if(set) {
allqueue(REDRAWNLA, 0);
allqueue (REDRAWACTION, 0);
@@ -5938,7 +5938,7 @@ void auto_timeoffs(void)
MEM_freeN(basesort);
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
}
void texspace_edit(void)
diff --git a/source/blender/src/editoops.c b/source/blender/src/editoops.c
index 562931c0a99..fb87b7cb849 100644
--- a/source/blender/src/editoops.c
+++ b/source/blender/src/editoops.c
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <math.h>
+#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -418,7 +419,7 @@ static void do_activate_oops(Oops *oops)
ob= OBACT;
if(ob && oops->id) {
assign_material(ob, (Material *)oops->id, ob->actcol);
- allqueue(REDRAWBUTSMAT, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
scrarea_queue_winredraw(curarea);
}
break;
diff --git a/source/blender/src/editsca.c b/source/blender/src/editsca.c
index 9c2c059956b..6f027850751 100644
--- a/source/blender/src/editsca.c
+++ b/source/blender/src/editsca.c
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <math.h>
+#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -75,6 +76,7 @@
#include "BIF_resources.h"
#include "BIF_space.h"
#include "BIF_interface.h"
+#include "BIF_butspace.h"
#include "BIF_screen.h"
#include "BIF_editsca.h"
#include "BIF_keyval.h"
@@ -115,6 +117,7 @@ static char *actuator_pup(Object *owner);
/****/
+
static void del_property(void *selpropv, void *data2_unused)
{
bProperty *prop, *selprop= selpropv;
@@ -137,7 +140,7 @@ static void del_property(void *selpropv, void *data2_unused)
a++;
prop= prop->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
@@ -264,7 +267,7 @@ static void sca_move_sensor(void *datav, void *data2_unused)
BLI_remlink(&base->object->sensors, sens);
BLI_insertlink(&base->object->sensors, sens->next, sens);
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
}
@@ -302,7 +305,7 @@ static void sca_move_controller(void *datav, void *data2_unused)
BLI_remlink(&base->object->controllers, cont);
BLI_insertlink(&base->object->controllers, cont->next, cont);
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
}
@@ -340,7 +343,7 @@ static void sca_move_actuator(void *datav, void *data2_unused)
BLI_remlink(&base->object->actuators, act);
BLI_insertlink(&base->object->actuators, act->next, act);
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
}
@@ -368,7 +371,7 @@ void do_gamebuts(unsigned short event)
prop= new_property(PROP_FLOAT);
make_unique_prop_names(prop->name);
BLI_addtail(&ob->prop, prop);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_CHANGE_PROP:
@@ -382,7 +385,7 @@ void do_gamebuts(unsigned short event)
}
prop= prop->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_ADD_SENS:
@@ -398,7 +401,7 @@ void do_gamebuts(unsigned short event)
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_CHANGE_SENS:
@@ -415,7 +418,7 @@ void do_gamebuts(unsigned short event)
}
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_DEL_SENS:
@@ -432,7 +435,7 @@ void do_gamebuts(unsigned short event)
}
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_ADD_CONT:
@@ -447,7 +450,7 @@ void do_gamebuts(unsigned short event)
}
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_CHANGE_CONT:
@@ -464,7 +467,7 @@ void do_gamebuts(unsigned short event)
}
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
@@ -483,7 +486,7 @@ void do_gamebuts(unsigned short event)
}
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_ADD_ACT:
@@ -498,7 +501,7 @@ void do_gamebuts(unsigned short event)
}
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_CHANGE_ACT:
@@ -515,7 +518,7 @@ void do_gamebuts(unsigned short event)
}
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_DEL_ACT:
@@ -533,7 +536,7 @@ void do_gamebuts(unsigned short event)
}
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
break;
case B_SOUNDACT_BROWSE:
@@ -579,7 +582,7 @@ void do_gamebuts(unsigned short event)
break;
base= base->next;
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
allqueue(REDRAWSOUND, 0);
break;
@@ -2159,7 +2162,7 @@ static void do_sensor_menu(void *arg, int event)
}
if(idar) MEM_freeN(idar);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
static uiBlock *sensor_menu(void *arg_unused)
@@ -2207,7 +2210,7 @@ static void do_controller_menu(void *arg, int event)
}
if(idar) MEM_freeN(idar);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
static uiBlock *controller_menu(void *arg_unused)
@@ -2255,7 +2258,7 @@ static void do_actuator_menu(void *arg, int event)
}
if(idar) MEM_freeN(idar);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
static uiBlock *actuator_menu(void *arg_unused)
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
index 1fa17779fb4..20434766fd1 100644
--- a/source/blender/src/editscreen.c
+++ b/source/blender/src/editscreen.c
@@ -251,7 +251,6 @@ void areawinset(short win)
G.vd= curarea->spacedata.first;
break;
case SPACE_IPO:
- if(G.sipo != curarea->spacedata.first) allqueue(REDRAWBUTSANIM, 0);
G.sipo= curarea->spacedata.first;
G.v2d= &G.sipo->v2d;
break;
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
index 79db90154c6..e4b174ab87a 100644
--- a/source/blender/src/editseq.c
+++ b/source/blender/src/editseq.c
@@ -737,6 +737,7 @@ static void add_sound_strip(char *name)
transform_seq('g');
}
+#if 0
static void reload_sound_strip(char *name)
{
Editing *ed;
@@ -777,6 +778,7 @@ static void reload_sound_strip(char *name)
allqueue(REDRAWSEQ, 0);
}
+#endif
static void reload_image_strip(char *name)
{
diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c
index aedf3cef1b6..8f21df450bd 100644
--- a/source/blender/src/editview.c
+++ b/source/blender/src/editview.c
@@ -68,7 +68,7 @@
#include "BIF_mywindow.h"
#include "BIF_space.h"
#include "BIF_screen.h"
-#include "BIF_buttons.h"
+#include "BIF_butspace.h"
#include "BIF_editgroup.h"
#include "BIF_editmesh.h"
#include "BIF_editoops.h"
@@ -399,6 +399,7 @@ static void deselectall_except(Base *b) /* deselect all except b */
countall();
}
+#if 0
/* smart function to sample a rect spiralling outside, nice for backbuf selection */
static unsigned int samplerect(unsigned int *buf, int size, unsigned int dontdo)
{
@@ -445,6 +446,7 @@ static unsigned int samplerect(unsigned int *buf, int size, unsigned int dontdo)
}
return retval;
}
+#endif
#define SELECTSIZE 51
@@ -591,9 +593,9 @@ void mouse_select(void)
}
}
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWHEADERS, 0); /* To force display update for the posebutton */
@@ -659,7 +661,7 @@ void borderselect(void)
}
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWVIEW3D, 0);
@@ -786,7 +788,7 @@ void borderselect(void)
}
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSCONSTRAINT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWVIEW3D, 0);
}
@@ -851,7 +853,7 @@ void borderselect(void)
base= base->next;
}
/* new */
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
allqueue(REDRAWNLA, 0);
}
countall();
diff --git a/source/blender/src/eventdebug.c b/source/blender/src/eventdebug.c
index a754dbfa49f..dd12215c727 100644
--- a/source/blender/src/eventdebug.c
+++ b/source/blender/src/eventdebug.c
@@ -48,20 +48,8 @@ char *event_to_string(short evt) {
smap(RESHAPE);
smap(UI_BUT_EVENT);
smap(REDRAWVIEW3D);
- smap(REDRAWBUTSHEAD);
- smap(REDRAWBUTSALL);
- smap(REDRAWBUTSVIEW);
- smap(REDRAWBUTSLAMP);
- smap(REDRAWBUTSMAT);
- smap(REDRAWBUTSTEX);
- smap(REDRAWBUTSANIM);
- smap(REDRAWBUTSWORLD);
- smap(REDRAWBUTSRENDER);
- smap(REDRAWBUTSEDIT);
smap(REDRAWVIEWCAM);
smap(REDRAWHEADERS);
- smap(REDRAWBUTSGAME);
- smap(REDRAWBUTSRADIO);
smap(REDRAWVIEW3D_Z);
smap(REDRAWALL);
smap(REDRAWINFO);
@@ -78,9 +66,6 @@ char *event_to_string(short evt) {
smap(IMALEFTMOUSE);
smap(AFTERPIBREAD);
smap(REDRAWTEXT);
- smap(REDRAWBUTSSCRIPT);
- smap(REDRAWSOUND);
- smap(REDRAWBUTSSOUND);
smap(REDRAWACTION);
smap(LEFTMOUSE);
smap(MIDDLEMOUSE);
@@ -200,7 +185,6 @@ char *event_to_string(short evt) {
smap(PAGEUPKEY);
smap(PAGEDOWNKEY);
smap(ENDKEY);
- smap(REDRAWBUTSCONSTRAINT);
smap(REDRAWNLA);
}
#undef smap
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
index 703905362ff..8c7851abff1 100644
--- a/source/blender/src/filesel.c
+++ b/source/blender/src/filesel.c
@@ -1534,7 +1534,7 @@ static void filesel_execute(SpaceFile *sfile)
}
}
}
- sfile->returnfunc((char*) sfile->retval);
+ sfile->returnfunc((char*) (long)sfile->retval);
}
else {
if(strncmp(sfile->title, "SAVE", 4)==0) free_filesel_spec(sfile->dir);
@@ -2289,7 +2289,8 @@ static void library_to_filelist(SpaceFile *sfile)
if(sfile->libfiledata==0) return;
}
- if (idcode= groupname_to_code(group)) {
+ idcode= groupname_to_code(group);
+ if (idcode) {
names= BLO_blendhandle_get_datablock_names(sfile->libfiledata, idcode);
} else {
names= BLO_blendhandle_get_linkable_groups(sfile->libfiledata);
@@ -2367,7 +2368,7 @@ static void filesel_select_objects(SpaceFile *sfile)
}
}
- allqueue(REDRAWBUTSRENDER, 0);
+ allqueue(REDRAWBUTSSCENE, 0);
}
}
diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c
index 9ec06f783fc..62045fdae20 100644
--- a/source/blender/src/headerbuttons.c
+++ b/source/blender/src/headerbuttons.c
@@ -332,8 +332,12 @@ static int std_libbuttons(uiBlock *block, int xco, int pin, short *pinpoin, int
id= G.main->world.first;
}
else if(ob && ob->type && (ob->type<OB_LAMP)) {
- if(G.buts->mainb==BUTS_MAT) id= G.main->mat.first;
- else if(G.buts->mainb==BUTS_TEX) id= G.main->tex.first;
+ if(G.buts->mainb==CONTEXT_SHADING) {
+ int tab= G.buts->tab[CONTEXT_SHADING];
+
+ if(tab==TAB_SHADING_MAT) id= G.main->mat.first;
+ else if(tab==TAB_SHADING_TEX) id= G.main->tex.first;
+ }
}
}
else if(curarea->spacetype==SPACE_TEXT) {
@@ -361,7 +365,7 @@ static int std_libbuttons(uiBlock *block, int xco, int pin, short *pinpoin, int
if( idtype==ID_SCE || idtype==ID_SCR ) uiClearButLock();
if(curarea->spacetype==SPACE_BUTS)
- uiSetButLock(idtype!=ID_SCR && G.obedit!=0 && G.buts->mainb==BUTS_EDIT, NULL);
+ uiSetButLock(idtype!=ID_SCR && G.obedit!=0 && G.buts->mainb==CONTEXT_EDITING, NULL);
if(parid) uiSetButLock(parid->lib!=0, "Can't edit library data");
@@ -380,13 +384,13 @@ static int std_libbuttons(uiBlock *block, int xco, int pin, short *pinpoin, int
xco+= XIC;
}
else if(curarea->spacetype==SPACE_BUTS) {
- if ELEM3(G.buts->mainb, BUTS_MAT, BUTS_TEX, BUTS_WORLD) {
+ if(G.buts->mainb==CONTEXT_SHADING) {
uiSetButLock(G.scene->id.lib!=0, "Can't edit library data");
if(parid) uiSetButLock(parid->lib!=0, "Can't edit library data");
uiDefButS(block, MENU, browse, "ADD NEW %x 32767",(short) xco,0,XIC,YIC, menupoin, 0, 0, 0, 0, "Browses Datablock");
uiClearButLock();
- } else if (G.buts->mainb == BUTS_SOUND) {
- uiDefButS(block, MENU, browse, "OPEN NEW %x 32766",(short) xco,0,XIC,YIC, menupoin, 0, 0, 0, 0, "Browses Datablock");
+// } else if (G.buts->mainb == BUTS_SOUND) {
+// uiDefButS(block, MENU, browse, "OPEN NEW %x 32766",(short) xco,0,XIC,YIC, menupoin, 0, 0, 0, 0, "Browses Datablock");
}
}
else if(curarea->spacetype==SPACE_TEXT) {
@@ -508,6 +512,8 @@ static int std_libbuttons(uiBlock *block, int xco, int pin, short *pinpoin, int
void do_update_for_newframe(int mute)
{
+ extern void audiostream_scrub(unsigned int frame); /* seqaudio.c */
+
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWACTION,0);
allqueue(REDRAWNLA,0);
@@ -515,9 +521,9 @@ void do_update_for_newframe(int mute)
allqueue(REDRAWINFO, 1);
allqueue(REDRAWSEQ, 1);
allqueue(REDRAWSOUND, 1);
- allqueue(REDRAWBUTSHEAD, 1);
- allqueue(REDRAWBUTSMAT, 1);
- allqueue(REDRAWBUTSLAMP, 1);
+ allqueue(REDRAWBUTSHEAD, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
/* layers/materials, object ipos are calculted in where_is_object (too) */
do_all_ipos();
@@ -794,7 +800,7 @@ void do_global_buttons(unsigned short event)
assign_material(ob, (Material *)idtest, ob->actcol);
allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSMAT, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
}
@@ -810,7 +816,7 @@ void do_global_buttons(unsigned short event)
if(ma) {
assign_material(ob, 0, ob->actcol);
allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSMAT, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
}
@@ -829,7 +835,7 @@ void do_global_buttons(unsigned short event)
if(mtex->tex) mtex->tex->id.us--;
MEM_freeN(mtex);
ma->mtex[ ma->texact ]= 0;
- allqueue(REDRAWBUTSTEX, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
}
@@ -843,7 +849,7 @@ void do_global_buttons(unsigned short event)
if(mtex->tex) mtex->tex->id.us--;
MEM_freeN(mtex);
wrld->mtex[ wrld->texact ]= 0;
- allqueue(REDRAWBUTSTEX, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
}
@@ -857,7 +863,7 @@ void do_global_buttons(unsigned short event)
if(mtex->tex) mtex->tex->id.us--;
MEM_freeN(mtex);
la->mtex[ la->texact ]= 0;
- allqueue(REDRAWBUTSTEX, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
}
@@ -919,8 +925,7 @@ void do_global_buttons(unsigned short event)
if(id) id->us--;
allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSTEX, 0);
- allqueue(REDRAWBUTSMAT, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
}
@@ -1079,7 +1084,7 @@ void do_global_buttons(unsigned short event)
else if(ipo->blocktype==ID_MA) {
( (Material *)from)->ipo= ipo;
id_us_plus(idtest);
- allqueue(REDRAWBUTSMAT, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
}
else if(ipo->blocktype==ID_SEQ) {
seq= (Sequence *)from;
@@ -1103,7 +1108,7 @@ void do_global_buttons(unsigned short event)
else if(ipo->blocktype==ID_WO) {
( (World *)from)->ipo= ipo;
id_us_plus(idtest);
- allqueue(REDRAWBUTSWORLD, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
}
else if(ipo->blocktype==ID_LA) {
( (Lamp *)from)->ipo= ipo;
@@ -1197,7 +1202,7 @@ void do_global_buttons(unsigned short event)
if(id) id->us--;
allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSWORLD, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
}
@@ -1206,7 +1211,7 @@ void do_global_buttons(unsigned short event)
if(G.scene->world) {
G.scene->world->id.us--;
G.scene->world= 0;
- allqueue(REDRAWBUTSWORLD, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
}
@@ -1262,8 +1267,7 @@ void do_global_buttons(unsigned short event)
if(id) id->us--;
allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSTEX, 0);
- allqueue(REDRAWBUTSWORLD, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
}
@@ -1358,7 +1362,7 @@ void do_global_buttons(unsigned short event)
if(id) id->us--;
allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSTEX, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWBUTSLAMP, 0);
allqueue(REDRAWIPO, 0);
BIF_preview_changed(G.buts);
@@ -1377,25 +1381,27 @@ void do_global_buttons(unsigned short event)
allqueue(REDRAWBUTSHEAD, 0);
break;
case B_AUTOTEXNAME:
- if(G.buts->mainb==BUTS_TEX) {
- autotexname(G.buts->lockpoin);
- allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSTEX, 0);
- }
- else if(G.buts->mainb==BUTS_MAT) {
- ma= G.buts->lockpoin;
- if(ma->mtex[ ma->texact]) autotexname(ma->mtex[ma->texact]->tex);
- allqueue(REDRAWBUTSMAT, 0);
- }
- else if(G.buts->mainb==BUTS_WORLD) {
- wrld= G.buts->lockpoin;
- if(wrld->mtex[ wrld->texact]) autotexname(wrld->mtex[wrld->texact]->tex);
- allqueue(REDRAWBUTSWORLD, 0);
- }
- else if(G.buts->mainb==BUTS_LAMP) {
- la= G.buts->lockpoin;
- if(la->mtex[ la->texact]) autotexname(la->mtex[la->texact]->tex);
- allqueue(REDRAWBUTSLAMP, 0);
+ if(G.buts->mainb==CONTEXT_SHADING) {
+ if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_TEX) {
+ autotexname(G.buts->lockpoin);
+ allqueue(REDRAWBUTSHEAD, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
+ }
+ else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_MAT) {
+ ma= G.buts->lockpoin;
+ if(ma->mtex[ ma->texact]) autotexname(ma->mtex[ma->texact]->tex);
+ allqueue(REDRAWBUTSSHADING, 0);
+ }
+ else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_WORLD) {
+ wrld= G.buts->lockpoin;
+ if(wrld->mtex[ wrld->texact]) autotexname(wrld->mtex[wrld->texact]->tex);
+ allqueue(REDRAWBUTSSHADING, 0);
+ }
+ else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_LAMP) {
+ la= G.buts->lockpoin;
+ if(la->mtex[ la->texact]) autotexname(la->mtex[la->texact]->tex);
+ allqueue(REDRAWBUTSLAMP, 0);
+ }
}
break;
@@ -5741,7 +5747,7 @@ static void do_view3d_facesel_propertiesmenu(void *arg, int event)
break;
}
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
static uiBlock *view3d_facesel_propertiesmenu(void *arg_unused)
@@ -5875,7 +5881,7 @@ static void do_view3d_faceselmenu(void *arg, int event)
break;
}
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
allqueue(REDRAWIMAGE, 0);
}
@@ -6853,8 +6859,8 @@ void ipo_buttons(void)
}
uiDefIconButS(block, ROW, B_IPOMAIN, ICON_SEQUENCE, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_SEQ, 0, 0, "Displays Sequence Ipos");
- if(G.buts && G.buts->mainb == BUTS_SOUND && G.buts->lockpoin)
- uiDefIconButS(block, ROW, B_IPOMAIN, ICON_SOUND, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_SO, 0, 0, "Displays Sound Ipos");
+// if(G.buts && G.buts->mainb == BUTS_SOUND && G.buts->lockpoin)
+// uiDefIconButS(block, ROW, B_IPOMAIN, ICON_SOUND, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_SO, 0, 0, "Displays Sound Ipos");
uiClearButLock();
@@ -6999,80 +7005,84 @@ void buttons_active_id(ID **id, ID **idfrom)
{
Object *ob= OBACT;
Material *ma;
- ID * search;
*id= NULL;
*idfrom= (ID *)ob;
- if(G.buts->mainb==BUTS_LAMP) {
- if(ob && ob->type==OB_LAMP) {
- *id= ob->data;
- }
- }
- else if(G.buts->mainb==BUTS_MAT) {
- if(ob && (ob->type<OB_LAMP) && ob->type) {
- *id= (ID *)give_current_material(ob, ob->actcol);
- *idfrom= material_from(ob, ob->actcol);
- }
+ if(G.buts->mainb==CONTEXT_SCENE) {
+ *id= (ID *)G.scene;
+
}
- else if(G.buts->mainb==BUTS_TEX) {
- MTex *mtex;
+ else if(G.buts->mainb==CONTEXT_SHADING) {
+ int tab= G.buts->tab[CONTEXT_SHADING];
- if(G.buts->mainbo != G.buts->mainb) {
- if(G.buts->mainbo==BUTS_LAMP) G.buts->texfrom= 2;
- else if(G.buts->mainbo==BUTS_WORLD) G.buts->texfrom= 1;
- else if(G.buts->mainbo==BUTS_MAT) G.buts->texfrom= 0;
- }
-
- if(G.buts->texfrom==0) {
- if(ob && ob->type<OB_LAMP && ob->type) {
- ma= give_current_material(ob, ob->actcol);
- *idfrom= (ID *)ma;
- if(ma) {
- mtex= ma->mtex[ ma->texact ];
- if(mtex) *id= (ID *)mtex->tex;
- }
+ if(tab==TAB_SHADING_LAMP) {
+ if(ob && ob->type==OB_LAMP) {
+ *id= ob->data;
}
}
- else if(G.buts->texfrom==1) {
- World *wrld= G.scene->world;
- *idfrom= (ID *)wrld;
- if(wrld) {
- mtex= wrld->mtex[ wrld->texact];
- if(mtex) *id= (ID *)mtex->tex;
+ else if(tab==TAB_SHADING_MAT) {
+ if(ob && (ob->type<OB_LAMP) && ob->type) {
+ *id= (ID *)give_current_material(ob, ob->actcol);
+ *idfrom= material_from(ob, ob->actcol);
}
}
- else if(G.buts->texfrom==2) {
- Lamp *la;
- if(ob && ob->type==OB_LAMP) {
- la= ob->data;
- *idfrom= (ID *)la;
- mtex= la->mtex[ la->texact];
- if(mtex) *id= (ID *)mtex->tex;
+ else if(tab==TAB_SHADING_WORLD) {
+ *id= (ID *)G.scene->world;
+ *idfrom= (ID *)G.scene;
+ }
+ else if(tab==TAB_SHADING_TEX) {
+ MTex *mtex;
+
+// if(G.buts->mainbo != G.buts->mainb) {
+// if(G.buts->mainbo==BUTS_LAMP) G.buts->texfrom= 2;
+// else if(G.buts->mainbo==BUTS_WORLD) G.buts->texfrom= 1;
+// else if(G.buts->mainbo==BUTS_MAT) G.buts->texfrom= 0;
+// }
+
+ if(G.buts->texfrom==0) {
+ if(ob && ob->type<OB_LAMP && ob->type) {
+ ma= give_current_material(ob, ob->actcol);
+ *idfrom= (ID *)ma;
+ if(ma) {
+ mtex= ma->mtex[ ma->texact ];
+ if(mtex) *id= (ID *)mtex->tex;
+ }
+ }
+ }
+ else if(G.buts->texfrom==1) {
+ World *wrld= G.scene->world;
+ *idfrom= (ID *)wrld;
+ if(wrld) {
+ mtex= wrld->mtex[ wrld->texact];
+ if(mtex) *id= (ID *)mtex->tex;
+ }
+ }
+ else if(G.buts->texfrom==2) {
+ Lamp *la;
+ if(ob && ob->type==OB_LAMP) {
+ la= ob->data;
+ *idfrom= (ID *)la;
+ mtex= la->mtex[ la->texact];
+ if(mtex) *id= (ID *)mtex->tex;
+ }
}
}
}
- else if ELEM3(G.buts->mainb, BUTS_ANIM, BUTS_GAME, BUTS_CONSTRAINT) {
+ else if(G.buts->mainb==CONTEXT_OBJECT || G.buts->mainb==CONTEXT_LOGIC) {
if(ob) {
*idfrom= (ID *)G.scene;
*id= (ID *)ob;
}
}
- else if(G.buts->mainb==BUTS_WORLD) {
- *id= (ID *)G.scene->world;
- *idfrom= (ID *)G.scene;
- }
- else if(G.buts->mainb==BUTS_RENDER) {
- *id= (ID *)G.scene;
-
- }
- else if(G.buts->mainb==BUTS_EDIT) {
+ else if(G.buts->mainb==CONTEXT_TYPES || G.buts->mainb==CONTEXT_EDITING) {
if(ob && ob->data) {
*id= ob->data;
}
}
else if (G.buts->mainb == BUTS_SOUND) {
- // printf("lockp: %d\n", G.buts->lockpoin);
+#if 0
+ ID * search;
if (G.buts->lockpoin) {
search = G.main->sound.first;
@@ -7091,10 +7101,11 @@ void buttons_active_id(ID **id, ID **idfrom)
*id = G.main->sound.first;
}
// printf("id: %d\n\n", *id);
+#endif
}
}
-#if 0
+
static void validate_bonebutton(void *bonev, void *data2_unused){
Bone *bone= bonev;
bArmature *arm;
@@ -7102,7 +7113,7 @@ static void validate_bonebutton(void *bonev, void *data2_unused){
arm = get_armature(G.obpose);
unique_bone_name(bone, arm);
}
-#endif
+
static int bonename_exists(Bone *orig, char *name, ListBase *list)
{
@@ -7158,8 +7169,7 @@ static void unique_bone_name (Bone *bone, bArmature *arm)
static uiBlock *sbuts_context_menu(void *arg_unused)
{
uiBlock *block;
- short yco = 0, xco = 0;
- int randomcolorindex = 1234;
+ short yco = 0;
block= uiNewBlock(&curarea->uiblocks, "context_options", UI_EMBOSSP, UI_HELV, curarea->headwin);
uiBlockSetCol(block, MENUCOL);
@@ -7815,7 +7825,7 @@ void load_space_sound(char *str) /* called from fileselect */
}
allqueue(REDRAWSOUND, 0);
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
@@ -7826,15 +7836,15 @@ void load_sound_buttons(char *str) /* called from fileselect */
sound= sound_new_sound(str);
if (sound) {
if (curarea && curarea->spacetype==SPACE_BUTS) {
- if (G.buts->mainb == BUTS_SOUND) {
- G.buts->lockpoin = sound;
- }
+// if (G.buts->mainb == BUTS_SOUND) {
+// G.buts->lockpoin = sound;
+// }
}
} else {
error("Not a valid sample: %s", str);
}
- allqueue(REDRAWBUTSSOUND, 0);
+ //allqueue(REDRAWBUTSSOUND, 0);
}
void do_action_buttons(unsigned short event)
@@ -7987,7 +7997,7 @@ void do_sound_buttons(unsigned short event)
if (idtest != id) {
G.buts->lockpoin = (bSound *)idtest;
if(idtest->us==0) idtest->us= 1;
- allqueue(REDRAWBUTSSOUND, 0);
+ //allqueue(REDRAWBUTSSOUND, 0);
BIF_preview_changed(G.buts);
}
}
@@ -8166,7 +8176,7 @@ void save_paint(char *name)
BLI_strncpy(ima->name, name, sizeof(ima->name));
ima->ibuf->userflags &= ~IB_BITMAPDIRTY;
allqueue(REDRAWHEADERS, 0);
- allqueue(REDRAWBUTSTEX, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
} else {
error("Couldn't write image: %s", str);
}
@@ -8304,7 +8314,7 @@ void do_image_buttons(unsigned short event)
ima->packedfile = newPackedFile(ima->name);
}
}
- allqueue(REDRAWBUTSTEX, 0);
+ allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWHEADERS, 0);
}
break;
diff --git a/source/blender/src/imasel.c b/source/blender/src/imasel.c
index f12c1bbd813..5ad53e15bf6 100644
--- a/source/blender/src/imasel.c
+++ b/source/blender/src/imasel.c
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 3b381d818b7..cdaa893555a 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -4286,7 +4286,7 @@ static void ui_delete_active_linkline(uiBlock *block)
}
/* temporal! these buttons can be everywhere... */
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSLOGIC, 0);
}
static void ui_do_active_linklines(uiBlock *block, short *mval)
diff --git a/source/blender/src/language.c b/source/blender/src/language.c
index 0439f119de8..e330d617672 100644
--- a/source/blender/src/language.c
+++ b/source/blender/src/language.c
@@ -237,7 +237,7 @@ void start_interface_font(void) {
strcat(tstr, ".bfont.ttf");
result = FTF_SetFont(tstr, U.fontsize);
- sprintf(U.fontname, ".blender/.bfont.ttf\0");
+ sprintf(U.fontname, ".blender/.bfont.ttf");
#elif defined (WIN32)
BLI_getInstallationDir(tstr);
strcat(tstr, "/.blender/.bfont.ttf\0");
diff --git a/source/blender/src/mywindow.c b/source/blender/src/mywindow.c
index f7208ceda2f..78f3443fa7b 100644
--- a/source/blender/src/mywindow.c
+++ b/source/blender/src/mywindow.c
@@ -84,7 +84,7 @@ static int mainwin_color_depth;
void mywindow_init_mainwin(Window *win, int orx, int ory, int sizex, int sizey)
{
- int r, g, b;
+ GLint r, g, b;
winlay_mainwindow= win;
diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c
index 9fcfce0ab5c..b6c4d68b406 100644
--- a/source/blender/src/previewrender.c
+++ b/source/blender/src/previewrender.c
@@ -335,7 +335,7 @@ void BIF_previewdraw(SpaceButs *sbuts)
display_pr_scanline(sbuts->rect, y);
}
- if (sbuts->mainb==BUTS_TEX) {
+ if (sbuts->mainb==CONTEXT_SHADING && sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_TEX) {
draw_tex_crop(sbuts->lockpoin);
}
}
@@ -839,22 +839,40 @@ static void shade_preview_pixel(float *vec,
void BIF_previewrender(SpaceButs *sbuts)
{
- Material *mat=0;
- Tex *tex = NULL;
+ Material *mat= NULL;
+ Tex *tex= NULL;
+ Lamp *la= NULL;
+ World *wrld= NULL;
+ LampRen *lar= NULL;
Image *ima;
- Lamp *la;
- LampRen *lar = NULL;
HaloRen har;
Object *ob;
- World *wrld;
float lens = 0.0, vec[3];
int x, y, starty, startx, endy, endx, radsq, xsq, ysq, last = 0;
unsigned int *rect;
if(sbuts->cury>=PR_RECTY) return;
+
+ ob= ((G.scene->basact)? (G.scene->basact)->object: 0);
+
+ if(sbuts->mainb==CONTEXT_SHADING) {
+ int tab= sbuts->tab[CONTEXT_SHADING];
+
+ if(tab==TAB_SHADING_MAT)
+ mat= sbuts->lockpoin;
+ else if(tab==TAB_SHADING_TEX)
+ tex= sbuts->lockpoin;
+ else if(tab==TAB_SHADING_LAMP) {
+ if(ob && ob->type==OB_LAMP) la= ob->data;
+ }
+ else if(tab==TAB_SHADING_WORLD)
+ wrld= sbuts->lockpoin;
+ }
+ else if(sbuts->mainb==CONTEXT_OBJECT) {
+ if(ob && ob->type==OB_LAMP) la= ob->data;
+ }
- if ELEM4(sbuts->mainb, BUTS_MAT, BUTS_TEX, BUTS_LAMP, BUTS_WORLD);
- else return;
+ if(mat==NULL || tex==NULL || la==NULL || wrld==NULL) return;
har.flarec= 0; /* below is a test for postrender flare */
@@ -867,10 +885,7 @@ void BIF_previewrender(SpaceButs *sbuts)
MTC_Mat4One(R.viewinv);
R.osatex= 0;
- if(sbuts->mainb==BUTS_MAT) {
- mat= sbuts->lockpoin;
- if(mat==0) return;
-
+ if(mat) {
/* rendervars */
init_render_world();
init_render_material(mat);
@@ -894,24 +909,21 @@ void BIF_previewrender(SpaceButs *sbuts)
if(mat->mode & MA_HALO) init_previewhalo(&har, mat);
}
- else if(sbuts->mainb==BUTS_TEX) {
- tex= sbuts->lockpoin;
- if(tex==0) return;
+ else if(tex) {
+
ima= tex->ima;
if(ima) last= ima->lastframe;
init_render_texture(tex);
free_unused_animimages();
if(tex->ima) {
- if(tex->ima!=ima) allqueue(REDRAWBUTSTEX, 0);
- else if(last!=ima->lastframe) allqueue(REDRAWBUTSTEX, 0);
+ if(tex->ima!=ima) allqueue(REDRAWBUTSSHADING, 0);
+ else if(last!=ima->lastframe) allqueue(REDRAWBUTSSHADING, 0);
}
if(tex->env && tex->env->object)
MTC_Mat4Invert(tex->env->object->imat, tex->env->object->obmat);
}
- else if(sbuts->mainb==BUTS_LAMP) {
- ob= ((G.scene->basact)? (G.scene->basact)->object: 0);
- if(ob==0 || ob->type!=OB_LAMP) return;
- la= ob->data;
+ else if(la) {
+
init_render_world();
init_render_textures(); /* do not do it twice!! (brightness) */
R.totlamp= 0;
@@ -925,9 +937,7 @@ void BIF_previewrender(SpaceButs *sbuts)
MTC_Mat3One(lar->imat);
}
- else {
- wrld= sbuts->lockpoin;
- if(wrld==0) return;
+ else if(wrld) {
lens= 35.0;
if(G.scene->camera) {
@@ -979,7 +989,7 @@ void BIF_previewrender(SpaceButs *sbuts)
rect= sbuts->rect + 1 + PR_RECTX*sbuts->cury;
if(y== -PR_RECTY/2 || y==endy-1); /* emboss */
- else if(sbuts->mainb==BUTS_MAT) {
+ else if(mat) {
if(mat->mode & MA_HALO) {
for(x=startx; x<endx; x++, rect++) {
@@ -1037,12 +1047,12 @@ void BIF_previewrender(SpaceButs *sbuts)
}
}
}
- else if(sbuts->mainb==BUTS_TEX) {
+ else if(tex) {
for(x=startx; x<endx; x++, rect++) {
texture_preview_pixel(tex, x, y, (char *)rect);
}
}
- else if(sbuts->mainb==BUTS_LAMP) {
+ else if(la) {
for(x=startx; x<endx; x++, rect++) {
lamp_preview_pixel(lar, x, y, (char *)rect);
}
@@ -1066,25 +1076,25 @@ void BIF_previewrender(SpaceButs *sbuts)
sbuts->cury++;
}
- if(sbuts->cury>=PR_RECTY && sbuts->mainb==BUTS_TEX)
+ if(sbuts->cury>=PR_RECTY && tex)
draw_tex_crop(sbuts->lockpoin);
glDrawBuffer(GL_BACK);
BIF_previewdraw(sbuts);
- if(sbuts->mainb==BUTS_MAT) {
+ if(mat) {
end_render_material(mat);
for(x=0; x<8; x++) {
if(mat->mtex[x] && mat->mtex[x]->tex) end_render_texture(mat->mtex[x]->tex);
}
}
- else if(sbuts->mainb==BUTS_TEX) {
+ else if(tex) {
end_render_texture(tex);
}
- else if(sbuts->mainb==BUTS_WORLD) {
+ else if(wrld) {
end_render_textures();
}
- else if(sbuts->mainb==BUTS_LAMP) {
+ else if(la) {
if(R.totlamp) {
if(R.la[0]->org) MEM_freeN(R.la[0]->org);
MEM_freeN(R.la[0]);
diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c
index da4c73e6635..ddd28fa839d 100644
--- a/source/blender/src/seqaudio.c
+++ b/source/blender/src/seqaudio.c
@@ -84,6 +84,8 @@
#include "mydevice.h"
#include "interface.h"
#include "blendef.h"
+#include "render.h"
+
void audio_fill(void *mixdown, Uint8 *sstream, int len);
/* ************ GLOBALS ************* */
@@ -115,7 +117,7 @@ void makewavstring (char *string)
void audio_mixdown()
{
- int file, c, totlen, totframe, i, oldcfra, cfra2;
+ int file, c, totlen, totframe, i, oldcfra, cfra2=0;
char *buf;
Editing *ed;
Sequence *seq;
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 90fa7655fe2..f2a3436c249 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -82,7 +82,7 @@
#include "BKE_scene.h"
#include "BKE_utildefines.h"
-#include "BIF_buttons.h"
+#include "BIF_butspace.h"
#include "BIF_drawimage.h"
#include "BIF_drawseq.h"
#include "BIF_drawtext.h"
@@ -127,6 +127,7 @@
#include "BDR_editcurve.h"
#include "BDR_editface.h"
#include "BDR_drawmesh.h"
+#include "BDR_drawobject.h"
#include "BLO_readfile.h" /* for BLO_blendhandle_close */
@@ -493,7 +494,7 @@ void group_menu(void)
else if(nr==3) select_parent();
allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSANIM, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
allspace(REMAKEIPO, 0);
allqueue(REDRAWIPO, 0);
}
@@ -2024,7 +2025,7 @@ void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
switch(event) {
case UI_BUT_EVENT:
- do_blenderbuttons(val);
+ do_butspace(val);
break;
case MIDDLEMOUSE:
@@ -3177,64 +3178,37 @@ void allqueue(unsigned short event, short val)
scrarea_queue_headredraw(sa);
}
break;
- case REDRAWBUTSVIEW:
+ case REDRAWBUTSSCENE:
if(sa->spacetype==SPACE_BUTS) {
buts= sa->spacedata.first;
- if(buts->mainb==BUTS_VIEW) {
+ if(buts->mainb==CONTEXT_SCENE) {
scrarea_queue_winredraw(sa);
scrarea_queue_headredraw(sa);
}
}
break;
- case REDRAWBUTSLAMP:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==BUTS_LAMP) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSMAT:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==BUTS_MAT) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSTEX:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==BUTS_TEX) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSANIM:
+ case REDRAWBUTSOBJECT:
if(sa->spacetype==SPACE_BUTS) {
buts= sa->spacedata.first;
- if(buts->mainb==BUTS_ANIM) {
+ if(buts->mainb==CONTEXT_OBJECT) {
scrarea_queue_winredraw(sa);
scrarea_queue_headredraw(sa);
}
}
break;
- case REDRAWBUTSWORLD:
+ case REDRAWBUTSTYPES:
if(sa->spacetype==SPACE_BUTS) {
buts= sa->spacedata.first;
- if(buts->mainb==BUTS_WORLD) {
+ if(buts->mainb==CONTEXT_TYPES) {
scrarea_queue_winredraw(sa);
scrarea_queue_headredraw(sa);
}
}
break;
- case REDRAWBUTSRENDER:
+ case REDRAWBUTSSHADING:
if(sa->spacetype==SPACE_BUTS) {
buts= sa->spacedata.first;
- if(buts->mainb==BUTS_RENDER) {
+ if(buts->mainb==CONTEXT_SHADING) {
scrarea_queue_winredraw(sa);
scrarea_queue_headredraw(sa);
}
@@ -3243,25 +3217,7 @@ void allqueue(unsigned short event, short val)
case REDRAWBUTSEDIT:
if(sa->spacetype==SPACE_BUTS) {
buts= sa->spacedata.first;
- if(buts->mainb==BUTS_EDIT) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSGAME:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if ELEM(buts->mainb, BUTS_GAME, BUTS_FPAINT) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSRADIO:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==BUTS_RADIO) {
+ if(buts->mainb==CONTEXT_EDITING) {
scrarea_queue_winredraw(sa);
scrarea_queue_headredraw(sa);
}
@@ -3270,30 +3226,32 @@ void allqueue(unsigned short event, short val)
case REDRAWBUTSSCRIPT:
if(sa->spacetype==SPACE_BUTS) {
buts= sa->spacedata.first;
- if(buts->mainb==BUTS_SCRIPT) {
+ if(buts->mainb==CONTEXT_SCRIPT) {
scrarea_queue_winredraw(sa);
scrarea_queue_headredraw(sa);
}
}
break;
- case REDRAWBUTSSOUND:
+ case REDRAWBUTSLOGIC:
if(sa->spacetype==SPACE_BUTS) {
buts= sa->spacedata.first;
- if(buts->mainb==BUTS_SOUND) {
+ if(buts->mainb==CONTEXT_LOGIC) {
scrarea_queue_winredraw(sa);
scrarea_queue_headredraw(sa);
}
}
break;
- case REDRAWBUTSCONSTRAINT:
+ case REDRAWBUTSLAMP:
if(sa->spacetype==SPACE_BUTS) {
buts= sa->spacedata.first;
- if(buts->mainb==BUTS_CONSTRAINT) {
+ if(buts->mainb==CONTEXT_SHADING || buts->mainb==CONTEXT_TYPES) {
scrarea_queue_winredraw(sa);
scrarea_queue_headredraw(sa);
}
}
- break;
+ break;
+
+
case REDRAWDATASELECT:
if(sa->spacetype==SPACE_FILE) {
sfile= sa->spacedata.first;
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
index edc328dd6ee..f31ca03da26 100644
--- a/source/blender/src/toets.c
+++ b/source/blender/src/toets.c
@@ -73,7 +73,7 @@
#include "BIF_interface.h"
#include "BIF_screen.h"
#include "BIF_space.h"
-#include "BIF_buttons.h"
+#include "BIF_butspace.h"
#include "BIF_renderwin.h"
#include "BIF_toolbox.h"
#include "BIF_toets.h"
@@ -392,6 +392,7 @@ void persptoetsen(unsigned short event)
G.vd->persp= 2;
G.vd->view= 0;
if(G.qual & LR_SHIFTKEY) {
+ void setcameratoview3d(void); // view.c
setcameratoview3d();
}
}
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c
index ed90b30ae08..0a62353715a 100644
--- a/source/blender/src/toolbox.c
+++ b/source/blender/src/toolbox.c
@@ -60,6 +60,7 @@
#include "DNA_image_types.h"
#include "DNA_object_types.h"
+#include "DNA_lamp_types.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
@@ -1455,6 +1456,7 @@ void clever_numbuts(void)
clever_numbuts_oops();
}
else if(curarea->spacetype==SPACE_ACTION){
+ void stupid_damn_numbuts_action(void); // editaction.c
stupid_damn_numbuts_action();
}
else if(curarea->spacetype==SPACE_FILE) {
@@ -1501,3 +1503,4 @@ void replace_names_but(void)
}
}
+
diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c
index 416b62ae215..6d780e6eb31 100644
--- a/source/blender/src/vpaint.c
+++ b/source/blender/src/vpaint.c
@@ -454,7 +454,7 @@ void sample_vpaint() /* frontbuf */
Gvp.b= cp[2];
Gvp.b /= 255.0;
- allqueue(REDRAWBUTSGAME, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
}
void init_vertexpaint()
@@ -1124,7 +1124,6 @@ void set_wpaint(void) /* toggle */
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSGAME, 0);
if(G.f & G_WEIGHTPAINT) {
setcursor_space(SPACE_VIEW3D, CURSOR_VPAINT);
@@ -1168,7 +1167,6 @@ void set_vpaint(void) /* toggle */
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSGAME, 0);
if(G.f & G_VERTEXPAINT) {
setcursor_space(SPACE_VIEW3D, CURSOR_VPAINT);