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

drawseq.c « src « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 22b397abde6c6f596a11a58aacfdedc29f06c8fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
/**
 * $Id$
 *
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version. The Blender
 * Foundation also sells licenses for use in proprietary software under
 * the Blender License.  See http://www.blender.org/BL/ for information
 * about this.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 * All rights reserved.
 *
 * The Original Code is: all of this file.
 *
 * Contributor(s): none yet.
 *
 * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */

#ifdef _WIN32
#include "BLI_winstuff.h"
#endif

#include <string.h>
#include <math.h>

#include "MEM_guardedalloc.h"

#include "BMF_Api.h"

#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BLI_editVert.h"

#include "IMB_imbuf_types.h"

#include "DNA_sequence_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_view2d_types.h"

#include "BKE_utildefines.h"
#include "BKE_global.h"

#include "BIF_gl.h"
#include "BIF_mywindow.h"
#include "BIF_screen.h"
#include "BIF_drawseq.h"
#include "BIF_editseq.h"
#include "BIF_drawimage.h"

#include "BSE_view.h"
#include "BSE_drawipo.h"
#include "BSE_sequence.h"

/* Modules used */
#include "blendertimer.h" /* timer functions */

int no_rightbox=0, no_leftbox= 0;

static void EmbossBoxf(float x1, float y1, float x2, float y2, int sel, unsigned int dark, unsigned int light)
{

	if(sel) cpack(dark); 
	else cpack(light);
	if(sel) glLineWidth(2.0);
	fdrawline(x1,  y2,  x2,  y2); 	/* boven */
	if(no_leftbox==0) fdrawline(x1,  y1,  x1,  y2);	/* links */
	
	if(sel) glLineWidth(1.0);
	
	if(sel) cpack(light); 
	else cpack(dark);	
	fdrawline(x1,  y1,  x2,  y1); /* onder */
	if(no_rightbox==0) fdrawline(x2,  y1,  x2,  y2); 	/* rechts */
	
}

static char *give_seqname(Sequence *seq)
{
	if(seq->type==SEQ_META) {
		if(seq->name[2]) return seq->name+2;
		return "META";
	}
	else if(seq->type==SEQ_SCENE) return "SCENE";
	else if(seq->type==SEQ_MOVIE) return "MOVIE";
	else if(seq->type<SEQ_EFFECT) return seq->strip->dir;
	else if(seq->type==SEQ_CROSS) return "CROSS";
	else if(seq->type==SEQ_GAMCROSS) return "GAMMA CROSS";
	else if(seq->type==SEQ_ADD) return "ADD";
	else if(seq->type==SEQ_SUB) return "SUB";
	else if(seq->type==SEQ_MUL) return "MUL";
	else if(seq->type==SEQ_ALPHAOVER) return "ALPHAOVER";
	else if(seq->type==SEQ_ALPHAUNDER) return "ALPHAUNDER";
	else if(seq->type==SEQ_OVERDROP) return "OVER DROP";
	else if(seq->type==SEQ_PLUGIN) {
		if(seq->plugin && seq->plugin->doit) return seq->plugin->pname;
		return "PLUGIN";
	}
	else return "EFFECT";
	
}

static void draw_cfra_seq(void)
{
	glColor3ub(0x30, 0x90, 0x50);
	glLineWidth(2.0);
	glBegin(GL_LINES);
	glVertex2f(G.scene->r.cfra, G.v2d->cur.ymin);
	glVertex2f(G.scene->r.cfra, G.v2d->cur.ymax);
	glEnd();
	glLineWidth(1.0);
}

static unsigned int seq_color(Sequence *seq)
{
	switch(seq->type) {
	case SEQ_META:
		return 0x509090;
	case SEQ_MOVIE:
		return 0x805040;
	case SEQ_SCENE:
		if(seq->scene==G.scene) return 0x709050;
		return 0x609060;
	case SEQ_CROSS:
		return 0x505090;
	case SEQ_GAMCROSS:
		return 0x5040A0;
	case SEQ_ADD:
		return 0x6060A0;
	case SEQ_SUB:
		return 0x8060A0;
	case SEQ_MUL:
		return 0x8080A0;
	case SEQ_ALPHAOVER:
		return 0x6080A0;
	case SEQ_ALPHAUNDER:
		return 0x9080A0;
	case SEQ_OVERDROP:
		return 0x5080B0;
	case SEQ_PLUGIN:
		return 0x906000;
	default:
		return 0x906060;
	}
	
}

