Fixing header*** files to use tabs instead of spaces (was my fault, sorry).

This commit is contained in:
2003-10-11 20:56:26 +00:00
parent 95ce9b93be
commit e32a73f69e
15 changed files with 5337 additions and 5337 deletions

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -80,78 +80,78 @@
void do_action_buttons(unsigned short event)
{
switch(event){
switch(event){
#ifdef __NLA_BAKE
case B_ACTBAKE:
bake_action_with_client (G.saction->action, OBACT, 0.01);
break;
case B_ACTBAKE:
bake_action_with_client (G.saction->action, OBACT, 0.01);
break;
#endif
case B_ACTCONT:
set_exprap_action(IPO_HORIZ);
break;
// case B_ACTEXTRAP:
// set_exprap_ipo(IPO_DIR);
// break;
case B_ACTCYCLIC:
set_exprap_action(IPO_CYCL);
break;
// case B_ACTCYCLICX:
// set_exprap_ipo(IPO_CYCLX);
// break;
case B_ACTHOME:
// Find X extents
//v2d= &(G.saction->v2d);
case B_ACTCONT:
set_exprap_action(IPO_HORIZ);
break;
// case B_ACTEXTRAP:
// set_exprap_ipo(IPO_DIR);
// break;
case B_ACTCYCLIC:
set_exprap_action(IPO_CYCL);
break;
// case B_ACTCYCLICX:
// set_exprap_ipo(IPO_CYCLX);
// break;
case B_ACTHOME:
// Find X extents
//v2d= &(G.saction->v2d);
G.v2d->cur.xmin = 0;
G.v2d->cur.ymin=-SCROLLB;
G.v2d->cur.xmin = 0;
G.v2d->cur.ymin=-SCROLLB;
if (!G.saction->action){ // here the mesh rvk?
G.v2d->cur.xmax=100;
}
else {
float extra;
G.v2d->cur.xmin= calc_action_start(G.saction->action);
G.v2d->cur.xmax= calc_action_end(G.saction->action);
extra= 0.05*(G.v2d->cur.xmax - G.v2d->cur.xmin);
G.v2d->cur.xmin-= extra;
G.v2d->cur.xmax+= extra;
}
if (!G.saction->action){ // here the mesh rvk?
G.v2d->cur.xmax=100;
}
else {
float extra;
G.v2d->cur.xmin= calc_action_start(G.saction->action);
G.v2d->cur.xmax= calc_action_end(G.saction->action);
extra= 0.05*(G.v2d->cur.xmax - G.v2d->cur.xmin);
G.v2d->cur.xmin-= extra;
G.v2d->cur.xmax+= extra;
}
G.v2d->tot= G.v2d->cur;
test_view2d(G.v2d, curarea->winx, curarea->winy);
G.v2d->tot= G.v2d->cur;
test_view2d(G.v2d, curarea->winx, curarea->winy);
addqueue (curarea->win, REDRAW, 1);
addqueue (curarea->win, REDRAW, 1);
break;
case B_ACTCOPY:
copy_posebuf();
allqueue(REDRAWVIEW3D, 1);
break;
case B_ACTPASTE:
paste_posebuf(0);
allqueue(REDRAWVIEW3D, 1);
break;
case B_ACTPASTEFLIP:
paste_posebuf(1);
allqueue(REDRAWVIEW3D, 1);
break;
break;
case B_ACTCOPY:
copy_posebuf();
allqueue(REDRAWVIEW3D, 1);
break;
case B_ACTPASTE:
paste_posebuf(0);
allqueue(REDRAWVIEW3D, 1);
break;
case B_ACTPASTEFLIP:
paste_posebuf(1);
allqueue(REDRAWVIEW3D, 1);
break;
case B_ACTPIN: /* __PINFAKE */
/* if (G.saction->flag & SACTION_PIN){
if (G.saction->action)
G.saction->action->id.us ++;
case B_ACTPIN: /* __PINFAKE */
/* if (G.saction->flag & SACTION_PIN){
if (G.saction->action)
G.saction->action->id.us ++;
}
else {
if (G.saction->action)
G.saction->action->id.us --;
}
*/ /* end PINFAKE */
allqueue(REDRAWACTION, 1);
break;
}
else {
if (G.saction->action)
G.saction->action->id.us --;
}
*/ /* end PINFAKE */
allqueue(REDRAWACTION, 1);
break;
}
}
}
void action_buttons(void)

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -95,254 +95,254 @@ static int bonename_exists(Bone *orig, char *name, ListBase *list);
void clear_matcopybuf(void)
{
memset(&matcopybuf, 0, sizeof(Material));
memset(&matcopybuf, 0, sizeof(Material));
}
void free_matcopybuf(void)
{
extern MTex mtexcopybuf; /* buttons.c */
int a;
extern MTex mtexcopybuf; /* buttons.c */
int a;
for(a=0; a<8; a++) {
if(matcopybuf.mtex[a]) {
MEM_freeN(matcopybuf.mtex[a]);
matcopybuf.mtex[a]= 0;
}
}
for(a=0; a<8; a++) {
if(matcopybuf.mtex[a]) {
MEM_freeN(matcopybuf.mtex[a]);
matcopybuf.mtex[a]= 0;
}
}
default_mtex(&mtexcopybuf);
default_mtex(&mtexcopybuf);
}
void do_buts_buttons(short event)
{
static short matcopied=0;
MTex *mtex;
Material *ma;
ID id;
int a;
static short matcopied=0;
MTex *mtex;
Material *ma;
ID id;
int a;
if(curarea->win==0) return;
if(curarea->win==0) return;
switch(event) {
case B_BUTSHOME:
uiSetPanel_view2d(curarea);
G.v2d->cur= G.v2d->tot;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
case B_BUTSPREVIEW:
BIF_preview_changed(G.buts);
scrarea_queue_headredraw(curarea);
scrarea_queue_winredraw(curarea);
break;
case B_MATCOPY:
if(G.buts->lockpoin) {
switch(event) {
case B_BUTSHOME:
uiSetPanel_view2d(curarea);
G.v2d->cur= G.v2d->tot;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
case B_BUTSPREVIEW:
BIF_preview_changed(G.buts);
scrarea_queue_headredraw(curarea);
scrarea_queue_winredraw(curarea);
break;
case B_MATCOPY:
if(G.buts->lockpoin) {
if(matcopied) free_matcopybuf();
if(matcopied) free_matcopybuf();
memcpy(&matcopybuf, G.buts->lockpoin, sizeof(Material));
for(a=0; a<8; a++) {
mtex= matcopybuf.mtex[a];
if(mtex) {
matcopybuf.mtex[a]= MEM_dupallocN(mtex);
}
}
matcopied= 1;
}
break;
case B_MATPASTE:
if(matcopied && G.buts->lockpoin) {
ma= G.buts->lockpoin;
/* free current mat */
for(a=0; a<8; a++) {
mtex= ma->mtex[a];
if(mtex && mtex->tex) mtex->tex->id.us--;
if(mtex) MEM_freeN(mtex);
}
memcpy(&matcopybuf, G.buts->lockpoin, sizeof(Material));
for(a=0; a<8; a++) {
mtex= matcopybuf.mtex[a];
if(mtex) {
matcopybuf.mtex[a]= MEM_dupallocN(mtex);
}
}
matcopied= 1;
}
break;
case B_MATPASTE:
if(matcopied && G.buts->lockpoin) {
ma= G.buts->lockpoin;
/* free current mat */
for(a=0; a<8; a++) {
mtex= ma->mtex[a];
if(mtex && mtex->tex) mtex->tex->id.us--;
if(mtex) MEM_freeN(mtex);
}
id= (ma->id);
memcpy(G.buts->lockpoin, &matcopybuf, sizeof(Material));
(ma->id)= id;
id= (ma->id);
memcpy(G.buts->lockpoin, &matcopybuf, sizeof(Material));
(ma->id)= id;
for(a=0; a<8; a++) {
mtex= ma->mtex[a];
if(mtex) {
ma->mtex[a]= MEM_dupallocN(mtex);
if(mtex->tex) id_us_plus((ID *)mtex->tex);
}
}
BIF_preview_changed(G.buts);
scrarea_queue_winredraw(curarea);
}
break;
case B_MESHTYPE:
allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWVIEW3D, 0);
break;
}
for(a=0; a<8; a++) {
mtex= ma->mtex[a];
if(mtex) {
ma->mtex[a]= MEM_dupallocN(mtex);
if(mtex->tex) id_us_plus((ID *)mtex->tex);
}
}
BIF_preview_changed(G.buts);
scrarea_queue_winredraw(curarea);
}
break;
case B_MESHTYPE:
allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWVIEW3D, 0);
break;
}
}
void buttons_active_id(ID **id, ID **idfrom)
{
Object *ob= OBACT;
Material *ma;
Object *ob= OBACT;
Material *ma;
*id= NULL;
*idfrom= (ID *)ob;
*id= NULL;
*idfrom= (ID *)ob;
if(G.buts->mainb==CONTEXT_SCENE) {
*id= (ID *)G.scene;
if(G.buts->mainb==CONTEXT_SCENE) {
*id= (ID *)G.scene;
}
else if(G.buts->mainb==CONTEXT_SHADING) {
int tab= G.buts->tab[CONTEXT_SHADING];
}
else if(G.buts->mainb==CONTEXT_SHADING) {
int tab= G.buts->tab[CONTEXT_SHADING];
if(tab==TAB_SHADING_LAMP) {
if(ob && ob->type==OB_LAMP) {
*id= ob->data;
}
}
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(tab==TAB_SHADING_WORLD) {
*id= (ID *)G.scene->world;
*idfrom= (ID *)G.scene;
}
else if(tab==TAB_SHADING_TEX) {
MTex *mtex;
if(tab==TAB_SHADING_LAMP) {
if(ob && ob->type==OB_LAMP) {
*id= ob->data;
}
}
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(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 && G.buts->tabo!=tab) {
if(G.buts->tabo==TAB_SHADING_LAMP) G.buts->texfrom= 2;
else if(G.buts->tabo==TAB_SHADING_WORLD) G.buts->texfrom= 1;
else if(G.buts->tabo==TAB_SHADING_MAT) G.buts->texfrom= 0;
}
if(G.buts->mainbo==G.buts->mainb && G.buts->tabo!=tab) {
if(G.buts->tabo==TAB_SHADING_LAMP) G.buts->texfrom= 2;
else if(G.buts->tabo==TAB_SHADING_WORLD) G.buts->texfrom= 1;
else if(G.buts->tabo==TAB_SHADING_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(G.buts->mainb==CONTEXT_OBJECT || G.buts->mainb==CONTEXT_LOGIC) {
if(ob) {
*idfrom= (ID *)G.scene;
*id= (ID *)ob;
}
}
else if(G.buts->mainb==CONTEXT_EDITING) {
if(ob && ob->data) {
*id= ob->data;
}
}
else if (G.buts->mainb == BUTS_SOUND) {
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(G.buts->mainb==CONTEXT_OBJECT || G.buts->mainb==CONTEXT_LOGIC) {
if(ob) {
*idfrom= (ID *)G.scene;
*id= (ID *)ob;
}
}
else if(G.buts->mainb==CONTEXT_EDITING) {
if(ob && ob->data) {
*id= ob->data;
}
}
else if (G.buts->mainb == BUTS_SOUND) {
#if 0
ID * search;
ID * search;
if (G.buts->lockpoin) {
search = G.main->sound.first;
while (search) {
if (search == G.buts->lockpoin) {
break;
}
search = search->next;
}
if (search == NULL) {
*id = G.main->sound.first;
} else {
*id = search;
}
} else {
*id = G.main->sound.first;
}
// printf("id: %d\n\n", *id);
if (G.buts->lockpoin) {
search = G.main->sound.first;
while (search) {
if (search == G.buts->lockpoin) {
break;
}
search = search->next;
}
if (search == NULL) {
*id = G.main->sound.first;
} else {
*id = search;
}
} else {
*id = G.main->sound.first;
}
// printf("id: %d\n\n", *id);
#endif
}
}
}
static void validate_bonebutton(void *bonev, void *data2_unused){
Bone *bone= bonev;
bArmature *arm;
Bone *bone= bonev;
bArmature *arm;
arm = get_armature(G.obpose);
unique_bone_name(bone, arm);
arm = get_armature(G.obpose);
unique_bone_name(bone, arm);
}
static int bonename_exists(Bone *orig, char *name, ListBase *list)
{
Bone *curbone;
Bone *curbone;
for (curbone=list->first; curbone; curbone=curbone->next){
/* Check this bone */
if (orig!=curbone){
if (!strcmp(curbone->name, name))
return 1;
}
for (curbone=list->first; curbone; curbone=curbone->next){
/* Check this bone */
if (orig!=curbone){
if (!strcmp(curbone->name, name))
return 1;
}
/* Check Children */
if (bonename_exists(orig, name, &curbone->childbase))
return 1;
}
/* Check Children */
if (bonename_exists(orig, name, &curbone->childbase))
return 1;
}
return 0;
return 0;
}
static void unique_bone_name (Bone *bone, bArmature *arm)
{
char tempname[64];
char oldname[64];
int number;
char *dot;
char tempname[64];
char oldname[64];
int number;
char *dot;
if (!arm)
return;
if (!arm)
return;
strcpy(oldname, bone->name);
strcpy(oldname, bone->name);
/* See if we even need to do this */
if (!bonename_exists(bone, bone->name, &arm->bonebase))
return;
/* See if we even need to do this */
if (!bonename_exists(bone, bone->name, &arm->bonebase))
return;
/* Strip off the suffix */
dot=strchr(bone->name, '.');
if (dot)
*dot=0;
/* Strip off the suffix */
dot=strchr(bone->name, '.');
if (dot)
*dot=0;
for (number = 1; number <=999; number++){
sprintf (tempname, "%s.%03d", bone->name, number);
for (number = 1; number <=999; number++){
sprintf (tempname, "%s.%03d", bone->name, number);
if (!bonename_exists(bone, tempname, &arm->bonebase)){
strcpy (bone->name, tempname);
return;
}
}
if (!bonename_exists(bone, tempname, &arm->bonebase)){
strcpy (bone->name, tempname);
return;
}
}
}
static uiBlock *sbuts_context_menu(void *arg_unused)

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -75,21 +75,21 @@
void do_file_buttons(short event)
{
SpaceFile *sfile;
SpaceFile *sfile;
if(curarea->win==0) return;
sfile= curarea->spacedata.first;
if(curarea->win==0) return;
sfile= curarea->spacedata.first;
switch(event) {
case B_SORTFILELIST:
sort_filelist(sfile);
scrarea_queue_winredraw(curarea);
break;
case B_RELOADDIR:
freefilelist(sfile);
scrarea_queue_winredraw(curarea);
break;
}
switch(event) {
case B_SORTFILELIST:
sort_filelist(sfile);
scrarea_queue_winredraw(curarea);
break;
case B_RELOADDIR:
freefilelist(sfile);
scrarea_queue_winredraw(curarea);
break;
}
}
@@ -123,7 +123,7 @@ void file_buttons(void)
uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTSIZE, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 2.0, 0, 0, "Sorts files by size");
cpack(0x0);
glRasterPos2i(xco+=XIC+10, 5);
glRasterPos2i(xco+=XIC+10, 5);
BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & TR_BUTTONS), 0);
xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & TR_BUTTONS));
@@ -143,11 +143,10 @@ void file_buttons(void)
filesel_statistics(sfile, &totfile, &selfile, &totlen, &sellen);
sprintf(naam, "Free: %.3f Mb Files: (%d) %d (%.3f) %.3f Mb",
df, selfile,totfile, sellen, totlen);
sprintf(naam, "Free: %.3f Mb Files: (%d) %d (%.3f) %.3f Mb", df, selfile,totfile, sellen, totlen);
cpack(0x0);
glRasterPos2i(xco, 5);
glRasterPos2i(xco, 5);
BIF_DrawString(uiBlockGetCurFont(block), naam, 0, 0);
}

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -87,268 +87,268 @@
#include "TPT_DependKludge.h"
void load_space_image(char *str) /* called from fileselect */
void load_space_image(char *str) /* called from fileselect */
{
Image *ima=0;
Image *ima=0;
if(G.obedit) {
error("Can't perfom this in editmode");
return;
}
if(G.obedit) {
error("Can't perfom this in editmode");
return;
}
ima= add_image(str);
if(ima) {
ima= add_image(str);
if(ima) {
G.sima->image= ima;
G.sima->image= ima;
free_image_buffers(ima); /* force read again */
ima->ok= 1;
image_changed(G.sima, 0);
free_image_buffers(ima); /* force read again */
ima->ok= 1;
image_changed(G.sima, 0);
}
}
allqueue(REDRAWIMAGE, 0);
allqueue(REDRAWIMAGE, 0);
}
void image_replace(Image *old, Image *new)
{
TFace *tface;
Mesh *me;
int a, rep=0;
TFace *tface;
Mesh *me;
int a, rep=0;
new->tpageflag= old->tpageflag;
new->twsta= old->twsta;
new->twend= old->twend;
new->xrep= old->xrep;
new->yrep= old->yrep;
new->tpageflag= old->tpageflag;
new->twsta= old->twsta;
new->twend= old->twend;
new->xrep= old->xrep;
new->yrep= old->yrep;
me= G.main->mesh.first;
while(me) {
me= G.main->mesh.first;
while(me) {
if(me->tface) {
tface= me->tface;
a= me->totface;
while(a--) {
if(tface->tpage==old) {
tface->tpage= new;
rep++;
}
tface++;
}
}
me= me->id.next;
if(me->tface) {
tface= me->tface;
a= me->totface;
while(a--) {
if(tface->tpage==old) {
tface->tpage= new;
rep++;
}
tface++;
}
}
me= me->id.next;
}
if(rep) {
if(new->id.us==0) new->id.us= 1;
}
else error("Nothing replaced");
}
if(rep) {
if(new->id.us==0) new->id.us= 1;
}
else error("Nothing replaced");
}
void replace_space_image(char *str) /* called from fileselect */
void replace_space_image(char *str) /* called from fileselect */
{
Image *ima=0;
Image *ima=0;
if(G.obedit) {
error("Can't perfom this in editmode");
return;
}
if(G.obedit) {
error("Can't perfom this in editmode");
return;
}
ima= add_image(str);
if(ima) {
ima= add_image(str);
if(ima) {
if(G.sima->image != ima) {
image_replace(G.sima->image, ima);
}
if(G.sima->image != ima) {
image_replace(G.sima->image, ima);
}
G.sima->image= ima;
G.sima->image= ima;
free_image_buffers(ima); /* force read again */
ima->ok= 1;
/* replace also assigns: */
image_changed(G.sima, 0);
free_image_buffers(ima); /* force read again */
ima->ok= 1;
/* replace also assigns: */
image_changed(G.sima, 0);
}
allqueue(REDRAWIMAGE, 0);
}
allqueue(REDRAWIMAGE, 0);
}
void save_paint(char *name)
{
char str[FILE_MAXDIR+FILE_MAXFILE];
Image *ima = G.sima->image;
ImBuf *ibuf;
char str[FILE_MAXDIR+FILE_MAXFILE];
Image *ima = G.sima->image;
ImBuf *ibuf;
if (ima && ima->ibuf) {
BLI_strncpy(str, name, sizeof(str));
if (ima && ima->ibuf) {
BLI_strncpy(str, name, sizeof(str));
BLI_convertstringcode(str, G.sce, G.scene->r.cfra);
BLI_convertstringcode(str, G.sce, G.scene->r.cfra);
if (saveover(str)) {
ibuf = IMB_dupImBuf(ima->ibuf);
if (saveover(str)) {
ibuf = IMB_dupImBuf(ima->ibuf);
if (ibuf) {
if (BIF_write_ibuf(ibuf, str)) {
BLI_strncpy(ima->name, name, sizeof(ima->name));
ima->ibuf->userflags &= ~IB_BITMAPDIRTY;
allqueue(REDRAWHEADERS, 0);
allqueue(REDRAWBUTSSHADING, 0);
} else {
error("Couldn't write image: %s", str);
}
if (ibuf) {
if (BIF_write_ibuf(ibuf, str)) {
BLI_strncpy(ima->name, name, sizeof(ima->name));
ima->ibuf->userflags &= ~IB_BITMAPDIRTY;
allqueue(REDRAWHEADERS, 0);
allqueue(REDRAWBUTSSHADING, 0);
} else {
error("Couldn't write image: %s", str);
}
IMB_freeImBuf(ibuf);
}
}
}
IMB_freeImBuf(ibuf);
}
}
}
}
void do_image_buttons(unsigned short event)
{
Image *ima;
ID *id, *idtest;
int nr;
char name[256], str[256];
Image *ima;
ID *id, *idtest;
int nr;
char name[256], str[256];
if(curarea->win==0) return;
if(curarea->win==0) return;
switch(event) {
case B_SIMAGEHOME:
image_home();
break;
switch(event) {
case B_SIMAGEHOME:
image_home();
break;
case B_SIMABROWSE:
if(G.sima->imanr== -2) {
activate_databrowse((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE,
&G.sima->imanr, do_image_buttons);
return;
}
if(G.sima->imanr < 0) break;
case B_SIMABROWSE:
if(G.sima->imanr== -2) {
activate_databrowse((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE,
&G.sima->imanr, do_image_buttons);
return;
}
if(G.sima->imanr < 0) break;
nr= 1;
id= (ID *)G.sima->image;
nr= 1;
id= (ID *)G.sima->image;
idtest= G.main->image.first;
while(idtest) {
if(nr==G.sima->imanr) {
break;
}
nr++;
idtest= idtest->next;
}
if(idtest==0) { /* no new */
return;
}
idtest= G.main->image.first;
while(idtest) {
if(nr==G.sima->imanr) {
break;
}
nr++;
idtest= idtest->next;
}
if(idtest==0) { /* no new */
return;
}
if(idtest!=id) {
G.sima->image= (Image *)idtest;
if(idtest->us==0) idtest->us= 1;
allqueue(REDRAWIMAGE, 0);
}
/* also when image is the same: assign! 0==no tileflag: */
image_changed(G.sima, 0);
if(idtest!=id) {
G.sima->image= (Image *)idtest;
if(idtest->us==0) idtest->us= 1;
allqueue(REDRAWIMAGE, 0);
}
/* also when image is the same: assign! 0==no tileflag: */
image_changed(G.sima, 0);
break;
case B_SIMAGELOAD:
case B_SIMAGELOAD1:
break;
case B_SIMAGELOAD:
case B_SIMAGELOAD1:
if(G.sima->image) strcpy(name, G.sima->image->name);
else strcpy(name, U.textudir);
if(G.sima->image) strcpy(name, G.sima->image->name);
else strcpy(name, U.textudir);
if(event==B_SIMAGELOAD)
activate_imageselect(FILE_SPECIAL, "SELECT IMAGE", name,
load_space_image);
else
activate_fileselect(FILE_SPECIAL, "SELECT IMAGE", name,
load_space_image);
break;
case B_SIMAGEREPLACE:
case B_SIMAGEREPLACE1:
if(event==B_SIMAGELOAD)
activate_imageselect(FILE_SPECIAL, "SELECT IMAGE", name,
load_space_image);
else
activate_fileselect(FILE_SPECIAL, "SELECT IMAGE", name,
load_space_image);
break;
case B_SIMAGEREPLACE:
case B_SIMAGEREPLACE1:
if(G.sima->image) strcpy(name, G.sima->image->name);
else strcpy(name, U.textudir);
if(G.sima->image) strcpy(name, G.sima->image->name);
else strcpy(name, U.textudir);
if(event==B_SIMAGEREPLACE)
activate_imageselect(FILE_SPECIAL, "REPLACE IMAGE", name,
replace_space_image);
else
activate_fileselect(FILE_SPECIAL, "REPLACE IMAGE", name,
replace_space_image);
break;
case B_SIMAGEDRAW:
if(event==B_SIMAGEREPLACE)
activate_imageselect(FILE_SPECIAL, "REPLACE IMAGE", name,
replace_space_image);
else
activate_fileselect(FILE_SPECIAL, "REPLACE IMAGE", name,
replace_space_image);
break;
case B_SIMAGEDRAW:
if(G.f & G_FACESELECT) {
make_repbind(G.sima->image);
image_changed(G.sima, 1);
}
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIMAGE, 0);
break;
if(G.f & G_FACESELECT) {
make_repbind(G.sima->image);
image_changed(G.sima, 1);
}
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIMAGE, 0);
break;
case B_SIMAGEDRAW1:
image_changed(G.sima, 2); /* 2: only tileflag */
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIMAGE, 0);
break;
case B_SIMAGEDRAW1:
image_changed(G.sima, 2); /* 2: only tileflag */
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIMAGE, 0);
break;
case B_TWINANIM:
ima = G.sima->image;
if (ima) {
if(ima->flag & IMA_TWINANIM) {
nr= ima->xrep*ima->yrep;
if(ima->twsta>=nr) ima->twsta= 1;
if(ima->twend>=nr) ima->twend= nr-1;
if(ima->twsta>ima->twend) ima->twsta= 1;
allqueue(REDRAWIMAGE, 0);
}
}
break;
case B_TWINANIM:
ima = G.sima->image;
if (ima) {
if(ima->flag & IMA_TWINANIM) {
nr= ima->xrep*ima->yrep;
if(ima->twsta>=nr) ima->twsta= 1;
if(ima->twend>=nr) ima->twend= nr-1;
if(ima->twsta>ima->twend) ima->twsta= 1;
allqueue(REDRAWIMAGE, 0);
}
}
break;
case B_CLIP_UV:
tface_do_clip();
allqueue(REDRAWIMAGE, 0);
allqueue(REDRAWVIEW3D, 0);
break;
case B_CLIP_UV:
tface_do_clip();
allqueue(REDRAWIMAGE, 0);
allqueue(REDRAWVIEW3D, 0);
break;
case B_SIMAGEPAINTTOOL:
// check for packed file here
allqueue(REDRAWIMAGE, 0);
allqueue(REDRAWVIEW3D, 0);
break;
case B_SIMAPACKIMA:
ima = G.sima->image;
if (ima) {
if (ima->packedfile) {
if (G.fileflags & G_AUTOPACK) {
if (okee("Disable AutoPack ?")) {
G.fileflags &= ~G_AUTOPACK;
}
}
case B_SIMAGEPAINTTOOL:
// check for packed file here
allqueue(REDRAWIMAGE, 0);
allqueue(REDRAWVIEW3D, 0);
break;
case B_SIMAPACKIMA:
ima = G.sima->image;
if (ima) {
if (ima->packedfile) {
if (G.fileflags & G_AUTOPACK) {
if (okee("Disable AutoPack ?")) {
G.fileflags &= ~G_AUTOPACK;
}
}
if ((G.fileflags & G_AUTOPACK) == 0) {
unpackImage(ima, PF_ASK);
}
} else {
if (ima->ibuf && (ima->ibuf->userflags & IB_BITMAPDIRTY)) {
error("Can't pack painted image. Save image first.");
} else {
ima->packedfile = newPackedFile(ima->name);
}
}
allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWHEADERS, 0);
}
break;
case B_SIMAGESAVE:
ima = G.sima->image;
if (ima) {
strcpy(name, ima->name);
if (ima->ibuf) {
save_image_filesel_str(str);
activate_fileselect(FILE_SPECIAL, str, name, save_paint);
}
}
break;
}
if ((G.fileflags & G_AUTOPACK) == 0) {
unpackImage(ima, PF_ASK);
}
} else {
if (ima->ibuf && (ima->ibuf->userflags & IB_BITMAPDIRTY)) {
error("Can't pack painted image. Save image first.");
} else {
ima->packedfile = newPackedFile(ima->name);
}
}
allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWHEADERS, 0);
}
break;
case B_SIMAGESAVE:
ima = G.sima->image;
if (ima) {
strcpy(name, ima->name);
if (ima->ibuf) {
save_image_filesel_str(str);
activate_fileselect(FILE_SPECIAL, str, name, save_paint);
}
}
break;
}
}
/* This should not be a stack var! */

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -71,30 +71,30 @@
void do_imasel_buttons(short event)
{
SpaceImaSel *simasel;
char name[256];
SpaceImaSel *simasel;
char name[256];
simasel= curarea->spacedata.first;
simasel= curarea->spacedata.first;
if(curarea->win==0) return;
if(curarea->win==0) return;
switch(event) {
case B_IMASELHOME:
break;
switch(event) {
case B_IMASELHOME:
break;
case B_IMASELREMOVEBIP:
case B_IMASELREMOVEBIP:
if(bitset(simasel->fase, IMS_FOUND_BIP)){
if(bitset(simasel->fase, IMS_FOUND_BIP)){
strcpy(name, simasel->dir);
strcat(name, ".Bpib");
strcpy(name, simasel->dir);
strcat(name, ".Bpib");
remove(name);
remove(name);
simasel->fase &= ~ IMS_FOUND_BIP;
}
break;
}
simasel->fase &= ~ IMS_FOUND_BIP;
}
break;
}
}
void imasel_buttons(void)
@@ -122,14 +122,14 @@ void imasel_buttons(void)
xco+=XIC;
if (simasel->title){
xco+=25;
glRasterPos2i(xco, 4);
glRasterPos2i(xco, 4);
BMF_DrawString(G.font, simasel->title);
xco+=BMF_GetStringWidth(G.fonts, simasel->title);
xco+=25;
}
uiDefIconBut(block, BUT, B_IMASELREMOVEBIP, ICON_BPIBFOLDER_X, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "");/* remove */
uiDefIconButS(block, TOG|BIT|0, B_REDR, ICON_BPIBFOLDERGREY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of directory information");/* dir */
uiDefIconButS(block, TOG|BIT|0, B_REDR, ICON_BPIBFOLDERGREY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of directory information");/* dir */
uiDefIconButS(block, TOG|BIT|1, B_REDR, ICON_INFO, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of selected image information");/* info */
uiDefIconButS(block, TOG|BIT|2, B_REDR, ICON_IMAGE_COL, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "");/* image */
uiDefIconButS(block, TOG|BIT|3, B_REDR, ICON_MAGNIFY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles magnified view of thumbnail of images under mouse pointer");/* magnify */

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -122,106 +122,106 @@ static float g_done;
int start_progress_bar(void)
{
g_progress_bar = 1;
return 1; // we never fail (yet)
g_progress_bar = 1;
return 1; // we never fail (yet)
}
void end_progress_bar(void)
{
g_progress_bar = 0;
g_progress_bar = 0;
}
static void update_progress_bar(float done, char *info)
{
g_done = done;
g_progress_info = info;
g_done = done;
g_progress_info = info;
}
/** Progress bar
'done': a value between 0.0 and 1.0, showing progress
'info': a info text what is currently being done
'done': a value between 0.0 and 1.0, showing progress
'info': a info text what is currently being done
Make sure that the progress bar is always called with:
done = 0.0 first
and
done = 1.0 last -- or alternatively use:
Make sure that the progress bar is always called with:
done = 0.0 first
and
done = 1.0 last -- or alternatively use:
start_progressbar();
do_stuff_and_callback_progress_bar();
end_progressbar();
start_progressbar();
do_stuff_and_callback_progress_bar();
end_progressbar();
*/
int progress_bar(float done, char *busy_info)
{
ScrArea *sa;
short val;
ScrArea *sa;
short val;
/* User break (ESC) */
while (qtest()) {
if (extern_qread(&val) == ESCKEY)
return 0;
}
if (done == 0.0) {
start_progress_bar();
} else if (done > 0.99) {
end_progress_bar();
}
/* User break (ESC) */
while (qtest()) {
if (extern_qread(&val) == ESCKEY)
return 0;
}
if (done == 0.0) {
start_progress_bar();
} else if (done > 0.99) {
end_progress_bar();
}
sa= G.curscreen->areabase.first;
while(sa) {
if (sa->spacetype == SPACE_INFO) {
update_progress_bar(done, busy_info);
sa= G.curscreen->areabase.first;
while(sa) {
if (sa->spacetype == SPACE_INFO) {
update_progress_bar(done, busy_info);
curarea = sa;
curarea = sa;
scrarea_do_headdraw(curarea);
areawinset(curarea->win);
sa->head_swap= WIN_BACK_OK;
screen_swapbuffers();
}
sa = sa->next;
}
return 1;
scrarea_do_headdraw(curarea);
areawinset(curarea->win);
sa->head_swap= WIN_BACK_OK;
screen_swapbuffers();
}
sa = sa->next;
}
return 1;
}
/* -- End of progress bar definitions ------- */
extern char videosc_dir[]; /* exotic.c */
extern char videosc_dir[]; /* exotic.c */
void write_videoscape_fs()
{
if(G.obedit) {
error("Can't save Videoscape. Press TAB to leave EditMode");
}
else {
if(videosc_dir[0]==0) strcpy(videosc_dir, G.sce);
activate_fileselect(FILE_SPECIAL, "SAVE VIDEOSCAPE", videosc_dir,
if(G.obedit) {
error("Can't save Videoscape. Press TAB to leave EditMode");
}
else {
if(videosc_dir[0]==0) strcpy(videosc_dir, G.sce);
activate_fileselect(FILE_SPECIAL, "SAVE VIDEOSCAPE", videosc_dir,
write_videoscape);
}
}
}
void write_vrml_fs()
{
if(G.obedit) {
error("Can't save VRML. Press TAB to leave EditMode");
}
else {
if(videosc_dir[0]==0) strcpy(videosc_dir, G.sce);
if(G.obedit) {
error("Can't save VRML. Press TAB to leave EditMode");
}
else {
if(videosc_dir[0]==0) strcpy(videosc_dir, G.sce);
activate_fileselect(FILE_SPECIAL, "SAVE VRML1", videosc_dir, write_vrml);
}
activate_fileselect(FILE_SPECIAL, "SAVE VRML1", videosc_dir, write_vrml);
}
}
void write_dxf_fs()
{
if(G.obedit) {
error("Can't save DXF. Press TAB to leave EditMode");
}
else {
if(G.obedit) {
error("Can't save DXF. Press TAB to leave EditMode");
}
else {
if(videosc_dir[0]==0) strcpy(videosc_dir, G.sce);
if(videosc_dir[0]==0) strcpy(videosc_dir, G.sce);
activate_fileselect(FILE_SPECIAL, "SAVE DXF", videosc_dir, write_dxf);
}
activate_fileselect(FILE_SPECIAL, "SAVE DXF", videosc_dir, write_dxf);
}
}
/* ------------ */
@@ -280,290 +280,290 @@ int buttons_do_unpack()
Scene *copy_scene(Scene *sce, int level)
{
/* level 0: al objects shared
* level 1: al object-data shared
* level 2: full copy
*/
Scene *scen;
Base *base, *obase;
/* level 0: al objects shared
* level 1: al object-data shared
* level 2: full copy
*/
Scene *scen;
Base *base, *obase;
/* level 0 */
scen= copy_libblock(sce);
duplicatelist(&(scen->base), &(sce->base));
/* level 0 */
scen= copy_libblock(sce);
duplicatelist(&(scen->base), &(sce->base));
clear_id_newpoins();
clear_id_newpoins();
id_us_plus((ID *)scen->world);
id_us_plus((ID *)scen->set);
id_us_plus((ID *)scen->world);
id_us_plus((ID *)scen->set);
scen->ed= 0;
scen->radio= 0;
scen->ed= 0;
scen->radio= 0;
obase= sce->base.first;
base= scen->base.first;
while(base) {
base->object->id.us++;
if(obase==sce->basact) scen->basact= base;
obase= sce->base.first;
base= scen->base.first;
while(base) {
base->object->id.us++;
if(obase==sce->basact) scen->basact= base;
obase= obase->next;
base= base->next;
}
obase= obase->next;
base= base->next;
}
if(level==0) return scen;
if(level==0) return scen;
/* level 1 */
G.scene= scen;
single_object_users(0);
/* level 1 */
G.scene= scen;
single_object_users(0);
/* camera */
ID_NEW(G.scene->camera);
/* camera */
ID_NEW(G.scene->camera);
/* level 2 */
if(level>=2) {
if(scen->world) {
scen->world->id.us--;
scen->world= copy_world(scen->world);
}
single_obdata_users(0);
single_mat_users_expand();
single_tex_users_expand();
}
/* level 2 */
if(level>=2) {
if(scen->world) {
scen->world->id.us--;
scen->world= copy_world(scen->world);
}
single_obdata_users(0);
single_mat_users_expand();
single_tex_users_expand();
}
clear_id_newpoins();
clear_id_newpoins();
BPY_copy_scriptlink(&sce->scriptlink);
BPY_copy_scriptlink(&sce->scriptlink);
// make a private copy of the avicodecdata
// make a private copy of the avicodecdata
if (sce->r.avicodecdata) {
if (sce->r.avicodecdata) {
scen->r.avicodecdata = MEM_dupallocN(sce->r.avicodecdata);
scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat);
scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms);
}
scen->r.avicodecdata = MEM_dupallocN(sce->r.avicodecdata);
scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat);
scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms);
}
// make a private copy of the qtcodecdata
// make a private copy of the qtcodecdata
if (sce->r.qtcodecdata) {
scen->r.qtcodecdata = MEM_dupallocN(sce->r.qtcodecdata);
scen->r.qtcodecdata->cdParms = MEM_dupallocN(scen->r.qtcodecdata->cdParms);
}
if (sce->r.qtcodecdata) {
scen->r.qtcodecdata = MEM_dupallocN(sce->r.qtcodecdata);
scen->r.qtcodecdata->cdParms = MEM_dupallocN(scen->r.qtcodecdata->cdParms);
}
return scen;
return scen;
}
void do_info_buttons(unsigned short event)
{
bScreen *sc, *oldscreen;
Scene *sce, *sce1;
ScrArea *sa;
int nr;
bScreen *sc, *oldscreen;
Scene *sce, *sce1;
ScrArea *sa;
int nr;
switch(event) {
switch(event) {
case B_INFOSCR: /* menu select screen */
case B_INFOSCR: /* menu select screen */
if( G.curscreen->screennr== -2) {
if(curarea->winy <50) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_databrowse((ID *)G.curscreen, ID_SCR, 0, B_INFOSCR,
&G.curscreen->screennr, do_info_buttons);
return;
}
if( G.curscreen->screennr < 0) return;
if( G.curscreen->screennr== -2) {
if(curarea->winy <50) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_databrowse((ID *)G.curscreen, ID_SCR, 0, B_INFOSCR,
&G.curscreen->screennr, do_info_buttons);
return;
}
if( G.curscreen->screennr < 0) return;
sc= G.main->screen.first;
nr= 1;
while(sc) {
if(nr==G.curscreen->screennr) {
if(is_allowed_to_change_screen(sc)) setscreen(sc);
else error("Unable to perform function in EditMode");
break;
}
nr++;
sc= sc->id.next;
}
/* last item: NEW SCREEN */
if(sc==0) {
duplicate_screen();
}
break;
case B_INFODELSCR:
sc= G.main->screen.first;
nr= 1;
while(sc) {
if(nr==G.curscreen->screennr) {
if(is_allowed_to_change_screen(sc)) setscreen(sc);
else error("Unable to perform function in EditMode");
break;
}
nr++;
sc= sc->id.next;
}
/* last item: NEW SCREEN */
if(sc==0) {
duplicate_screen();
}
break;
case B_INFODELSCR:
/*do this event only with buttons, so it can never be called with full-window*/
if(G.curscreen->id.prev) sc= G.curscreen->id.prev;
else if(G.curscreen->id.next) sc= G.curscreen->id.next;
else return;
if(okee("Delete current screen")) {
/* find new G.curscreen */
if(G.curscreen->id.prev) sc= G.curscreen->id.prev;
else if(G.curscreen->id.next) sc= G.curscreen->id.next;
else return;
if(okee("Delete current screen")) {
/* find new G.curscreen */
oldscreen= G.curscreen;
setscreen(sc); /* this test if sc has a full */
unlink_screen(oldscreen);
free_libblock(&G.main->screen, oldscreen);
}
scrarea_queue_headredraw(curarea);
oldscreen= G.curscreen;
setscreen(sc); /* this test if sc has a full */
unlink_screen(oldscreen);
free_libblock(&G.main->screen, oldscreen);
}
scrarea_queue_headredraw(curarea);
break;
case B_INFOSCE: /* menu select scene */
break;
case B_INFOSCE: /* menu select scene */
if( G.obedit) {
error("Unable to perform function in EditMode");
return;
}
if( G.curscreen->scenenr== -2) {
if(curarea->winy <50) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_databrowse((ID *)G.scene, ID_SCE, 0, B_INFOSCE,
&G.curscreen->scenenr, do_info_buttons);
return;
}
if( G.curscreen->scenenr < 0) return;
if( G.obedit) {
error("Unable to perform function in EditMode");
return;
}
if( G.curscreen->scenenr== -2) {
if(curarea->winy <50) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_databrowse((ID *)G.scene, ID_SCE, 0, B_INFOSCE,
&G.curscreen->scenenr, do_info_buttons);
return;
}
if( G.curscreen->scenenr < 0) return;
sce= G.main->scene.first;
nr= 1;
while(sce) {
if(nr==G.curscreen->scenenr) {
if(sce!=G.scene) set_scene(sce);
break;
}
nr++;
sce= sce->id.next;
}
/* last item: NEW SCENE */
if(sce==0) {
nr= pupmenu("Add scene%t|Empty|Link Objects|Link ObData|Full Copy");
if(nr<= 0) return;
if(nr==1) {
sce= add_scene(G.scene->id.name+2);
sce->r= G.scene->r;
sce= G.main->scene.first;
nr= 1;
while(sce) {
if(nr==G.curscreen->scenenr) {
if(sce!=G.scene) set_scene(sce);
break;
}
nr++;
sce= sce->id.next;
}
/* last item: NEW SCENE */
if(sce==0) {
nr= pupmenu("Add scene%t|Empty|Link Objects|Link ObData|Full Copy");
if(nr<= 0) return;
if(nr==1) {
sce= add_scene(G.scene->id.name+2);
sce->r= G.scene->r;
#ifdef _WIN32
if (sce->r.avicodecdata) {
sce->r.avicodecdata = MEM_dupallocN(G.scene->r.avicodecdata);
sce->r.avicodecdata->lpFormat = MEM_dupallocN(G.scene->r.avicodecdata->lpFormat);
sce->r.avicodecdata->lpParms = MEM_dupallocN(G.scene->r.avicodecdata->lpParms);
}
if (sce->r.avicodecdata) {
sce->r.avicodecdata = MEM_dupallocN(G.scene->r.avicodecdata);
sce->r.avicodecdata->lpFormat = MEM_dupallocN(G.scene->r.avicodecdata->lpFormat);
sce->r.avicodecdata->lpParms = MEM_dupallocN(G.scene->r.avicodecdata->lpParms);
}
#endif
#ifdef WITH_QUICKTIME
if (sce->r.qtcodecdata) {
sce->r.qtcodecdata = MEM_dupallocN(G.scene->r.qtcodecdata);
sce->r.qtcodecdata->cdParms = MEM_dupallocN(G.scene->r.qtcodecdata->cdParms);
}
if (sce->r.qtcodecdata) {
sce->r.qtcodecdata = MEM_dupallocN(G.scene->r.qtcodecdata);
sce->r.qtcodecdata->cdParms = MEM_dupallocN(G.scene->r.qtcodecdata->cdParms);
}
#endif
}
else sce= copy_scene(G.scene, nr-2);
}
else sce= copy_scene(G.scene, nr-2);
set_scene(sce);
}
BIF_preview_changed(G.buts);
set_scene(sce);
}
BIF_preview_changed(G.buts);
break;
case B_INFODELSCE:
break;
case B_INFODELSCE:
if(G.scene->id.prev) sce= G.scene->id.prev;
else if(G.scene->id.next) sce= G.scene->id.next;
else return;
if(okee("Delete current scene")) {
if(G.scene->id.prev) sce= G.scene->id.prev;
else if(G.scene->id.next) sce= G.scene->id.next;
else return;
if(okee("Delete current scene")) {
/* check all sets */
sce1= G.main->scene.first;
while(sce1) {
if(sce1->set == G.scene) sce1->set= 0;
sce1= sce1->id.next;
}
/* check all sets */
sce1= G.main->scene.first;
while(sce1) {
if(sce1->set == G.scene) sce1->set= 0;
sce1= sce1->id.next;
}
/* check all sequences */
clear_scene_in_allseqs(G.scene);
/* check all sequences */
clear_scene_in_allseqs(G.scene);
/* al screens */
sc= G.main->screen.first;
while(sc) {
if(sc->scene == G.scene) sc->scene= sce;
sc= sc->id.next;
}
free_libblock(&G.main->scene, G.scene);
set_scene(sce);
}
/* al screens */
sc= G.main->screen.first;
while(sc) {
if(sc->scene == G.scene) sc->scene= sce;
sc= sc->id.next;
}
free_libblock(&G.main->scene, G.scene);
set_scene(sce);
}
break;
case B_FILEMENU:
tbox_setmain(9);
toolbox();
break;
}
break;
case B_FILEMENU:
tbox_setmain(9);
toolbox();
break;
}
}
static void check_packAll()
{
// first check for dirty images
Image *ima;
// first check for dirty images
Image *ima;
ima = G.main->image.first;
while (ima) {
if (ima->ibuf && (ima->ibuf->userflags &= IB_BITMAPDIRTY)) {
break;
}
ima= ima->id.next;
}
ima = G.main->image.first;
while (ima) {
if (ima->ibuf && (ima->ibuf->userflags &= IB_BITMAPDIRTY)) {
break;
}
ima= ima->id.next;
}
if (ima == 0 || okee("Some images are painted on. These changes will be lost. Continue ?")) {
packAll();
G.fileflags |= G_AUTOPACK;
}
if (ima == 0 || okee("Some images are painted on. These changes will be lost. Continue ?")) {
packAll();
G.fileflags |= G_AUTOPACK;
}
}
int write_runtime(char *str, char *exename)
{
char *freestr= NULL;
char *ext = 0;
char *freestr= NULL;
char *ext = 0;
#ifdef _WIN32
ext = ".exe";
ext = ".exe";
#endif
#ifdef __APPLE__
ext = ".app";
ext = ".app";
#endif
if (ext && (!BLI_testextensie(str, ext))) {
freestr= MEM_mallocN(strlen(str) + strlen(ext) + 1, "write_runtime_check");
strcpy(freestr, str);
strcat(freestr, ext);
str= freestr;
}
if (ext && (!BLI_testextensie(str, ext))) {
freestr= MEM_mallocN(strlen(str) + strlen(ext) + 1, "write_runtime_check");
strcpy(freestr, str);
strcat(freestr, ext);
str= freestr;
}
if (!BLI_exists(str) || saveover(str))
BLO_write_runtime(str, exename);
if (!BLI_exists(str) || saveover(str))
BLO_write_runtime(str, exename);
if (freestr)
MEM_freeN(freestr);
if (freestr)
MEM_freeN(freestr);
return 0;
return 0;
}
static void write_runtime_check_dynamic(char *str)
{
write_runtime(str, "blenderdynplayer.exe");
write_runtime(str, "blenderdynplayer.exe");
}
static void write_runtime_check(char *str)
{
char player[128];
char player[128];
strcpy(player, "blenderplayer");
strcpy(player, "blenderplayer");
#ifdef _WIN32
strcat(player, ".exe");
strcat(player, ".exe");
#endif
#ifdef __APPLE__
strcat(player, ".app");
strcat(player, ".app");
#endif
write_runtime(str, player);
write_runtime(str, player);
}
/* end keyed functions */
@@ -585,7 +585,7 @@ static uiBlock *info_file_optionsmenu(void *arg_unused)
block= uiNewBlock(&curarea->uiblocks, "runtime_options", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_info_file_optionsmenu, NULL);
uiBlockSetXOfs(block,-40); // offset to parent button
uiBlockSetXOfs(block,-40); // offset to parent button
uiBlockSetCol(block, MENUCOL);
/* flags are case-values */
@@ -624,7 +624,7 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused)
uiBlockSetEmboss(block, UI_EMBOSSW);
uiDefBut(block, LABEL, 0, "Size options:", xco, yco-=20, 114, 19, 0, 0.0, 0.0, 0, 0, "");
uiDefButS(block, NUM, 0, "X:", xco+19, yco-=20, 95, 19, &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change.");
uiDefButS(block, NUM, 0, "X:", xco+19, yco-=20, 95, 19, &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change.");
uiDefButS(block, NUM, 0, "Y:", xco+19, yco-=20, 95, 19, &G.scene->r.yplay, 10.0, 2000.0, 0, 0, "Displays current Y screen/window resolution. Click to change.");
uiDefBut(block, SEPR, 0, "", xco, yco-=4, 114, 4, NULL, 0.0, 0.0, 0, 0, "");
@@ -639,10 +639,10 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused)
/* stereo settings */
/* can't use any definition from the game engine here so hardcode it. Change it here when it changes there!
* RAS_IRasterizer has definitions:
* RAS_STEREO_NOSTEREO 1
* RAS_STEREO_NOSTEREO 1
* RAS_STEREO_QUADBUFFERED 2
* RAS_STEREO_ABOVEBELOW 3
* RAS_STEREO_INTERLACED 4 future
* RAS_STEREO_ABOVEBELOW 3
* RAS_STEREO_INTERLACED 4 future
*/
uiDefBut(block, LABEL, 0, "Stereo options", xco, yco-=20, 114, 19, 0, 0.0, 0.0, 0, 0, "");
uiDefButS(block, ROW, 0, "no stereo", xco+19, yco-=20, 95, 19, &(G.scene->r.stereomode), 6.0, 1.0, 0, 0, "Disables stereo");
@@ -927,7 +927,7 @@ static void do_info_add_meshmenu(void *arg, int event)
static uiBlock *info_add_meshmenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
@@ -943,7 +943,7 @@ static uiBlock *info_add_meshmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cylinder|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tube|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cone|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grid|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 8, "");
uiBlockSetDirection(block, UI_RIGHT);
@@ -984,7 +984,7 @@ static void do_info_add_curvemenu(void *arg, int event)
static uiBlock *info_add_curvemenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
@@ -1041,7 +1041,7 @@ static void do_info_add_surfacemenu(void *arg, int event)
static uiBlock *info_add_surfacemenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
@@ -1094,7 +1094,7 @@ static void do_info_add_metamenu(void *arg, int event)
static uiBlock *info_add_metamenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short xco= 0;
@@ -1164,7 +1164,7 @@ static void do_info_addmenu(void *arg, int event)
static uiBlock *info_addmenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
@@ -1211,7 +1211,7 @@ static void do_info_gamemenu(void *arg, int event)
static uiBlock *info_gamemenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
short menuwidth=120;
@@ -1228,7 +1228,7 @@ static uiBlock *info_gamemenu(void *arg_unused)
if(G.fileflags & (1 << G_FILE_ENABLE_ALL_FRAMES_BIT)) {
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, "");
} else {
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, "");
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, "");
}
if(G.fileflags & (1 << G_FILE_SHOW_FRAMERATE_BIT)) {
@@ -1278,23 +1278,23 @@ static void do_info_timelinemenu(void *arg, int event)
/* Show and select Keyframes */
if (!ob) error("Select an object before showing and selecting its keyframes");
else select_select_keys();
break;
case 3:
break;
case 3:
/* select next keyframe */
if (!ob) error("Select an object before selecting its next keyframe");
else nextkey_obipo(1);
break;
case 4:
break;
case 4:
/* select previous keyframe */
if (!ob) error("Select an object before selecting its previous keyframe");
else nextkey_obipo(-1);
break;
case 5:
case 5:
/* next keyframe */
if (!ob) error("Select an object before going to its next keyframe");
else movekey_obipo(1);
break;
case 6:
break;
case 6:
/* previous keyframe */
if (!ob) error("Select an object before going to its previous keyframe");
else movekey_obipo(-1);
@@ -1304,7 +1304,7 @@ static void do_info_timelinemenu(void *arg, int event)
CFRA++;
update_for_newframe();
break;
case 8:
case 8:
/* previous frame */
CFRA--;
if(CFRA<1) CFRA=1;
@@ -1337,7 +1337,7 @@ static void do_info_timelinemenu(void *arg, int event)
static uiBlock *info_timelinemenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
short menuwidth=120;
@@ -1408,13 +1408,13 @@ static void do_info_rendermenu(void *arg, int event)
if(select_area(SPACE_VIEW3D)) {
BIF_do_ogl_render(curarea->spacedata.first, 0 );
}
break;
case 3:
break;
case 3:
if(select_area(SPACE_VIEW3D)) {
BIF_do_ogl_render(curarea->spacedata.first, 1 );
}
break;
case 4:
break;
case 4:
BIF_toggle_render_display();
break;
case 5:
@@ -1451,7 +1451,7 @@ static void do_info_rendermenu(void *arg, int event)
break;
case 7:
case 7:
extern_set_butspace(F10KEY);
break;
}
@@ -1460,7 +1460,7 @@ static void do_info_rendermenu(void *arg, int event)
static uiBlock *info_rendermenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
short menuwidth=120;
@@ -1502,10 +1502,10 @@ static void do_info_help_websitesmenu(void *arg, int event)
{
/* these are no defines, easier this way, the codes are in the function below */
switch(event) {
case 0: /* */
case 0: /* */
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -1567,7 +1567,7 @@ static void do_info_helpmenu(void *arg, int event)
static uiBlock *info_helpmenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
short menuwidth=120;
@@ -1618,12 +1618,12 @@ static void info_text(int x, int y)
if(G.obedit) {
sprintf(infostr,"Ve:%d-%d Fa:%d-%d Mem:%.2fM ",
sprintf(infostr,"Ve:%d-%d Fa:%d-%d Mem:%.2fM ",
G.totvertsel, G.totvert, G.totfacesel, G.totface,
(mem_in_use>>10)/1024.0);
}
else {
sprintf(infostr,"Ve:%d Fa:%d Ob:%d-%d La:%d Mem:%.2fM ",
sprintf(infostr,"Ve:%d Fa:%d Ob:%d-%d La:%d Mem:%.2fM ",
G.totvert, G.totface, G.totobj, G.totobjsel, G.totlamp, (mem_in_use>>10)/1024.0);
}
ob= OBACT;
@@ -1631,7 +1631,7 @@ static void info_text(int x, int y)
strcat(infostr, ob->id.name+2);
}
if (g_progress_bar) {
if (g_progress_bar) {
hsize = 4 + (138.0 * g_done);
fac1 = 0.5 * g_done; // do some rainbow colours on progress
fac2 = 1.0;
@@ -1653,7 +1653,7 @@ static void info_text(int x, int y)
swatch_color= hsv_to_cpack(fac1, fac2, fac3);
cpack( swatch_color );
glRecti(x-24, y-4, x-24+hsize, y+13);
glRecti(x-24, y-4, x-24+hsize, y+13);
glColor3ub(0, 0, 0);
@@ -1661,7 +1661,7 @@ static void info_text(int x, int y)
BIF_DrawString(G.font, headerstr, (U.transopts & TR_MENUS), 0);
glRasterPos2i(x+120, y);
glRasterPos2i(x+120, y);
BIF_DrawString(G.font, infostr, (U.transopts & TR_MENUS), 0);
}
@@ -1680,11 +1680,11 @@ void info_buttons(void)
if(U.uiflag & FLIPINFOMENU) {
uiDefIconButS(block, TOG|BIT|6, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
xco,2,XIC,YIC-2,
&(U.uiflag), 0, 0, 0, 0, "Enables display of pulldown menus");/* dir */
&(U.uiflag), 0, 0, 0, 0, "Enables display of pulldown menus");/* dir */
} else {
uiDefIconButS(block, TOG|BIT|6, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
xco,2,XIC,YIC-2,
&(U.uiflag), 0, 0, 0, 0, "Hides pulldown menus");/* dir */
&(U.uiflag), 0, 0, 0, 0, "Hides pulldown menus");/* dir */
}
xco+=XIC;
@@ -1770,11 +1770,11 @@ void info_buttons(void)
if(U.uiflag & FLIPFULLSCREEN) {
uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_WINDOW,
(short)(curarea->winx-(XIC*2)-2), 0,XIC,YIC,
0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
} else {
uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_FULLSCREEN,
(short)(curarea->winx-(XIC*2)-2), 0,XIC,YIC,
0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
}
#endif

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -84,119 +84,119 @@ static int viewmovetemp = 0;
void do_ipo_buttons(short event)
{
EditIpo *ei;
View2D *v2d;
rcti rect;
float xmin, ymin, dx, dy;
int a, val, first;
short mval[2];
EditIpo *ei;
View2D *v2d;
rcti rect;
float xmin, ymin, dx, dy;
int a, val, first;
short mval[2];
if(curarea->win==0) return;
if(curarea->win==0) return;
switch(event) {
case B_IPOHOME:
switch(event) {
case B_IPOHOME:
/* boundbox */
/* boundbox */
v2d= &(G.sipo->v2d);
first= 1;
v2d= &(G.sipo->v2d);
first= 1;
ei= G.sipo->editipo;
if(ei==0) return;
for(a=0; a<G.sipo->totipo; a++, ei++) {
if ISPOIN(ei, flag & IPO_VISIBLE, icu) {
ei= G.sipo->editipo;
if(ei==0) return;
for(a=0; a<G.sipo->totipo; a++, ei++) {
if ISPOIN(ei, flag & IPO_VISIBLE, icu) {
boundbox_ipocurve(ei->icu);
boundbox_ipocurve(ei->icu);
if(first) {
v2d->tot= ei->icu->totrct;
first= 0;
}
else BLI_union_rctf(&(v2d->tot), &(ei->icu->totrct));
}
}
if(first) {
v2d->tot= ei->icu->totrct;
first= 0;
}
else BLI_union_rctf(&(v2d->tot), &(ei->icu->totrct));
}
}
/* speciale home */
if(G.qual & LR_SHIFTKEY) {
v2d->tot.xmin= SFRA;
v2d->tot.xmax= EFRA;
}
/* speciale home */
if(G.qual & LR_SHIFTKEY) {
v2d->tot.xmin= SFRA;
v2d->tot.xmax= EFRA;
}
/* zoom out a bit */
dx= 0.10*(v2d->tot.xmax-v2d->tot.xmin);
dy= 0.10*(v2d->tot.ymax-v2d->tot.ymin);
/* zoom out a bit */
dx= 0.10*(v2d->tot.xmax-v2d->tot.xmin);
dy= 0.10*(v2d->tot.ymax-v2d->tot.ymin);
if(dx<v2d->min[0]) dx= v2d->min[0];
if(dy<v2d->min[1]) dy= v2d->min[1];
if(dx<v2d->min[0]) dx= v2d->min[0];
if(dy<v2d->min[1]) dy= v2d->min[1];
v2d->cur.xmin= v2d->tot.xmin- dx;
v2d->cur.xmax= v2d->tot.xmax+ dx;
v2d->cur.ymin= v2d->tot.ymin- dy;
v2d->cur.ymax= v2d->tot.ymax+ dy;
v2d->cur.xmin= v2d->tot.xmin- dx;
v2d->cur.xmax= v2d->tot.xmax+ dx;
v2d->cur.ymin= v2d->tot.ymin- dy;
v2d->cur.ymax= v2d->tot.ymax+ dy;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
case B_IPOBORDER:
val= get_border(&rect, 2);
if(val) {
mval[0]= rect.xmin;
mval[1]= rect.ymin;
areamouseco_to_ipoco(G.v2d, mval, &xmin, &ymin);
mval[0]= rect.xmax;
mval[1]= rect.ymax;
areamouseco_to_ipoco(G.v2d, mval, &(G.v2d->cur.xmax), &(G.v2d->cur.ymax));
G.v2d->cur.xmin= xmin;
G.v2d->cur.ymin= ymin;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
case B_IPOBORDER:
val= get_border(&rect, 2);
if(val) {
mval[0]= rect.xmin;
mval[1]= rect.ymin;
areamouseco_to_ipoco(G.v2d, mval, &xmin, &ymin);
mval[0]= rect.xmax;
mval[1]= rect.ymax;
areamouseco_to_ipoco(G.v2d, mval, &(G.v2d->cur.xmax), &(G.v2d->cur.ymax));
G.v2d->cur.xmin= xmin;
G.v2d->cur.ymin= ymin;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
}
break;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
}
break;
case B_IPOPIN:
allqueue (REDRAWIPO, 0);
break;
case B_IPOPIN:
allqueue (REDRAWIPO, 0);
break;
case B_IPOCOPY:
copy_editipo();
break;
case B_IPOPASTE:
paste_editipo();
break;
case B_IPOCONT:
set_exprap_ipo(IPO_HORIZ);
break;
case B_IPOEXTRAP:
set_exprap_ipo(IPO_DIR);
break;
case B_IPOCYCLIC:
set_exprap_ipo(IPO_CYCL);
break;
case B_IPOCYCLICX:
set_exprap_ipo(IPO_CYCLX);
break;
case B_IPOMAIN:
make_editipo();
scrarea_queue_winredraw(curarea);
scrarea_queue_headredraw(curarea);
case B_IPOCOPY:
copy_editipo();
break;
case B_IPOPASTE:
paste_editipo();
break;
case B_IPOCONT:
set_exprap_ipo(IPO_HORIZ);
break;
case B_IPOEXTRAP:
set_exprap_ipo(IPO_DIR);
break;
case B_IPOCYCLIC:
set_exprap_ipo(IPO_CYCL);
break;
case B_IPOCYCLICX:
set_exprap_ipo(IPO_CYCLX);
break;
case B_IPOMAIN:
make_editipo();
scrarea_queue_winredraw(curarea);
scrarea_queue_headredraw(curarea);
break;
case B_IPOSHOWKEY:
/* reverse value because of winqread */
G.sipo->showkey= 1-G.sipo->showkey;
ipo_toggle_showkey();
scrarea_queue_headredraw(curarea);
scrarea_queue_winredraw(curarea);
allqueue(REDRAWVIEW3D, 0);
break;
case B_VIEW2DZOOM:
viewmovetemp= 0;
view2dzoom(event);
scrarea_queue_headredraw(curarea);
break;
break;
case B_IPOSHOWKEY:
/* reverse value because of winqread */
G.sipo->showkey= 1-G.sipo->showkey;
ipo_toggle_showkey();
scrarea_queue_headredraw(curarea);
scrarea_queue_winredraw(curarea);
allqueue(REDRAWVIEW3D, 0);
break;
case B_VIEW2DZOOM:
viewmovetemp= 0;
view2dzoom(event);
scrarea_queue_headredraw(curarea);
break;
}
}
}
void ipo_buttons(void)
@@ -234,14 +234,14 @@ void ipo_buttons(void)
if(ob && give_current_material(ob, ob->actcol)) {
uiDefIconButS(block, ROW, B_IPOMAIN, ICON_MATERIAL, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_MA, 0, 0, "Displays Material Ipos");
if(G.sipo->blocktype==ID_MA) {
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Material texture. Click to change.");
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Material texture. Click to change.");
xco-= 4;
}
}
if(G.scene->world) {
uiDefIconButS(block, ROW, B_IPOMAIN, ICON_WORLD, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_WO, 0, 0, "Display World Ipos");
if(G.sipo->blocktype==ID_WO) {
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active World texture. Click to change.");
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active World texture. Click to change.");
xco-= 4;
}
}
@@ -255,7 +255,7 @@ void ipo_buttons(void)
if(ob && ob->type==OB_LAMP) {
uiDefIconButS(block, ROW, B_IPOMAIN, ICON_LAMP, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_LA, 0, 0, "Display Lamp Ipos");
if(G.sipo->blocktype==ID_LA) {
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Lamp texture. Click to change.");
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Lamp texture. Click to change.");
xco-= 4;
}
}
@@ -301,8 +301,8 @@ void ipo_buttons(void)
/* EXTRAP */
uiDefIconBut(block, BUT, B_IPOCONT, ICON_CONSTANT, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to constant");
uiDefIconBut(block, BUT, B_IPOEXTRAP, ICON_LINEAR, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to extrapolation");
uiDefIconBut(block, BUT, B_IPOCYCLIC, ICON_CYCLIC, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to cyclic");
uiDefIconBut(block, BUT, B_IPOCYCLICX, ICON_CYCLICLINEAR, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to cyclic extrapolation");
uiDefIconBut(block, BUT, B_IPOCYCLIC, ICON_CYCLIC, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to cyclic");
uiDefIconBut(block, BUT, B_IPOCYCLICX, ICON_CYCLICLINEAR, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to cyclic extrapolation");
xco+= XIC/2;
uiClearButLock();

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -73,28 +73,28 @@
void do_nla_buttons(unsigned short event)
{
View2D *v2d;
View2D *v2d;
switch(event){
case B_NLAHOME:
// Find X extents
v2d= &(G.snla->v2d);
switch(event){
case B_NLAHOME:
// Find X extents
v2d= &(G.snla->v2d);
v2d->cur.xmin = G.scene->r.sfra;
v2d->cur.ymin=-SCROLLB;
v2d->cur.xmin = G.scene->r.sfra;
v2d->cur.ymin=-SCROLLB;
// if (!G.saction->action){
v2d->cur.xmax=G.scene->r.efra;
// }
// else
// {
// v2d->cur.xmax=calc_action_length(G.saction->action)+1;
// }
// if (!G.saction->action){
v2d->cur.xmax=G.scene->r.efra;
// }
// else
// {
// v2d->cur.xmax=calc_action_length(G.saction->action)+1;
// }
test_view2d(G.v2d, curarea->winx, curarea->winy);
addqueue (curarea->win, REDRAW, 1);
break;
}
test_view2d(G.v2d, curarea->winx, curarea->winy);
addqueue (curarea->win, REDRAW, 1);
break;
}
}
void nla_buttons(void)

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -74,30 +74,30 @@ static int viewmovetemp = 0;
void do_oops_buttons(short event)
{
float dx, dy;
float dx, dy;
if(curarea->win==0) return;
if(curarea->win==0) return;
switch(event) {
case B_OOPSHOME:
boundbox_oops();
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;
switch(event) {
case B_OOPSHOME:
boundbox_oops();
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_NEWOOPS:
scrarea_queue_winredraw(curarea);
scrarea_queue_headredraw(curarea);
G.soops->lockpoin= 0;
break;
}
case B_NEWOOPS:
scrarea_queue_winredraw(curarea);
scrarea_queue_headredraw(curarea);
G.soops->lockpoin= 0;
break;
}
}
@@ -156,7 +156,7 @@ void oops_buttons(void)
else strcpy(naam, oops->id->name);
cpack(0x0);
glRasterPos2i(xco+=XIC+10, 5);
glRasterPos2i(xco+=XIC+10, 5);
BMF_DrawString(uiBlockGetCurFont(block), naam);
}

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -75,22 +75,22 @@ static int viewmovetemp = 0;
void do_seq_buttons(short event)
{
Editing *ed;
Editing *ed;
ed= G.scene->ed;
if(ed==0) return;
ed= G.scene->ed;
if(ed==0) return;
switch(event) {
case B_SEQHOME:
G.v2d->cur= G.v2d->tot;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
case B_SEQCLEAR:
free_imbuf_seq();
allqueue(REDRAWSEQ, 1);
break;
}
switch(event) {
case B_SEQHOME:
G.v2d->cur= G.v2d->tot;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
case B_SEQCLEAR:
free_imbuf_seq();
allqueue(REDRAWSEQ, 1);
break;
}
}
void seq_buttons()

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -77,93 +77,93 @@
void do_sound_buttons(unsigned short event)
{
ID *id, *idtest;
int nr;
char name[256];
ID *id, *idtest;
int nr;
char name[256];
switch(event) {
switch(event) {
case B_SOUNDBROWSE:
if(G.ssound->sndnr== -2) {
activate_databrowse((ID *)G.ssound->sound, ID_SO, 0,
B_SOUNDBROWSE, &G.ssound->sndnr, do_sound_buttons);
return;
}
if (G.ssound->sndnr < 0) break;
if (G.ssound->sndnr == 32766) {
if (G.ssound && G.ssound->sound) strcpy(name, G.ssound->sound->name);
else strcpy(name, U.sounddir);
activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name,
load_space_sound);
} else {
nr= 1;
id= (ID *)G.ssound->sound;
case B_SOUNDBROWSE:
if(G.ssound->sndnr== -2) {
activate_databrowse((ID *)G.ssound->sound, ID_SO, 0,
B_SOUNDBROWSE, &G.ssound->sndnr, do_sound_buttons);
return;
}
if (G.ssound->sndnr < 0) break;
if (G.ssound->sndnr == 32766) {
if (G.ssound && G.ssound->sound) strcpy(name, G.ssound->sound->name);
else strcpy(name, U.sounddir);
activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name,
load_space_sound);
} else {
nr= 1;
id= (ID *)G.ssound->sound;
idtest= G.main->sound.first;
while(idtest) {
if(nr==G.ssound->sndnr) {
break;
}
nr++;
idtest= idtest->next;
}
idtest= G.main->sound.first;
while(idtest) {
if(nr==G.ssound->sndnr) {
break;
}
nr++;
idtest= idtest->next;
}
if(idtest==0) { /* no new */
return;
}
if(idtest==0) { /* no new */
return;
}
if(idtest!=id) {
G.ssound->sound= (bSound *)idtest;
if(idtest->us==0) idtest->us= 1;
allqueue(REDRAWSOUND, 0);
}
}
if(idtest!=id) {
G.ssound->sound= (bSound *)idtest;
if(idtest->us==0) idtest->us= 1;
allqueue(REDRAWSOUND, 0);
}
}
break;
case B_SOUNDBROWSE2:
id = (ID *)G.buts->lockpoin;
if(G.buts->texnr == -2) {
activate_databrowse(id, ID_SO, 0, B_SOUNDBROWSE2,
&G.buts->texnr, do_sound_buttons);
return;
}
if (G.buts->texnr < 0) break;
if (G.buts->texnr == 32766) {
if (id) strcpy(name, ((bSound *)id)->name);
else strcpy(name, U.sounddir);
activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE",
name, load_sound_buttons);
} else {
nr= 1;
break;
case B_SOUNDBROWSE2:
id = (ID *)G.buts->lockpoin;
if(G.buts->texnr == -2) {
activate_databrowse(id, ID_SO, 0, B_SOUNDBROWSE2,
&G.buts->texnr, do_sound_buttons);
return;
}
if (G.buts->texnr < 0) break;
if (G.buts->texnr == 32766) {
if (id) strcpy(name, ((bSound *)id)->name);
else strcpy(name, U.sounddir);
activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE",
name, load_sound_buttons);
} else {
nr= 1;
idtest= G.main->sound.first;
while (idtest) {
if(nr == G.buts->texnr) {
break;
}
nr++;
idtest = idtest->next;
}
idtest= G.main->sound.first;
while (idtest) {
if(nr == G.buts->texnr) {
break;
}
nr++;
idtest = idtest->next;
}
if (idtest == 0) { /* geen new */
return;
}
if (idtest == 0) { /* geen new */
return;
}
if (idtest != id) {
G.buts->lockpoin = (bSound *)idtest;
if(idtest->us==0) idtest->us= 1;
//allqueue(REDRAWBUTSSOUND, 0);
BIF_preview_changed(G.buts);
}
}
break;
if (idtest != id) {
G.buts->lockpoin = (bSound *)idtest;
if(idtest->us==0) idtest->us= 1;
//allqueue(REDRAWBUTSSOUND, 0);
BIF_preview_changed(G.buts);
}
}
break;
case B_SOUNDHOME:
G.v2d->cur= G.v2d->tot;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
}
case B_SOUNDHOME:
G.v2d->cur= G.v2d->tot;
test_view2d(G.v2d, curarea->winx, curarea->winy);
scrarea_queue_winredraw(curarea);
break;
}
}
void sound_buttons(void)
@@ -226,35 +226,35 @@ void sound_buttons(void)
void load_space_sound(char *str)
{
bSound *sound;
bSound *sound;
sound= sound_new_sound(str);
if (sound) {
if (G.ssound) {
G.ssound->sound= sound;
}
} else {
error("Not a valid sample: %s", str);
}
sound= sound_new_sound(str);
if (sound) {
if (G.ssound) {
G.ssound->sound= sound;
}
} else {
error("Not a valid sample: %s", str);
}
allqueue(REDRAWSOUND, 0);
allqueue(REDRAWBUTSLOGIC, 0);
allqueue(REDRAWSOUND, 0);
allqueue(REDRAWBUTSLOGIC, 0);
}
void load_sound_buttons(char *str)
{
bSound *sound;
bSound *sound;
sound= sound_new_sound(str);
if (sound) {
if (curarea && curarea->spacetype==SPACE_BUTS) {
// if (G.buts->mainb == BUTS_SOUND) {
// G.buts->lockpoin = sound;
// }
}
} else {
error("Not a valid sample: %s", str);
}
sound= sound_new_sound(str);
if (sound) {
if (curarea && curarea->spacetype==SPACE_BUTS) {
// if (G.buts->mainb == BUTS_SOUND) {
// G.buts->lockpoin = sound;
// }
}
} else {
error("Not a valid sample: %s", str);
}
//allqueue(REDRAWBUTSSOUND, 0);
//allqueue(REDRAWBUTSSOUND, 0);
}

View File

@@ -23,7 +23,7 @@
*
* 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.
* 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.
@@ -78,109 +78,109 @@
void do_text_buttons(unsigned short event)
{
SpaceText *st= curarea->spacedata.first;
ID *id, *idtest;
int nr= 1;
Text *text;
SpaceText *st= curarea->spacedata.first;
ID *id, *idtest;
int nr= 1;
Text *text;
if (!st) return;
if (st->spacetype != SPACE_TEXT) return;
if (!st) return;
if (st->spacetype != SPACE_TEXT) return;
switch (event) {
case B_TEXTBROWSE:
if (st->menunr==-2) {
activate_databrowse((ID *)st->text, ID_TXT, 0, B_TEXTBROWSE,
&st->menunr, do_text_buttons);
break;
}
if(st->menunr < 0) break;
switch (event) {
case B_TEXTBROWSE:
if (st->menunr==-2) {
activate_databrowse((ID *)st->text, ID_TXT, 0, B_TEXTBROWSE,
&st->menunr, do_text_buttons);
break;
}
if(st->menunr < 0) break;
text= st->text;
text= st->text;
nr= 1;
id= (ID *)text;
nr= 1;
id= (ID *)text;
if (st->menunr==32767) {
st->text= (Text *)add_empty_text();
if (st->menunr==32767) {
st->text= (Text *)add_empty_text();
st->top= 0;
st->top= 0;
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
}
else if (st->menunr==32766) {
activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE", G.sce, add_text_fs);
return;
}
else {
idtest= G.main->text.first;
while(idtest) {
if(nr==st->menunr) {
break;
}
nr++;
idtest= idtest->next;
}
if(idtest==0) { /* new text */
activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE",
G.sce, add_text_fs);
return;
}
if(idtest!=id) {
st->text= (Text *)idtest;
st->top= 0;
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
}
else if (st->menunr==32766) {
activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE", G.sce, add_text_fs);
return;
}
else {
idtest= G.main->text.first;
while(idtest) {
if(nr==st->menunr) {
break;
}
nr++;
idtest= idtest->next;
}
if(idtest==0) { /* new text */
activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE",
G.sce, add_text_fs);
return;
}
if(idtest!=id) {
st->text= (Text *)idtest;
st->top= 0;
pop_space_text(st);
pop_space_text(st);
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
}
}
break;
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
}
}
break;
case B_TEXTDELETE:
case B_TEXTDELETE:
text= st->text;
if (!text) return;
text= st->text;
if (!text) return;
BPY_clear_bad_scriptlinks(text);
free_text_controllers(text);
BPY_clear_bad_scriptlinks(text);
free_text_controllers(text);
unlink_text(text);
free_libblock(&G.main->text, text);
unlink_text(text);
free_libblock(&G.main->text, text);
break;
break;
/*
case B_TEXTSTORE:
st->text->flags ^= TXT_ISEXT;
case B_TEXTSTORE:
st->text->flags ^= TXT_ISEXT;
allqueue(REDRAWHEADERS, 0);
break;
allqueue(REDRAWHEADERS, 0);
break;
*/
case B_TEXTLINENUM:
if(st->showlinenrs)
st->showlinenrs = 0;
else
st->showlinenrs = 1;
case B_TEXTLINENUM:
if(st->showlinenrs)
st->showlinenrs = 0;
else
st->showlinenrs = 1;
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
break;
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
break;
case B_TEXTFONT:
switch(st->font_id) {
case 0:
st->lheight= 12; break;
case 1:
st->lheight= 15; break;
}
case B_TEXTFONT:
switch(st->font_id) {
case 0:
st->lheight= 12; break;
case 1:
st->lheight= 15; break;
}
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
break;
}
break;
}
}
void text_buttons(void)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@
*
* 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.
* 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.
@@ -193,7 +193,7 @@ static void check_packAll(void);
static void unique_bone_name(Bone *bone, bArmature *arm);
static int bonename_exists(Bone *orig, char *name, ListBase *list);
static void test_idbutton_cb(void *namev, void *arg2_unused)
static void test_idbutton_cb(void *namev, void *arg2_unused)
{
char *name= namev;
test_idbutton(name+2);
@@ -206,19 +206,19 @@ static void test_idbutton_cb(void *namev, void *arg2_unused)
#include "SYS_System.h"
static int std_libbuttons(uiBlock *block,
int xco, int pin, short *pinpoin,
int browse, ID *id, ID *parid,
short *menupoin, int users,
int lib, int del, int autobut, int keepbut);
int xco, int pin, short *pinpoin,
int browse, ID *id, ID *parid,
short *menupoin, int users,
int lib, int del, int autobut, int keepbut);
extern char versionstr[]; /* from blender.c */
/* extern void add_text_fs(char *file); *//* from text.c, BIF_text.h*/
/* extern void add_text_fs(char *file); *//* from text.c, BIF_text.h*/
/* WATCH IT: always give all headerbuttons for same window the same name
* event B_REDR is a standard redraw
*
*/
* event B_REDR is a standard redraw
*
*/
/* View3d->modeselect
@@ -241,7 +241,7 @@ extern char versionstr[]; /* from blender.c */
static int viewmovetemp=0;
/* extern void info_buttons(); in BSE_headerbuttons.c */
/* extern void info_buttons(); in BSE_headerbuttons.c */
extern char videosc_dir[]; /* exotic.c */
@@ -561,7 +561,7 @@ static void show_splash(void)
extern char * build_type;
string = &buffer[0];
sprintf(string,"Built on %s %s Version %s %s", build_date, build_time, build_platform, build_type);
sprintf(string,"Built on %s %s Version %s %s", build_date, build_time, build_platform, build_type);
#endif
splash((void *)datatoc_splash_jpg, datatoc_splash_jpg_size, string);
@@ -790,7 +790,7 @@ void do_global_buttons(unsigned short event)
idtest= idtest->next;
}
if(idtest==0) { /* new mat */
if(id) idtest= (ID *)copy_material((Material *)id);
if(id) idtest= (ID *)copy_material((Material *)id);
else {
idtest= (ID *)add_material("Material");
}
@@ -912,7 +912,7 @@ void do_global_buttons(unsigned short event)
idtest= idtest->next;
}
if(idtest==0) { /* new tex */
if(id) idtest= (ID *)copy_texture((Tex *)id);
if(id) idtest= (ID *)copy_texture((Tex *)id);
else idtest= (ID *)add_texture("Tex");
idtest->us--;
}
@@ -1252,7 +1252,7 @@ void do_global_buttons(unsigned short event)
idtest= idtest->next;
}
if(idtest==0) { /* new tex */
if(id) idtest= (ID *)copy_texture((Tex *)id);
if(id) idtest= (ID *)copy_texture((Tex *)id);
else idtest= (ID *)add_texture("Tex");
idtest->us--;
}
@@ -1347,7 +1347,7 @@ void do_global_buttons(unsigned short event)
idtest= idtest->next;
}
if(idtest==0) { /* new tex */
if(id) idtest= (ID *)copy_texture((Tex *)id);
if(id) idtest= (ID *)copy_texture((Tex *)id);
else idtest= (ID *)add_texture("Tex");
idtest->us--;
}
@@ -1413,7 +1413,7 @@ void do_global_buttons(unsigned short event)
SYS_WriteCommandLineInt(SYS_GetSystem(), "noaudio", (U.gameflags & USERDEF_DISABLE_SOUND));
break;
case B_SHOWSPLASH:
show_splash();
show_splash();
break;
case B_MIPMAPCHANGED:
set_mipmap(!(U.gameflags & USERDEF_DISABLE_SOUND));
@@ -1422,7 +1422,7 @@ void do_global_buttons(unsigned short event)
case B_NEWSPACE:
newspace(curarea, curarea->butspacetype);
break;
case B_LOADTEMP: /* is button from space.c */
case B_LOADTEMP: /* is button from space.c */
BIF_read_autosavefile();
break;
@@ -1430,11 +1430,11 @@ void do_global_buttons(unsigned short event)
allqueue(REDRAWINFO, 0);
break;
case B_DRAWINFO: /* is button from space.c *info* */
case B_DRAWINFO: /* is button from space.c *info* */
allqueue(REDRAWVIEW3D, 0);
break;
case B_FLIPINFOMENU: /* is button from space.c *info* */
case B_FLIPINFOMENU: /* is button from space.c *info* */
scrarea_queue_headredraw(curarea);
break;
@@ -1450,7 +1450,7 @@ void do_global_buttons(unsigned short event)
/* Fileselect windows for user preferences file paths */
case B_FONTDIRFILESEL: /* is button from space.c *info* */
case B_FONTDIRFILESEL: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1459,7 +1459,7 @@ void do_global_buttons(unsigned short event)
activate_fileselect(FILE_SPECIAL, "SELECT FONT PATH", U.fontdir, filesel_u_fontdir);
break;
case B_TEXTUDIRFILESEL: /* is button from space.c *info* */
case B_TEXTUDIRFILESEL: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1468,7 +1468,7 @@ void do_global_buttons(unsigned short event)
activate_fileselect(FILE_SPECIAL, "SELECT TEXTURE PATH", U.textudir, filesel_u_textudir);
break;
case B_PLUGTEXDIRFILESEL: /* is button form space.c *info* */
case B_PLUGTEXDIRFILESEL: /* is button form space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1477,7 +1477,7 @@ void do_global_buttons(unsigned short event)
activate_fileselect(FILE_SPECIAL, "SELECT TEX PLUGIN PATH", U.plugtexdir, filesel_u_plugtexdir);
break;
case B_PLUGSEQDIRFILESEL: /* is button from space.c *info* */
case B_PLUGSEQDIRFILESEL: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1486,7 +1486,7 @@ void do_global_buttons(unsigned short event)
activate_fileselect(FILE_SPECIAL, "SELECT SEQ PLUGIN PATH", U.plugseqdir, filesel_u_plugseqdir);
break;
case B_RENDERDIRFILESEL: /* is button from space.c *info* */
case B_RENDERDIRFILESEL: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1495,7 +1495,7 @@ void do_global_buttons(unsigned short event)
activate_fileselect(FILE_SPECIAL, "SELECT RENDER PATH", U.renderdir, filesel_u_renderdir);
break;
case B_PYTHONDIRFILESEL: /* is button from space.c *info* */
case B_PYTHONDIRFILESEL: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1504,7 +1504,7 @@ void do_global_buttons(unsigned short event)
activate_fileselect(FILE_SPECIAL, "SELECT SCRIPT PATH", U.pythondir, filesel_u_pythondir);
break;
case B_SOUNDDIRFILESEL: /* is button from space.c *info* */
case B_SOUNDDIRFILESEL: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1513,7 +1513,7 @@ void do_global_buttons(unsigned short event)
activate_fileselect(FILE_SPECIAL, "SELECT SOUND PATH", U.sounddir, filesel_u_sounddir);
break;
case B_TEMPDIRFILESEL: /* is button from space.c *info* */
case B_TEMPDIRFILESEL: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1526,7 +1526,7 @@ void do_global_buttons(unsigned short event)
#ifdef INTERNATIONAL
case B_LOADUIFONT: /* is button from space.c *info* */
case B_LOADUIFONT: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
@@ -1535,21 +1535,21 @@ void do_global_buttons(unsigned short event)
activate_fileselect(FILE_SPECIAL, "LOAD UI FONT", buf, set_interface_font);
break;
case B_SETLANGUAGE: /* is button from space.c *info* */
case B_SETLANGUAGE: /* is button from space.c *info* */
lang_setlanguage();
allqueue(REDRAWALL, 0);
break;
case B_SETFONTSIZE: /* is button from space.c *info* */
case B_SETFONTSIZE: /* is button from space.c *info* */
FTF_SetSize(U.fontsize);
allqueue(REDRAWALL, 0);
break;
case B_SETTRANSBUTS: /* is button from space.c *info* */
case B_SETTRANSBUTS: /* is button from space.c *info* */
allqueue(REDRAWALL, 0);
break;
case B_DOLANGUIFONT: /* is button from space.c *info* */
case B_DOLANGUIFONT: /* is button from space.c *info* */
if(U.transopts & TR_ALL)
start_interface_font();
else
@@ -2113,7 +2113,7 @@ Scene *copy_scene(Scene *sce, int level)
G.scene= scen;
single_object_users(0);
/* camera */
/* camera */
ID_NEW(G.scene->camera);
/* level 2 */
@@ -2296,7 +2296,7 @@ void do_info_buttons(unsigned short event)
}
/* strubi shamelessly abused the status line as a progress bar...
feel free to kill him after release */
feel free to kill him after release */
static int g_progress_bar = 0;
static char *g_progress_info = 0;
@@ -2377,7 +2377,7 @@ static void check_packAll()
break;
}
ima= ima->id.next;
}
}
if (ima == 0 || okee("Some images are painted on. These changes will be lost. Continue ?")) {
packAll();
@@ -2491,7 +2491,7 @@ static uiBlock *info_file_optionsmenu(void *arg_unused)
block= uiNewBlock(&curarea->uiblocks, "runtime_options", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_info_file_optionsmenu, NULL);
uiBlockSetXOfs(block,-40); // offset to parent button
uiBlockSetXOfs(block,-40); // offset to parent button
uiBlockSetCol(block, MENUCOL);
/* flags are case-values */
@@ -2530,7 +2530,7 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused)
uiBlockSetEmboss(block, UI_EMBOSSW);
uiDefBut(block, LABEL, 0, "Size options:", xco, yco-=20, 114, 19, 0, 0.0, 0.0, 0, 0, "");
uiDefButS(block, NUM, 0, "X:", xco+19, yco-=20, 95, 19, &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change.");
uiDefButS(block, NUM, 0, "X:", xco+19, yco-=20, 95, 19, &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change.");
uiDefButS(block, NUM, 0, "Y:", xco+19, yco-=20, 95, 19, &G.scene->r.yplay, 10.0, 2000.0, 0, 0, "Displays current Y screen/window resolution. Click to change.");
uiDefBut(block, SEPR, 0, "", xco, yco-=4, 114, 4, NULL, 0.0, 0.0, 0, 0, "");
@@ -2545,10 +2545,10 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused)
/* stereo settings */
/* can't use any definition from the game engine here so hardcode it. Change it here when it changes there!
* RAS_IRasterizer has definitions:
* RAS_STEREO_NOSTEREO 1
* RAS_STEREO_NOSTEREO 1
* RAS_STEREO_QUADBUFFERED 2
* RAS_STEREO_ABOVEBELOW 3
* RAS_STEREO_INTERLACED 4 future
* RAS_STEREO_ABOVEBELOW 3
* RAS_STEREO_INTERLACED 4 future
*/
uiDefBut(block, LABEL, 0, "Stereo options", xco, yco-=20, 114, 19, 0, 0.0, 0.0, 0, 0, "");
uiDefButS(block, ROW, 0, "no stereo", xco+19, yco-=20, 95, 19, &(G.scene->r.stereomode), 6.0, 1.0, 0, 0, "Disables stereo");
@@ -2836,7 +2836,7 @@ static void do_info_add_meshmenu(void *arg, int event)
static uiBlock *info_add_meshmenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
@@ -2852,7 +2852,7 @@ static uiBlock *info_add_meshmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cylinder|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tube|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cone|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grid|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 8, "");
uiBlockSetDirection(block, UI_RIGHT);
@@ -2893,7 +2893,7 @@ static void do_info_add_curvemenu(void *arg, int event)
static uiBlock *info_add_curvemenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
@@ -2950,7 +2950,7 @@ static void do_info_add_surfacemenu(void *arg, int event)
static uiBlock *info_add_surfacemenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
@@ -3003,7 +3003,7 @@ static void do_info_add_metamenu(void *arg, int event)
static uiBlock *info_add_metamenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short xco= 0;
@@ -3073,7 +3073,7 @@ static void do_info_addmenu(void *arg, int event)
static uiBlock *info_addmenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
@@ -3120,7 +3120,7 @@ static void do_info_gamemenu(void *arg, int event)
static uiBlock *info_gamemenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
short menuwidth=120;
@@ -3137,7 +3137,7 @@ static uiBlock *info_gamemenu(void *arg_unused)
if(G.fileflags & (1 << G_FILE_ENABLE_ALL_FRAMES_BIT)) {
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, "");
} else {
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, "");
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, "");
}
if(G.fileflags & (1 << G_FILE_SHOW_FRAMERATE_BIT)) {
@@ -3187,23 +3187,23 @@ static void do_info_timelinemenu(void *arg, int event)
/* Show and select Keyframes */
if (!ob) error("Select an object before showing and selecting its keyframes");
else select_select_keys();
break;
case 3:
break;
case 3:
/* select next keyframe */
if (!ob) error("Select an object before selecting its next keyframe");
else nextkey_obipo(1);
break;
case 4:
break;
case 4:
/* select previous keyframe */
if (!ob) error("Select an object before selecting its previous keyframe");
else nextkey_obipo(-1);
break;
case 5:
case 5:
/* next keyframe */
if (!ob) error("Select an object before going to its next keyframe");
else movekey_obipo(1);
break;
case 6:
break;
case 6:
/* previous keyframe */
if (!ob) error("Select an object before going to its previous keyframe");
else movekey_obipo(-1);
@@ -3213,7 +3213,7 @@ static void do_info_timelinemenu(void *arg, int event)
CFRA++;
update_for_newframe();
break;
case 8:
case 8:
/* previous frame */
CFRA--;
if(CFRA<1) CFRA=1;
@@ -3246,7 +3246,7 @@ static void do_info_timelinemenu(void *arg, int event)
static uiBlock *info_timelinemenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
short menuwidth=120;
@@ -3316,13 +3316,13 @@ static void do_info_rendermenu(void *arg, int event)
if(select_area(SPACE_VIEW3D)) {
BIF_do_ogl_render(curarea->spacedata.first, 0 );
}
break;
case 3:
break;
case 3:
if(select_area(SPACE_VIEW3D)) {
BIF_do_ogl_render(curarea->spacedata.first, 1 );
}
break;
case 4:
break;
case 4:
BIF_toggle_render_display();
break;
case 5:
@@ -3359,7 +3359,7 @@ static void do_info_rendermenu(void *arg, int event)
break;
case 7:
case 7:
extern_set_butspace(F10KEY);
break;
}
@@ -3368,7 +3368,7 @@ static void do_info_rendermenu(void *arg, int event)
static uiBlock *info_rendermenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
short menuwidth=120;
@@ -3410,10 +3410,10 @@ static void do_info_help_websitesmenu(void *arg, int event)
{
/* these are no defines, easier this way, the codes are in the function below */
switch(event) {
case 0: /* */
case 0: /* */
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -3475,7 +3475,7 @@ static void do_info_helpmenu(void *arg, int event)
static uiBlock *info_helpmenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0;
short menuwidth=120;
@@ -3528,12 +3528,12 @@ static void info_text(int x, int y)
if(G.obedit) {
sprintf(infostr,"Ve:%d-%d Fa:%d-%d Mem:%.2fM ",
sprintf(infostr,"Ve:%d-%d Fa:%d-%d Mem:%.2fM ",
G.totvertsel, G.totvert, G.totfacesel, G.totface,
(mem_in_use>>10)/1024.0);
}
else {
sprintf(infostr,"Ve:%d Fa:%d Ob:%d-%d La:%d Mem:%.2fM ",
sprintf(infostr,"Ve:%d Fa:%d Ob:%d-%d La:%d Mem:%.2fM ",
G.totvert, G.totface, G.totobj, G.totobjsel, G.totlamp, (mem_in_use>>10)/1024.0);
}
ob= OBACT;
@@ -3541,7 +3541,7 @@ static void info_text(int x, int y)
strcat(infostr, ob->id.name+2);
}
if (g_progress_bar) {
if (g_progress_bar) {
hsize = 4 + (138.0 * g_done);
fac1 = 0.5 * g_done; // do some rainbow colours on progress
fac2 = 1.0;
@@ -3563,7 +3563,7 @@ static void info_text(int x, int y)
swatch_color= hsv_to_cpack(fac1, fac2, fac3);
cpack( swatch_color );
glRecti(x-24, y-4, x-24+hsize, y+13);
glRecti(x-24, y-4, x-24+hsize, y+13);
glColor3ub(0, 0, 0);
@@ -3571,7 +3571,7 @@ static void info_text(int x, int y)
BIF_DrawString(G.font, headerstr, (U.transopts & TR_MENUS), 0);
glRasterPos2i(x+120, y);
glRasterPos2i(x+120, y);
BIF_DrawString(G.font, infostr, (U.transopts & TR_MENUS), 0);
}
@@ -3600,11 +3600,11 @@ void info_buttons(void)
if(U.uiflag & FLIPINFOMENU) {
uiDefIconButS(block, TOG|BIT|6, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
xco,2,XIC,YIC-2,
&(U.uiflag), 0, 0, 0, 0, "Enables display of pulldown menus");/* dir */
&(U.uiflag), 0, 0, 0, 0, "Enables display of pulldown menus");/* dir */
} else {
uiDefIconButS(block, TOG|BIT|6, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
xco,2,XIC,YIC-2,
&(U.uiflag), 0, 0, 0, 0, "Hides pulldown menus");/* dir */
&(U.uiflag), 0, 0, 0, 0, "Hides pulldown menus");/* dir */
}
xco+=XIC;
@@ -3690,11 +3690,11 @@ void info_buttons(void)
if(U.uiflag & FLIPFULLSCREEN) {
uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_WINDOW,
(short)(curarea->winx-(XIC*2)-2), 0,XIC,YIC,
0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
} else {
uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_FULLSCREEN,
(short)(curarea->winx-(XIC*2)-2), 0,XIC,YIC,
0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
}
#endif
@@ -3798,7 +3798,7 @@ void do_layer_buttons(short event)
}
if(G.qual & LR_SHIFTKEY) {
if(G.vd->lay & (1<<event)) G.vd->lay -= (1<<event);
else G.vd->lay += (1<<event);
else G.vd->lay += (1<<event);
}
do_view3d_buttons(event+B_LAY);
}
@@ -3839,7 +3839,7 @@ static void do_view3d_view_cameracontrolsmenu(void *arg, int event)
static uiBlock *view3d_view_cameracontrolsmenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0, menuwidth=120;
@@ -3925,7 +3925,7 @@ static void do_view3d_viewmenu(void *arg, int event)
static uiBlock *view3d_viewmenu(void *arg_unused)
{
/* static short tog=0; */
/* static short tog=0; */
uiBlock *block;
short yco= 0, menuwidth=120;
@@ -4385,7 +4385,7 @@ static uiBlock *view3d_select_faceselmenu(void *arg_unused)
static void do_view3d_edit_object_transformmenu(void *arg, int event)
{
switch(event) {
case 0: /* clear origin */
case 0: /* clear origin */
clear_object('o');
break;
case 1: /* clear size */
@@ -4440,7 +4440,7 @@ static void do_view3d_edit_object_parentmenu(void *arg, int event)
case 1: /* make parent */
make_parent();
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -4470,7 +4470,7 @@ static void do_view3d_edit_object_trackmenu(void *arg, int event)
case 1: /* make track */
make_track();
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -4502,7 +4502,7 @@ static void do_view3d_edit_objectmenu(void *arg, int event)
switch(event) {
case 0: /* transform properties*/
case 0: /* transform properties*/
blenderqread(NKEY, 1);
break;
case 1: /* delete */
@@ -4625,7 +4625,7 @@ static void do_view3d_edit_propfalloffmenu(void *arg, int event)
case 1: /* proportional edit - smooth*/
prop_mode = 1;
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -4774,7 +4774,7 @@ static void do_view3d_edit_mesh_facesmenu(void *arg, int event)
case 4: /* Flip triangle edges */
edge_flip();
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -4813,7 +4813,7 @@ static void do_view3d_edit_mesh_normalsmenu(void *arg, int event)
case 2: /* recalculate outside */
righthandfaces(1);
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -4996,7 +4996,7 @@ static void do_view3d_edit_curve_controlpointsmenu(void *arg, int event)
case 5: /* make vertex parent */
make_parent();
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -5038,7 +5038,7 @@ static void do_view3d_edit_curve_segmentsmenu(void *arg, int event)
case 1: /* switch direction */
switchdirectionNurb2();
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -5300,7 +5300,7 @@ static void do_view3d_edit_text_charsmenu(void *arg, int event)
case 16: /* spanish exclamation mark */
do_textedit(0,0,161);
break;
}
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -5561,7 +5561,7 @@ static uiBlock *view3d_edit_armaturemenu(void *arg_unused)
static void do_view3d_pose_armature_transformmenu(void *arg, int event)
{
switch(event) {
case 0: /* clear origin */
case 0: /* clear origin */
clear_object('o');
break;
case 1: /* clear size */
@@ -5700,7 +5700,7 @@ static void do_view3d_facesel_propertiesmenu(void *arg, int event)
set_lasttface();
switch(event) {
case 0: /* textured */
case 0: /* textured */
lasttface->mode ^= TF_TEX;
break;
case 1: /* tiled*/
@@ -6193,10 +6193,10 @@ void do_view3d_buttons(short event)
if (curarea->spacetype==SPACE_VIEW3D) {
BIF_do_ogl_render(curarea->spacedata.first, G.qual!=0 );
}
break;
break;
case B_STARTGAME:
if (select_area(SPACE_VIEW3D)) {
start_game();
start_game();
}
break;
case B_VIEWZOOM:
@@ -6819,14 +6819,14 @@ void ipo_buttons(void)
if(ob && give_current_material(ob, ob->actcol)) {
uiDefIconButS(block, ROW, B_IPOMAIN, ICON_MATERIAL, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_MA, 0, 0, "Displays Material Ipos");
if(G.sipo->blocktype==ID_MA) {
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Material texture. Click to change.");
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Material texture. Click to change.");
xco-= 4;
}
}
if(G.scene->world) {
uiDefIconButS(block, ROW, B_IPOMAIN, ICON_WORLD, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_WO, 0, 0, "Display World Ipos");
if(G.sipo->blocktype==ID_WO) {
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active World texture. Click to change.");
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active World texture. Click to change.");
xco-= 4;
}
}
@@ -6840,7 +6840,7 @@ void ipo_buttons(void)
if(ob && ob->type==OB_LAMP) {
uiDefIconButS(block, ROW, B_IPOMAIN, ICON_LAMP, xco+=XIC,0,XIC,YIC, &G.sipo->blocktype, 1.0, (float)ID_LA, 0, 0, "Display Lamp Ipos");
if(G.sipo->blocktype==ID_LA) {
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Lamp texture. Click to change.");
uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Lamp texture. Click to change.");
xco-= 4;
}
}
@@ -6886,8 +6886,8 @@ void ipo_buttons(void)
/* EXTRAP */
uiDefIconBut(block, BUT, B_IPOCONT, ICON_CONSTANT, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to constant");
uiDefIconBut(block, BUT, B_IPOEXTRAP, ICON_LINEAR, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to extrapolation");
uiDefIconBut(block, BUT, B_IPOCYCLIC, ICON_CYCLIC, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to cyclic");
uiDefIconBut(block, BUT, B_IPOCYCLICX, ICON_CYCLICLINEAR, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to cyclic extrapolation");
uiDefIconBut(block, BUT, B_IPOCYCLIC, ICON_CYCLIC, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to cyclic");
uiDefIconBut(block, BUT, B_IPOCYCLICX, ICON_CYCLICLINEAR, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Sets the extend mode to cyclic extrapolation");
xco+= XIC/2;
uiClearButLock();
@@ -7072,7 +7072,7 @@ void buttons_active_id(ID **id, ID **idfrom)
*id= (ID *)ob;
}
}
else if(G.buts->mainb==CONTEXT_TYPES || G.buts->mainb==CONTEXT_EDITING) {
else if(G.buts->mainb==CONTEXT_TYPES || G.buts->mainb==CONTEXT_EDITING) {
if(ob && ob->data) {
*id= ob->data;
}
@@ -7097,7 +7097,7 @@ void buttons_active_id(ID **id, ID **idfrom)
} else {
*id = G.main->sound.first;
}
// printf("id: %d\n\n", *id);
// printf("id: %d\n\n", *id);
#endif
}
}
@@ -7506,7 +7506,7 @@ void file_buttons(void)
uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTSIZE, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 2.0, 0, 0, "Sorts files by size");
cpack(0x0);
glRasterPos2i(xco+=XIC+10, 5);
glRasterPos2i(xco+=XIC+10, 5);
BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & TR_BUTTONS), 0);
xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & TR_BUTTONS));
@@ -7526,11 +7526,11 @@ void file_buttons(void)
filesel_statistics(sfile, &totfile, &selfile, &totlen, &sellen);
sprintf(naam, "Free: %.3f Mb Files: (%d) %d (%.3f) %.3f Mb",
sprintf(naam, "Free: %.3f Mb Files: (%d) %d (%.3f) %.3f Mb",
df, selfile,totfile, sellen, totlen);
cpack(0x0);
glRasterPos2i(xco, 5);
glRasterPos2i(xco, 5);
BIF_DrawString(uiBlockGetCurFont(block), naam, 0, 0);
}
@@ -7628,7 +7628,7 @@ void oops_buttons(void)
else strcpy(naam, oops->id->name);
cpack(0x0);
glRasterPos2i(xco+=XIC+10, 5);
glRasterPos2i(xco+=XIC+10, 5);
BMF_DrawString(uiBlockGetCurFont(block), naam);
}
@@ -7807,7 +7807,7 @@ void text_buttons(void)
/* ******************** TEXT ********************** */
/* ******************** TEXT ********************** */
/* ******************** SOUND ********************** */
void load_space_sound(char *str) /* called from fileselect */
@@ -8476,14 +8476,14 @@ void imasel_buttons(void)
xco+=XIC;
if (simasel->title){
xco+=25;
glRasterPos2i(xco, 4);
glRasterPos2i(xco, 4);
BMF_DrawString(G.font, simasel->title);
xco+=BMF_GetStringWidth(G.fonts, simasel->title);
xco+=25;
}
uiDefIconBut(block, BUT, B_IMASELREMOVEBIP, ICON_BPIBFOLDER_X, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "");/* remove */
uiDefIconButS(block, TOG|BIT|0, B_REDR, ICON_BPIBFOLDERGREY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of directory information");/* dir */
uiDefIconButS(block, TOG|BIT|0, B_REDR, ICON_BPIBFOLDERGREY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of directory information");/* dir */
uiDefIconButS(block, TOG|BIT|1, B_REDR, ICON_INFO, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles display of selected image information");/* info */
uiDefIconButS(block, TOG|BIT|2, B_REDR, ICON_IMAGE_COL, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "");/* image */
uiDefIconButS(block, TOG|BIT|3, B_REDR, ICON_MAGNIFY, xco+=XIC,0,XIC,YIC, &simasel->mode, 0, 0, 0, 0, "Toggles magnified view of thumbnail of images under mouse pointer");/* magnify */