Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2011-07-05 05:55:03 +0400
committerJoshua Leung <aligorith@gmail.com>2011-07-05 05:55:03 +0400
commitafd77d081aa9c9fb51e22961e962b13f90da6cd8 (patch)
treee219dac25710f96235354767aff6d9db613a3ae9 /source/blender/editors/space_nla
parenta0fa8c3cd2c01fd8d7f77565e12442d322f43a45 (diff)
Reduce duplicate code
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r--source/blender/editors/space_nla/nla_draw.c119
1 files changed, 39 insertions, 80 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 53d174169e5..b2a396ead98 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -640,47 +640,6 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie
{
NlaTrack *nlt= (NlaTrack *)ale->data;
- indent= 0;
-
- if (ale->id) {
- /* special exception for textures */
- if (GS(ale->id->name) == ID_TE) {
- offset= 14;
- indent= 1;
- }
- /* special exception for nodetrees */
- else if (GS(ale->id->name) == ID_NT) {
- bNodeTree *ntree = (bNodeTree *)ale->id;
-
- switch (ntree->type) {
- case NTREE_SHADER:
- {
- /* same as for textures */
- offset= 14;
- indent= 1;
- }
- break;
-
- case NTREE_TEXTURE:
- {
- /* even more */
- offset= 21;
- indent= 1;
- }
- break;
-
- default:
- /* normal will do */
- offset= 14;
- break;
- }
- }
- else
- offset= 14;
- }
- else
- offset= 0;
-
/* FIXME: 'solo' as the 'special' button?
* - need special icons for these
*/
@@ -717,45 +676,6 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie
group = 5;
- if (ale->id) {
- /* special exception for textures */
- if (GS(ale->id->name) == ID_TE) {
- offset= 14;
- indent= 1;
- }
- /* special exception for nodetrees */
- else if (GS(ale->id->name) == ID_NT) {
- bNodeTree *ntree = (bNodeTree *)ale->id;
-
- switch (ntree->type) {
- case NTREE_SHADER:
- {
- /* same as for textures */
- offset= 14;
- indent= 1;
- }
- break;
-
- case NTREE_TEXTURE:
- {
- /* even more */
- offset= 21;
- indent= 1;
- }
- break;
-
- default:
- /* normal will do */
- offset= 14;
- break;
- }
- }
- else
- offset= 14;
- }
- else
- offset= 0;
-
special = ICON_ACTION;
if (act)
@@ -776,6 +696,45 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie
/* if special types, draw manually for now... */
if (doDraw) {
+ if (ale->id) {
+ /* special exception for textures */
+ if (GS(ale->id->name) == ID_TE) {
+ offset= 14;
+ indent= 1;
+ }
+ /* special exception for nodetrees */
+ else if (GS(ale->id->name) == ID_NT) {
+ bNodeTree *ntree = (bNodeTree *)ale->id;
+
+ switch (ntree->type) {
+ case NTREE_SHADER:
+ {
+ /* same as for textures */
+ offset= 14;
+ indent= 1;
+ }
+ break;
+
+ case NTREE_TEXTURE:
+ {
+ /* even more */
+ offset= 21;
+ indent= 1;
+ }
+ break;
+
+ default:
+ /* normal will do */
+ offset= 14;
+ break;
+ }
+ }
+ else
+ offset= 14;
+ }
+ else
+ offset= 0;
+
/* now, start drawing based on this information */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);