diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-19 22:11:02 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-19 22:11:02 +0300 |
commit | 3bda5490f7f50a795cd8b2c3d841c9375723aee9 (patch) | |
tree | cdcd6b5a08cc8566a0d3c8e8e1518fe990d5826f /source/blender/blenkernel | |
parent | 12ad72ba8f4ab598c558428567707413e208eac7 (diff) |
2.5: globals cleanup
* G.version removed, use BLENDER_VERSION
* G.order removed, ENDIAN_ORDER
* G.vd, G.sipo, G.buts, G.sima, .. removed.
* G.qual removed
* G.simulf removed (was unused in 2.4x)
* error() and some other unused stubs removed
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_global.h | 39 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/exotic.c | 13 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 2 |
4 files changed, 18 insertions, 54 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 284d41e7891..2edf10f846e 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -66,15 +66,6 @@ struct BME_Glob; typedef struct Global { /* active pointers */ - struct View3D *vd; - struct View2D *v2d; - struct SpaceIpo *sipo; - struct SpaceButs *buts; - struct SpaceImage *sima; - struct SpaceOops *soops; - struct SpaceSound *ssound; - struct SpaceAction *saction; /* __NLA */ - struct SpaceNla *snla; struct Main *main; struct Scene *scene; /* denk aan file.c */ struct bScreen *curscreen; @@ -99,14 +90,11 @@ typedef struct Global { int totvert, totedge, totface, totvertsel, totedgesel, totfacesel; short afbreek, moving; - short qual, background; + short background; short winpos, displaymode; /* used to be in Render */ short rendering; /* to indicate render is busy, prevent renderwindow events etc */ - /** - * The current version of Blender. - */ - short version; - short simulf, order, rt; + + short rt; int f; /* Editmode lists */ @@ -235,28 +223,11 @@ typedef struct Global { #define G_WINDOWSTATE_BORDER 1 #define G_WINDOWSTATE_FULLSCREEN 2 -/* G.simulf */ -#define G_LOADFILE 2 -#define G_RESTART 4 -#define G_QUIT 8 -#define G_SETSCENE 16 - -/* G.qual */ -#define R_SHIFTKEY 1 -#define L_SHIFTKEY 2 -#define LR_SHIFTKEY 3 -#define R_ALTKEY 4 -#define L_ALTKEY 8 -#define LR_ALTKEY 12 -#define R_CTRLKEY 16 -#define L_CTRLKEY 32 -#define LR_CTRLKEY 48 -#define LR_COMMANDKEY 64 - -/* G.order: indicates what endianness the platform where the file was +/* ENDIAN_ORDER: indicates what endianness the platform where the file was * written had. */ #define L_ENDIAN 1 #define B_ENDIAN 0 +extern short ENDIAN_ORDER; /* G.moving, signals drawing in (3d) window to denote transform */ #define G_TRANSFORM_OBJ 1 diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 2ab12c12ab8..6cadd57e390 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -94,6 +94,7 @@ Global G; UserDef U; ListBase WMlist= {NULL, NULL}; +short ENDIAN_ORDER; char versionstr[48]= ""; @@ -200,15 +201,13 @@ void initglobals(void) strcpy(G.ima, "//"); - G.version= BLENDER_VERSION; - - G.order= 1; - G.order= (((char*)&G.order)[0])?L_ENDIAN:B_ENDIAN; + ENDIAN_ORDER= 1; + ENDIAN_ORDER= (((char*)&ENDIAN_ORDER)[0])? L_ENDIAN: B_ENDIAN; if(BLENDER_SUBVERSION) - sprintf(versionstr, "www.blender.org %d.%d", G.version, BLENDER_SUBVERSION); + sprintf(versionstr, "www.blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION); else - sprintf(versionstr, "www.blender.org %d", G.version); + sprintf(versionstr, "www.blender.org %d", BLENDER_VERSION); #ifdef _WIN32 // FULLSCREEN G.windowstate = G_WINDOWSTATE_USERDEF; @@ -244,13 +243,6 @@ static void clear_global(void) G.main= NULL; G.obedit= NULL; - G.saction= NULL; - G.buts= NULL; - G.v2d= NULL; - G.vd= NULL; - G.soops= NULL; - G.sima= NULL; - G.sipo= NULL; G.f &= ~(G_WEIGHTPAINT + G_VERTEXPAINT + G_FACESELECT + G_PARTICLEEDIT); } diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 28ed74aa9db..1570f735fc5 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -105,6 +105,7 @@ #include "BLI_arithb.h" #include "BLI_editVert.h" +#include "BKE_blender.h" #include "BKE_global.h" #include "BKE_main.h" #include "BKE_mesh.h" @@ -181,7 +182,7 @@ static int is_stl(char *str) return; \ } \ else { \ - if (G.order==B_ENDIAN) { \ + if (ENDIAN_ORDER==B_ENDIAN) { \ SWITCH_INT(mvert->co[0]); \ SWITCH_INT(mvert->co[1]); \ SWITCH_INT(mvert->co[2]); \ @@ -250,7 +251,7 @@ static void read_stl_mesh_binary(char *str) fseek(fpSTL, 80, SEEK_SET); fread(&numfacets, 4*sizeof(char), 1, fpSTL); - if (G.order==B_ENDIAN) { + if (ENDIAN_ORDER==B_ENDIAN) { SWITCH_INT(numfacets); } @@ -2459,7 +2460,7 @@ static void write_vert_stl(Object *ob, MVert *verts, int index, FILE *fpSTL) VECCOPY(vert, verts[(index)].co); Mat4MulVecfl(ob->obmat, vert); - if (G.order==B_ENDIAN) { + if (ENDIAN_ORDER==B_ENDIAN) { SWITCH_INT(vert[0]); SWITCH_INT(vert[1]); SWITCH_INT(vert[2]); @@ -2564,7 +2565,7 @@ void write_stl(char *str) */ fseek(fpSTL, 80, SEEK_SET); - if (G.order==B_ENDIAN) { + if (ENDIAN_ORDER==B_ENDIAN) { SWITCH_INT(numfacets); } fwrite(&numfacets, 4*sizeof(char), 1, fpSTL); @@ -2605,7 +2606,7 @@ static void write_videoscape_mesh(Object *ob, char *str) cp[1]= (unsigned char) (255.0*ma->b); cp[2]= (unsigned char) (255.0*ma->g); cp[3]= (unsigned char) (255.0*ma->r); - if(G.order==L_ENDIAN) SWITCH_INT(kleur[a]); + if(ENDIAN_ORDER==L_ENDIAN) SWITCH_INT(kleur[a]); } else kleur[a]= 0x00C0C0C0; @@ -3026,7 +3027,7 @@ void write_vrml(char *str) /* FIRST: write all the datablocks */ - fprintf(fp, "#VRML V1.0 ascii\n\n# Blender V%d\n\n# 'Switch' is used as a hack, to ensure it is not part of the drawing\n\n", G.version); + fprintf(fp, "#VRML V1.0 ascii\n\n# Blender V%d\n\n# 'Switch' is used as a hack, to ensure it is not part of the drawing\n\n", BLENDER_VERSION); fprintf(fp, "Separator {\n"); fprintf(fp, "Switch {\n"); diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 7008f254871..3ac3ed4f7aa 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -302,7 +302,7 @@ static AVFrame* generate_video_frame(uint8_t* pixels) /* Do RGBA-conversion and flipping in one step depending on CPU-Endianess */ - if (G.order == L_ENDIAN) { + if (ENDIAN_ORDER == L_ENDIAN) { int y; for (y = 0; y < height; y++) { uint8_t* target = rgb_frame->data[0] |