Changed window size and removed stuff from main
authorIvan Hernandez <iturtleman128@gmail.com>
Sun, 12 Jul 2009 21:27:15 +0000 (16:27 -0500)
committerIvan Hernandez <iturtleman128@gmail.com>
Sun, 12 Jul 2009 21:27:15 +0000 (16:27 -0500)
Game.cpp
main.cpp

index 4bd9ca2..20518f5 100644 (file)
--- a/Game.cpp
+++ b/Game.cpp
@@ -12,7 +12,7 @@ Game::Game() : mCurrentLevel(0), mScreen(0)
        atexit (SDL_Quit);
 
        // Set 800x600 video mode
-       mScreen = SDL_SetVideoMode(800, 600, 32, SDL_SWSURFACE | SDL_DOUBLEBUF);
+       mScreen = SDL_SetVideoMode(640, 468, 32, SDL_SWSURFACE);
        if (!mScreen) {
                printf ("Couldn't set 800x600 32b video mode: %s\n", SDL_GetError ());
                exit (2);
index c5b187e..a63b101 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -17,37 +17,6 @@ template<class T> string to_string(const T& t)
     os << t;\r
     return os.str();\r
 }\r
-\r
-// Allocate a pointer to an SDL_Surface for the screen buffer \r
-// and for the image we want to load and display on screen.\r
-SDL_Surface *back = NULL;\r
-SDL_Surface *screen = NULL;\r
-SDL_Surface *image = NULL;\r
-\r
-//Sprite vikings1;\r
-//Sprite vikings2;\r
-//Sprite sun;\r
-\r
-vector<Sprite> SpriteList;//see about differnt containter HERE\r
-\r
-void DrawSprites()\r
-{\r
-       for(int i=0; i<SpriteList.size(); ++i)\r
-       {\r
-               SpriteList[i].clearBG();\r
-       }\r
-       for(int i=0; i<SpriteList.size(); ++i)\r
-       {\r
-               SpriteList[i].updateBG();\r
-       }\r
-       for(int i=0; i<SpriteList.size(); ++i)\r
-       {\r
-               SpriteList[i].draw();\r
-       }\r
-}\r
-\r
-//functions from other main\r
-\r
 //locks the screen for drawing pixels to the screen\r
 void Slock(SDL_Surface *screen)\r
 {   \r
@@ -113,123 +82,6 @@ bufp[0] = color;
     }\r
 }\r
 \r
-/*void draw ()\r
-{\r
-\r
-    Uint32 color;\r
-\r
-    // Create a black background using the screen pixel format (32 bpp)\r
-    color = SDL_MapRGB (screen->format, 0, 0, 0);\r
-    SDL_FillRect (screen, NULL, color);\r
-\r
-    // Set the image offset\r
-    SDL_BlitSurface(image, NULL, screen, &rect);\r
-\r
-    // Flip the working image buffer with the screen buffer\r
-    SDL_Flip (screen);\r
-\r
-    // Add a little pause...\r
-    SDL_Delay (1);\r
-}*/\r
-\r
-//blits whole image to specified location\r
-void DrawIMG(SDL_Surface *img, int x, int y)\r
-{\r
-    SDL_Rect dest;\r
-    dest.x = x;\r
-    dest.y = y;\r
-    SDL_BlitSurface(img, NULL, screen, &dest);\r
-}\r
-\r
-//blits the part of the image defined by x y w and h to the psecified position\r
-void DrawIMG(SDL_Surface *img, int x, int y,\r
-             int w, int h, int x2, int y2)\r
-{\r
-    SDL_Rect dest;\r
-    dest.x = x;\r
-    dest.y = y;\r
-    SDL_Rect src;\r
-    src.x = x2;\r
-    src.y = y2;\r
-    src.w = w;\r
-    src.h = h;\r
-    SDL_BlitSurface(img, &src, screen, &dest);\r
-}\r
-\r
-void DrawBG()\r
-{\r
-  DrawIMG(back, 0, 0);\r
-}\r
-\r
-//-------------------------------------------------------------------//\r
-// Function : init()    - Params : none\r
-// SDL Initialisation function\r
-// Instead of having a heavy and loaded main function, all the \r
-// setting up of our application is handled here\r
-\r
-bool init()\r
-{\r
-    return true;\r
-}\r
-\r
-\r
-\r
-//-------------------------------------------------------------------//\r
-// Function : draw()    - Params : none\r
-// Frame rendering function\r
-// This function is called on every loop, to draw the scene\r
-// It draws then swaps the work and screen buffer to display the scene\r
-void DrawScene(SDL_Surface *screen)\r
-{\r
-       /*Tutorial 1\r
-       Slock(screen);\r
-       for(int x=0;x<640;x++)\r
-       {  \r
-               for(int y=0;y<480;y++)\r
-           {\r
-                        DrawPixel(screen, x,y,y/2,y/2,x/3);\r
-           }\r
-       }\r
-       Sulock(screen);\r
-       */\r
-                                                                                                                                  \r
-    Uint32 color;\r
-\r
-    // Create a black background using the screen pixel format (32 bpp)\r
-    color = SDL_MapRGB (screen->format, 0, 0, 0);\r
-    SDL_FillRect (screen, NULL, color);\r
-       \r
-       //Draw BG\r
-       DrawBG();\r
-       \r
-       /*\r
-       vikings1.clearBG();\r
-       vikings2.clearBG();\r
-       sun.clearBG();\r
-\r
-       vikings1.updateBG();\r
-       vikings2.updateBG();\r
-       sun.updateBG();\r
-\r
-       vikings1.draw();\r
-       vikings2.draw();\r
-       sun.draw();\r
-       \r
-       //*/\r
-       DrawSprites();\r
-\r
-    // Set the image offset (change to draw a set of passed images)\r
-    //DrawIMG(image,x,y);\r
-    \r
-    // Flip the working image buffer with the screen buffer\r
-    SDL_Flip (screen);\r
-    \r
-    // Add a little pause...\r
-    SDL_Delay (1);\r
-}\r
-\r
-\r
-\r
 \r
 //-------------------------------------------------------------------//\r
 // Function : main()    - Params : argc, argv\r