static void drawmeta_contents(Sequence *seqm, float x1, float y1, float x2, float y2)
{
	Sequence *seq;
	float dx;
	int nr;
	
	nr= 0;
	WHILE_SEQ(&seqm->seqbase) {
		nr++;
	}
	END_SEQ
	
	dx= (x2-x1)/nr;
	
	WHILE_SEQ(&seqm->seqbase) {
		cpack(seq_color(seq));
		glRectf(x1,  y1,  x1+0.9*dx,  y2);
		EmbossBoxf(x1, y1, x1+0.9*dx, y2, 0, 0x404040, 0xB0B0B0);
		x1+= dx;
	}
	END_SEQ
}

void drawseq(Sequence *seq)
{
	float v1[2], v2[2], x1, x2, y1, y2;
	unsigned int body, dark, light;
	int len, size;
	short mval[2];
	char str[120], *strp;
	

	if(seq->startdisp > seq->enddisp) body= 0x707070;

	body= seq_color(seq);
	dark= 0x202020;
	light= 0xB0B0B0;

	if(G.moving && (seq->flag & SELECT)) {
		if(seq->flag & SEQ_OVERLAP) dark= light= 0x4040FF;
		else {
			if(seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL));
			else dark= light= 0xFFFFFF;
		}
	}

	/* body */
	if(seq->startstill) x1= seq->start;
	else x1= seq->startdisp;
	y1= seq->machine+0.2;
	if(seq->endstill) x2= seq->start+seq->len;
	else x2= seq->enddisp;
	y2= seq->machine+0.8;
	
	cpack(body);
	glRectf(x1,  y1,  x2,  y2);
	EmbossBoxf(x1, y1, x2, y2, seq->flag & 1, dark, light);
	
	v1[1]= y1;
	v2[1]= y2;
	if(seq->type < SEQ_EFFECT) {

		/* decoratie: balkjes */
		x1= seq->startdisp;
		x2= seq->enddisp;
		
		if(seq->startofs) {
			cpack(0x707070);
			glRectf((float)(seq->start),  y1-0.2,  x1,  y1);
			EmbossBoxf((float)(seq->start), y1-0.2, x1, y1, seq->flag & 1, dark, light);
		}
		if(seq->endofs) {
			cpack(0x707070);
			glRectf(x2,  y2,  (float)(seq->start+seq->len),  y2+0.2);
			EmbossBoxf(x2, y2, (float)(seq->start+seq->len), y2+0.2, seq->flag & 1, dark, light);
		}

		if(seq->startstill) {
			cpack(body);
			glRectf(x1,  y1+0.1,  (float)(seq->start),  y1+0.5);
			no_rightbox= 1;
			EmbossBoxf(x1, y1+0.1, (float)(seq->start), y1+0.5, seq->flag & 1, dark, light);
			no_rightbox= 0;
		}
		if(seq->endstill) {
			cpack(body);
			glRectf((float)(seq->start+seq->len),  y1+0.1,  x2,  y1+0.5);
			no_leftbox= 1;
			EmbossBoxf((float)(seq->start+seq->len), y1+0.1, x2, y1+0.5, seq->flag & 1, dark, light);
			no_leftbox= 0;
		}
		
	}

	/* berekenen of seq lang genoeg is om naam te printen */
	x1= seq->startdisp+seq->handsize;
	x2= seq->enddisp-seq->handsize;
	
	/* maar eerst de inhoud van de meta */
	if(seq->type==SEQ_META) drawmeta_contents(seq, x1, y1+0.15, x2, y2-0.15);
	
	if(x1<G.v2d->cur.xmin) x1= G.v2d->cur.xmin;
	else if(x1>G.v2d->cur.xmax) x1= G.v2d->cur.xmax;
	if(x2<G.v2d->cur.xmin) x2= G.v2d->cur.xmin;
	else if(x2>G.v2d->cur.xmax) x2= G.v2d->cur.xmax;
	
	if(x1 != x2) {
		v1[0]= x1;
		ipoco_to_areaco_noclip(G.v2d, v1, mval);
		x1= mval[0];
		v2[0]= x2;
		ipoco_to_areaco_noclip(G.v2d, v2, mval);
		x2= mval[0];
		size= x2-x1;
		
		if(seq->type == SEQ_META) sprintf(str, "%d %s", seq->len, give_seqname(seq));
		else if(seq->type == SEQ_SCENE) {
			if(seq->scene) sprintf(str, "%d %s %s", seq->len, give_seqname(seq), seq->scene->id.name+2);
			else sprintf(str, "%d %s", seq->len, give_seqname(seq));
		}
		else if(seq->type & SEQ_EFFECT) {
			if(seq->seq3!=seq->seq2 && seq->seq1!=seq->seq3)
				sprintf(str, "%d %s: %d-%d (use %d)", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, seq->seq3->machine);
			else 
				sprintf(str, "%d %s: %d-%d", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine);
		}
		else if(seq->name[2]) sprintf(str, "%s", seq->name+2);
		else sprintf(str, "%d %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);

		strp= str;
		
		while( (len= BMF_GetStringWidth(G.font, strp)) > size) {
			if(len < 10) break;
			if(strp[1]==0) break;
			strp++;
		}
		
		mval[0]= (x1+x2-len+1)/2;
		mval[1]= 1;
		areamouseco_to_ipoco(G.v2d, mval, &x1, &x2);
		
		if(seq->flag & SELECT) cpack(0xFFFFFF);
		else cpack(0x0);
		glRasterPos3f(x1,  y1+0.2, 0.0);
		BMF_DrawString(G.font, strp);
	}

	if(seq->type < SEQ_EFFECT) {

		/* decoratie: driehoekjes */
		x1= seq->startdisp;
		x2= seq->enddisp;
		
		body+= 0x101010;
		dark= 0x202020;
		light= 0xB0B0B0;
		
		/* linker driehoek */
		
		if(seq->flag & SEQ_LEFTSEL) {
			cpack(body+0x20);
			if(G.moving) {
				if(seq->flag & SEQ_OVERLAP) dark= light= 0x4040FF;
				else dark= light= 0xFFFFFF;
			}
		}
		else {
			cpack(body);
		}

		glBegin(GL_TRIANGLES);
			v1[0]= x1; glVertex2fv(v1);
			v2[0]= x1; glVertex2fv(v2);
			v2[0]+= seq->handsize; v2[1]= (y1+y2)/2.0; glVertex2fv(v2); v2[1]= y2;
		glEnd();

		cpack(light);

		glBegin(GL_LINE_STRIP);
			v1[0]= x1; glVertex2fv(v1);
			v2[0]= x1; glVertex2fv(v2);
			v2[0]+= seq->handsize; v2[1]= (y1+y2)/2.0; glVertex2fv(v2); v2[1]= y2;
			cpack(dark);
			glVertex2fv(v1);
		glEnd();

		if(G.moving || (seq->flag & SEQ_LEFTSEL)) {
			cpack(0xFFFFFF);
			glRasterPos3f(x1,  y1+0.2, 0.0);
			sprintf(str, "%d", seq->startdisp);
			BMF_DrawString(G.font, str);
		}
		
		/* rechter driehoek */
		
		dark= 0x202020;
		light= 0xB0B0B0;

		if(seq->flag & SEQ_RIGHTSEL) {
			cpack(body+0x20);
			if(G.moving) {
				if(seq->flag & SEQ_OVERLAP) dark= light= 0x4040FF;
				else dark= light= 0xFFFFFF;
			}
		}
		else {
			cpack(body);
		}
		glBegin(GL_TRIANGLES);
			v2[0]= x2; glVertex2fv(v2);
			v1[0]= x2; glVertex2fv(v1);
			v2[0]-= seq->handsize; v2[1]= (y1+y2)/2.0; glVertex2fv(v2); v2[1]= y2;
		glEnd();
		
		cpack(dark);
		glBegin(GL_LINE_STRIP);
			v2[0]= x2; glVertex2fv(v2);
			v1[0]= x2; glVertex2fv(v1);
			v1[0]-= seq->handsize; v1[1]= (y1+y2)/2.0; glVertex2fv(v1); v1[1]= y2;
			cpack(light);
			glVertex2fv(v2);
		glEnd();

		if(G.moving || (seq->flag & SEQ_RIGHTSEL)) {
			cpack(0xFFFFFF);
			glRasterPos3f(x2-seq->handsize/2,  y1+0.2, 0.0);
			sprintf(str, "%d", seq->enddisp-1);
			BMF_DrawString(G.font, str);
		}

		
	}
}

