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:
authorTon Roosendaal <ton@blender.org>2003-11-18 14:22:17 +0300
committerTon Roosendaal <ton@blender.org>2003-11-18 14:22:17 +0300
commitbc22e2242a528b7b7917b2a04958adf37e3c45cc (patch)
tree75c3cf2a82dc005db76ded905efd7d4731224c86 /source/blender
parent683b51fe83b3fe0c147c5c07067a442948dcf82d (diff)
- removed temporal patch from myortho2() in mywindow.c, and changed
all calls to ortho2 with correctness offset of 0.375 instead of 0.5. this efficiently solves bug in drawing UV lines as reported. cvS: ----------------------------------------------------------------------
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/src/butspace.c2
-rw-r--r--source/blender/src/drawaction.c6
-rw-r--r--source/blender/src/drawimage.c2
-rw-r--r--source/blender/src/drawimasel.c6
-rw-r--r--source/blender/src/drawipo.c4
-rw-r--r--source/blender/src/drawnla.c4
-rw-r--r--source/blender/src/drawoops.c2
-rw-r--r--source/blender/src/drawseq.c2
-rw-r--r--source/blender/src/drawsound.c4
-rw-r--r--source/blender/src/drawtext.c2
-rw-r--r--source/blender/src/editscreen.c8
-rw-r--r--source/blender/src/filesel.c4
-rw-r--r--source/blender/src/mywindow.c8
-rw-r--r--source/blender/src/space.c2
-rw-r--r--source/blender/src/spacetypes.c2
-rw-r--r--source/blender/src/view.c4
16 files changed, 29 insertions, 33 deletions
diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c
index 5488c71d8c7..8313d19a3a8 100644
--- a/source/blender/src/butspace.c
+++ b/source/blender/src/butspace.c
@@ -455,7 +455,7 @@ void drawbutspace(ScrArea *sa, void *spacedata)
sbuts->mainbo= sbuts->mainb;
sbuts->tabo= sbuts->tab[sbuts->mainb];
- myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
+ myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
draw_area_emboss(sa);
myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c
index fc79033c496..ff94e60c551 100644
--- a/source/blender/src/drawaction.c
+++ b/source/blender/src/drawaction.c
@@ -125,7 +125,7 @@ void meshactionbuts(SpaceAction *saction, Key *key)
* correctly *grumble*
*/
mywinset(curarea->win);
- myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+ myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
sprintf(str, "actionbuttonswin %d", curarea->win);
block= uiNewBlock (&curarea->uiblocks, str,
@@ -615,7 +615,7 @@ void drawactionspace(ScrArea *sa, void *spacedata)
/* Draw scroll */
mywinset(curarea->win); // reset scissor too
if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+ myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
if(G.v2d->scroll) drawscroll(0);
}
@@ -630,7 +630,7 @@ void drawactionspace(ScrArea *sa, void *spacedata)
}
mywinset(curarea->win); // reset scissor too
- myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+ myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
draw_area_emboss(sa);
curarea->win_swap= WIN_BACK_OK;
}
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c
index edfd5e30ded..cd13b7eb920 100644
--- a/source/blender/src/drawimage.c
+++ b/source/blender/src/drawimage.c
@@ -516,7 +516,7 @@ void drawimagespace(ScrArea *sa, void *spacedata)
calc_image_view(G.sima, 'f'); /* float */
}
- myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+ myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
draw_area_emboss(sa);
myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
}
diff --git a/source/blender/src/drawimasel.c b/source/blender/src/drawimasel.c
index 3c73ca8061e..03ec40a3638 100644
--- a/source/blender/src/drawimasel.c
+++ b/source/blender/src/drawimasel.c
@@ -142,7 +142,7 @@ void viewgate(short sx, short sy, short ex, short ey)
wx = curarea->winrct.xmin; wy = curarea->winrct.ymin;
glViewport(wx+sx, wy+sy, (wx+ex )-(wx+sx)+1, (wy+ey )-(wy+sy)+1);
glScissor(wx+sx, wy+sy, (wx+ex )-(wx+sx)+1, (wy+ey )-(wy+sy)+1);
- myortho2((float)sx-0.5 , (float)ex-0.5, (float)sy-0.5, (float)ey-0.5);
+ myortho2((float)sx-0.375 , (float)ex-0.375, (float)sy-0.375, (float)ey-0.375);
}
void areaview (void)
@@ -151,7 +151,7 @@ void areaview (void)
wx = curarea->winrct.xmin; wy = curarea->winrct.ymin;
glViewport(wx, wy, curarea->winx, curarea->winy);
glScissor(wx, wy, curarea->winx, curarea->winy);
- myortho2(-0.5, (float)(curarea->winx)-0.5, -0.5, (float)(curarea->winy)-0.5);
+ myortho2(-0.375, (float)(curarea->winx)-0.375, -0.375, (float)(curarea->winy)-0.375);
}
@@ -867,7 +867,7 @@ void drawimaselspace(ScrArea *sa, void *spacedata)
simasel= curarea->spacedata.first;
/* ortho: xmin xmax, ymin, ymax! */
- myortho2(-0.5, (float)(curarea->winx)-0.5, -0.5, (float)(curarea->winy)-0.5);
+ myortho2(-0.375, (float)(curarea->winx)-0.375, -0.375, (float)(curarea->winy)-0.375);
if (simasel->fase == 0){
checkdir(simasel->dir);
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c
index ad4a5319845..aa1dba8454b 100644
--- a/source/blender/src/drawipo.c
+++ b/source/blender/src/drawipo.c
@@ -1676,7 +1676,7 @@ void drawipospace(ScrArea *sa, void *spacedata)
if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
/* ortho at pixel level sa */
- myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+ myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
if(v2d->scroll) {
drawscroll(disptype);
@@ -1691,7 +1691,7 @@ void drawipospace(ScrArea *sa, void *spacedata)
draw_ipogrid();
}
- myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+ myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
draw_area_emboss(sa);
/* it is important to end a view in a transform compatible with buttons */
diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c
index fc36f1e1019..5434505da8f 100644
--- a/source/blender/src/drawnla.c
+++ b/source/blender/src/drawnla.c
@@ -447,7 +447,7 @@ void drawnlaspace(ScrArea *sa, void *spacedata)
/* Draw scroll */
mywinset(curarea->win); // reset scissor too
if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+ myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
if(G.v2d->scroll) drawscroll(0);
}
@@ -455,7 +455,7 @@ void drawnlaspace(ScrArea *sa, void *spacedata)
draw_nlatree();
mywinset(curarea->win); // reset scissor too
- myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+ myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
draw_area_emboss(sa);
curarea->win_swap= WIN_BACK_OK;
diff --git a/source/blender/src/drawoops.c b/source/blender/src/drawoops.c
index a0ea01ff770..5297f260d38 100644
--- a/source/blender/src/drawoops.c
+++ b/source/blender/src/drawoops.c
@@ -423,7 +423,7 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
/* ortho at pixel level curarea */
- myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+ myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
if(G.v2d->scroll) {
drawscroll(0);
}
diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c
index d1c41eebc23..81da1d40b9f 100644
--- a/source/blender/src/drawseq.c
+++ b/source/blender/src/drawseq.c
@@ -646,7 +646,7 @@ void drawseqspace(ScrArea *sa, void *spacedata)
mywinset(curarea->win);
/* ortho at pixel level curarea */
- myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+ myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
if(G.v2d->scroll) {
diff --git a/source/blender/src/drawsound.c b/source/blender/src/drawsound.c
index a7acd3ba7dc..bafd27f0833 100644
--- a/source/blender/src/drawsound.c
+++ b/source/blender/src/drawsound.c
@@ -229,7 +229,7 @@ void drawsoundspace(ScrArea *sa, void *spacedata)
mywinset(curarea->win);
/* ortho at pixel level curarea */
- myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+ myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
if(G.v2d->scroll) {
@@ -237,7 +237,7 @@ void drawsoundspace(ScrArea *sa, void *spacedata)
}
}
- myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5);
+ myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
draw_area_emboss(sa);
curarea->win_swap= WIN_BACK_OK;
}
diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c
index bdbf753adc4..0e00824b7e3 100644
--- a/source/blender/src/drawtext.c
+++ b/source/blender/src/drawtext.c
@@ -552,7 +552,7 @@ void drawtextspace(ScrArea *sa, void *spacedata)
BIF_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT);
- myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
+ myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
draw_area_emboss(sa);
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
index 7a2d7e91ac2..9c32ff6d54f 100644
--- a/source/blender/src/editscreen.c
+++ b/source/blender/src/editscreen.c
@@ -366,9 +366,9 @@ void scrarea_do_headchange(ScrArea *area)
float ofs= area->headbutofs;
if (area->headertype==HEADERDOWN) {
- bwin_ortho2(area->headwin, -0.5+ofs, area->headrct.xmax-area->headrct.xmin-0.5+ofs, -3.5, area->headrct.ymax-area->headrct.ymin-3.5);
+ bwin_ortho2(area->headwin, -0.375+ofs, area->headrct.xmax-area->headrct.xmin-0.375+ofs, -3.375, area->headrct.ymax-area->headrct.ymin-3.375);
} else if (area->headertype==HEADERTOP) {
- bwin_ortho2(area->headwin, -0.5+ofs, area->headrct.xmax-area->headrct.xmin-0.5+ofs, -2.5, area->headrct.ymax-area->headrct.ymin-2.5);
+ bwin_ortho2(area->headwin, -0.375+ofs, area->headrct.xmax-area->headrct.xmin-0.375+ofs, -2.375, area->headrct.ymax-area->headrct.ymin-2.375);
}
}
@@ -1780,7 +1780,7 @@ static bScreen *addscreen(char *name) /* use setprefsize() if you want somethin
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- myortho2(-0.5, sc->sizex-0.5, -0.5, sc->sizey-0.5);
+ myortho2(-0.375, sc->sizex-0.375, -0.375, sc->sizey-0.375);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -2930,7 +2930,7 @@ void drawscreen(void)
ScrArea *sa;
mywinset(G.curscreen->mainwin);
- myortho2(-0.5, (float)G.curscreen->sizex-0.5, -0.5, (float)G.curscreen->sizey-0.5);
+ myortho2(-0.375, (float)G.curscreen->sizex-0.375, -0.375, (float)G.curscreen->sizey-0.375);
sa= G.curscreen->areabase.first;
while(sa) {
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
index a13520281a5..c0bbc6f1b3e 100644
--- a/source/blender/src/filesel.c
+++ b/source/blender/src/filesel.c
@@ -1141,7 +1141,7 @@ void drawfilespace(ScrArea *sa, void *spacedata)
char name[20];
char *menu;
- myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5);
+ myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
BIF_GetThemeColor3fv(TH_HEADER, col); // basic undrawn color is border
glClearColor(col[0], col[1], col[2], 0.0);
@@ -1197,7 +1197,7 @@ void drawfilespace(ScrArea *sa, void *spacedata)
/* others diskfree etc ? */
scrarea_queue_headredraw(curarea);
- myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
+ myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
draw_area_emboss(sa);
curarea->win_swap= WIN_BACK_OK;
diff --git a/source/blender/src/mywindow.c b/source/blender/src/mywindow.c
index a9bc8d756d8..060cef8abc5 100644
--- a/source/blender/src/mywindow.c
+++ b/source/blender/src/mywindow.c
@@ -427,15 +427,11 @@ void mywinposition(int winid, int xmin, int xmax, int ymin, int ymax) /* watch:
void bwin_ortho(int winid, float x1, float x2, float y1, float y2, float n, float f)
{
bWindow *bwin= bwin_from_winid(winid);
- float offs= 0.125;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- // in blender it's always called with -0.5... according to opengl
- // manual it should be (-)0.375 for correctness.
-
- //offs= 0.01*G.rt;
- glOrtho(x1+offs, x2+offs, y1+offs, y2+offs, n, f);
+
+ glOrtho(x1, x2, y1, y2, n, f);
glGetFloatv(GL_PROJECTION_MATRIX, (float *)bwin->winmat);
glMatrixMode(GL_MODELVIEW);
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 29da5bead05..098dc6e0cc3 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -2450,7 +2450,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
uiDrawBlock(block);
- myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5);
+ myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
draw_area_emboss(sa);
myortho2(0.0, 1280.0, 0.0, curarea->winy/fac);
sa->win_swap= WIN_BACK_OK;
diff --git a/source/blender/src/spacetypes.c b/source/blender/src/spacetypes.c
index 8a0ba57f373..060f00d64a7 100644
--- a/source/blender/src/spacetypes.c
+++ b/source/blender/src/spacetypes.c
@@ -124,7 +124,7 @@ void scrarea_do_winchange(ScrArea *area)
st->winchange(area, area->spacedata.first);
} else {
if (!BLI_rcti_is_empty(&area->winrct)) {
- bwin_ortho2(area->win, -0.5, area->winrct.xmax-area->winrct.xmin-0.5, -0.5, area->winrct.ymax-area->winrct.ymin-0.5);
+ bwin_ortho2(area->win, -0.375, area->winrct.xmax-area->winrct.xmin-0.375, -0.375, area->winrct.ymax-area->winrct.ymin-0.375);
glLoadIdentity();
}
}
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index 5127ce78fbe..2d45884d6cd 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -94,7 +94,7 @@ void persp_general(int a)
glPushMatrix();
glMatrixMode(GL_MODELVIEW);
- myortho2(-0.5, ((float)(curarea->winx))-0.5, -0.5, ((float)(curarea->winy))-0.5);
+ myortho2(-0.375, ((float)(curarea->winx))-0.375, -0.375, ((float)(curarea->winy))-0.375);
glLoadIdentity();
}
else if(a== 1) {
@@ -117,7 +117,7 @@ void persp(int a)
mygetmatrix(G.vd->viewmat1);
}
else if(a== PERSP_WIN) { // only set
- myortho2(-0.5, (float)(curarea->winx)-0.5, -0.5, (float)(curarea->winy)-0.5);
+ myortho2(-0.375, (float)(curarea->winx)-0.375, -0.375, (float)(curarea->winy)-0.375);
glLoadIdentity();
}
else if(a== PERSP_VIEW) {