/* Example programs for BETATRON game library. ** Copyright (C) 1997 Liouros Thanasis, liouros@hotmail.com ** ** demo.cc: This file is part of the example programs for BETATRON game ** library and can be used and/or distributed only under the terms ** of the GNU General Public License. See doc/examples.txt for ** details. */ #include #include #include "world.h" #include "plkeys.h" #include "pltimer.h" #include #include #include #include #include "plvesa.h" #include "guyele.h" #include "cloud.h" #include "scroll.h" #define DXSCROLL 4 #define DYSCROLL 3 #define BITMAPSNO 22 // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // loads a raw bitmap from the disk into a raw buffer char loadraw(char *fname,char *&frame,unsigned short &l,unsigned short &h) { FILE *f; if ( (f=fopen(fname,"rb")) == NULL ) return 0; fread(&l,2,1,f); fread(&h,2,1,f); if ( (frame = (char *)malloc(l*h)) == NULL ) { fclose(f); return 0; } fread(frame,l*h,1,f); fclose(f); return 1; } // ---------------------- exit object's action function --------------------- void exitaction(TOobject *s) { TOworld *w=s->owner; // if ESCAPE was hit then finish. if ( pl_testkey(mcESC) ) w->exitbit=1; // if P was hit then pause until P is hit again if (pl_testkey(mcP) ) { for (;pl_testkey(mcP);); for (;!pl_testkey(mcP);); for (;pl_testkey(mcP);); } if (pl_testkey(mcR) ) { pl_restoreVESAstate(); w->refresh(); w->rgbset(0,0,0,0); } }; //---------------------------------------------------------------------- //----------------- action function of the C 1997 logo ----------------- void stable(TOsprite *s) { s->x=s->owner->x+274; s->y=s->owner->y+3; }; //---------------------------------------------------------------------- void tileeffect(TOobject *o) { #define STX 43 #define STY 16 #define TIME 30 TOworld *w=o->owner; static int i=STX,j=STY; static short dx=1,dy=0; static short til=0; o->time+=w->dticks; if ( (o->time)