Commits

Anonymous committed 21f0d4f

* convertion des textures par avec SDL_DisplayFormat() : division par 2 du temps CPU ! :)

Comments (0)

Files changed (2)

 	}
 
 	void vsync() {
-		//SDL_UpdateRect( mSurface, 0, 0, WIDTH, HEIGHT );
-		//SDL_Delay( 1 );
 		SDL_Flip(gScreen.mSurface);
 
 		mDelay = 16 - ( SDL_GetTicks() - mMilliseconds );

src/texturemanager.d

 		if( p != null ) {
 			return( *p );
 		}
-		else {
-			SDL_Surface* s = IMG_Load( toStringz( "data/" ~ filename ) );
+		else {
+			SDL_Surface* temp = IMG_Load( toStringz( "data/" ~ filename ) );
+			SDL_Surface* s = SDL_DisplayFormatAlpha(temp);
+			SDL_FreeSurface( temp );
 			assert( s != null );
 			mTextureList[ filename ] = s;
 			return s;