Anonymous avatar Anonymous committed 6a631f7

* Mise a jour des PNGs pour utilisation de la colorkey ( et plus de l'alpha )
* Modifications de TextureManager et de Anim pour gestion des textures alpha si besoin
* Améliorations des menus et dialogues

Comments (0)

Files changed (60)

Add a comment to this file

data/bigwall1_1.png

Old
Old image
New
New image
Add a comment to this file

data/bigwall1_2.png

Old
Old image
New
New image
Add a comment to this file

data/bigwall1_3.png

Old
Old image
New
New image
Add a comment to this file

data/bigwall1_4.png

Old
Old image
New
New image
Add a comment to this file

data/bluedoor.png

Old
Old image
New
New image
Add a comment to this file

data/bluekey.png

Old
Old image
New
New image
Add a comment to this file

data/boss3.png

Old
Old image
New
New image
Add a comment to this file

data/boss_icon.png

Old
Old image
New
New image
Add a comment to this file

data/brick.png

Old
Old image
New
New image
Add a comment to this file

data/column_add.png

Old
Old image
New
New image
Add a comment to this file

data/column_delete.png

Old
Old image
New
New image
Add a comment to this file

data/delete.png

Old
Old image
New
New image
Add a comment to this file

data/doublejump.png

Old
Old image
New
New image
Add a comment to this file

data/editor_ennemi_h_left.png

Old
Old image
New
New image
Add a comment to this file

data/editor_ennemi_h_right.png

Old
Old image
New
New image
Add a comment to this file

data/editor_ennemi_v_down.png

Old
Old image
New
New image
Add a comment to this file

data/editor_ennemi_v_up.png

Old
Old image
New
New image
Add a comment to this file

data/ennemi_v_000001.png

Old
Old image
New
New image
Add a comment to this file

data/ennemi_v_000002.png

Old
Old image
New
New image
Add a comment to this file

data/ennemi_v_000003.png

Old
Old image
New
New image
Add a comment to this file

data/ennemi_v_000004.png

Old
Old image
New
New image
Add a comment to this file

data/greendoor.png

Old
Old image
New
New image
Add a comment to this file

data/greenkey.png

Old
Old image
New
New image
Add a comment to this file

data/hero_left_crouched_1.png

Old
Old image
New
New image
Add a comment to this file

data/hero_left_crouched_2.png

Old
Old image
New
New image
Add a comment to this file

data/hero_right_crouched_1.png

Old
Old image
New
New image
Add a comment to this file

data/hero_right_crouched_2.png

Old
Old image
New
New image
Add a comment to this file

data/horizontal_speed.png

Old
Old image
New
New image
Add a comment to this file

data/missile.png

Old
Old image
New
New image
Add a comment to this file

data/pointer.png

Old
Old image
New
New image
Add a comment to this file

data/powerup_missile.png

Old
Old image
New
New image
Add a comment to this file

data/princess_000001.png

Old
Old image
New
New image
Add a comment to this file

data/princess_000002.png

Old
Old image
New
New image
Add a comment to this file

data/princess_000003.png

Old
Old image
New
New image
Add a comment to this file

data/projectile_enemy.png

Old
Old image
New
New image
Add a comment to this file

data/projectile_hero.png

Old
Old image
New
New image
Add a comment to this file

data/reddoor.png

Old
Old image
New
New image
Add a comment to this file

data/redkey.png

Old
Old image
New
New image
Add a comment to this file

data/row_add.png

Old
Old image
New
New image
Add a comment to this file

data/row_delete.png

Old
Old image
New
New image
Add a comment to this file

data/save_0.png

Old
Old image
New
New image
Add a comment to this file

data/save_1.png

Old
Old image
New
New image
Add a comment to this file

data/save_2.png

Old
Old image
New
New image
Add a comment to this file

data/save_3.png

Old
Old image
New
New image
Add a comment to this file

data/save_4.png

Old
Old image
New
New image
Add a comment to this file

data/scrollbg.png

Old
Old image
New
New image
Add a comment to this file

data/shot.png

Old
Old image
New
New image
Add a comment to this file

data/super_shot.png

Old
Old image
New
New image
Add a comment to this file

data/vertical_speed.png

Old
Old image
New
New image
Add a comment to this file

data/wall1_round_left.png

Old
Old image
New
New image
Add a comment to this file

data/wall1_round_right.png

Old
Old image
New
New image
Add a comment to this file

data/wall2.png

Old
Old image
New
New image
 "#                           J  =   &  =              = #"
 "#                        ========== ===              = #"
 "#                 m          u                       = #"
-"# ,,,,,,,,,,,,,,,,=               ==================== #"
-"# ~~~~~~~~~~~~~~~~=               =            =       #"
-"# ~~~~~~~~~~~~~~~~=               =            =       #"
-"# ~~~~~~~~~~~~~~~~=  &         c        &&&   V  &&&&  #"
+"#,,,,,,,,,,,,,,,,,=               ==================== #"
+"#~~~~~~~~~~~~~~~~~=               =            =       #"
+"#~~~~~~~~~~~~~~~~~=               =            =       #"
+"#~~~~~~~~~~~~~~~~~=  &         c        &&&   V  &&&&  #"
 "########################################################"
 }
 
    EDITOR {
       METHOD = key
-      KEYCODE = 293
+      KEYCODE = 290
    }
  ; F12
 
 	/**
 	 * adds a frame to the list
 	 */
