~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/src/drawnla.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: drawnla.c,v 1.13 2004/04/27 19:05:41 ton Exp $
 
2
 * $Id: drawnla.c,v 1.18 2005/03/31 18:49:52 theeth Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
36
36
 
37
37
#ifdef _WIN32
38
38
#pragma warning (once : 4761)
39
 
#include "BLI_winstuff.h"
40
39
#endif
41
40
 
42
41
#include "BMF_Api.h"
96
95
        float   x, y;
97
96
        bActionStrip *strip;
98
97
        bConstraintChannel *conchan;
99
 
        float col[3];
100
98
 
101
99
        myortho2(0,     NLAWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax);    //      Scaling
102
100
 
103
 
        /* Blank out the area */
104
 
        if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
105
 
                if(G.v2d->scroll) {     
106
 
                        ofsx= curarea->winrct.xmin;     
107
 
                        ofsy= curarea->winrct.ymin;
108
 
                        glViewport(ofsx,  ofsy+G.v2d->mask.ymin-SCROLLB, NLAWIDTH, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin-SCROLLB)); 
109
 
                        glScissor(ofsx,  ofsy+G.v2d->mask.ymin-SCROLLB, NLAWIDTH, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin-SCROLLB));
110
 
                }
111
 
        }
112
 
        
113
 
        BIF_GetThemeColor3fv(TH_HEADER, col);
114
 
        glClearColor(col[0], col[1], col[2], 0.0); 
115
 
        glClear(GL_COLOR_BUFFER_BIT);
116
 
 
117
101
        /* Clip to the scrollable area */
118
 
 
 
102
        if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
 
103
                if(G.v2d->scroll) {     
 
104
                        ofsx= curarea->winrct.xmin;     
 
105
                        ofsy= curarea->winrct.ymin;
 
106
                        glViewport(ofsx,  ofsy+G.v2d->mask.ymin, NLAWIDTH, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin)); 
 
107
                        glScissor(ofsx,  ofsy+G.v2d->mask.ymin, NLAWIDTH, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin));
 
108
                }
 
109
        }
 
110
        
119
111
        glColor3ub(0x00, 0x00, 0x00);
120
112
        
121
113
        x = 0.0;
197
189
                }
198
190
        }
199
191
        
200
 
        myortho2(0,     NLAWIDTH, 0, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin-SCROLLB));        //      Scaling
 
192
        myortho2(0,     NLAWIDTH, 0, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin));        //      Scaling
201
193
}
202
194
 
203
195
static void draw_nlastrips(SpaceNla *snla)
215
207
        /* Draw strips */
216
208
 
217
209
        scr_rct.xmin= snla->area->winrct.xmin + NLAWIDTH;
218
 
        scr_rct.ymin= snla->area->winrct.ymin + snla->v2d.mask.ymin-SCROLLB;
 
210
        scr_rct.ymin= snla->area->winrct.ymin + snla->v2d.mask.ymin;
219
211
        scr_rct.xmax= snla->area->winrct.xmin + snla->v2d.hor.xmax;
220
212
        scr_rct.ymax= snla->area->winrct.ymin + snla->v2d.mask.ymax; 
221
213
        di= glaBegin2DDraw(&scr_rct, &G.v2d->cur);
234
226
                        /* Draw the field */
235
227
                        glEnable (GL_BLEND);
236
228
                        if (TESTBASE_SAFE(base))
237
 
                                glColor4b (col1[0], col1[1], col1[2], 0x22);
 
229
                                glColor4ub (col1[0], col1[1], col1[2], 0x22);
238
230
                        else
239
 
                                glColor4b (col2[0], col2[1], col2[2], 0x22);
 
231
                                glColor4ub (col2[0], col2[1], col2[2], 0x22);
240
232
                        
241
233
                        gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);
242
234
                        glRectf(0,  channel_y-NLACHANNELHEIGHT/2,  frame1_x,  channel_y+NLACHANNELHEIGHT/2);
243
235
                        
244
236
                        
245
237
                        if (TESTBASE_SAFE(base))
246
 
                                glColor4b (col1[0], col1[1], col1[2], 0x44);
 
238
                                glColor4ub (col1[0], col1[1], col1[2], 0x44);
247
239
                        else
248
 
                                glColor4b (col2[0], col2[1], col2[2], 0x44);
 
240
                                glColor4ub (col2[0], col2[1], col2[2], 0x44);
249
241
                        glRectf(frame1_x,  channel_y-NLACHANNELHEIGHT/2,   G.v2d->hor.xmax,  channel_y+NLACHANNELHEIGHT/2);
250
242
                        
251
243
                        glDisable (GL_BLEND);
258
250
                        for (conchan=ob->constraintChannels.first; conchan; conchan=conchan->next){
259
251
                                glEnable (GL_BLEND);
260
252
                                if (conchan->flag & CONSTRAINT_CHANNEL_SELECT)
261
 
                                        glColor4b (col1[0], col1[1], col1[2], 0x22);
 
253
                                        glColor4ub (col1[0], col1[1], col1[2], 0x22);
262
254
                                else
263
 
                                        glColor4b (col2[0], col2[1], col2[2], 0x22);
 
255
                                        glColor4ub (col2[0], col2[1], col2[2], 0x22);
264
256
                                
265
257
                                gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);
266
258
                                glRectf(0,  channel_y-NLACHANNELHEIGHT/2+4,  frame1_x,  channel_y+NLACHANNELHEIGHT/2-4);
267
259
                                
268
260
                                
269
261
                                if (conchan->flag & CONSTRAINT_CHANNEL_SELECT)
