home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 November / Chip_2002-11_cd1.bin / oddech / orbital / orbital.exe / src / logoscreen.cpp < prev    next >
C/C++ Source or Header  |  2002-07-14  |  2KB  |  68 lines

  1. ///////////////////////////////////////////////
  2. // 
  3. //  Snipe2d ludum dare 48h compo entry
  4. //
  5. //  Jari Komppa aka Sol 
  6. //  http://iki.fi/sol
  7. // 
  8. ///////////////////////////////////////////////
  9. // License
  10. ///////////////////////////////////////////////
  11. // 
  12. //     This software is provided 'as-is', without any express or implied
  13. //     warranty.    In no event will the authors be held liable for any damages
  14. //     arising from the use of this software.
  15. // 
  16. //     Permission is granted to anyone to use this software for any purpose,
  17. //     including commercial applications, and to alter it and redistribute it
  18. //     freely, subject to the following restrictions:
  19. // 
  20. //     1. The origin of this software must not be misrepresented; you must not
  21. //        claim that you wrote the original software. If you use this software
  22. //        in a product, an acknowledgment in the product documentation would be
  23. //        appreciated but is not required.
  24. //     2. Altered source versions must be plainly marked as such, and must not be
  25. //        misrepresented as being the original software.
  26. //     3. This notice may not be removed or altered from any source distribution.
  27. // 
  28. // (eg. same as ZLIB license)
  29. //
  30. ///////////////////////////////////////////////
  31. //
  32. // Houses are taken from a satellite picture of glasgow.
  33. //
  34. // The sources are a mess, as I didn't even try to do anything
  35. // really organized here.. and hey, it's a 48h compo =)
  36. //
  37. #include "snipe2d.h"
  38.  
  39. void logoscreen()
  40. {
  41.     SDL_Surface *logoscreen = SDL_LoadBMP("logoscreen.bmp");
  42.     SDL_BlitSurface(logoscreen, NULL, gScreen, NULL);
  43.     SDL_UpdateRect(gScreen, 0, 0, 640, 480);    
  44.     init();
  45.     int go = 0;
  46.     int startTick = GetTickCount();
  47.     while (!go)
  48.     {
  49.         SDL_Event event;
  50.         while ( SDL_PollEvent(&event) ) 
  51.         {
  52.             switch (event.type) 
  53.             {
  54.             case SDL_KEYUP:
  55.                 if (event.key.keysym.sym == SDLK_ESCAPE)
  56.                     exit(0);
  57.                 break;
  58.             case SDL_MOUSEBUTTONUP:
  59.                 if ((GetTickCount() - startTick) > 500)
  60.                     go = 1;
  61.                 break;
  62.             case SDL_QUIT:
  63.                 exit(0);
  64.             }
  65.         }
  66.     }
  67.     SDL_FreeSurface(logoscreen);
  68. }