-	void addFrame( char[] texture ) {
-
-		mBitmapList ~= gTextureManager.get( texture );
-
+	void addFrame( char[] texture, bool useAlpha=false ) {
+		mBitmapList ~= gTextureManager.get( texture, useAlpha );
 	}
 
 
 	 * adds multiple frames in one call
 	 */
 	void addFrames( char[][] textures ... ) {
-
 		foreach( t; textures ) {
 			addFrame( t );
 		}
-
 	}
+
+	void addFramesAlpha( bool useAlpha, string[] textures ... ) {
+		foreach( t; textures ) {
+			addFrame( t, useAlpha );
+		}
+	}
 
 }
 
 
         switch( mSubPart.getState() ) {
 
-            case GAMEPART_STATE.UNPAUSE:
+            case GAMEPART_STATE.UNPAUSE: // from the pause menu
                 delete( mSubPart);
             break;
 
                 mState = GAMEPART_STATE.MAIN_MENU;
             break;
 
+			case GAMEPART_STATE.MENU_OPTIONS:
+				delete( mSubPart );
+				mSubPart = new MenuOptions();
+			break;
+
+			case GAMEPART_STATE.MAIN_MENU: // return from the option menu
+				delete( mSubPart);
+				mSubPart = new PauseMenu();
+			break;
+
             default:
             break;
         }
 import gameconstants;
 import std.stdio;
 import graphics;
+import time;
 
 class GUI {
 
 		}
 	}
 
+
+
 	class Panel: public Widget, Renderable {
 
 		Panel[] mPanels;
 		Button[] mButtons;
 		Label[] mLabels;
 		TextInput[] mTextInputs;
+		PanelEffect mEffect;
+
+		enum EFFECT { FROM_RIGHT };
 
 		int mMargin = 8;
 		int mLineHeight;
 		Button mHighlighted;
 		uint mSelectedTextInput;
 		bool mHidden=false;
+		bool drawBorder = true;
 
 		enum ALIGN { FREE, MIN, MAX, CENTERED };
 		ALIGN mHAlign = ALIGN.FREE;
 			return( m );
 		}
 
+		List addList( string[] labels ) {
+			List l = new List( this, mXInsert, mYInsert, labels );
+			mPanels ~= l;
+			resize( l.width, l.height );
+			return( l );
+		}
+
+
 		void changeChildWidth( int width ) {
 			mXInsert += width;
 		}
 				if( mBg != null ) SDL_FreeSurface( mBg );
 				mBg = mGraphics.createTransparentSurface( mW, mH, 0xA0, 0x000000 );
 
-				mRect.w =cast(ushort)mW;
-				mRect.h =cast(ushort)mH;
+				mRect.w = cast(ushort)mW;
+				mRect.h = cast(ushort)mH;
+
+				// special case for Panels : make the parent grow accordingly
+				//if( (cast(Panel)this) && (mParent !is null) )
+				//	(cast(Panel)mParent).resize( mW-prevW, mH-prevH );
+
+				move( mX, mY ); // move depending on auto-alignment
 			}
 
-			// special case for Panels : make the parent grow accordingly
-			//if( (cast(Panel)this) && (mParent !is null) )
-			//	(cast(Panel)mParent).resize( mW-prevW, mH-prevH );
-
-			move( mX, mY ); // move depending on auto-alignment
-
 		}
 