static Sequence *special_seq_update= 0;

void set_special_seq_update(int val)
{
	int x;

	/* als met muis in sequence && LEFTMOUSE */
	if(val) {
		special_seq_update= find_nearest_seq(&x);
	}
	else special_seq_update= 0;
}


static void draw_image_seq(void)
{
	SpaceSeq *sseq;
	StripElem *se;
	struct ImBuf *ibuf;
	int x1, y1;
	
	glClearColor(0.0, 0.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);

	curarea->win_swap= WIN_BACK_OK;

	ibuf= (ImBuf *)give_ibuf_seq( (G.scene->r.cfra));

	if(special_seq_update) {
       se = special_seq_update->curelem;
       if(se) {
           if(se->ok==2) {
               if(se->se1)
                   ibuf= se->se1->ibuf;
           }
           else ibuf= se->ibuf;
       }
	}
	if(ibuf==0 || ibuf->rect==0) return;
	
	sseq= curarea->spacedata.first;
	if(sseq==0) return;
	
	/* plek berekenen */
	x1= curarea->winrct.xmin+(curarea->winx-sseq->zoom*ibuf->x)/2;
	y1= curarea->winrct.ymin+(curarea->winy-sseq->zoom*ibuf->y)/2;
	
	/* convert_rgba_to_abgr(ibuf->x*ibuf->y, ibuf->rect); */
	
	rectwrite_part(curarea->winrct.xmin, curarea->winrct.ymin, 
				curarea->winrct.xmax, curarea->winrct.ymax, 
				x1, y1, ibuf->x, ibuf->y, (float)sseq->zoom,(float)sseq->zoom, ibuf->rect);

	/* convert_rgba_to_abgr(ibuf->x*ibuf->y, ibuf->rect); */
}

