diff options
author | rsc <devnull@localhost> | 2006-07-18 15:26:33 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-07-18 15:26:33 +0000 |
commit | 28b49df3542a635cca788f3de213385f3fcb6334 (patch) | |
tree | a3a30774249929e66988bf77e76df9459acb50bc /src/cmd/venti/srv/graph.c | |
parent | 686bd37d9d8db5e3b969a3aa2d5b455e0976b262 (diff) | |
download | plan9port-28b49df3542a635cca788f3de213385f3fcb6334.tar.gz plan9port-28b49df3542a635cca788f3de213385f3fcb6334.tar.bz2 plan9port-28b49df3542a635cca788f3de213385f3fcb6334.zip |
assorted changes from Plan 9
Diffstat (limited to 'src/cmd/venti/srv/graph.c')
-rw-r--r-- | src/cmd/venti/srv/graph.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/cmd/venti/srv/graph.c b/src/cmd/venti/srv/graph.c index 647c74b2..9c906ad7 100644 --- a/src/cmd/venti/srv/graph.c +++ b/src/cmd/venti/srv/graph.c @@ -55,7 +55,11 @@ ginit(void) first = 0; memimageinit(); +#ifdef PLAN9PORT smallfont = openmemsubfont(unsharp("#9/font/lucsans/lstr.10")); +#else + smallfont = openmemsubfont("/lib/font/bit/lucidasans/lstr.10"); +#endif black = memblack; blue = allocrepl(DBlue); red = allocrepl(DRed); @@ -121,7 +125,7 @@ statgraph(Graph *g) if(g->wid > nelem(bin)) g->wid = nelem(bin); if(g->fill < 0) - g->fill = ((uint)(uintptr)g->arg>>8)%nelem(lofill); + g->fill = ((uint)g->arg>>8)%nelem(lofill); if(g->fill > nelem(lofill)) g->fill %= nelem(lofill); @@ -151,7 +155,7 @@ statgraph(Graph *g) qlock(&memdrawlock); ginit(); if(smallfont==nil || black==nil || blue==nil || red==nil || hifill==nil || lofill==nil){ - werrstr("graphics initialization failed"); + werrstr("graphics initialization failed: %r"); qunlock(&memdrawlock); return nil; } @@ -186,12 +190,12 @@ statgraph(Graph *g) if(0) if(lastlo != -1){ if(lastlo < lo) - memimagedraw(m, Rect(x-1, lastlo, x, lo), hifill[g->fill], ZP, memopaque, ZP, S); + memimagedraw(m, Rect(x-1, lastlo, x, lo), hifill[g->fill%nelem(hifill)], ZP, memopaque, ZP, S); else if(lastlo > lo) - memimagedraw(m, Rect(x-1, lo, x, lastlo), hifill[g->fill], ZP, memopaque, ZP, S); + memimagedraw(m, Rect(x-1, lo, x, lastlo), hifill[g->fill%nelem(hifill)], ZP, memopaque, ZP, S); } - memimagedraw(m, Rect(x, hi, x+1,lo), hifill[g->fill], ZP, memopaque, ZP, S); - memimagedraw(m, Rect(x, lo, x+1, r.max.y), lofill[g->fill], ZP, memopaque, ZP, S); + memimagedraw(m, Rect(x, hi, x+1,lo), hifill[g->fill%nelem(hifill)], ZP, memopaque, ZP, S); + memimagedraw(m, Rect(x, lo, x+1, r.max.y), lofill[g->fill%nelem(lofill)], ZP, memopaque, ZP, S); lastlo = lo; } |