Annotation of researchv9/jerq/src/lib/jj/clip.c, revision 1.1

1.1     ! root        1: #include       <jerq.h>
        !             2: #include       <font.h>
        !             3: 
        !             4: static Rectangle clipr;
        !             5: 
        !             6: Clip(r)
        !             7:        Rectangle r;
        !             8: {
        !             9:        clipr = r;
        !            10: }
        !            11: 
        !            12: Cbitblt(sb, sr, db, dp, fc)
        !            13:        Bitmap *sb, *db;
        !            14:        Rectangle sr;
        !            15:        Point dp;
        !            16: {
        !            17:        Rectangle r;
        !            18: 
        !            19:        r = raddp(sr, sub(dp, sr.origin));
        !            20:        if(rectclip(&r, clipr))
        !            21:        {
        !            22:                r = rsubp(r, sub(dp, sr.origin));
        !            23:                dp = add(dp, sub(r.origin, sr.origin));
        !            24:                bitblt(sb, r, db, dp, fc);
        !            25:        }
        !            26: }
        !            27: 
        !            28: Crectf(bp, r, fc)
        !            29:        Bitmap *bp;
        !            30:        Rectangle r;
        !            31: {
        !            32:        if(rectclip(&r, clipr))
        !            33:                rectf(bp, r, fc);
        !            34: }
        !            35: 
        !            36: Point
        !            37: Cstring(f, s, bp, p, fc)
        !            38:        Font *f;
        !            39:        char *s;
        !            40:        Bitmap *bp;
        !            41:        Point p;
        !            42:        Code fc;
        !            43: {
        !            44:        register c;
        !            45:        int full = (fc == F_STORE);
        !            46:        Rectangle r;
        !            47:        register Fontchar *i;
        !            48: 
        !            49:        if (full) {
        !            50:                r.origin.y = 0;
        !            51:                r.corner.y = f->height;
        !            52:        }
        !            53:        for (; c = *s++; p.x += i->width) {
        !            54:                i = f->info + c;
        !            55:                if (!full) {
        !            56:                        r.origin.y = i->top;
        !            57:                        r.corner.y = i->bottom;
        !            58:                }
        !            59:                r.origin.x = i->x;
        !            60:                r.corner.x = (i+1)->x;
        !            61:                Cbitblt(f->bits,r,bp,Pt(p.x+
        !            62:                        ((i->left & 0x80) ? i->left | 0xffffff00 : i->left),
        !            63:                        p.y+r.origin.y),fc);
        !            64:        }
        !            65:        return(p);
        !            66: }
        !            67: 
        !            68: Ctexture(bp, r, t, fc)
        !            69:        Bitmap *bp;
        !            70:        Rectangle r;
        !            71:        Texture *t;
        !            72:        Code fc;
        !            73: {
        !            74:        if(rectclip(&r, clipr))
        !            75:                texture(bp, r, t, fc);
        !            76: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.