static void draw_extra_seqinfo(void)
{
	extern Sequence *last_seq;
	StripElem *se, *last;
	float xco, xfac;
	int sta, end;
	char str[256];
	
	if(last_seq==0) return;
		
	/* xfac: afm 1 pixel */
	xfac= G.v2d->cur.xmax - G.v2d->cur.xmin;
	xfac/= (float)(G.v2d->mask.xmax-G.v2d->mask.xmin);
	xco= G.v2d->cur.xmin+40*xfac;
	
	cpack(0);
	
	/* NAAM */
	glRasterPos3f(xco,  0.3, 0.0);
	strcpy(str, give_seqname(last_seq));
	BMF_DrawString(G.font, str);
	xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac;

	if(last_seq->type==SEQ_SCENE && last_seq->scene) {
		glRasterPos3f(xco,  0.3, 0.0);
		BMF_DrawString(G.font, last_seq->scene->id.name+2);
		xco += xfac*BMF_GetStringWidth(G.font, last_seq->scene->id.name+2) +30.0*xfac;
	}

	/* LEN */
	if(last_seq->type & SEQ_EFFECT)
		sprintf(str, "len: %d   From %d - %d", last_seq->len, last_seq->startdisp, last_seq->enddisp-1);
	else 
		sprintf(str, "len: %d (%d)", last_seq->enddisp-last_seq->startdisp, last_seq->len);
	
	glRasterPos3f(xco,  0.3, 0.0);
	BMF_DrawString(G.font, str);
	xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac;

	if(last_seq->type==SEQ_IMAGE) {
	
		/* CURRENT */
		se= (StripElem *)give_stripelem(last_seq,  (G.scene->r.cfra));
		if(se) {
			sprintf(str, "cur: %s", se->name);
			glRasterPos3f(xco,  0.3, 0.0);
			BMF_DrawString(G.font, str);
			xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac;
		}
		
		/* FIRST EN LAST */
	
		if(last_seq->strip) {
			se= last_seq->strip->stripdata;
			last= se+last_seq->len-1;
			if(last_seq->startofs) se+= last_seq->startofs;
			if(last_seq->endofs) last-= last_seq->endofs;
			
			sprintf(str, "First: %s at %d     Last: %s at %d", se->name, last_seq->startdisp, last->name, last_seq->enddisp-1);
			glRasterPos3f(xco,  0.3, 0.0);
			BMF_DrawString(G.font, str);
			xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac;
			
			/* orig size */
			sprintf(str, "OrigSize: %d x %d", last_seq->strip->orx, last_seq->strip->ory);
			glRasterPos3f(xco,  0.3, 0.0);
			BMF_DrawString(G.font, str);
			xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac;
		}
	}
	else if(last_seq->type==SEQ_MOVIE) {
	
		sta= last_seq->startofs;
		end= last_seq->len-1-last_seq->endofs;
	
		sprintf(str, "%s   %s%s  First: %d at %d     Last: %d at %d     Cur: %d", 
				last_seq->name+2, last_seq->strip->dir, last_seq->strip->stripdata->name, 
				sta, last_seq->startdisp, end, last_seq->enddisp-1,  (G.scene->r.cfra)-last_seq->startdisp);
		
		glRasterPos3f(xco,  0.3, 0.0);
		BMF_DrawString(G.font, str);
	}
}