270
 
                                        glColor4b (col1[0], col1[1], col1[2], 0x44);
 
262
                                        glColor4ub (col1[0], col1[1], col1[2], 0x44);
271
263
                                else
272
 
                                        glColor4b (col2[0], col2[1], col2[2], 0x44);
 
264
                                        glColor4ub (col2[0], col2[1], col2[2], 0x44);
273
265
                                glRectf(frame1_x,  channel_y-NLACHANNELHEIGHT/2+4,   G.v2d->hor.xmax,  channel_y+NLACHANNELHEIGHT/2-4);
274
266
                                
275
267
                                glDisable (GL_BLEND);
494
486
        uiDefBut(block, LABEL, 0, "Options:",                   10,60,300,19, 0, 0, 0, 0, 0, "");
495
487
 
496
488
        uiBlockBeginAlign(block);
497
 
        uiDefBut(block, NUM|FLO, B_REDR, "Strip Start:", 10,160,150,19, &strip->start, 1.0, 18000.0, 100, 0, "First frame in the timeline");
498
 
        uiDefBut(block, NUM|FLO, B_REDR, "Strip End:",  160,160,150,19, &strip->end, 1.0, 18000.0, 100, 0, "Last frame in the timeline");
499
 
 
500
 
        uiBlockBeginAlign(block);
501
 
        uiDefBut(block, NUM|FLO, B_REDR, "Action Start:", 10,120,150,19, &strip->actstart, 1.0, 18000.0, 100, 0, "First frame of the action to map to the playrange");
502
 
        uiDefBut(block, NUM|FLO, B_REDR, "Action End:", 160,120,150,19, &strip->actend, 1.0, 18000.0, 100, 0, "Last frame of the action to map to the playrange");
503
 
 
504
 
        uiBlockBeginAlign(block);
505
 
        uiDefBut(block, NUM|FLO, B_REDR, "Blendin:",    10,80,150,19, &strip->blendin, 0.0, 18000.0, 100, 0, "Number of frames of ease-in");
506
 
        uiDefBut(block, NUM|FLO, B_REDR, "Blendout:",   160,80,150,19, &strip->blendout, 0.0, 18000.0, 100, 0, "Number of frames of ease-out");
507
 
 
508
 
        uiBlockBeginAlign(block);
509
 
        uiDefBut(block, NUM|FLO, B_REDR, "Repeat:",     10,40,150,19, &strip->repeat, 0.0001, 18000.0, 100, 0, "Number of times the action should repeat");
510
 
        uiDefBut(block, NUM|FLO, B_REDR, "Stride:",     160,40,150,19, &strip->stridelen, 0.0001, 18000.0, 100, 0, "Distance covered by one complete cycle of the action specified in the Action Range");
 
489
        uiDefBut(block, NUM|FLO, B_REDR, "Strip Start:", 10,160,150,19, &strip->start, 1.0, MAXFRAMEF, 100, 0, "First frame in the timeline");
 
490
        uiDefBut(block, NUM|FLO, B_REDR, "Strip End:",  160,160,150,19, &strip->end, 1.0, MAXFRAMEF, 100, 0, "Last frame in the timeline");
 
491
 
 
492
        uiBlockBeginAlign(block);
 
493
        uiDefBut(block, NUM|FLO, B_REDR, "Action Start:", 10,120,150,19, &strip->actstart, 1.0, MAXFRAMEF, 100, 0, "First frame of the action to map to the playrange");
 
494
        uiDefBut(block, NUM|FLO, B_REDR, "Action End:", 160,120,150,19, &strip->actend, 1.0, MAXFRAMEF, 100, 0, "Last frame of the action to map to the playrange");
 
495
 
 
496
        uiBlockBeginAlign(block);
 
497
        uiDefBut(block, NUM|FLO, B_REDR, "Blendin:",    10,80,150,19, &strip->blendin, 0.0, MAXFRAMEF, 100, 0, "Number of frames of ease-in");
 
498
        uiDefBut(block, NUM|FLO, B_REDR, "Blendout:",   160,80,150,19, &strip->blendout, 0.0, MAXFRAMEF, 100, 0, "Number of frames of ease-out");
 
499
 
 
500
        uiBlockBeginAlign(block);
 
501
        uiDefBut(block, NUM|FLO, B_REDR, "Repeat:",     10,40,150,19, &strip->repeat, 0.0001, MAXFRAMEF, 100, 0, "Number of times the action should repeat");
 
502
        uiDefBut(block, NUM|FLO, B_REDR, "Stride:",     160,40,150,19, &strip->stridelen, 0.0001, MAXFRAMEF, 100, 0, "Distance covered by one complete cycle of the action specified in the Action Range");
511
503
 
512
504
        uiBlockBeginAlign(block);
513
505
        uiDefBut(block, TOG|SHO|BIT|ACTSTRIP_USESTRIDEBIT, B_REDR, "Use Path",  10,0,100,19, &strip->flag, 0, 0, 0, 0, "Plays action based on path position & stride. Only armatures parented to a path");
544
536
 
545
537
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ;
546
538
        
547
 
        calc_scrollrcts(G.v2d, curarea->winx, curarea->winy);
 
539
        calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy);
 
540
        
 
541
        /* clear all, becomes the color for left part */
 
542
        BIF_GetThemeColor3fv(TH_HEADER, col);
 
543
        glClearColor(col[0], col[1], col[2], 0.0); 
 
544
        glClear(GL_COLOR_BUFFER_BIT);
548
545
        
549
546
        if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
550
547
                if(G.v2d->scroll) {