[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13261] branches/blender2.5/blender/source /blender: * rearrange screen level drawing code a bit in preparation for tests.

Nathan Letwory jesterking at letwory.net
Wed Jan 16 20:49:35 CET 2008


Revision: 13261
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13261
Author:   jesterking
Date:     2008-01-16 20:49:34 +0100 (Wed, 16 Jan 2008)

Log Message:
-----------
* rearrange screen level drawing code a bit in preparation for tests.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/include/BIF_glutil.h
    branches/blender2.5/blender/source/blender/editors/screen/glutil.c
    branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c
    branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: branches/blender2.5/blender/source/blender/editors/include/BIF_glutil.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/BIF_glutil.h	2008-01-16 14:28:20 UTC (rev 13260)
+++ branches/blender2.5/blender/source/blender/editors/include/BIF_glutil.h	2008-01-16 19:49:34 UTC (rev 13261)
@@ -22,13 +22,7 @@
  *
  * Contributor(s): Blender Foundation 2002-2008
  *
-<<<<<<< .mine
- * Contributor(s): none yet.
- *
  * ***** END GPL LICENSE BLOCK *****
-=======
- * ***** END GPL LICENSE BLOCK *****
->>>>>>> .r13159
  */
 
 #ifndef BIF_GLUTIL_H
@@ -39,7 +33,9 @@
 
 void fdrawline(float x1, float y1, float x2, float y2);
 void fdrawbox(float x1, float y1, float x2, float y2);
-void sdrawline(short x1, short y1, short x2, short y2);
+void sdrawline(short x1, short y1, short x2, short y2);
+void sdrawtri(short x1, short y1, short x2, short y2);
+void sdrawtrifill(short x1, short y1, short x2, short y2, float r, float g, float b);
 void sdrawbox(short x1, short y1, short x2, short y2);
 
 void sdrawXORline(int x0, int y0, int x1, int y1);

Modified: branches/blender2.5/blender/source/blender/editors/screen/glutil.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/glutil.c	2008-01-16 14:28:20 UTC (rev 13260)
+++ branches/blender2.5/blender/source/blender/editors/screen/glutil.c	2008-01-16 19:49:34 UTC (rev 13261)
@@ -91,6 +91,42 @@
 	v[0] = x2; v[1] = y2;
 	glVertex2sv(v);
 	glEnd();
+}
+
+/*
+
+	x1,y2
+	|  \
+	|   \
+	|    \
+	x1,y1-- x2,y1
+
+*/
+
+void sdrawtripoints(short x1, short y1, short x2, short y2){
+	short v[2];
+	v[0]= x1; v[1]= y1;
+	glVertex2sv(v);
+	v[0]= x1; v[1]= y2;
+	glVertex2sv(v);
+	v[0]= x2; v[1]= y1;
+	glVertex2sv(v);
+	glEnd();
+}
+
+void sdrawtri(short x1, short y1, short x2, short y2)
+{
+	glBegin(GL_LINE_STRIP);
+	sdrawtripoints(x1, y1, x2, y2);
+	glEnd();
+}
+
+void sdrawtrifill(short x1, short y1, short x2, short y2, float r, float g, float b)
+{
+	glBegin(GL_TRIANGLES);
+	glColor3f(r, g, b);
+	sdrawtripoints(x1, y1, x2, y2);
+	glEnd();
 }
 
 void sdrawbox(short x1, short y1, short x2, short y2)

Modified: branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c	2008-01-16 14:28:20 UTC (rev 13260)
+++ branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c	2008-01-16 19:49:34 UTC (rev 13261)
@@ -699,10 +699,14 @@
 
 static void drawscredge_area(ScrArea *sa)
 {
-	short x1= sa->v1->vec.x;
-	short y1= sa->v1->vec.y;
-	short x2= sa->v3->vec.x;
-	short y2= sa->v3->vec.y;
+	short x1= sa->v1->vec.x;
+	short xa1= x1+HEADERY;
+	short y1= sa->v1->vec.y;
+	short ya1= y1+HEADERY;
+	short x2= sa->v3->vec.x;
+	short xb2= x2-HEADERY;
+	short y2= sa->v3->vec.y;
+	short yb2= y2-HEADERY;
 	
 	cpack(0x0);
 	
@@ -710,14 +714,19 @@
 	sdrawline(x2, y1, x2, y2);
 	
 	/* left border area */
-	if(x1>0) { // otherwise it draws the emboss of window over
+	if(x1>0) { /* otherwise it draws the emboss of window over */
 		sdrawline(x1, y1, x1, y2);
-	}	
+	}
+	
 	/* top border area */
 	sdrawline(x1, y2, x2, y2);
 	
 	/* bottom border area */
-	sdrawline(x1, y1, x2, y1);
+	sdrawline(x1, y1, x2, y1);
+	
+	/* temporary viz for 'action corner' */
+	sdrawtrifill(x1, y1, xa1, ya1, .2, .2, .2);
+	
 }
 
 void ED_screen_do_listen(bScreen *screen, wmNotifier *note)
@@ -741,7 +750,7 @@
 	
 	wm_subwindow_set(win, win->screen->mainwin);
 	
-	for(sa= win->screen->areabase.first; sa; sa= sa->next)
+	for(sa= win->screen->areabase.first; sa; sa= sa->next)
 		drawscredge_area(sa);
 
 	printf("draw screen\n");

Modified: branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c	2008-01-16 14:28:20 UTC (rev 13260)
+++ branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c	2008-01-16 19:49:34 UTC (rev 13261)
@@ -180,8 +180,6 @@
 			/* notifiers for screen redraw */
 			if(win->screen->do_refresh)
 				ED_screen_refresh(C->wm, win);
-			if(win->screen->do_draw)
-				ED_screen_draw(win);
 			
 			for(sa= win->screen->areabase.first; sa; sa= sa->next) {
 				ARegion *ar= sa->regionbase.first;
@@ -197,7 +195,12 @@
 					if(ar->swinid && ar->do_draw)
 						ED_region_do_draw(C, ar);
 				}
-			}
+			}
+			
+			/* move this here so we can do area 'overlay' drawing */
+			if(win->screen->do_draw)
+				ED_screen_draw(win);
+			
 			wm_window_swap_buffers(win);
 		}
 	}





More information about the Bf-blender-cvs mailing list