void drawseqspace(void)
{
	SpaceSeq *sseq;
	Editing *ed;
	Sequence *seq;
	int ofsx, ofsy;

	ed= G.scene->ed;
	
	sseq= curarea->spacedata.first;
	if(sseq->mainb==1) {
		draw_image_seq();
		return;
	}

	if(ed && ed->metastack.first) glClearColor(0.5, 0.5, 0.4, 0.0);
	else glClearColor(.40625, .40625, .40625, 0.0);
	
	glClear(GL_COLOR_BUFFER_BIT);

	calc_scrollrcts(G.v2d, curarea->winx, curarea->winy);

	if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
		if(G.v2d->scroll) {	
			ofsx= curarea->winrct.xmin;	/* ivm mywin */
			ofsy= curarea->winrct.ymin;
			glViewport(ofsx+G.v2d->mask.xmin,  ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); 
			glScissor(ofsx+G.v2d->mask.xmin,  ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
		}
	}


	myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
	
	cpack(0x585858);
	glRectf(G.v2d->cur.xmin,  0.0,  G.v2d->cur.xmax,  1.0);
	
	boundbox_seq();
	calc_ipogrid();	
	draw_ipogrid();
	draw_cfra_seq();

	/* sequenties: eerst de deselect */
	
	if(ed) {
		seq= ed->seqbasep->first;
		while(seq) {
			if(seq->flag & SELECT); else drawseq(seq);
			seq= seq->next;
		}
	}
	ed= G.scene->ed;
	if(ed) {
		seq= ed->seqbasep->first;
		while(seq) {
			if(seq->flag & SELECT) drawseq(seq);
			seq= seq->next;
		}
	}

	draw_extra_seqinfo();

	/* restore viewport */
	mywinset(curarea->win);

	if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
		
		/* ortho op pixelnivo curarea */
		myortho2(-0.5, curarea->winx+0.5, -0.5, curarea->winy+0.5);
		
		if(G.v2d->scroll) {
			drawscroll(0);
		}
		
		
	}
	
	curarea->win_swap= WIN_BACK_OK;
}