|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T x
Length: 2965 (0xb95) Types: TextFile Names: »xbit.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/X/Xgo/xbit.c«
/* * $Header: xbit.c,v 1.2 88/02/13 12:53:11 hale Locked $ */ /* Copyright 1987 Greg Hale Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ #include "xgo.h" #include "xpiecenum.h" #include "Xmask.h" #include "Xmask0.h" #include "Xpiecemask.h" #include "Xintersect.h" #include "Xpoint.h" #include "Xblack.h" #include "Xwhite.h" #include "Xdl.h" #include "Xdr.h" #include "Xul.h" #include "Xur.h" #include "Xu.h" #include "Xr.h" #include "Xd.h" #include "Xl.h" #include "Xneu.h" #include "Xfwh.h" #include "Xfbl.h" #include "XButton.h" #define MAXPIECES 20 static Bitmap p[MAXPIECES]; InitBit() { p[Smask]=XStoreBitmap(25,25,mask_bits); p[Smask0]=XStoreBitmap(25,25,mask0_bits); p[Spiecemask]=XStoreBitmap(25,25,piecemask_bits); p[Sintersect]=XStoreBitmap(25,25,intersect_bits); p[Spoint]=XStoreBitmap(25,25,point_bits); p[Swhite]=XStoreBitmap(25,25,black_bits); p[Sblack]=XStoreBitmap(25,25,white_bits); p[Sdl]=XStoreBitmap(25,25,dl_bits); p[Sdr]=XStoreBitmap(25,25,dr_bits); p[Sul]=XStoreBitmap(25,25,ul_bits); p[Sur]=XStoreBitmap(25,25,ur_bits); p[Su]=XStoreBitmap(25,25,u_bits); p[Sr]=XStoreBitmap(25,25,r_bits); p[Sd]=XStoreBitmap(25,25,d_bits); p[Sl]=XStoreBitmap(25,25,l_bits); p[Sneu]=XStoreBitmap(25,25,neu_bits); p[Sfbl]=XStoreBitmap(25,25,fwh_bits); p[Sfwh]=XStoreBitmap(25,25,fbl_bits); p[Sbutton]=XStoreBitmap(80,30,XButton_bits); } #define PltShp(pc) XPixFill(Wboard,x*25,y*25,25,25,WhitePixel,pc,GXcopy,AllPlanes); #define ErsShp(pc) XPixFill(Wboard,x*25,y*25,25,25,WhitePixel,pc,GXclear,AllPlanes); PltPiece(x,y,pi) int x,y,pi; { PltShp(p[cp(x,y)]); switch (pi) { WHEN 1: ErsShp(p[Spiecemask]); PltShp(p[Sblack]); WHEN 2: ErsShp(p[Spiecemask]); PltShp(p[Swhite]); WHEN 4: ErsShp(p[Spiecemask]); PltShp(p[Sfbl]); WHEN 5: ErsShp(p[Spiecemask]); PltShp(p[Sfwh]); WHEN 0: default: ErsShp(p[Spiecemask]); PltShp(p[cp(x,y)]); } } cp(x,y) int x,y; { extern int handin; if ((x==handin || x==MAXX-1-handin || x == (MAXX-1)/2) && (y==handin || y==MAXY-1-handin || y == (MAXY-1)/2)) { return Spoint; } else if (x == 0) { if (y == 0) return Sul; if (y == MAXY-1) return Sdl; return Sl; } else if (x == MAXX-1) { if (y==0) return Sur; if (y==MAXY-1) return Sdr; return Sr; } else if (y == 0) { return Su; } else if (y == MAXY-1) { return Sd; } else return Sintersect; } \f /* * $Log: xbit.c,v $ * Revision 1.2 88/02/13 12:53:11 hale * modified redraw to draw background behind shapes * so there are no blank spots between pieces on redraw. * */