-		void move( int x, int y ) {
+		void move( int x, int y, bool dont_align=false ) {
 			bool moved = false;
 
 			int prevX = mX;
 			int prevY = mY;
 
-			if( mHAlign == ALIGN.FREE ) { mX = x; if(prevX != mX) moved = true; }
-			if( mVAlign == ALIGN.FREE ) { mY = y; if(prevY != mY) moved = true; }
+			if( dont_align ) {
+				mX = x;
+				mY = y;
+				moved = true;
 
-			moved = doAlign( mX, mHAlign, mW, gScreen.WIDTH ) || moved;
-			moved = doAlign( mY, mVAlign, mH, gScreen.HEIGHT ) || moved;
+			} else {
+
+				if( mHAlign == ALIGN.FREE ) { mX = x; if(prevX != mX) moved = true; }
+				if( mVAlign == ALIGN.FREE ) { mY = y; if(prevY != mY) moved = true; }
+
+				moved = doAlign( mX, mHAlign, mW, gScreen.WIDTH ) || moved;
+				moved = doAlign( mY, mVAlign, mH, gScreen.HEIGHT ) || moved;
+			}
 
 			if( moved ) {
 				mRect.x = cast(short)mX;
 			foreach( ti; mTextInputs ) { ti.render(); }
 			foreach( p; mPanels ) { p.render(); }
 
-			mGraphics.drawBox( cast(short)mX, cast(short)mY, cast(ushort)mW, cast(ushort)mH );
+			if( drawBorder ) mGraphics.drawBox( cast(short)mX, cast(short)mY, cast(ushort)mW, cast(ushort)mH );
 		}
 
 		void checkButtons( int x, int y, bool clicked ) {
 
+			if( mEffect && mEffect.done )
+				delete mEffect;
+
 			// sub-panels
 			foreach( p; mPanels ) {
 				p.checkButtons( x, y , clicked );
 				mTextInputs[mSelectedTextInput].injectKey( key );
 		}
 
+
+		class PanelEffect {
+			int mDestX,mDestY;
+			this() {
+				mDestX = mX;
+				mDestY = mY;
+			}
+			abstract bool done();
+		}
+
+		class FromRight : PanelEffect {
+
+			this() {
+				super();
+				mX = gScreen.WIDTH;
+			}
+
+			bool done() {
+
+				move( cast(int)(mX - (mX-mDestX)*gTime.getDelta()), mY, true );
+
+				if( mX <= mDestX ) {
+					mX = mDestX;
+					return( true );
+				}
+				return(false);
+			}
+		}
+
+		void setEffect( EFFECT e ) {
+			switch( e ) {
+				case EFFECT.FROM_RIGHT: mEffect = new FromRight(); break;
+				default: break;
+			}
+
+		}
+
+	}
+
+
+	class List: public Panel {
+		this( Widget parent, int x, int y, string[] labels ) {
+			super( parent, x, y );
+			foreach( label; labels ) {
+				addLabel( label );
+				nl();
+			}
+		}
 	}
 
 
 			mSelectedItem += dir;
 			if( mSelectedItem < 0) mSelectedItem = mItems.length-1;
 			if( mSelectedItem > mItems.length-1 ) mSelectedItem = 0;
-			//mSelectedItem = ( mSelectedItem + dir )%(mItems.length);
 
 			if( mHighlighted ) mHighlighted.highlight(false);
 			mItems[mSelectedItem].highlight(true);

src/inputconfigurationdialog.d

 import inputmanager;
 import inputconfiguration;
 import inputactions;
+import derelict.sdl.sdl;
 debug import std.stdio;
 
 class InputConfigurationDialog: GUI.ButtonListener, GUI.MenuListener {
 	GUI.Panel mPanel;
 	GUI.Button mApplyButton;
 	GUI.Button mCancelButton;
-	GUI.Button[] mActionButtons;
 
 	GUI.Menu mActionsMenu;
 	GUI.Panel mDefinitionsPanel;
 
 	void recreatePanel() {
 
+		// reset
 		if( mPanel ) GUI.instance.removePanel( mPanel );
 
-		mActionButtons.length = 0;
+		// build the panels data
+		string items[];
+		string labels[];
+		foreach( ia; mInputConfig.mInputActions ) {
+			items ~= ia.name;
 
-		mPanel = GUI.instance.addPanel(0,0);
-		mPanel.setAlign( GUI.Panel.ALIGN.CENTERED, GUI.Panel.ALIGN.CENTERED );
-
-		string items[];
-		foreach( ia; mInputConfig.mInputActions ) {	items ~= ia.name; }
-		mActionsMenu = mPanel.addMenu( items, 200 );
-		mActionsMenu.setListener(this);
-
-		mDefinitionsPanel = mPanel.addPanel();
-
-		foreach( ia; mInputConfig.mInputActions ) {
-			//mActionButtons ~= b;
 			switch( ia.method ) {
 				case IAM_KEY:
-					mDefinitionsPanel.addLabel( "key: " ~ gInputManager.getKeyName( ia.keycode ) );
+					labels ~= "[ " ~ gInputManager.getKeyName( ia.keycode ) ~ " ]";
 				break;
 				case IAM_BUTTON:
-					mDefinitionsPanel.addLabel( "joy#" ~ std.string.toString(ia.joynum) ~ " button#" ~ std.string.toString(ia.button) );
+					labels ~= "joy#" ~ std.string.toString(ia.joynum) ~ " button#" ~ std.string.toString(ia.button);
 				break;
 				case IAM_AXIS:
 					string dir = std.string.toString( ia.dir );
-					mDefinitionsPanel.addLabel( "joy#" ~ std.string.toString(ia.joynum) ~ " axis#" ~ std.string.toString(ia.axis) ~ " dir:" ~ dir );
+					labels ~= "joy#" ~ std.string.toString(ia.joynum) ~ " axis#" ~ std.string.toString(ia.axis) ~ " dir:" ~ dir;
 				break;
 				default:
 				break;
 			}
-			//mPanel.tab(250);
-			mDefinitionsPanel.nl();
 		}
 
-/*
-		foreach( ia; mInputConfig.mInputActions ) {
-			GUI.TextButton b = mPanel.addTextButton( ia.name, "", this );
-			b.changeWidth(180);
-			mActionButtons ~= b;
-			mPanel.tab(250);
-			switch( ia.method ) {
-				case IAM_KEY:
-					mPanel.addLabel( "key: " ~ gInputManager.getKeyName( ia.keycode ) );
-				break;
-				case IAM_BUTTON:
-					mPanel.addLabel( "joy#" ~ std.string.toString(ia.joynum) ~ " button#" ~ std.string.toString(ia.button) );
-				break;
-				case IAM_AXIS:
-					string dir = std.string.toString( ia.dir );
-					mPanel.addLabel( "joy#" ~ std.string.toString(ia.joynum) ~ " axis#" ~ std.string.toString(ia.axis) ~ " dir:" ~ dir );
-				break;
-				default:
-				break;
-			}
-			mPanel.nl();
-		}
-*/
+		// build the panel
+		mPanel = GUI.instance.addPanel(0,0);
+		mPanel.setAlign( GUI.Panel.ALIGN.CENTERED, GUI.Panel.ALIGN.CENTERED );
+		mActionsMenu = mPanel.addMenu( items, 150 );
+		mActionsMenu.setListener(this);
+		mActionsMenu.drawBorder = false;
+		mPanel.addList(labels).drawBorder = false;
 		mPanel.nl();
 
 		mApplyButton = mPanel.addTextButton( "Apply", "", this );
 		mCancelButton = mPanel.addTextButton( "Cancel", "", this );
+		mPanel.show();
 	}
 
 
 			mDone = true;
 			return;
 		}
-		/*
-		foreach( n, button; mActionButtons ) {
-			if( b == button ) {
-				mPanel.hide;
-				mConfiguredAction = n;
-				mDetect = new InputDetectDialog( mInputConfig.mInputActions[n] );
-			}
-		}
-		*/
 	}
 
 	void onSelectedItem( int item ) {
 		if( item >= 0 ) {
 			mConfiguredAction = item;
 			mDetect = new InputDetectDialog( mInputConfig.mInputActions[item] );
+			mPanel.hide();
 		}
 	}
 
 import gui;
 import inputconfigurationdialog;
 
-// ============ base Menu class ===============
 
-class Menu : public GamePart {
-
-	TextSurface[2][] mText;
-	GAMEPART_STATE mState = GAMEPART_STATE.GAME;
-
-	~this() {
-		foreach( t; mText ) {
-			if( t[0] !is null ) delete(t[0]);
-			if( t[1] !is null ) delete(t[1]);
-		}
-	}
-
-    void update() {
-        overlay(false);
-        draw();
-        processInput();
-    }
-
-    // comportement de base
-    abstract void processInput();
-
-	void overlay( bool fade ) {
-		SDL_Surface* surf = SDL_CreateRGBSurface(
-			SDL_HWSURFACE,
-			gScreen.WIDTH, gScreen.HEIGHT, 32,
-			0, 0, 0, 0 );
-
-		if( fade ) {
-			ubyte alpha;
-
-			while( alpha++ < 12 ) {
-				SDL_SetAlpha( surf, SDL_SRCALPHA, 16 );
-				SDL_BlitSurface( surf, null, gScreen.mSurface, null );
-				gScreen.vsync();
-			}
-		}
-		else {
-			SDL_SetAlpha( surf, SDL_SRCALPHA, 176 );
-			SDL_BlitSurface( surf, null, gScreen.mSurface, null );
-		}
-
-		SDL_FreeSurface( surf );
-	}
-
-
-	void draw() {
-		int x,y;
-
-		x = (gScreen.WIDTH - 300) / 2;
-		y = 100;
-
-		foreach( i, t; mText ) {
-			y += 32;
-			t[0].draw( x, y );
-			if( t[1] !is null ) {
-				t[1].draw( x+150, y );
-			}
-		}
-	}
-
-
-    void action() {
-    }
-
-    void addItem( string s ) {
-    	TextSurface[2] t;
-		if( std.string.ifind( s, '|' ) != -1 ) {
-			char[][] items = std.string.split( s, "|" );
-			t[0] = new TextSurface( items[0] );
-			t[1] = new TextSurface( items[1] );
-		}
-		else {
-			t[0] = new TextSurface( s );
-		}
-        mText ~= t;
-    }
-
-    GAMEPART_STATE getState() {
-        return( mState );
-    }
-
-}
-
-// ============================================================
-// Menu spécial utilisé par Game
-class PauseMenu : public Menu {
-    this() {
-        addItem("        ***  Paused ***");
-        addItem("");
-        addItem("Continue |: RETURN");
-        addItem("Volume Up |: keypad +");
-        addItem("Volume Down |: keypad -");
-        addItem("Quit |: Escape");
-    }
-
-    // override d'update() pour gestion spéciale de la pause
-    void processInput() {
-        if( gInputManager.isReleased( IMA_ACTION )) mState = GAMEPART_STATE.UNPAUSE;
-        if( gInputManager.isReleased( IMA_BACK )) mState = GAMEPART_STATE.EXIT;
-    }
-}
 
 // ============================================================
 
-class MenuBackground {
+interface MenuBackground {
+	void draw();
+}
+
+class TranslucentBackground: MenuBackground {
+
+	SDL_Surface* mBg;
+
+	this() {
+		mBg = SDL_CreateRGBSurface(
+			SDL_HWSURFACE,
+			gScreen.WIDTH, gScreen.HEIGHT, 32,
+			0, 0, 0, 0 );
+		SDL_SetAlpha( mBg, SDL_SRCALPHA, 128 );
+	}
+
+	~this() {
+		SDL_FreeSurface(mBg);
+	}
+
+	void draw() {
+		SDL_BlitSurface( mBg, null, gScreen.mSurface, null );
+	}
+}
+
+
+class ScrollBackground: MenuBackground {
 	static short mX, mY; // static to avoid graphical "jump" between menus
 	short mDx, mDy;
 	SDL_Surface* mBg;
 
 	this() {
 		mBg = gTextureManager.get("scrollbg.png");
-		mDx = 1; //cast(short)(std.random.rand()%2);
-		mDy = 1; //cast(short)(std.random.rand()%2);
+		mDx = 1;
+		mDy = 1;
 		with(mRect) { w=cast(ushort)mBg.w; h=cast(ushort)mBg.h; }
 	}
 
 class MenuBase: GamePart, GUI.MenuListener {
 	GUI.Menu mMenu;
 	GAMEPART_STATE mState = GAMEPART_STATE.GAME;
-	//SDL_Surface* mBg;
+
 	MenuBackground mBg;
 
-	this() {
+	this( MenuBackground bg ) {
 		mMenu = GUI.instance.addMenu( 20, 20 );
 		mMenu.setListener(this);
 		mMenu.setAlign( GUI.Panel.ALIGN.CENTERED, GUI.Panel.ALIGN.CENTERED );
-		//mBg = gTextureManager.get("background.png");
-		mBg = new MenuBackground();
+
+		//mMenu.setEffect( GUI.Panel.EFFECT.FROM_RIGHT );
+
+		mBg = bg;
 	}
 
 	~this() {
 		GUI.instance.removePanel( mMenu );
+		if( mBg ) delete( mBg );
 	}
 
 	void update() {
 
-		//SDL_BlitSurface( mBg, null, gScreen.mSurface, null );
-		mBg.draw();
+		if( mBg ) mBg.draw();
 
 		int x, y;
 		gInputManager.getMousePositionRelative( x,y );
 class MainMenu: MenuBase {
 
 	this() {
+		super( new ScrollBackground );
 		mMenu.addItems( "Play", "Options", "Editor", "Quit" );
 	}
 
                 mState = GAMEPART_STATE.MENU_OPTIONS;
                 break;
 			case 2:
-				mState = GAMEPART_STATE.EDITOR; // .MENU_MAP_EDITOR;
+				mState = GAMEPART_STATE.EDITOR;
 				break;
             case 3:
             case -1:
 	MapList mMapList;
 
 	this() {
+		super( new ScrollBackground );
 		mMapList = new MapList;
 		mMenu.addItems( mMapList.getMenuText() );
 	}
 	MapList mMapList;
 
 	this() {
+		super( new ScrollBackground );
 		mMapList = new MapList;
 		string[] items;
 		items ~= "* New Map *";
 			return;
 		}
 
-		{
-			if( gMap !is null ) delete(gMap);
-			new Map( mMapList.getFileName(item-1) );
-			mState = GAMEPART_STATE.EDITOR;
-		}
+		if( gMap !is null ) delete(gMap);
+		new Map( mMapList.getFileName(item-1) );
+		mState = GAMEPART_STATE.EDITOR;
+
     }
 }
 
 
 class MenuOptions : MenuBase {
 
-	string[] mOptions = ["Toggle Fulscreen","(Input configuration)", "Cancel" ];
+	string[] mOptions = ["Toggle Fulscreen","Input configuration", "Cancel" ];
 
 	InputConfigurationDialog mInputConfigurationDialog;
+	bool createConfigDialog;
 
 	this() {
+		super( new ScrollBackground );
 		mMenu.addItems( mOptions );
 	}
 
 			break;
 
 			case 1:
-				//mState = GAMEPART_STATE.INPUT_CONFIG;
-				mInputConfigurationDialog = new InputConfigurationDialog();
+				// workaround to the click problem :
+				createConfigDialog = true;
+				//mInputConfigurationDialog = new InputConfigurationDialog();
 				mMenu.hide();
 			break;
 
 	}
 
 	void update() {
+
+		super.update();
+
 		if( mInputConfigurationDialog !is null ) {
 			if( mInputConfigurationDialog.done() ) {
 				delete( mInputConfigurationDialog );
 				mMenu.show();
 			}
+		} else {
+			if( createConfigDialog ) {
+				mInputConfigurationDialog = new InputConfigurationDialog();
+				createConfigDialog = false;
+			}
 		}
-		super.update();
 	}
 }
 
+
+class PauseMenu : public MenuBase {
+	this() {
+		super( new TranslucentBackground );
+		mMenu.addItems("Continue", "Options", "Abandon game" );
+	}
+
+	void onSelectedItem( int item ) {
+		switch( item ) {
+            case 0:
+                mState = GAMEPART_STATE.UNPAUSE;
+                break;
+            case 1:
+                mState = GAMEPART_STATE.MENU_OPTIONS;
+                break;
+			case 2:
+            case -1:
+                mState = GAMEPART_STATE.EXIT;
+                break;
+            default:
+                break;
+        }
+	}
+}

src/texturemanager.d

 	}
 
 
-	SDL_Surface* get( char[] filename ) {
+	SDL_Surface* get( char[] filename, bool useAlpha=false ) {
 		SDL_Surface** p;
 
 		p = filename in mTextureList;
 		}
 		else {
 			SDL_Surface* temp = IMG_Load( toStringz( "data/" ~ filename ) );
-			SDL_Surface* s = SDL_DisplayFormatAlpha(temp);
+			SDL_Surface* s;
+			if( useAlpha ) {
+				s = SDL_DisplayFormatAlpha(temp);
+			}
+			else {
+				s = SDL_DisplayFormat(temp);
+			}
 			SDL_FreeSurface( temp );
 			assert( s != null );
 			mTextureList[ filename ] = s;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.