Update of /cvsroot/hgengine/Mercury/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16472
Modified Files:
ScreenExample2DSS.cpp
Log Message:
Make 2DSS use themes.
Index: ScreenExample2DSS.cpp
===================================================================
RCS file: /cvsroot/hgengine/Mercury/src/ScreenExample2DSS.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ScreenExample2DSS.cpp 7 Oct 2005 18:14:17 -0000 1.5
--- ScreenExample2DSS.cpp 17 Dec 2005 22:58:30 -0000 1.6
***************
*** 5,8 ****
--- 5,9 ----
#include "MercuryDisplay.h" //for access to the DISPLAY global singleton
#include "CN3D.h" //for collision functions
+ #include "MercuryTheme.h" //For the theme
#define MC_INPUTMAPPED 1 //convention: MESSAGE CODE
***************
*** 14,19 ****
KeyMapping( button_space );
- const CString ThisScreenPrefix = "ScreenExample2DSS/";
-
//In order to make it easy to include screens in the project without modifying
//core files, by doing this, you only have link in the ScreenExample, and with
--- 15,18 ----
***************
*** 32,36 ****
{
m_modMan.SetName( "Man" ); //Set the "Man"'s name. (for debug purposes)
! m_modMan.Load( ThisScreenPrefix + "man.txt" ); //Load the model
m_modMan.SetRotY( 90 ); //Rotate the man so he is facing the camera
AddObject( &m_modMan ); //Make the engine take control of drawing and tweening the man
--- 31,35 ----
{
m_modMan.SetName( "Man" ); //Set the "Man"'s name. (for debug purposes)
! m_modMan.Load( GET_MODEL_BY_NAME( "Man" ) ); //Load the model
m_modMan.SetRotY( 90 ); //Rotate the man so he is facing the camera
AddObject( &m_modMan ); //Make the engine take control of drawing and tweening the man
***************
*** 40,44 ****
m_sprBackground.SetName( "Background" ); //Set the background's name
! m_sprBackground.LoadPNG( ThisScreenPrefix + "Background.png" ); //Load the background PNG
m_sprBackground.SetScale( MercuryPoint( 2000, 2000, 2000 )); //Make the sky look really big
m_sprBackground.SetZ(-90); //Move the sky behind the man and boxes
--- 39,43 ----
m_sprBackground.SetName( "Background" ); //Set the background's name
! m_sprBackground.LoadPNG( GET_GRAPHIC_BY_NAME("Background") ); //Load the background PNG
m_sprBackground.SetScale( MercuryPoint( 2000, 2000, 2000 )); //Make the sky look really big
m_sprBackground.SetZ(-90); //Move the sky behind the man and boxes
***************
*** 50,54 ****
//top object is drawn, the alpha will not transfer properly (under OpenGL or DirectX)
m_sprTitle.SetName( "Title Sprite" );
! m_sprTitle.LoadPNG( ThisScreenPrefix + "Title.png" );
//Give the title sprite a command:
--- 49,53 ----
//top object is drawn, the alpha will not transfer properly (under OpenGL or DirectX)
m_sprTitle.SetName( "Title Sprite" );
! m_sprTitle.LoadPNG( GET_GRAPHIC_BY_NAME( "Title" ) );
//Give the title sprite a command:
***************
*** 63,67 ****
//Call our private member function
! LoadMap( ThisScreenPrefix + "map.txt" );
//Set up basic physics constraints for this screen
--- 62,66 ----
//Call our private member function
! LoadMap( GET_FILE_BY_NAME( "Map" ) );
//Set up basic physics constraints for this screen
***************
*** 218,221 ****
--- 217,222 ----
//Make sure we draw the title sprite last.
m_sprBackground.Draw();
+
+ //Draw the title sprite
m_sprTitle.Draw();
}
***************
*** 257,261 ****
//Instanciate a new box.
m_vBoxes[m_vBoxes.size()-1] = new MercuryMilkshapeModel;
! m_vBoxes[m_vBoxes.size()-1]->Load( ThisScreenPrefix + "box.txt" ); //Load a model of the box
m_vBoxes[m_vBoxes.size()-1]->SetName( ssprintf( "Box%d", m_vBoxes.size() ) );
m_vBoxes[m_vBoxes.size()-1]->SetX( x*4 ); //Set its location
--- 258,262 ----
//Instanciate a new box.
m_vBoxes[m_vBoxes.size()-1] = new MercuryMilkshapeModel;
! m_vBoxes[m_vBoxes.size()-1]->Load( GET_MODEL_BY_NAME ( "Box" ) ); //Load a model of the box
m_vBoxes[m_vBoxes.size()-1]->SetName( ssprintf( "Box%d", m_vBoxes.size() ) );
m_vBoxes[m_vBoxes.size()-1]->SetX( x*4 ); //Set its location
|