home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 4 / CD_Magazyn_EXEC_nr_4.iso / Recent / dev / c / GSys.lha / gsys / GangstahSystem.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-10-14  |  842 b   |  52 lines

  1.  
  2. #define GAMIGA
  3. #ifdef __PPC__
  4. #define GAMIGA_PPC    // må være i tillegg til GAMIGA
  5. #endif
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include <math.h>
  11.  
  12. #ifdef __GNUC__
  13.  
  14. #else
  15.  
  16. #endif
  17.  
  18. #include "gsystem/GFile.cpp"
  19. #include "ggraphics/GScreen.cpp"
  20.  
  21. void main(int argc,char *argv[])
  22. {
  23.     GScreen *myscr = new GScreen(320, 200, 24);
  24.     GFile *file = new GFile("etc:fun/donut24.dat");
  25.  
  26.     if ( file && file->IsErrorFree() )
  27.     {
  28.         myscr->AttachOwnPixelArray();
  29.         ULONG *bmap = myscr->GetOwnPixelArray();
  30.  
  31.         ULONG bmap2[256*256*2];
  32.         file->FileRead((void *)&bmap2, 256*256*4);
  33.  
  34.         for (int y = 0; y < 256; y++)
  35.         {
  36.             for (int x = 0; x < 256; x++)
  37.             {
  38.                 bmap[(y*320)+x] = bmap2[(y*256)+x];
  39.             }
  40.         }
  41.  
  42.         myscr->LoadPixelArray();
  43.  
  44.         while ( SMSG_LMD != myscr->CheckScreenMsgs() )
  45.         {
  46.         }
  47.     }
  48.     delete file;
  49.     delete myscr;
  50.  
  51. } // end of program
  52.