Pārlūkot izejas kodu

The SDL 1.3 is finaly working

Panagiotis Christopoulos Charitos 15 gadi atpakaļ
vecāks
revīzija
c3c28ff20b
4 mainītis faili ar 358 papildinājumiem un 360 dzēšanām
  1. 351 356
      build/debug/Makefile
  2. 5 3
      src/Util/App.cpp
  3. 1 0
      src/Util/App.h
  4. 1 1
      src/Util/Common.h

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 351 - 356
build/debug/Makefile


+ 5 - 3
src/Util/App.cpp

@@ -72,7 +72,7 @@ void App::initWindow()
 
 
 	// the icon
-	/*iconImage = SDL_LoadBMP("gfx/icon.bmp");
+	iconImage = SDL_LoadBMP("gfx/icon.bmp");
 	if( iconImage == NULL )
 	{
 		ERROR( "Cannot load window icon" );
@@ -81,8 +81,9 @@ void App::initWindow()
 	{
 		Uint32 colorkey = SDL_MapRGB( iconImage->format, 255, 0, 255 );
 		SDL_SetColorKey( iconImage, SDL_SRCCOLORKEY, colorkey );
-		SDL_WM_SetIcon( iconImage, NULL );
-	}*/
+		//SDL_WM_SetIcon( iconImage, NULL );
+		SDL_SetWindowIcon( windowId, iconImage );
+	}
 
 	INFO( "SDL window initialization ends" );
 }
@@ -114,6 +115,7 @@ void App::swapBuffers()
 //=====================================================================================================================================
 void App::quitApp( int code )
 {
+	SDL_FreeSurface( iconImage );
 	SDL_GL_DeleteContext( glContext );
 	SDL_DestroyWindow( windowId );
 	SDL_Quit();

+ 1 - 0
src/Util/App.h

@@ -23,6 +23,7 @@ class App
 		uint time;
 		SDL_WindowID windowId;
 		SDL_GLContext glContext;
+		SDL_Surface* iconImage;
 		bool fullScreenFlag;
 
 	public:

+ 1 - 1
src/Util/Common.h

@@ -179,7 +179,7 @@ template<typename Type> class Vec: public vector<Type>
 	public:
 		Vec(): vector<Type>() {}
 		Vec( size_t size ): vector<Type>(size) {}
-		Vec( size_t size, Type val ): vector<Type>(val,size) {}
+		Vec( size_t size, Type val ): vector<Type>(size,val) {}
 
 		Type& operator[]( size_t n )
 		{

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels