From 02016ae442156402ffb6541be0715d21292be6d8 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 22 May 2003 05:28:37 +0000 Subject: [PATCH] Reorganize RageDisplay Add Direct3D renderer (separate project configuration) Add Xbox project config (doesn't yet compile) --- .../ScreenCompany background/white.png | Bin 1205 -> 1213 bytes stepmania/Utils/WINDIFF.EXE | Bin 89360 -> 96259 bytes stepmania/src/BitmapText.cpp | 3 +- stepmania/src/GhostArrow.cpp | 2 +- stepmania/src/GhostArrowBright.cpp | 2 +- stepmania/src/GrooveGraph.cpp | 23 +- stepmania/src/GrooveRadar.cpp | 19 +- stepmania/src/Inventory.cpp | 2 +- stepmania/src/Model.cpp | 3 +- stepmania/src/NoteDisplay.cpp | 7 +- stepmania/src/RageBitmapTexture.cpp | 469 +-- stepmania/src/RageBitmapTexture.h | 10 +- stepmania/src/RageDisplay.cpp | 1121 ++---- stepmania/src/RageDisplay.h | 132 +- stepmania/src/RageDisplay_D3D.cpp | 802 ++++ stepmania/src/RageDisplay_OGL.cpp | 1001 +++++ stepmania/src/RageLog.cpp | 4 +- stepmania/src/RageMath.cpp | 87 +- stepmania/src/RageMath.h | 14 + stepmania/src/RageTexture.cpp | 28 +- stepmania/src/RageTexture.h | 17 +- stepmania/src/RageTextureManager.cpp | 26 +- stepmania/src/RageTypes.h | 11 +- stepmania/src/RageUtil.cpp | 10 +- stepmania/src/SDL_utils.cpp | 8 +- stepmania/src/Sprite.cpp | 61 +- stepmania/src/Sprite.h | 16 +- stepmania/src/StdString.h | 11 +- stepmania/src/StepMania.cpp | 7 +- stepmania/src/StepMania.dsp | 3325 ++++++++++++++++- stepmania/src/StepMania.sln | 18 +- stepmania/src/StepMania.vcproj | 209 +- .../arch/MovieTexture/MovieTexture_DShow.cpp | 86 +- .../arch/MovieTexture/MovieTexture_DShow.h | 10 +- stepmania/src/global.h | 5 + 35 files changed, 6051 insertions(+), 1498 deletions(-) create mode 100644 stepmania/src/RageDisplay_D3D.cpp create mode 100644 stepmania/src/RageDisplay_OGL.cpp diff --git a/stepmania/Themes/default/BGAnimations/ScreenCompany background/white.png b/stepmania/Themes/default/BGAnimations/ScreenCompany background/white.png index 0d193e1f7f6c52cc3f9832a07a22d1d212fb5cd1..0408ed9ae55c2f4e0ea470ca6232505bce001967 100644 GIT binary patch delta 91 zcmdnWxtCM1Gr-TCmrII^fq{Y7)59eQNV9-22Q!eIr=RDuQ89u!E?JAGJxtCJYD@<);T3K0RRBF{I*FQbGy~ fhXR|MTLS}7T8M#l)28RVKy?hBu6{1-oD!Mel+l+?jKS;*WDDuA(?eE0TTgdx=ut zIWPCV&;8!d_viiI^qtC4W^?+^o2DLp?N!s%k!MWbwv!%0$SxBhZj2=umpoO3yrRsS zUYs?Vo++^O_3_kyn2;BrC^YT8GnUAj&F`!EW&wF&*{iEh%)Z+?v)H%aDRtQE!(D-n zJ@y(Q&>raUh4!ylkzf4i>g!~;gOGaDl^UkVO4ITyA>zM!i3tQY6yQ6HknA*^8Fh<+ zv&R@9$Yj}%K7KwhFqiDSfsmpjC$l0YWi8=Wo`F?(nJ9bHRG8_Hosa~Ccgggag%BKXpXhD}l~?Zq%gnMY%jFqA%JNVEmBf+R@j z6IOkLH|kiR8icUfJ(4onz`qSkUM?jq(5NmX6_+R6cx1PxF#Fs=6G-gdAkl^P8B8k~ zt(*25TXN_ORG%56>kRI-oOBeV<*3PTwCEx_X`JcEPU@L_zY zwaLLC(WC{=&%)Z2l9IF<@q_JtM&73*-vYu`HZMaWcJ6@L8$p};ZZWOJxIAGy@E6!D zr-Li5qn|JD=-f!@H6+Cn; z=0TI2c0$TuwF;}tFr&LbYSck6msxNWMry;%V9rY|Fc5W+v0(@jq&xu|a-p2S5?1IF zPT2yljhtWpoc%cTQ8Vx}V+MaNfT;2w?9vN zvptODIjAjOCA~#i`Oo}IQ=SBeo4#Yz?e%U=jy(&6qmO|NVar3+G(vQYqembURW34} zdO=O(R{dbRecWk=^zB%yFpJq0*;1i0ZszEN*v`>^VyAM^d`Pe8#l*wJHNd%rKu7#B5u((r_MP|;Ris<%h;$hh?xhzHQ!o70jsi0m2j5+26B2MWjmGGDK6 zGj|tpYHf+yU^O>b)}Iz~l<|_84@;d^v$F_M?` zoy8SBwgdTKS^?;1Yv9^{aq?B!Mb-1_>Evl@E(^>hv^)V^q~yL3xQ@989TL|sXBGz~i~>Zoqs ztg$J|6_~jqWz>wwc&L0bOFwuLs@qLRjE`;VIb;M0QZEk?J33dtHmqMz(t`P;fdO?9 z*HoNc*n_GgIjCM%9aMGAmQHr%nv?4ibH~&<^|JYa*&)`*`sVtFz7B8Zj(KPRX=Rn2 zKqBcq(51!XA|#$uE?V@LC2Nf?^frA8Lg}){c3d2>Kcc0LEBalCGq8pr5S92Dk@7|m z<&l}27xhJD+``~)DO*j>T(cCL>XvSVDD75XA7VFhaab*6GHvw) ztj6&h7(i_zXIku40LHCj63wzQp6}&?IrKJ&Yq1N4aQYZzc6_#UhcaG>4a+EMI%AmL z+fq^i&PW_6YXUyxlbw$;n21{xQFqfbScAD6P^oVEy73|3te#Vos$^AN$wu@Rm&J%h zPVMyUOddYXAI|lAXbd#0JLDs2EQ47XSyZfqf`@GDop}Kbbd34TT9#`um4c=fZY?&* zjH9CfSO?RTH*m+f>8w#`E8MacqxvQKTS(~pgLW3$Wl$I-{vLynHEBPl3AS_;1)d2o z>y#F(X0wTv{``t1qqQ@89)mijp5BQ`seY+cK7+&x*T{afXF?}|(=z-RH_lk2N7b*p z^4ErNQswyzRYRX*GXEhf33d9%DwY}>8=C7k zdB}R_kHkFu%;c@FWwTn$ymbu?&D)#yMMPe1FJHI4Lkvgm5jsL;Xqe>C*v=i>emq)2 zPMFe@LyjV2cEZ$`h9Xa2O@zm7H|~GrDiV0ugV&n3?%}I#`yaWs@cv)f3I(+==f1w| zobWG*6>nRpB@)ruo%J>3AvC<$=qgm){7CMv@p1TuM^|4fKaLrDUc7h-hlD*FdA^hU z(BWxt)R(U-YYl}+ynSkZBsEnN3PkPXam1D114HC zqPk@yzPT=my|uhpBMAcEA*NN;f%dw6OcqOQ-d zWSgs7TLsuk;@=OZ(dIzQJvCveLnQHy8A?5+?VADu-y(*EeIP!kN1{ILYpoCL7JNGP zdpk1@G2sGy_m(!Mk;HG8I~lPDt{Xss?r0Nl_$Z1(V7DalELuB`PP_aT2FLVW3_;g6g)+UE1Qysf&{xO^SHJ-h&yzS91toPiB`fc+v9HHspw6zE_(Lz_gOAbtVP^?n(w5rxpEK%~x7Gp3npGV%a|~E0i%HehcN>KLjofMg9(t<0Mbanfq}uH`2*wj4~&cp V1UN#w-(>yIxS_p$h7eSetTextureModeModulate(); /* Draw if we're not fully transparent or the zbuffer is enabled */ @@ -303,7 +304,7 @@ void BitmapText::DrawPrimitives() if( m_bShadow ) { DISPLAY->PushMatrix(); - DISPLAY->TranslateLocal( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units + DISPLAY->TranslateWorld( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units RageColor dim(0,0,0,0.5f*m_temp.diffuse[0].a); // semi-transparent black diff --git a/stepmania/src/GhostArrow.cpp b/stepmania/src/GhostArrow.cpp index 3f2710a464..cda42d4cad 100644 --- a/stepmania/src/GhostArrow.cpp +++ b/stepmania/src/GhostArrow.cpp @@ -50,7 +50,7 @@ void GhostArrow::Step( TapNoteScore score ) // HACK: set the length of each frame so the animation plays in exactly 1 pop up time. // We can't do this in the constructor because the image hasn't been loaded yet for( int i=0; iSetTexture( NULL ); DISPLAY->SetTextureModeModulate(); - RageVertex v[3]; + RageVertex v[4]; for( int i=NUM_DIFFICULTIES-1; i>=0; i-- ) { float fValue = SCALE(m_fPercentTowardNew, 0.f, 1.f, m_fValuesOld[i], m_fValuesNew[i] ); float fHeight = MOUNTAIN_HEIGHT*fValue; - v[0].p = RageVector3( -MOUNTAIN_WIDTH/2, 0, 0 ); + v[0].p = v[3].p = RageVector3( -MOUNTAIN_WIDTH/2, 0, 0 ); v[1].p = RageVector3( MOUNTAIN_WIDTH/2, 0, 0 ); v[2].p = RageVector3( 0, -fHeight, 0 ); - v[0].c = v[1].c = v[2].c = g_DifficultyColorsCache[i]; + v[0].c = v[1].c = v[2].c = v[3].c = g_DifficultyColorsCache[i]; DISPLAY->DrawFan( v, 3 ); } - switch( PREFSMAN->m_iPolygonRadar ) - { - case 0: DISPLAY->DrawLoop_LinesAndPoints( v, 3, 2 ); break; - case 1: DISPLAY->DrawLoop_Polys( v, 3, 2 ); break; - default: - case -1: DISPLAY->DrawLoop( v, 3, 2 ); break; - } + // TODO: Add this back in +// switch( PREFSMAN->m_iPolygonRadar ) +// { +// case 0: DISPLAY->DrawLoop_LinesAndPoints( v, 3, 2 ); break; +// case 1: DISPLAY->DrawLoop_Polys( v, 3, 2 ); break; +// default: +// case -1: + DISPLAY->DrawLineStrip( v, 4, 2 ); +// break; +// } } diff --git a/stepmania/src/GrooveRadar.cpp b/stepmania/src/GrooveRadar.cpp index b7ba70f7bd..81dcef7dbe 100644 --- a/stepmania/src/GrooveRadar.cpp +++ b/stepmania/src/GrooveRadar.cpp @@ -186,7 +186,7 @@ void GrooveRadar::GrooveRadarValueMap::DrawPrimitives() // // use a line loop to draw the thick line // - for( i=0; im_iPolygonRadar ) - { - case 0: DISPLAY->DrawLoop_LinesAndPoints( v, NUM_RADAR_CATEGORIES, RADAR_EDGE_WIDTH ); break; - case 1: DISPLAY->DrawLoop_Polys( v, NUM_RADAR_CATEGORIES, RADAR_EDGE_WIDTH ); break; - default: - case -1: DISPLAY->DrawLoop( v, NUM_RADAR_CATEGORIES, RADAR_EDGE_WIDTH ); break; - } + // TODO: Add this back in. -Chris +// switch( PREFSMAN->m_iPolygonRadar ) +// { +// case 0: DISPLAY->DrawLoop_LinesAndPoints( v, NUM_RADAR_CATEGORIES, RADAR_EDGE_WIDTH ); break; +// case 1: DISPLAY->DrawLoop_Polys( v, NUM_RADAR_CATEGORIES, RADAR_EDGE_WIDTH ); break; +// default: +// case -1: + DISPLAY->DrawLineStrip( v, NUM_RADAR_CATEGORIES+1, RADAR_EDGE_WIDTH ); +// break; +// } } } diff --git a/stepmania/src/Inventory.cpp b/stepmania/src/Inventory.cpp index f04c28e062..0c2751f7f0 100644 --- a/stepmania/src/Inventory.cpp +++ b/stepmania/src/Inventory.cpp @@ -181,7 +181,7 @@ void Inventory::UseItem( int iSlot ) if( asInventory[iSlot].IsBlank() ) return; - PlayerNumber pnToAttack = OPPOSITE_PLAYER[m_PlayerNumber]; +// PlayerNumber pnToAttack = OPPOSITE_PLAYER[m_PlayerNumber]; GameState::Attack a = asInventory[iSlot]; // GAMESTATE->LaunchAttack( pnToAttack, a ); diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 0333182d4b..6aa3855736 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -725,11 +725,10 @@ bool Model::LoadMilkshapeAsciiBones( CString sPath ) void Model::DrawPrimitives() { - if (!m_pModel) return; - Actor::DrawPrimitives(); // set Actor-specified render states + Actor::SetRenderStates(); // set Actor-specified render states DISPLAY->Scale( 1, -1, 1 ); // flip Y so positive is up diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index 384486db29..5d3d1937ff 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -125,6 +125,12 @@ void NoteMetricCache_t::Load(PlayerNumber pn, const CString &name) NoteDisplay::NoteDisplay() { + for( int i=0; iTrace( "RageBitmapTexture::RageBitmapTexture()" ); - - m_uGLTextureID = 0; - - Create(); // sFilePath and prefs are saved by RageTexture() + Create(); } RageBitmapTexture::~RageBitmapTexture() { - if(m_uGLTextureID) - glDeleteTextures(1,reinterpret_cast(&m_uGLTextureID)); + Destroy(); } void RageBitmapTexture::Reload() { - RageTexture::Reload(); - DISPLAY->SetTexture(0); - - if(m_uGLTextureID) - { - glDeleteTextures(1, reinterpret_cast(&m_uGLTextureID)); - m_uGLTextureID = 0; - } - + Destroy(); Create(); } -/* 1. Create (and return) a surface ready to be loaded to OpenGL, - * 2. Set up m_ActualID, and - * 3. Set these texture parameters: - * m_iSourceWidth, m_iSourceHeight - * m_iTextureWidth, m_iTextureHeight - * m_iImageWidth, m_iImageHeight - * m_iFramesWide, m_iFramesHigh +/* + * Each dwMaxSize, dwTextureColorDepth and iAlphaBits are maximums; we may + * use less. iAlphaBits must be 0, 1 or 4. + * + * XXX: change iAlphaBits == 4 to iAlphaBits == 8 to indicate "as much alpha + * as needed", since that's what it really is; still only use 4 in 16-bit textures. + * + * Dither forces dithering when loading 16-bit textures. + * Stretch forces the loaded image to fill the texture completely. */ -SDL_Surface *RageBitmapTexture::CreateImg(int &pixfmt) +void RageBitmapTexture::Create() { + /* Create (and return) a surface ready to be loaded to OpenGL */ /* Load the image into an SDL surface. */ SDL_Surface *img = IMG_Load(GetFilePath()); @@ -174,7 +87,7 @@ SDL_Surface *RageBitmapTexture::CreateImg(int &pixfmt) if(img == NULL) RageException::Throw( "RageBitmapTexture: Couldn't load %s: %s", GetFilePath().c_str(), SDL_GetError() ); - if(m_ActualID.bHotPinkColorKey) + if(m_ID.bHotPinkColorKey) { /* Annoying: SDL will do a nearest-match on paletted images if * they don't have the color we ask for, so images without HOT PINK @@ -199,79 +112,46 @@ SDL_Surface *RageBitmapTexture::CreateImg(int &pixfmt) * TRAIT_NO_TRANSPARENCY if the color key is never used. */ int traits = FindSurfaceTraits(img); if(traits & TRAIT_NO_TRANSPARENCY) - m_ActualID.iAlphaBits = 0; + m_ID.iAlphaBits = 0; else if(traits & TRAIT_BOOL_TRANSPARENCY) - m_ActualID.iAlphaBits = 1; + m_ID.iAlphaBits = 1; if(traits & TRAIT_WHITE_ONLY) - m_ActualID.iTransparencyOnly = 8; + m_ID.iTransparencyOnly = 8; } // look in the file name for a format hints CString HintString = GetFilePath(); HintString.MakeLower(); - if( HintString.Find("4alphaonly") != -1 ) m_ActualID.iTransparencyOnly = 4; - else if( HintString.Find("8alphaonly") != -1 ) m_ActualID.iTransparencyOnly = 8; - if( HintString.Find("dither") != -1 ) m_ActualID.bDither = true; + if( HintString.Find("4alphaonly") != -1 ) m_ID.iTransparencyOnly = 4; + else if( HintString.Find("8alphaonly") != -1 ) m_ID.iTransparencyOnly = 8; + if( HintString.Find("dither") != -1 ) m_ID.bDither = true; - if( m_ActualID.iTransparencyOnly ) - { - /* Treat the image as 32-bit, so we don't lose any alpha precision. */ - m_ActualID.iColorDepth = 32; - } - - GLenum fmtTexture; - /* Figure out which texture format to use. */ - if( m_ActualID.iColorDepth == 16 ) - { - /* Bits of alpha in the source: */ - int src_alpha_bits = 8 - img->format->Aloss; - - /* No real alpha in paletted input. */ - if( img->format->BytesPerPixel == 1 ) - src_alpha_bits = 0; - - /* Colorkeyed input effectively has at least one bit of alpha: */ - if( img->flags & SDL_SRCCOLORKEY ) - src_alpha_bits = max( 1, src_alpha_bits ); - - /* Don't use more than we were hinted to. */ - src_alpha_bits = min( m_ActualID.iAlphaBits, src_alpha_bits ); - - switch( src_alpha_bits ) { - case 0: - case 1: - fmtTexture = GL_RGB5_A1; - break; - default: - fmtTexture = GL_RGBA4; - break; - } - } - else if( m_ActualID.iColorDepth == 32) - fmtTexture = GL_RGBA8; - else - RageException::Throw( "Invalid color depth: %d bits", m_ActualID.iColorDepth ); + if( m_ID.iTransparencyOnly ) + m_ID.iColorDepth = 32; /* Treat the image as 32-bit, so we don't lose any alpha precision. */ /* Cap the max texture size to the hardware max. */ - m_ActualID.iMaxSize = min( m_ActualID.iMaxSize, DISPLAY->GetMaxTextureSize() ); + m_ID.iMaxSize = min( m_ID.iMaxSize, DISPLAY->GetMaxTextureSize() ); /* Save information about the source. */ m_iSourceWidth = img->w; m_iSourceHeight = img->h; + /* See if the apparent "size" is being overridden. */ + GetResolutionFromFileName(m_ID.filename, m_iSourceWidth, m_iSourceHeight); + /* image size cannot exceed max size */ - m_iImageWidth = min( m_iSourceWidth, m_ActualID.iMaxSize ); - m_iImageHeight = min( m_iSourceHeight, m_ActualID.iMaxSize ); + m_iImageWidth = min( m_iSourceWidth, m_ID.iMaxSize ); + m_iImageHeight = min( m_iSourceHeight, m_ID.iMaxSize ); /* Texture dimensions need to be a power of two; jump to the next. */ m_iTextureWidth = power_of_two(m_iImageWidth); m_iTextureHeight = power_of_two(m_iImageHeight); - ASSERT( m_iTextureWidth <= m_ActualID.iMaxSize ); - ASSERT( m_iTextureHeight <= m_ActualID.iMaxSize ); + ASSERT( m_iTextureWidth <= m_ID.iMaxSize ); + ASSERT( m_iTextureHeight <= m_ID.iMaxSize ); - if(m_ActualID.bStretch) + if(m_ID.bStretch) { /* The hints asked for the image to be stretched to the texture size, * probably for tiling. */ @@ -279,225 +159,140 @@ SDL_Surface *RageBitmapTexture::CreateImg(int &pixfmt) m_iImageHeight = m_iTextureHeight; } - /* If the source is larger than the texture, we have to scale it to fit. */ - if(m_iSourceWidth > m_iImageWidth || m_iSourceHeight > m_iImageHeight) - m_ActualID.bStretch = true; - - pixfmt = PixFmtMaskNo(fmtTexture); - - if( m_ActualID.bStretch ) + if( img->w != m_iImageWidth || img->h != m_iImageHeight ) { /* resize currently only does RGBA8888 */ - int mask = 0; - ConvertSDLSurface(img, img->w, img->h, PixFmtMasks[mask].bpp, - PixFmtMasks[mask].masks[0], PixFmtMasks[mask].masks[1], - PixFmtMasks[mask].masks[2], PixFmtMasks[mask].masks[3]); + ConvertSDLSurface(img, img->w, img->h, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); zoomSurface(img, m_iImageWidth, m_iImageHeight ); } - /* See if the apparent "size" is being overridden. */ - GetResolutionFromFileName(m_ActualID.filename, m_iSourceWidth, m_iSourceHeight); - return img; -} + // Format of the image that we will pass to OpenGL and that we want OpenGL to use + PixelFormat pixfmt; -/* - * Each dwMaxSize, dwTextureColorDepth and iAlphaBits are maximums; we may - * use less. iAlphaBits must be 0, 1 or 4. - * - * XXX: change iAlphaBits == 4 to iAlphaBits == 8 to indicate "as much alpha - * as needed", since that's what it really is; still only use 4 in 16-bit textures. - * - * Dither forces dithering when loading 16-bit textures. - * Stretch forces the loaded image to fill the texture completely. - */ -void RageBitmapTexture::Create() -{ - /* This will be set to the pixfmt we should use if we use an RGBA texture. */ - int desired_rgba_pixfmt; + SDL_SaveBMP( img, "testing.bmp" ); - SDL_Surface *img = CreateImg(desired_rgba_pixfmt); - if(!m_uGLTextureID) - glGenTextures(1, reinterpret_cast(&m_uGLTextureID)); - ASSERT(m_uGLTextureID); - - DISPLAY->SetTexture(this); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - - /* This is an experiment: some people are seeing skips when the danger - * background comes in. One hypothesis: we're loading the danger background, - * keeping it in memory without displaying it for several games, it gets - * swapped out of texture memory, and then we skip swapping it in. - * - * It's rather small, so I'm not entirely convinced this is what's happening. - * Let's try boosting the texture priority for the danger background and - * see if it goes away. If it does, I'll make texture pris a texture hint - * (or find another way to do this; perhaps we should do a dummy render of - * a texture when it's reused from our texture cache if it hasn't been used - * in a long time). */ - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 0.5f); - if(GetFilePath().Find("danger") != -1) - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 1.0f); - - int pixfmt = desired_rgba_pixfmt; - -retry: - if(img->format->BitsPerPixel == 8 && DISPLAY->GetSpecs().EXT_paletted_texture) - pixfmt = FMT_PAL; - - if(pixfmt != FMT_PAL) + /* Figure out which texture format to use. */ + // if the source is palleted, load palleted no matter what the prefs + if(img->format->BitsPerPixel == 8 && DISPLAY->SupportsTextureFormat(FMT_PAL)) { + pixfmt = FMT_PAL; + } + else + { + // not paletted + switch( m_ID.iColorDepth ) + { + case 16: + { + /* Bits of alpha in the source: */ + int src_alpha_bits = 8 - img->format->Aloss; + + /* No real alpha in paletted input. */ + if( img->format->BytesPerPixel == 1 ) + src_alpha_bits = 0; + + /* Colorkeyed input effectively has at least one bit of alpha: */ + if( img->flags & SDL_SRCCOLORKEY ) + src_alpha_bits = max( 1, src_alpha_bits ); + + /* Don't use more than we were hinted to. */ + src_alpha_bits = min( m_ID.iAlphaBits, src_alpha_bits ); + + switch( src_alpha_bits ) { + case 0: + case 1: + pixfmt = FMT_RGB5A1; + break; + default: + pixfmt = FMT_RGBA4; + break; + } + } + break; + case 32: + pixfmt = FMT_RGBA8; + break; + default: + RageException::Throw( "Invalid color depth: %d bits", m_ID.iColorDepth ); + } + + /* Override the internalformat with an alpha format if it was requested. + * Don't use iTransparencyOnly with paletted images; there's no point--paletted + * images are as small or smaller (and the load will fail). */ + /* SDL surfaces don't allow for 8 bpp surfaces that aren't paletted. Arg! + * fix this later. -Chris */ +// if(m_ID.iTransparencyOnly > 0) +// { +// imagePixfmt = FMT_ALPHA8; +// texturePixfmt = FMT_ALPHA8; +// } + /* It's either not a paletted image, or we can't handle paletted textures. * Convert to the desired RGBA format, dithering if appropriate. */ - - /* Never dither when the target is 32bpp; there's no point. */ - if( PixFmtMasks[pixfmt].bpp == 32) - m_ActualID.bDither = false; - - if( m_ActualID.bDither ) + if( m_ID.bDither && + (pixfmt==FMT_RGBA4 || pixfmt==FMT_RGB5A1) ) /* Don't dither if format is 32bpp; there's no point. */ { /* Dither down to the destination format. */ - SDL_Surface *dst = SDL_CreateRGBSurfaceSane(SDL_SWSURFACE, img->w, img->h, PixFmtMasks[pixfmt].bpp, - PixFmtMasks[pixfmt].masks[0], PixFmtMasks[pixfmt].masks[1], - PixFmtMasks[pixfmt].masks[2], PixFmtMasks[pixfmt].masks[3]); + SDL_Surface *dst = SDL_CreateRGBSurfaceSane(SDL_SWSURFACE, img->w, img->h, PIXEL_FORMAT_DESC[pixfmt].bpp, + PIXEL_FORMAT_DESC[pixfmt].masks[0], PIXEL_FORMAT_DESC[pixfmt].masks[1], + PIXEL_FORMAT_DESC[pixfmt].masks[2], PIXEL_FORMAT_DESC[pixfmt].masks[3]); - //SM_SDL_OrderedDither(img, dst); SM_SDL_ErrorDiffusionDither(img, dst); SDL_FreeSurface(img); img = dst; } } - /* Convert the data to the destination format if it's not in it already. */ - ConvertSDLSurface(img, m_iTextureWidth, m_iTextureHeight, PixFmtMasks[pixfmt].bpp, - PixFmtMasks[pixfmt].masks[0], PixFmtMasks[pixfmt].masks[1], - PixFmtMasks[pixfmt].masks[2], PixFmtMasks[pixfmt].masks[3]); + SDL_SaveBMP( img, "testing.bmp" ); /* This needs to be done *after* the final resize, since that resize * may introduce new alpha bits that need to be set. It needs to be * done *before* we set up the palette, since it might change it. */ FixHiddenAlpha(img); - if(pixfmt == FMT_PAL) - { - /* The image is currently paletted. Let's try to set up a paletted texture. */ - GLubyte palette[256*4]; - memset(palette, 0, sizeof(palette)); - int p = 0; - /* Copy the palette to the simple, unpacked data OGL expects. If - * we're color keyed, change it over as we go. */ - for(int i = 0; i < img->format->palette->ncolors; ++i) - { - palette[p++] = img->format->palette->colors[i].r; - palette[p++] = img->format->palette->colors[i].g; - palette[p++] = img->format->palette->colors[i].b; + SDL_SaveBMP( img, "testing.bmp" ); - if(img->flags & SDL_SRCCOLORKEY && i == int(img->format->colorkey)) - palette[p++] = 0; - else - palette[p++] = 0xFF; /* opaque */ - } + /* Convert the data to the destination format and dimensions + * required by OpenGL if it's not in it already. */ + ConvertSDLSurface(img, m_iTextureWidth, m_iTextureHeight, PIXEL_FORMAT_DESC[pixfmt].bpp, + PIXEL_FORMAT_DESC[pixfmt].masks[0], PIXEL_FORMAT_DESC[pixfmt].masks[1], + PIXEL_FORMAT_DESC[pixfmt].masks[2], PIXEL_FORMAT_DESC[pixfmt].masks[3]); + + SDL_SaveBMP( img, "testing.bmp" ); - /* Set the palette. */ - GLExt::glColorTableEXT(GL_TEXTURE_2D, GL_RGBA8, 256, GL_RGBA, GL_UNSIGNED_BYTE, palette); + m_uTexHandle = DISPLAY->CreateTexture( pixfmt, img ); - GLint RealFormat = 0; - GLExt::glGetColorTableParameterivEXT(GL_TEXTURE_2D, GL_COLOR_TABLE_FORMAT, &RealFormat); - if(RealFormat != GL_RGBA8) - { - /* This is a case I don't expect to happen; if it does, log, - * turn off PT's permanently and continue as an RGBA texture. */ - LOG->Info("Expected an RGBA8 palette, got %i instead; disabling paletted textures", RealFormat); - DISPLAY->DisablePalettedTexture(); - pixfmt = desired_rgba_pixfmt; - goto retry; - } - } - - glPixelStorei(GL_UNPACK_ROW_LENGTH, img->pitch / img->format->BytesPerPixel); - - GLenum internalfmt = PixFmtMasks[pixfmt].internalfmt; - - if(DISPLAY->GetSpecs().bPackedPixelsCauseProblems && - IsPackedPixelFormat(pixfmt)) - { - /* GLDirect crashes if we give it packed pixel format. We need - * to convert to a non-packed format (FMT_RGBA8). However, we - * can still get 16-bit textures by passing it the appropriate - * internalformat; it'll simply truncate the extra bits. This - * means that it'll still use the dithering we gave it; we just - * have to do a bit of redundant conversion work. */ - ConvertSDLSurface(img, m_iTextureWidth, m_iTextureHeight, PixFmtMasks[FMT_RGBA8].bpp, - PixFmtMasks[FMT_RGBA8].masks[0], PixFmtMasks[FMT_RGBA8].masks[1], - PixFmtMasks[FMT_RGBA8].masks[2], PixFmtMasks[FMT_RGBA8].masks[3]); - - pixfmt = FMT_RGBA8; - /* (don't change internalfmt) */ - } - - if(internalfmt != GL_COLOR_INDEX8_EXT) - { - /* Override the internalformat with an alpha format if it was requested. - * Don't use iTransparencyOnly with paletted images; there's no point--paletted - * images are as small or smaller (and the load will fail). */ - if(m_ActualID.iTransparencyOnly == 4) - internalfmt = GL_ALPHA4; - else if(m_ActualID.iTransparencyOnly == 8) - internalfmt = GL_ALPHA8; - else ASSERT(m_ActualID.iTransparencyOnly == 0); - } - - glTexImage2D(GL_TEXTURE_2D, 0, internalfmt, - m_iTextureWidth, m_iTextureHeight, 0, - PixFmtMasks[pixfmt].format, PixFmtMasks[pixfmt].type, img->pixels); - - /* If we're paletted, and didn't get the 8-bit palette we asked for ...*/ - if(img->format->BitsPerPixel == 8) - { - GLint size = 0; - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GLenum(GL_TEXTURE_INDEX_SIZE_EXT), &size); - if(size != 8) - { - /* I don't know any reason this should actually fail (paletted textures - * but no support for 8-bit palettes?), so let's just disable paletted - * textures the first time this happens. */ - LOG->Info("Expected an 8-bit palette, got a %i-bit one instead; disabling paletted textures", size); - DISPLAY->DisablePalettedTexture(); - pixfmt = desired_rgba_pixfmt; - goto retry; - } - } - - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glFlush(); - - SDL_FreeSurface(img); + SDL_FreeSurface( img ); CreateFrameRects(); - CString props = " "; - switch( internalfmt ) - { - case GL_RGBA4: props += "GL_RGBA4 "; break; - case GL_RGBA8: props += "GL_RGBA8 "; break; - case GL_RGB5_A1: props += "GL_RGB5_A1 "; break; - case GL_ALPHA8: props += "GL_ALPHA8 "; break; - case GL_COLOR_INDEX8_EXT: props += "GL_COLOR_INDEX8_EXT "; break; - default: props += ssprintf("unknown-format-%d ",internalfmt); break; - } - if(m_ActualID.iAlphaBits == 0) props += "opaque "; - if(m_ActualID.iAlphaBits == 1) props += "matte "; - if(m_ActualID.iTransparencyOnly) props += "mask "; - if(m_ActualID.bStretch) props += "stretch "; - if(m_ActualID.bDither) props += "dither "; +/* + CString props = " "; + switch( pixfmt ) + { + case FMT_RGBA4: props += "FMT_RGBA4 "; break; + case FMT_RGBA8: props += "FMT_RGBA8 "; break; + case FMT_RGB5A1: props += "FMT_RGB5A1 "; break; + case FMT_ALPHA8: props += "FMT_ALPHA8 "; break; + case FMT_PAL: props += "FMT_PAL "; break; + default: ASSERT(0); break; + } + if(m_ID.iAlphaBits == 0) props += "opaque "; + if(m_ID.iAlphaBits == 1) props += "matte "; + if(m_ID.iTransparencyOnly) props += "mask "; + if(m_ID.bStretch) props += "stretch "; + if(m_ID.bDither) props += "dither "; if(IsPackedPixelFormat(pixfmt)) props += "paletted "; props.erase(props.size()-1); LOG->Trace( "RageBitmapTexture: Loaded '%s' (%ux%u); %s, source %d,%d; image %d,%d.", - m_ActualID.filename.c_str(), GetTextureWidth(), GetTextureHeight(), + m_ID.filename.c_str(), GetTextureWidth(), GetTextureHeight(), props.c_str(), m_iSourceWidth, m_iSourceHeight, m_iImageWidth, m_iImageHeight); +*/ +} + +void RageBitmapTexture::Destroy() +{ + DISPLAY->DeleteTexture( m_uTexHandle ); } diff --git a/stepmania/src/RageBitmapTexture.h b/stepmania/src/RageBitmapTexture.h index 3b2ad0cc96..b455d12633 100644 --- a/stepmania/src/RageBitmapTexture.h +++ b/stepmania/src/RageBitmapTexture.h @@ -13,22 +13,22 @@ */ #include "RageTexture.h" -#include "RageDisplayInternal.h" - struct SDL_Surface; + class RageBitmapTexture : public RageTexture { public: RageBitmapTexture( RageTextureID name ); virtual ~RageBitmapTexture(); /* only called by RageTextureManager::InvalidateTextures */ - virtual void Invalidate() { m_uGLTextureID = 0; } + virtual void Invalidate() { m_uTexHandle = 0; /* don't Destroy() */} virtual void Reload(); + virtual unsigned GetTexHandle() { return m_uTexHandle; }; // accessed by RageDisplay private: void Create(); // called by constructor and Reload - unsigned int GetGLTextureID() { return m_uGLTextureID; } - unsigned int m_uGLTextureID; + void Destroy(); + unsigned m_uTexHandle; // treat as unsigned in OpenGL, ID3D8Texture* for D3D SDL_Surface *CreateImg(int &pixfmt); }; diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 9553df9fad..75171de8ee 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- Class: RageDisplay - Desc: See header. + Desc: Methods common to all RageDisplays Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford @@ -12,36 +12,19 @@ */ #include "RageDisplay.h" -#include "RageDisplayInternal.h" - -#include "RageUtil.h" -#include "RageLog.h" #include "RageTimer.h" -#include "RageException.h" -#include "RageTexture.h" -#include "RageTextureManager.h" +#include "RageLog.h" #include "RageMath.h" -#include "RageTypes.h" +#include "RageUtil.h" #include "GameConstantsAndTypes.h" -#include "StepMania.h" -#include "arch/arch.h" -#include "arch/LowLevelWindow/LowLevelWindow.h" - -#include - -RageDisplay* DISPLAY = NULL; - -//////////// -// Globals -//////////// +// +// Statistics stuff +// RageTimer g_LastCheckTimer; int g_iNumVerts; int g_iFPS, g_iVPF, g_iCFPS; -int g_PerspectiveMode = 0; - -int g_ModelMatrixCnt=0; int RageDisplay::GetFPS() const { return g_iFPS; } int RageDisplay::GetVPF() const { return g_iVPF; } int RageDisplay::GetCumFPS() const { return g_iCFPS; } @@ -51,289 +34,8 @@ static int g_iFramesRenderedSinceLastCheck, g_iVertsRenderedSinceLastCheck, g_iNumChecksSinceLastReset; -PWSWAPINTERVALEXTPROC GLExt::wglSwapIntervalEXT; -PFNGLCOLORTABLEPROC GLExt::glColorTableEXT; -PFNGLCOLORTABLEPARAMETERIVPROC GLExt::glGetColorTableParameterivEXT; - -/* We don't actually use normals (we don't tunr on lighting), there's just - * no GL_T2F_C4F_V3F. */ -const GLenum RageVertexFormat = GL_T2F_C4F_N3F_V3F; - - -LowLevelWindow *wind; - -void GetGLExtensions(set &ext) +void RageDisplay::ProcessStatsOnFlip() { - const char *buf = (const char *)glGetString(GL_EXTENSIONS); - - vector lst; - split(buf, " ", lst); - - for(unsigned i = 0; i < lst.size(); ++i) - ext.insert(lst[i]); -} - -RageDisplay::RageDisplay( bool windowed, int width, int height, int bpp, int rate, bool vsync ) -{ - LOG->Trace( "RageDisplay::RageDisplay()" ); - - m_oglspecs = new oglspecs_t; - - wind = MakeLowLevelWindow(); - - SetVideoMode( windowed, width, height, bpp, rate, vsync ); - - // Log driver details - LOG->Info("OGL Vendor: %s", glGetString(GL_VENDOR)); - LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER)); - LOG->Info("OGL Version: %s", glGetString(GL_VERSION)); - LOG->Info("OGL Extensions: %s", glGetString(GL_EXTENSIONS)); - if( IsSoftwareRenderer() ) - LOG->Warn("This is a software renderer!"); - - - /* Log this, so if people complain that the radar looks bad on their - * system we can compare them: */ - glGetFloatv(GL_LINE_WIDTH_RANGE, m_oglspecs->line_range); - glGetFloatv(GL_LINE_WIDTH_GRANULARITY, &m_oglspecs->line_granularity); - LOG->Info("Line width range: %.3f-%.3f +%.3f", m_oglspecs->line_range[0], m_oglspecs->line_range[1], m_oglspecs->line_granularity); - - glGetFloatv(GL_POINT_SIZE_RANGE, m_oglspecs->point_range); - glGetFloatv(GL_POINT_SIZE_GRANULARITY, &m_oglspecs->point_granularity); - LOG->Info("Point size range: %.3f-%.3f +%.3f", m_oglspecs->point_range[0], m_oglspecs->point_range[1], m_oglspecs->point_granularity); - - /* sizeof("string constant") is the size of the pointer (~4), not the length of the string. */ - m_oglspecs->bAALinesCauseProblems = strncmp((const char*)glGetString(GL_RENDERER),"3Dfx/Voodoo3 (tm)/2 TMUs/16 MB SDRAM/ICD (Nov 2 2000)",strlen("3Dfx/Voodoo3"))==0; - if( m_oglspecs->bAALinesCauseProblems ) - LOG->Info("Anti-aliased lines are known to cause problems with this driver."); - m_oglspecs->bPackedPixelsCauseProblems = - strncmp((const char*)glGetString(GL_RENDERER),"GLDirect",strlen("GLDirect"))==0; - if( m_oglspecs->bPackedPixelsCauseProblems ) - LOG->Info("Packed pixel formats are known to cause problems with this driver."); -} - -void RageDisplay::Update(float fDeltaTime) -{ - wind->Update(fDeltaTime); -} - -bool RageDisplay::IsSoftwareRenderer() -{ - return - ( strcmp((const char*)glGetString(GL_VENDOR),"Microsoft Corporation")==0 ) && - ( strcmp((const char*)glGetString(GL_RENDERER),"GDI Generic")==0 ); -} - -void RageDisplay::SetupOpenGL() -{ - /* - * Set up OpenGL for 2D rendering. - */ - glDisable(GL_DEPTH_TEST); - glDisable(GL_CULL_FACE); - - /* Reject pixels that are completely transparent early in the pipeline */ - glAlphaFunc( GL_GREATER, 0.01f ); - glEnable( GL_ALPHA_TEST ); - - /* - * Set state variables - */ - glEnable(GL_TEXTURE_2D); - glEnable(GL_BLEND); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - - /* Use <= for depth testing. This lets us set all components of an actor to the - * same depth. */ - glDepthFunc(GL_LEQUAL); - - /* Line antialiasing is fast on most hardware, and saying "don't care" - * should turn it off if it isn't. */ - glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE); - glHint(GL_POINT_SMOOTH_HINT, GL_DONT_CARE); - - /* Initialize the default ortho projection. */ - - LoadMenuPerspective(0); // 0 FOV = ortho -} - -RageDisplay::~RageDisplay() -{ - delete wind; - delete m_oglspecs; -} - -bool RageDisplay::HasExtension(CString ext) const -{ - return m_oglspecs->glExts.find(ext) != m_oglspecs->glExts.end(); -} - -void RageDisplay::SetupExtensions() -{ - double fGLVersion = atof( (const char *) glGetString(GL_VERSION) ); - m_oglspecs->glVersion = int(roundf(fGLVersion * 10)); - GetGLExtensions(m_oglspecs->glExts); - - /* Check for extensions: */ - m_oglspecs->EXT_texture_env_combine = HasExtension("GL_EXT_texture_env_combine"); - m_oglspecs->WGL_EXT_swap_control = HasExtension("WGL_EXT_swap_control"); - m_oglspecs->EXT_paletted_texture = HasExtension("GL_EXT_paletted_texture"); - - /* Find extension functions. */ - GLExt::wglSwapIntervalEXT = (PWSWAPINTERVALEXTPROC) wind->GetProcAddress("wglSwapIntervalEXT"); - GLExt::glColorTableEXT = (PFNGLCOLORTABLEPROC) wind->GetProcAddress("glColorTableEXT"); - GLExt::glGetColorTableParameterivEXT = (PFNGLCOLORTABLEPARAMETERIVPROC) wind->GetProcAddress("glGetColorTableParameterivEXT"); - - /* Make sure we have all components for detected extensions. */ - if(m_oglspecs->WGL_EXT_swap_control) - { - if(!GLExt::wglSwapIntervalEXT) - { - LOG->Warn("wglSwapIntervalEXT but wglSwapIntervalEXT() not found"); - m_oglspecs->WGL_EXT_swap_control=false; - } - } - if(m_oglspecs->EXT_paletted_texture) - { - if(!GLExt::glColorTableEXT || !GLExt::glGetColorTableParameterivEXT) - { - LOG->Warn("GL_EXT_paletted_texture but glColorTableEXT or glGetColorTableParameterivEXT not found"); - m_oglspecs->EXT_paletted_texture = false; - } - } -} - -/* Set the video mode. In some cases, changing the video mode will reset - * the rendering context; returns true if we need to reload textures. */ -bool RageDisplay::SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync ) -{ -// LOG->Trace( "RageDisplay::SetVideoMode( %d, %d, %d, %d, %d, %d )", windowed, width, height, bpp, rate, vsync ); - bool NewOpenGLContext = wind->SetVideoMode( windowed, width, height, bpp, rate, vsync ); - - if(NewOpenGLContext) - { - /* We have a new OpenGL context, so we have to tell our textures that - * their OpenGL texture number is invalid. */ - if(TEXTUREMAN) - TEXTUREMAN->InvalidateTextures(); - } - - SetupOpenGL(); - DumpOpenGLDebugInfo(); - - /* Now that we've initialized, we can search for extensions (some of which - * we may need to set up the video mode). */ - SetupExtensions(); - - /* Set vsync the Windows way, if we can. (What other extensions are there - * to do this, for other archs?) */ - if(m_oglspecs->WGL_EXT_swap_control) - GLExt::wglSwapIntervalEXT(vsync); - - ResolutionChanged(); - - return NewOpenGLContext; -} - -void RageDisplay::DumpOpenGLDebugInfo() -{ -#if defined(WIN32) - /* Dump Windows pixel format data. */ - int Actual = GetPixelFormat(wglGetCurrentDC()); - - PIXELFORMATDESCRIPTOR pfd; - memset(&pfd, 0, sizeof(pfd)); - pfd.nSize=sizeof(pfd); - pfd.nVersion=1; - - int pfcnt = DescribePixelFormat(GetDC(g_hWndMain),1,sizeof(pfd),&pfd); - for (int i=1; i <= pfcnt; i++) - { - memset(&pfd, 0, sizeof(pfd)); - pfd.nSize=sizeof(pfd); - pfd.nVersion=1; - DescribePixelFormat(GetDC(g_hWndMain),i,sizeof(pfd),&pfd); - - bool skip = false; - - bool rgba = (pfd.iPixelType==PFD_TYPE_RGBA); - - bool mcd = ((pfd.dwFlags & PFD_GENERIC_FORMAT) && (pfd.dwFlags & PFD_GENERIC_ACCELERATED)); - bool soft = ((pfd.dwFlags & PFD_GENERIC_FORMAT) && !(pfd.dwFlags & PFD_GENERIC_ACCELERATED)); - bool icd = !(pfd.dwFlags & PFD_GENERIC_FORMAT) && !(pfd.dwFlags & PFD_GENERIC_ACCELERATED); - bool opengl = !!(pfd.dwFlags & PFD_SUPPORT_OPENGL); - bool window = !!(pfd.dwFlags & PFD_DRAW_TO_WINDOW); - bool dbuff = !!(pfd.dwFlags & PFD_DOUBLEBUFFER); - - if(!rgba || soft || !opengl || !window || !dbuff) - skip = true; - - /* Skip the above, unless it happens to be the one we chose. */ - if(skip && i != Actual) - continue; - - CString str = ssprintf("Mode %i: ", i); - if(i == Actual) str += "*** "; - if(skip) str += "(BOGUS) "; - if(soft) str += "software "; - if(icd) str += "ICD "; - if(mcd) str += "MCD "; - if(!rgba) str += "indexed "; - if(!opengl) str += "!OPENGL "; - if(!window) str += "!window "; - if(!dbuff) str += "!dbuff "; - - str += ssprintf("%i (%i%i%i) ", pfd.cColorBits, pfd.cRedBits, pfd.cGreenBits, pfd.cBlueBits); - if(pfd.cAlphaBits) str += ssprintf("%i alpha ", pfd.cAlphaBits); - if(pfd.cDepthBits) str += ssprintf("%i depth ", pfd.cDepthBits); - if(pfd.cStencilBits) str += ssprintf("%i stencil ", pfd.cStencilBits); - if(pfd.cAccumBits) str += ssprintf("%i accum ", pfd.cAccumBits); - - if(i == Actual && skip) - { - /* We chose a bogus format. */ - LOG->Warn("%s", str.c_str()); - } else - LOG->Info("%s", str.c_str()); - } -#endif -} - -void RageDisplay::ResolutionChanged() -{ - SetViewport(0,0); - - /* Clear any junk that's in the framebuffer. */ - Clear(); - Flip(); -} - -void RageDisplay::SetViewport(int shift_left, int shift_down) -{ - /* left and down are on a 0..SCREEN_WIDTH, 0..SCREEN_HEIGHT scale. - * Scale them to the actual viewport range. */ - shift_left = int( shift_left * float(wind->GetWidth()) / SCREEN_WIDTH ); - shift_down = int( shift_down * float(wind->GetWidth()) / SCREEN_WIDTH ); - - glViewport(shift_left, -shift_down, wind->GetWidth(), wind->GetHeight()); -} - -int RageDisplay::GetMaxTextureSize() const -{ - GLint size; - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size); - return size; -} - -void RageDisplay::Clear() -{ - glClearColor( 0,0,0,1 ); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); -} - -void RageDisplay::Flip() -{ - wind->SwapBuffers(); g_iFramesRenderedSinceLastCheck++; g_iFramesRenderedSinceLastReset++; @@ -349,13 +51,6 @@ void RageDisplay::Flip() } } -float RageDisplay::PredictedSecondsUntilNextFlip() const -{ - float fps = max( 30.f, GetFPS() ); - return 1.f/fps; -} - - void RageDisplay::ResetStats() { g_iFPS = g_iVPF = 0; @@ -365,309 +60,229 @@ void RageDisplay::ResetStats() g_LastCheckTimer.GetDeltaTime(); } -void RageDisplay::DisablePalettedTexture() +void RageDisplay::StatsAddVerts( int iNumVertsRendered ) { g_iVertsRenderedSinceLastCheck += iNumVertsRendered; } + + + + +void RageDisplay::SetDefaultRenderStates() { - m_oglspecs->EXT_paletted_texture = false; -} - -void RageDisplay::SaveScreenshot( CString sPath ) -{ - ASSERT( sPath.Right(3).CompareNoCase("bmp") == 0 ); // we can only save bitmaps - - SDL_Surface *image = SDL_CreateRGBSurface( - SDL_SWSURFACE, wind->GetWidth(), wind->GetHeight(), - 24, 0x0000FF, 0x00FF00, 0xFF0000, 0x000000); - SDL_Surface *temp = SDL_CreateRGBSurface( - SDL_SWSURFACE, wind->GetWidth(), wind->GetHeight(), - 24, 0x0000FF, 0x00FF00, 0xFF0000, 0x000000); - - glReadPixels(0, 0, wind->GetWidth(), wind->GetHeight(), GL_RGB, - GL_UNSIGNED_BYTE, image->pixels); - - // flip vertically - for( int y=0; yGetHeight(); y++ ) - memcpy( - (char *)temp->pixels + 3 * wind->GetWidth() * y, - (char *)image->pixels + 3 * wind->GetWidth() * (wind->GetHeight()-1-y), - 3*wind->GetWidth() ); - - SDL_SaveBMP( temp, sPath ); - - SDL_FreeSurface( image ); - SDL_FreeSurface( temp ); + SetLighting( false ); + SetBackfaceCull( false ); + SetZBuffer( false ); + SetAlphaTest( true ); + SetBlendMode( BLEND_NORMAL ); + SetTextureFiltering( true ); + LoadMenuPerspective(0); // 0 FOV = ortho } -bool RageDisplay::IsWindowed() const +// +// Matrix stuff +// +class MatrixStack { - return wind->IsWindowed(); -} + vector stack; +public: -void RageDisplay::DrawQuad( const RageVertex v[4] ) // upper-left, upper-right, lower-right, lower-left -{ - DrawQuads( v, 4 ); -} - -void RageDisplay::DrawQuads( const RageVertex v[], int iNumVerts ) -{ - ASSERT( (iNumVerts%4) == 0 ); - - if(iNumVerts == 0) - return; -#if 1 - static float *Vertex, *Color, *Texture; - static int Size = 0; - if(iNumVerts > Size) + MatrixStack() { - Size = iNumVerts; - delete [] Vertex; - delete [] Color; - delete [] Texture; - Vertex = new float[Size*3]; - Color = new float[Size*4]; - Texture = new float[Size*2]; + stack.resize(1); + LoadIdentity(); } - for(unsigned i = 0; i < unsigned(iNumVerts); ++i) + // Pops the top of the stack, returns the current top + // *after* popping the top. + void Pop() { - Vertex[i*3+0] = v[i].p[0]; - Vertex[i*3+1] = v[i].p[1]; - Vertex[i*3+2] = v[i].p[2]; - Color[i*4+0] = v[i].c[0]; - Color[i*4+1] = v[i].c[1]; - Color[i*4+2] = v[i].c[2]; - Color[i*4+3] = v[i].c[3]; - Texture[i*2+0] = v[i].t[0]; - Texture[i*2+1] = v[i].t[1]; + stack.pop_back(); + ASSERT( stack.size() > 0 ); // underflow } - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, 0, Vertex); - glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(4, GL_FLOAT, 0, Color); + // Pushes the stack by one, duplicating the current matrix. + void Push() + { + stack.push_back( stack.back() ); + ASSERT( stack.size() < 100 ); // overflow + } - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_FLOAT, 0, Texture); + // Loads identity in the current matrix. + void LoadIdentity() + { + RageMatrixIdentity( &stack.back() ); + } - glDisableClientState(GL_NORMAL_ARRAY); -#else - glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); -#endif + // Loads the given matrix into the current matrix + void LoadMatrix( const RageMatrix& m ) + { + stack.back() = m; + } - glDrawArrays( GL_QUADS, 0, iNumVerts ); + // Right-Multiplies the given matrix to the current matrix. + // (transformation is about the current world origin) + void MultMatrix( const RageMatrix& m ) + { + RageMatrixMultiply( &stack.back(), &m, &stack.back() ); + } - g_iVertsRenderedSinceLastCheck += iNumVerts; -} -void RageDisplay::DrawFan( const RageVertex v[], int iNumVerts ) -{ - ASSERT( iNumVerts >= 3 ); - glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); - glDrawArrays( GL_TRIANGLE_FAN, 0, iNumVerts ); - g_iVertsRenderedSinceLastCheck += iNumVerts; -} + // Left-Multiplies the given matrix to the current matrix + // (transformation is about the local origin of the object) + void MultMatrixLocal( const RageMatrix& m ) + { + RageMatrixMultiply( &stack.back(), &stack.back(), &m ); + } -void RageDisplay::DrawStrip( const RageVertex v[], int iNumVerts ) -{ - ASSERT( iNumVerts >= 3 ); - glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); - glDrawArrays( GL_TRIANGLE_STRIP, 0, iNumVerts ); - g_iVertsRenderedSinceLastCheck += iNumVerts; -} - -void RageDisplay::DrawTriangles( const RageVertex v[], int iNumVerts ) -{ - if( iNumVerts == 0 ) - return; - ASSERT( iNumVerts >= 3 ); - ASSERT( (iNumVerts%3) == 0 ); - glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); - glDrawArrays( GL_TRIANGLES, 0, iNumVerts ); - g_iVertsRenderedSinceLastCheck += iNumVerts; -} - -void RageDisplay::DrawIndexedTriangles( const RageVertex v[], const Uint16 pIndices[], int iNumIndices ) -{ - if( iNumIndices == 0 ) - return; - ASSERT( iNumIndices >= 3 ); - ASSERT( (iNumIndices%3) == 0 ); - glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); - glDrawElements( GL_TRIANGLES, iNumIndices, GL_UNSIGNED_SHORT, pIndices ); - g_iVertsRenderedSinceLastCheck += iNumIndices; -} - -/* Draw a line as a quad. GL_LINES with antialiasing off can draw line - * ends at odd angles--they're forced to axis-alignment regardless of the - * angle of the line. */ -void RageDisplay::DrawPolyLine(const RageVertex &p1, const RageVertex &p2, float LineWidth ) -{ - /* soh cah toa strikes strikes again! */ - float opp = p2.p.x - p1.p.x; - float adj = p2.p.y - p1.p.y; - float hyp = powf(opp*opp + adj*adj, 0.5f); - - float lsin = opp/hyp; - float lcos = adj/hyp; - - RageVertex p[4]; - p[0] = p[1] = p1; - p[2] = p[3] = p2; - - float ydist = lsin * LineWidth/2; - float xdist = lcos * LineWidth/2; + // Right multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the current world origin) + void RotateX( float degrees ) + { + RageMatrix m; + RageMatrixRotationX( &m, degrees ); + MultMatrix( m ); + } + void RotateY( float degrees ) + { + RageMatrix m; + RageMatrixRotationY( &m, degrees ); + MultMatrix( m ); + } + void RotateZ( float degrees ) + { + RageMatrix m; + RageMatrixRotationZ( &m, degrees ); + MultMatrix( m ); + } - p[0].p.x += xdist; - p[0].p.y -= ydist; - p[1].p.x -= xdist; - p[1].p.y += ydist; - p[2].p.x -= xdist; - p[2].p.y += ydist; - p[3].p.x += xdist; - p[3].p.y -= ydist; - - DrawQuad(p); -} - -/* Draw a line loop with rounded corners using polys. This is used on - * cards that have strange allergic reactions to antialiased points and - * lines. */ -void RageDisplay::DrawLoop_Polys( const RageVertex v[], int iNumVerts, float LineWidth ) -{ - ASSERT( iNumVerts >= 3 ); - - int i; - for(i = 0; i < iNumVerts; ++i) - DrawPolyLine(v[i], v[(i+1)%iNumVerts], LineWidth); - - /* Join the lines with circles so we get rounded corners. */ - GLUquadricObj *q = gluNewQuadric(); - for(i = 0; i < iNumVerts; ++i) + // Left multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // local origin of the object) + void RotateXLocal( float degrees ) { - glPushMatrix(); - glColor4fv(v[i].c); - glTexCoord3fv(v[i].t); - glTranslatef(v[i].p.x, v[i].p.y, v[i].p.z); - - gluDisk(q, 0, LineWidth/2, 32, 32); - glPopMatrix(); + RageMatrix m; + RageMatrixRotationX( &m, degrees ); + MultMatrixLocal( m ); } - gluDeleteQuadric(q); + void RotateYLocal( float degrees ) + { + RageMatrix m; + RageMatrixRotationY( &m, degrees ); + MultMatrixLocal( m ); + } + void RotateZLocal( float degrees ) + { + RageMatrix m; + RageMatrixRotationZ( &m, degrees ); + MultMatrixLocal( m ); + } + + // Right multiply the current matrix with the computed scale + // matrix. (transformation is about the current world origin) + void Scale( float x, float y, float z) + { + RageMatrix m; + RageMatrixScaling( &m, x, y, z ); + MultMatrix( m ); + } + + // Left multiply the current matrix with the computed scale + // matrix. (transformation is about the local origin of the object) + void ScaleLocal( float x, float y, float z) + { + RageMatrix m; + RageMatrixScaling( &m, x, y, z ); + MultMatrixLocal( m ); + } + + // Right multiply the current matrix with the computed translation + // matrix. (transformation is about the current world origin) + void Translate( float x, float y, float z) + { + RageMatrix m; + RageMatrixTranslation( &m, x, y, z ); + MultMatrix( m ); + } + + // Left multiply the current matrix with the computed translation + // matrix. (transformation is about the local origin of the object) + void TranslateLocal( float x, float y, float z) + { + RageMatrix m; + RageMatrixTranslation( &m, x, y, z ); + MultMatrixLocal( m ); + } + + // Obtain the current matrix at the top of the stack + const RageMatrix* GetTop() { return &stack.back(); } +}; + + +MatrixStack g_ProjectionStack; +MatrixStack g_ModelViewStack; + +const RageMatrix* RageDisplay::GetProjection() +{ + return g_ProjectionStack.GetTop(); } -/* Draw a nice AA'd line loop. One problem with this is that point and line - * sizes don't always precisely match, which doesn't look quite right. - * It's worth it for the AA, though. */ -void RageDisplay::DrawLoop_LinesAndPoints( const RageVertex v[], int iNumVerts, float LineWidth ) +const RageMatrix* RageDisplay::GetModelViewTop() { - ASSERT( iNumVerts >= 3 ); - - glEnable(GL_LINE_SMOOTH); - - /* Our line width is wrt the regular internal SCREEN_WIDTHxSCREEN_HEIGHT screen, - * but these width functions actually want raster sizes (that is, actual pixels). - * Scale the line width and point size by the average ratio of the scale. */ - float WidthVal = float(wind->GetWidth()) / SCREEN_WIDTH; - float HeightVal = float(wind->GetHeight()) / SCREEN_HEIGHT; - LineWidth *= (WidthVal + HeightVal) / 2; - - /* Clamp the width to the hardware max for both lines and points (whichever - * is more restrictive). */ - LineWidth = clamp(LineWidth, m_oglspecs->line_range[0], m_oglspecs->line_range[1]); - LineWidth = clamp(LineWidth, m_oglspecs->point_range[0], m_oglspecs->point_range[1]); - - /* Hmm. The granularity of lines and points might be different; for example, - * if lines are .5 and points are .25, we might want to snap the width to the - * nearest .5, so the hardware doesn't snap them to different sizes. Does it - * matter? */ - glLineWidth(LineWidth); - - /* Draw the line loop: */ - glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); - glDrawArrays( GL_LINE_LOOP, 0, iNumVerts ); - - glDisable(GL_LINE_SMOOTH); - - /* Round off the corners. This isn't perfect; the point is sometimes a little - * larger than the line, causing a small bump on the edge. Not sure how to fix - * that. */ - glPointSize(LineWidth); - - /* Hack: if the points will all be the same, we don't want to draw - * any points at all, since there's nothing to connect. That'll happen - * if both scale factors in the matrix are ~0. (Actually, I think - * it's true if two of the three scale factors are ~0, but we don't - * use this for anything 3d at the moment anyway ...) This is needed - * because points aren't scaled like regular polys--a zero-size point - * will still be drawn. */ - RageMatrix mat; - glGetFloatv( GL_MODELVIEW_MATRIX, (float*)mat ); - - if(mat.m[0][0] < 1e-5 && mat.m[1][1] < 1e-5) - return; - - glEnable(GL_POINT_SMOOTH); - - glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); - glDrawArrays( GL_POINTS, 0, iNumVerts ); - - glDisable(GL_POINT_SMOOTH); -} - -void RageDisplay::DrawLoop( const RageVertex v[], int iNumVerts, float LineWidth ) -{ - if( m_oglspecs->bAALinesCauseProblems ) - DrawLoop_Polys(v, iNumVerts, LineWidth); - else - DrawLoop_LinesAndPoints(v, iNumVerts, LineWidth); + return g_ModelViewStack.GetTop(); } void RageDisplay::PushMatrix() { - glPushMatrix(); - ASSERT(++g_ModelMatrixCnt<20); + g_ModelViewStack.Push(); } void RageDisplay::PopMatrix() { - glPopMatrix(); - ASSERT(g_ModelMatrixCnt-->0); + g_ModelViewStack.Pop(); } -static RageMatrix rgluLookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, - GLfloat centerx, GLfloat centery, GLfloat centerz, - GLfloat upx, GLfloat upy, GLfloat upz) +void RageDisplay::Translate( float x, float y, float z ) { - RageVector3 Z(eyex - centerx, eyey - centery, eyez - centerz); - RageVec3Normalize(&Z, &Z); + g_ModelViewStack.TranslateLocal(x, y, z); +} - RageVector3 Y(upx, upy, upz); +void RageDisplay::TranslateWorld( float x, float y, float z ) +{ + g_ModelViewStack.Translate(x, y, z); +} - RageVector3 X( - Y[1] * Z[2] - Y[2] * Z[1], - -Y[0] * Z[2] + Y[2] * Z[0], - Y[0] * Z[1] - Y[1] * Z[0]); +void RageDisplay::Scale( float x, float y, float z ) +{ + g_ModelViewStack.ScaleLocal(x, y, z); +} - Y = RageVector3( - Z[1] * X[2] - Z[2] * X[1], - -Z[0] * X[2] + Z[2] * X[0], - Z[0] * X[1] - Z[1] * X[0] ); +void RageDisplay::RotateX( float deg ) +{ + g_ModelViewStack.RotateXLocal( deg ); +} - RageVec3Normalize(&X, &X); - RageVec3Normalize(&Y, &Y); +void RageDisplay::RotateY( float deg ) +{ + g_ModelViewStack.RotateYLocal( deg ); +} - RageMatrix mat( - X[0], Y[0], Z[0], 0, - X[1], Y[1], Z[1], 0, - X[2], Y[2], Z[2], 0, - 0, 0, 0, 1 ); +void RageDisplay::RotateZ( float deg ) +{ + g_ModelViewStack.RotateZLocal( deg ); +} - RageMatrix mat2; - RageMatrixTranslation(&mat2, -eyex, -eyey, -eyez); +void RageDisplay::PostMultMatrix( const RageMatrix &m ) +{ + g_ModelViewStack.MultMatrix( m ); +} - RageMatrix ret; - RageMatrixMultiply(&ret, &mat, &mat2); +void RageDisplay::PreMultMatrix( const RageMatrix &m ) +{ + g_ModelViewStack.MultMatrixLocal( m ); +} - return ret; +void RageDisplay::LoadIdentity() +{ + g_ModelViewStack.LoadIdentity(); } @@ -682,70 +297,35 @@ void RageDisplay::LoadMenuPerspective(float fovDegrees) */ if( fovDegrees == 0 ) { - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - float left = 0, right = SCREEN_WIDTH, bottom = SCREEN_HEIGHT, top = 0; - if(strncmp((const char*)glGetString(GL_RENDERER),"GLDirect",strlen("GLDirect"))==0) - { - /* GLDirect incorrectly uses Direct3D's device coordinate system - * instead of OpenGL's, so we need to compensate. */ - left += 0.5f; - right += 0.5f; - bottom += 0.5f; - top += 0.5f; - } - glOrtho(left, right, bottom, top, SCREEN_NEAR, SCREEN_FAR ); - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); + g_ProjectionStack.LoadMatrix( RageOrtho(left, right, bottom, top, SCREEN_NEAR, SCREEN_FAR) ); + g_ModelViewStack.LoadIdentity(); } else { CLAMP( fovDegrees, 0.1f, 179.9f ); float fovRadians = fovDegrees / 180.f * PI; - // tan(theta) = 320/d float theta = fovRadians/2; float fDistCameraFromImage = SCREEN_WIDTH/2 / tanf( theta ); /* It's the caller's responsibility to push first. */ - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); + g_ProjectionStack.LoadMatrix( + RageMatrixFrustrum( + -(SCREEN_WIDTH/2)/fDistCameraFromImage, + +(SCREEN_WIDTH/2)/fDistCameraFromImage, + +(SCREEN_HEIGHT/2)/fDistCameraFromImage, + -(SCREEN_HEIGHT/2)/fDistCameraFromImage, + 1, + fDistCameraFromImage+1000 ) ); - glFrustum( - -(SCREEN_WIDTH/2)/fDistCameraFromImage, - +(SCREEN_WIDTH/2)/fDistCameraFromImage, - +(SCREEN_HEIGHT/2)/fDistCameraFromImage, - -(SCREEN_HEIGHT/2)/fDistCameraFromImage, - 1, - fDistCameraFromImage+1000 - ); - - glMatrixMode( GL_MODELVIEW ); - RageVector3 Up( 0.0f, 1.0f, 0.0f ); - RageVector3 Eye( CENTER_X, CENTER_Y, fDistCameraFromImage ); - RageVector3 At( CENTER_X, CENTER_Y, 0 ); - glLoadIdentity(); - PostMultMatrix(rgluLookAt(Eye.x, Eye.y, Eye.z, At.x, At.y, At.z, Up.x, Up.y, Up.z)); - - /* GLDirect incorrectly uses Direct3D's device coordinate system - * instead of OpenGL's, so we need to compensate. */ - if(strncmp((const char*)glGetString(GL_RENDERER),"GLDirect",strlen("GLDirect"))==0) - glTranslatef( 0.5f, 0.5f, 0 ); + g_ModelViewStack.MultMatrixLocal( + RageLookAt( + CENTER_X, CENTER_Y, fDistCameraFromImage, + CENTER_X, CENTER_Y, 0, + 0.0f, 1.0f, 0.0f) ); } } -/* Getting rid of GLU calls. We don't use them much, and it's just another - * library. */ -static void rgluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar) -{ - GLfloat ymax = zNear * tanf(fovy * PI / 360.0f); - GLfloat ymin = -ymax; - GLfloat xmin = ymin * aspect; - GLfloat xmax = ymax * aspect; - - glFrustum(xmin, xmax, ymin, ymax, zNear, zFar); -} /* Switch from orthogonal to perspective view. * @@ -766,272 +346,63 @@ static void rgluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat */ void RageDisplay::EnterPerspective(float fov, bool preserve_loc, float near_clip, float far_clip) { - g_PerspectiveMode++; - if(g_PerspectiveMode > 1) { - /* havn't yet worked out the details of this */ - LOG->Trace("EnterPerspective called when already in perspective mode"); - g_PerspectiveMode++; - return; - } + g_ProjectionStack.Push(); + g_ModelViewStack.Push(); - /* Save the old matrices. */ - DISPLAY->PushMatrix(); - glMatrixMode( GL_PROJECTION ); - glPushMatrix(); - glLoadIdentity(); float aspect = SCREEN_WIDTH/(float)SCREEN_HEIGHT; - rgluPerspective(fov, aspect, near_clip, far_clip); - - + g_ProjectionStack.LoadMatrix( RageMatrixPerspective(fov, aspect, near_clip, far_clip) ); /* Flip the Y coordinate, so positive numbers go down. */ - glScalef(1, -1, 1); + g_ProjectionStack.Scale(1, -1, 1); - if(!preserve_loc) + if( preserve_loc ) { - glMatrixMode( GL_MODELVIEW ); - return; + RageMatrix matTop = *g_ModelViewStack.GetTop(); + /* TODO: Come up with a more general way to handle this. + * It looks kind of hacky. -Chris */ + // { + // /* Pull out the 2d translation. */ + // float x = matTop.m[3][0], y = matTop.m[3][1]; + // + // /* These values are where the viewpoint should be. By default, it's in the + // * center of the screen, and these values are from the top-left, so subtract + // * the difference. */ + // x -= SCREEN_WIDTH/2; + // y -= SCREEN_HEIGHT/2; + // SetViewport(int(x), int(y)); + // } + // + // /* Pull out the 2d rotations and scales. */ + // { + // RageMatrix mat; + // RageMatrixIdentity(&mat); + // mat.m[0][0] = matTop.m[0][0]; + // mat.m[0][1] = matTop.m[0][1]; + // mat.m[1][0] = matTop.m[1][0]; + // mat.m[1][1] = matTop.m[1][1]; + // this->MultMatrix(mat); + // } + // + // /* We can't cope with perspective matrices or things that touch Z. (We shouldn't + // * have touched those while in 2d, anyway.) */ + // ASSERT(matTop.m[0][2] == 0.f && matTop.m[0][3] == 0.f && matTop.m[1][2] == 0.f && + // matTop.m[1][3] == 0.f && matTop.m[2][0] == 0.f && matTop.m[2][1] == 0.f && + // matTop.m[2][2] == 1.f && matTop.m[3][2] == 0.f && matTop.m[3][3] == 1.f); + // + // /* Reset the matrix back to identity. */ + // glMatrixMode( GL_MODELVIEW ); + // glLoadIdentity(); } - - RageMatrix matTop; - glGetFloatv( GL_MODELVIEW_MATRIX, (float*)matTop ); - - { - /* Pull out the 2d translation. */ - float x = matTop.m[3][0], y = matTop.m[3][1]; - - /* These values are where the viewpoint should be. By default, it's in the - * center of the screen, and these values are from the top-left, so subtract - * the difference. */ - x -= SCREEN_WIDTH/2; - y -= SCREEN_HEIGHT/2; - DISPLAY->SetViewport(int(x), int(y)); - } - - /* Pull out the 2d rotations and scales. */ - { - RageMatrix mat; - RageMatrixIdentity(&mat); - mat.m[0][0] = matTop.m[0][0]; - mat.m[0][1] = matTop.m[0][1]; - mat.m[1][0] = matTop.m[1][0]; - mat.m[1][1] = matTop.m[1][1]; - this->MultMatrix(mat); - } - - /* We can't cope with perspective matrices or things that touch Z. (We shouldn't - * have touched those while in 2d, anyway.) */ - ASSERT(matTop.m[0][2] == 0.f && matTop.m[0][3] == 0.f && matTop.m[1][2] == 0.f && - matTop.m[1][3] == 0.f && matTop.m[2][0] == 0.f && matTop.m[2][1] == 0.f && - matTop.m[2][2] == 1.f && matTop.m[3][2] == 0.f && matTop.m[3][3] == 1.f); - - /* Reset the matrix back to identity. */ - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); } void RageDisplay::ExitPerspective() { - g_PerspectiveMode--; - if(g_PerspectiveMode) return; - - /* Restore the old matrices. */ - glMatrixMode( GL_PROJECTION ); - glPopMatrix(); - glMatrixMode( GL_MODELVIEW ); - DISPLAY->PopMatrix(); - - /* Restore the viewport. */ - DISPLAY->SetViewport(0, 0); + g_ProjectionStack.Pop(); + g_ModelViewStack.Pop(); } /* gluLookAt. The result is pre-multiplied to the matrix (M = L * M) instead of * post-multiplied. */ void RageDisplay::LookAt(const RageVector3 &Eye, const RageVector3 &At, const RageVector3 &Up) { - PreMultMatrix(rgluLookAt(Eye.x, Eye.y, Eye.z, At.x, At.y, At.z, Up.x, Up.y, Up.z)); -} - -void RageDisplay::Translate( float x, float y, float z ) -{ - glTranslatef(x, y, z); -} - - -void RageDisplay::TranslateLocal( float x, float y, float z ) -{ - RageMatrix matTemp; - RageMatrixTranslation( &matTemp, x, y, z ); - - PreMultMatrix(matTemp); -} - -void RageDisplay::Scale( float x, float y, float z ) -{ - glScalef(x, y, z); -} - -void RageDisplay::RotateX( float r ) -{ - glRotatef(r, 1, 0, 0); -} - -void RageDisplay::RotateY( float r ) -{ - glRotatef(r, 0, 1, 0); -} - -void RageDisplay::RotateZ( float r ) -{ - // HACK: Rotation about (0,0,1) seems to be broken in many Voodoo3 drivers, - // but only while using orthographic projections. Strange... - // Adding a tiny X component fixes the problem. -Chris - glRotatef(r, 0.00001f, 0, 1); -} - -void RageDisplay::PostMultMatrix( const RageMatrix &f ) -{ - glMultMatrixf((const float *) f); -} - -void RageDisplay::PreMultMatrix( const RageMatrix &f ) -{ - RageMatrix m; - glGetFloatv( GL_MODELVIEW_MATRIX, (float*)m ); - RageMatrixMultiply( &m, &f, &m ); - glLoadMatrixf((const float*) m); -} - -void RageDisplay::SetTexture( RageTexture* pTexture ) -{ - glBindTexture( GL_TEXTURE_2D, pTexture? pTexture->GetGLTextureID() : 0 ); -} -void RageDisplay::SetTextureModeModulate() -{ - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); -} - -void RageDisplay::SetTextureModeGlow(GlowMode m) -{ - if(m == GLOW_WHITEN && !m_oglspecs->EXT_texture_env_combine) - m = GLOW_BRIGHTEN; /* we can't do GLOW_WHITEN */ - - switch(m) - { - case GLOW_BRIGHTEN: - glBlendFunc( GL_SRC_ALPHA, GL_ONE ); - return; - - case GLOW_WHITEN: - /* Source color is the diffuse color only: */ - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); - glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_COMBINE_RGB_EXT), GL_REPLACE); - glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_RGB_EXT), GL_PRIMARY_COLOR_EXT); - - /* Source alpha is texture alpha * diffuse alpha: */ - glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_COMBINE_ALPHA_EXT), GL_MODULATE); - glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_OPERAND0_ALPHA_EXT), GL_SRC_ALPHA); - glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_ALPHA_EXT), GL_PRIMARY_COLOR_EXT); - glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_OPERAND1_ALPHA_EXT), GL_SRC_ALPHA); - glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE1_ALPHA_EXT), GL_TEXTURE); - return; - } -} - -void RageDisplay::SetBlendMode( BlendMode mode ) -{ - switch( mode ) - { - case BLEND_NORMAL: - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - break; - case BLEND_ADD: - glBlendFunc( GL_ONE, GL_ONE ); - break; - case BLEND_NO_EFFECT: - glBlendFunc( GL_ZERO, GL_ONE ); - break; - default: - ASSERT(0); - } -} - -bool RageDisplay::IsZBufferEnabled() const -{ - bool a; - glGetBooleanv( GL_DEPTH_TEST, (unsigned char*)&a ); - return a; -} - -void RageDisplay::SetZBuffer( bool b ) -{ - if( b ) - glEnable( GL_DEPTH_TEST ); - else - glDisable( GL_DEPTH_TEST ); -} -void RageDisplay::ClearZBuffer() -{ - glClear( GL_DEPTH_BUFFER_BIT ); -} - -void RageDisplay::SetTextureWrapping( bool b ) -{ - GLenum mode = b ? GL_REPEAT : GL_CLAMP; - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, mode ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode ); -} - -void RageDisplay::SetMaterial( - float emissive[4], - float ambient[4], - float diffuse[4], - float specular[4], - float shininess - ) -{ - glMaterialfv( GL_FRONT, GL_EMISSION, emissive ); - glMaterialfv( GL_FRONT, GL_AMBIENT, ambient ); - glMaterialfv( GL_FRONT, GL_DIFFUSE, diffuse ); - glMaterialfv( GL_FRONT, GL_SPECULAR, specular ); - glMaterialf( GL_FRONT, GL_SHININESS, shininess ); -} - -void RageDisplay::SetLighting( bool b ) -{ - if( b ) glEnable( GL_LIGHTING ); - else glDisable( GL_LIGHTING ); -} - -void RageDisplay::SetLightOff( int index ) -{ - glDisable( GL_LIGHT0+index ); -} -void RageDisplay::SetLightDirectional( - int index, - RageColor ambient, - RageColor diffuse, - RageColor specular, - RageVector3 dir ) -{ - // Light coordinates are transformed by the modelview matrix, but - // we are being passed in world-space coords. - glPushMatrix(); - glLoadIdentity(); - - glEnable( GL_LIGHT0+index ); - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT0, GL_SPECULAR, specular); - float position[4] = {dir.x, dir.y, dir.z, 0}; - glLightfv(GL_LIGHT0, GL_POSITION, position); - - glPopMatrix(); -} - -void RageDisplay::SetBackfaceCull( bool b ) -{ - if( b ) - glEnable( GL_CULL_FACE ); - else - glDisable( GL_CULL_FACE ); + PreMultMatrix(RageLookAt(Eye.x, Eye.y, Eye.z, At.x, At.y, At.z, Up.x, Up.y, Up.z)); } diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index e180219df6..b6fef5a3c2 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -4,24 +4,53 @@ ----------------------------------------------------------------------------- Class: RageDisplay - Desc: Wrapper around a D3D device. Also holds global vertex and index - buffers that dynamic geometry can use to render. + Desc: Wrapper around a graphics device. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ -class RageTexture; -struct RageMatrix; -struct RageVertex; - #include "SDL_types.h" #include "RageTypes.h" const int REFRESH_DEFAULT = 0; -struct oglspecs_t; +struct SDL_Surface; +// VertexArray holds vertex data in a format that is most efficient for +// the graphics API. +/*struct VertexArray +{ + VertexArray(); + ~VertexArray(); + unsigned size(); + void resize( unsigned new_size ); + RageVector2& TexCoord( int index ); + RageColor& Color( int index ); + RageVector3& Normal( int index ); + RageVector3& Position( int index ); + // convenience. Remove this later! + void Set( int index, const RageVertex& v ); + + struct Impl; + Impl* pImpl; +}; +*/ + +enum PixelFormat { + FMT_RGBA8, + FMT_RGBA4, + FMT_RGB5A1, + FMT_RGB5, + FMT_RGB8, + FMT_PAL, + NUM_PIX_FORMATS +}; +struct PixelFormatDesc { + int bpp; + unsigned int masks[4]; +}; +extern const PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS]; class RageDisplay { @@ -41,30 +70,33 @@ public: void Clear(); void Flip(); - float PredictedSecondsUntilNextFlip() const; bool IsWindowed() const; int GetWidth() const; int GetHeight() const; int GetBPP() const; - void PushMatrix(); - void PopMatrix(); - void Translate( float x, float y, float z ); - void TranslateLocal( float x, float y, float z ); - void Scale( float x, float y, float z ); - void RotateX( float r ); - void RotateY( float r ); - void RotateZ( float r ); - void MultMatrix( const RageMatrix &f ) { PostMultMatrix(f); } /* alias */ - void PostMultMatrix( const RageMatrix &f ); - void PreMultMatrix( const RageMatrix &f ); - void SetBlendMode( BlendMode mode ); + bool SupportsTextureFormat( PixelFormat pixfmt ); + /* return 0 if failed or internal texture resource handle + * (unsigned in OpenGL, texture pointer in D3D) */ + unsigned CreateTexture( + PixelFormat pixfmt, // format of img and of texture in video mem + SDL_Surface*& img // must be in pixfmt + ); + void UpdateTexture( + unsigned uTexHandle, + PixelFormat pixfmt, // this must be the same as what was passed to CreateTexture + SDL_Surface*& img, + int xoffset, int yoffset, int width, int height + ); + void DeleteTexture( unsigned uTexHandle ); void SetTexture( RageTexture* pTexture ); void SetTextureModeModulate(); - void SetTextureModeGlow( GlowMode m = GLOW_WHITEN ); + void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ); void SetTextureWrapping( bool b ); + int GetMaxTextureSize() const; + void SetTextureFiltering( bool b); bool IsZBufferEnabled() const; void SetZBuffer( bool b ); @@ -72,6 +104,8 @@ public: void SetBackfaceCull( bool b ); + void SetAlphaTest( bool b ); + void SetMaterial( float emissive[4], float ambient[4], @@ -89,48 +123,56 @@ public: RageColor specular, RageVector3 dir ); - void DrawQuad( const RageVertex v[4] ); // upper-left, upper-right, lower-left, lower-right + + void DrawQuad( const RageVertex v[] ) { DrawQuads(v,4); } /* alias. upper-left, upper-right, lower-left, lower-right */ void DrawQuads( const RageVertex v[], int iNumVerts ); void DrawFan( const RageVertex v[], int iNumVerts ); void DrawStrip( const RageVertex v[], int iNumVerts ); void DrawTriangles( const RageVertex v[], int iNumVerts ); void DrawIndexedTriangles( const RageVertex v[], const Uint16* pIndices, int iNumIndices ); - void DrawLoop( const RageVertex v[], int iNumVerts, float LineWidth ); - void DrawLoop_LinesAndPoints( const RageVertex v[], int iNumVerts, float LineWidth ); - void DrawLoop_Polys( const RageVertex v[], int iNumVerts, float LineWidth ); - void FlushQueue(); + void DrawLineStrip( const RageVertex v[], int iNumVerts, float LineWidth ); - int GetMaxTextureSize() const; - - // This far clipping this might cause Z-fighting if we ever turn the z-buffer on - void LoadMenuPerspective(float fovDegrees); - void EnterPerspective(float fov, bool preserve_loc = true, float near = 1, float far = 1000); - void ExitPerspective(); - void LookAt(const RageVector3 &Eye, const RageVector3 &At, const RageVector3 &Up); + void SaveScreenshot( CString sPath ); +protected: + void SetViewport(int shift_left, int shift_down); + // Stuff in RageDisplay.cpp + void SetDefaultRenderStates(); + +public: /* Statistics */ int GetFPS() const; int GetVPF() const; int GetCumFPS() const; /* average FPS since last reset */ void ResetStats(); + void ProcessStatsOnFlip(); + void StatsAddVerts( int iNumVertsRendered ); - const oglspecs_t &GetSpecs() const { return *m_oglspecs; } - void DisablePalettedTexture(); + /* Statistics */ - void SaveScreenshot( CString sPath ); + /* Statistics */ + void PushMatrix(); + void PopMatrix(); + void Translate( float x, float y, float z ); + void TranslateWorld( float x, float y, float z ); + void Scale( float x, float y, float z ); + void RotateX( float deg ); + void RotateY( float deg ); + void RotateZ( float deg ); + void MultMatrix( const RageMatrix &f ) { this->PostMultMatrix(f); } /* alias */ + void PostMultMatrix( const RageMatrix &f ); + void PreMultMatrix( const RageMatrix &f ); + void LoadIdentity(); + void LoadMenuPerspective(float fovDegrees); + void EnterPerspective(float fov, bool preserve_loc = true, float znear = 1, float zfar = 1000); + void ExitPerspective(); + void LookAt(const RageVector3 &Eye, const RageVector3 &At, const RageVector3 &Up); protected: - void AddVerts( const RageVertex v[], int iNumVerts ); - void SetupOpenGL(); - void SetupExtensions(); - void SetViewport(int shift_left, int shift_down); - oglspecs_t *m_oglspecs; - /* Don't use this to check extensions; use GetSpecs. */ - bool HasExtension(CString ext) const; - void RageDisplay::DumpOpenGLDebugInfo(); + const RageMatrix* GetProjection(); + const RageMatrix* GetModelViewTop(); - void DrawPolyLine(const RageVertex &p1, const RageVertex &p2, float LineWidth ); }; diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp new file mode 100644 index 0000000000..8a7c8cb332 --- /dev/null +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -0,0 +1,802 @@ +#include "global.h" +/* +----------------------------------------------------------------------------- + Class: RageDisplay + + Desc: See header. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford + Glenn Maynard +----------------------------------------------------------------------------- +*/ + +#include "RageDisplay.h" +#include "D3D8.h" +#include "RageUtil.h" +#include "RageLog.h" +#include "RageTimer.h" +#include "RageException.h" +#include "RageTexture.h" +#include "RageTextureManager.h" +#include "RageMath.h" +#include "RageTypes.h" +#include "GameConstantsAndTypes.h" +#include "StepMania.h" +#include "RageUtil.h" +#include "D3dx8math.h" +#include "SDL_video.h" // for SDL_Surface +#include "SDL_utils.h" + +#include "arch/arch.h" + +#pragma comment(lib, "D3d8.lib") +#pragma comment(lib, "D3dx8.lib") + +#include + +RageDisplay* DISPLAY = NULL; + +// +// Globals +// +LPDIRECT3D8 g_pd3d = NULL; +LPDIRECT3DDEVICE8 g_pd3dDevice = NULL; +D3DCAPS8 g_DeviceCaps; +D3DDISPLAYMODE g_DesktopMode; +D3DPRESENT_PARAMETERS g_d3dpp; +int g_ModelMatrixCnt=0; +bool g_Windowed; +int g_CurrentHeight, g_CurrentWidth, g_CurrentBPP; + +/* Direct3D doesn't associate a palette with textures. + * Instead, we load a palette into a slot. We need to keep track + * of which texture's palette is stored in what slot. */ +map g_TexResourceToPaletteIndex; +int GetUnusedPaletteIndex() +{ + for( int i=0; i<256; i++ ) + { + bool bFreeToUse = true; + for( map::const_iterator iter=g_TexResourceToPaletteIndex.begin(); + iter!=g_TexResourceToPaletteIndex.end(); + iter++ ) + { + if( iter->second == i ) + { + bFreeToUse = false; + break; + } + } + if( bFreeToUse ) + return i; + } + ASSERT( 0 ); // couldn't find a free palette index. Resource leak? + return 0; +} + +#define D3DFVF_RAGEVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_DIFFUSE|D3DFVF_TEX1) // D3D FVF flags which describe our vertex structure + + +const PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS] = { + { + /* A8B8G8R8 */ + 32, + { 0x00FF0000, + 0x0000FF00, + 0x000000FF, + 0xFF000000 } + }, { + /* A4R4G4B4 */ + 16, + { 0x0F00, + 0x00F0, + 0x000F, + 0xF000 }, + }, { + /* A1B5G5R5 */ + 16, + { 0x7C00, + 0x03E0, + 0x001F, + 0x8000 }, + }, { + /* X1R5G5R5 */ + 16, + { 0x7C00, + 0x03E0, + 0x001F, + 0x0000 }, + }, { + /* B8G8R8 */ + 24, + { 0xFF0000, + 0x00FF00, + 0x0000FF, + 0x000000 } + }, { + /* Paletted */ + 8, + { 0,0,0,0 } /* N/A */ + } +}; + + +RageDisplay::RageDisplay( bool windowed, int width, int height, int bpp, int rate, bool vsync ) +{ + LOG->Trace( "RageDisplay::RageDisplay()" ); + + if(!SDL_WasInit(SDL_INIT_VIDEO)) + SDL_InitSubSystem(SDL_INIT_VIDEO); + + /* By default, ignore all SDL events. We'll enable them as we need them. + * We must not enable any events we don't actually want, since we won't + * query for them and they'll fill up the event queue. + * + * This needs to be done after we initialize video, since it's really part + * of the SDL video system--it'll be reinitialized on us if we do this first. */ + SDL_EventState(0xFF /*SDL_ALLEVENTS*/, SDL_IGNORE); + + SDL_EventState(SDL_VIDEORESIZE, SDL_ENABLE); + + g_Windowed = false; + + + g_pd3d = Direct3DCreate8( D3D_SDK_VERSION ); + + if( FAILED( g_pd3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &g_DeviceCaps) ) ) + throw RageException( + "There was an error while initializing your video card.\n\n" + "Your system is reporting that Direct3D8 hardware acceleration\n" + "is not available. In most cases, you can download an updated\n" + "driver from your card's manufacturer." + ); + + D3DADAPTER_IDENTIFIER8 identifier; + g_pd3d->GetAdapterIdentifier( D3DADAPTER_DEFAULT, 0, &identifier ); + + LOG->Trace( + "Driver: %s\n" + "Description: %s\n" + "Max texture size: %d\n", + identifier.Driver, + identifier.Description, + g_DeviceCaps.MaxTextureWidth + ); + + LOG->Trace( "This display adaptor supports the following modes:" ); + D3DDISPLAYMODE mode; + for( UINT u=0; uGetAdapterModeCount(D3DADAPTER_DEFAULT); u++ ) + if( SUCCEEDED( g_pd3d->EnumAdapterModes( D3DADAPTER_DEFAULT, u, &mode ) ) ) + LOG->Trace( " %ux%u %uHz, format %d", mode.Width, mode.Height, mode.RefreshRate, mode.Format ); + + // Save the original desktop format. + g_pd3d->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &g_DesktopMode ); + + SetVideoMode( windowed, width, height, bpp, rate, vsync ); +} + +void RageDisplay::Update(float fDeltaTime) +{ + SDL_Event event; + while(SDL_GetEvent(event, SDL_VIDEORESIZEMASK)) + { + switch(event.type) + { + case SDL_VIDEORESIZE: + g_CurrentWidth = event.resize.w; + g_CurrentHeight = event.resize.h; + + /* Let DISPLAY know that our resolution has changed. */ + ResolutionChanged(); + break; + } + } +} + +bool RageDisplay::IsSoftwareRenderer() +{ + return false; +} + +RageDisplay::~RageDisplay() +{ + SDL_QuitSubSystem(SDL_INIT_VIDEO); + SDL_EventState(SDL_VIDEORESIZE, SDL_IGNORE); + + g_pd3dDevice->Release(); + g_pd3d->Release(); +} + +D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP) +{ + HRESULT hr; + + // If windowed, then bpp is ignored. Use whatever works. + vector vBackBufferFormats; // throw all possibilities in here + + /* When windowed, add all formats; otherwise add only formats that match dwBPP. */ + if( iBPP == 16 || bWindowed ) + { + vBackBufferFormats.push_back( D3DFMT_R5G6B5 ); + vBackBufferFormats.push_back( D3DFMT_X1R5G5B5 ); + vBackBufferFormats.push_back( D3DFMT_A1R5G5B5 ); + } + if( iBPP == 32 || bWindowed ) + { +#ifndef _XBOX + vBackBufferFormats.push_back( D3DFMT_R8G8B8 ); +#endif + vBackBufferFormats.push_back( D3DFMT_X8R8G8B8 ); + vBackBufferFormats.push_back( D3DFMT_A8R8G8B8 ); + } + if( !bWindowed && iBPP != 16 && iBPP != 32 ) + throw RageException( ssprintf("Invalid BPP '%u' specified", iBPP) ); + + // Test each back buffer format until we find something that works. + for( unsigned i=0; i < vBackBufferFormats.size(); i++ ) + { + D3DFORMAT fmtBackBuffer = vBackBufferFormats[i]; + + D3DFORMAT fmtDisplay; + if( bWindowed ) + fmtDisplay = g_DesktopMode.Format; + else // Fullscreen + fmtDisplay = vBackBufferFormats[i]; + + LOG->Trace( "Testing format: display %d, back buffer %d, windowed %d...", + fmtDisplay, fmtBackBuffer, bWindowed ); + + hr = g_pd3d->CheckDeviceType( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + fmtDisplay, fmtBackBuffer, bWindowed ); + + if( FAILED(hr) ) + continue; // skip + + // done searching + LOG->Trace( "This will work." ); + return fmtBackBuffer; + } + + RageException::Throw( "Couldn't find an appropriate back buffer format." ); + return D3DFMT_UNKNOWN; +} + +#ifndef _XBOX +HWND GetHwnd() +{ + SDL_SysWMinfo info; + SDL_VERSION(&info.version); + if( SDL_GetWMInfo(&info) < 0 ) + RageException::Throw( "SDL_GetWMInfo failed" ); + return info.window; +} +#endif + +/* Set the video mode. */ +bool RageDisplay::SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync ) +{ + int flags = SDL_RESIZABLE; + if( !windowed ) + flags |= SDL_FULLSCREEN; + + g_Windowed = windowed; + SDL_ShowCursor( g_Windowed ); + + SDL_Surface *screen = SDL_SetVideoMode(width, height, bpp, flags); + if(!screen) + RageException::Throw("SDL_SetVideoMode failed: %s", SDL_GetError()); + + g_CurrentWidth = screen->w; + g_CurrentHeight = screen->h; + g_CurrentBPP = bpp; + + + ZeroMemory( &g_d3dpp, sizeof(g_d3dpp) ); + g_d3dpp.BackBufferWidth = width; + g_d3dpp.BackBufferHeight = height; + g_d3dpp.BackBufferFormat = FindBackBufferType( windowed, bpp ); + g_d3dpp.BackBufferCount = 1; + g_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; + g_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; +#ifndef _XBOX + g_d3dpp.hDeviceWindow = GetHwnd(); +#endif + g_d3dpp.Windowed = windowed; + g_d3dpp.EnableAutoDepthStencil = TRUE; + g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; + g_d3dpp.Flags = 0; + g_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; + + /* Windowed must always use D3DPRESENT_INTERVAL_DEFAULT. */ + g_d3dpp.FullScreen_PresentationInterval = + (windowed || vsync) ? D3DPRESENT_INTERVAL_DEFAULT : D3DPRESENT_INTERVAL_IMMEDIATE; + + if( g_pd3dDevice == NULL ) // device is not yet created. We need to create it + { + g_pd3d->CreateDevice( + D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, +#ifndef _XBOX + GetHwnd(), + D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED, +#else + NULL, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, +#endif + &g_d3dpp, + &g_pd3dDevice ); + ASSERT( g_pd3dDevice ); + } + else + { + g_pd3dDevice->Reset( &g_d3dpp ); + } + + ResolutionChanged(); + + this->SetDefaultRenderStates(); + + g_pd3dDevice->BeginScene(); + + return false; // we can always reuse the D3D device +} + +void RageDisplay::ResolutionChanged() +{ + // no need to clear because D3D uses an overlay +// SetViewport(0,0); +// +// /* Clear any junk that's in the framebuffer. */ +// Clear(); +// Flip(); +} + +void RageDisplay::SetViewport(int shift_left, int shift_down) +{ + /* left and down are on a 0..SCREEN_WIDTH, 0..SCREEN_HEIGHT scale. + * Scale them to the actual viewport range. */ + shift_left = int( shift_left * float(g_CurrentWidth) / SCREEN_WIDTH ); + shift_down = int( shift_down * float(g_CurrentWidth) / SCREEN_WIDTH ); + + D3DVIEWPORT8 viewData = { shift_left, -shift_down, g_CurrentWidth, g_CurrentHeight, 0.f, 1.f }; + g_pd3dDevice->SetViewport( &viewData ); +} + +int RageDisplay::GetMaxTextureSize() const +{ + return g_DeviceCaps.MaxTextureWidth; +} + +void RageDisplay::Clear() +{ + g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, + D3DCOLOR_XRGB(0,0,0), 1.0f, 0x00000000 ); +} + +void RageDisplay::Flip() +{ + g_pd3dDevice->EndScene(); + g_pd3dDevice->Present( 0, 0, 0, 0 ); + g_pd3dDevice->BeginScene(); + ProcessStatsOnFlip(); +} + +D3DFORMAT D3DFORMATS[NUM_PIX_FORMATS] = +{ + D3DFMT_A8R8G8B8, + D3DFMT_A4R4G4B4, + D3DFMT_A1R5G5B5, + D3DFMT_X1R5G5B5, +#ifndef _XBOX + D3DFMT_R8G8B8, +#else + D3DFMT_A8R8G8B8, +#endif + D3DFMT_P8 +}; + +bool RageDisplay::SupportsTextureFormat( PixelFormat pixfmt ) +{ + D3DFORMAT d3dfmt = D3DFORMATS[pixfmt]; + HRESULT hr = g_pd3d->CheckDeviceFormat( + D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, + g_d3dpp.BackBufferFormat, + 0, + D3DRTYPE_TEXTURE, + d3dfmt); + return SUCCEEDED( hr ); +} + +void RageDisplay::SaveScreenshot( CString sPath ) +{ +#ifndef _XBOX + IDirect3DSurface8* pSurface; + g_pd3dDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pSurface ); + D3DXSaveSurfaceToFile( sPath, D3DXIFF_BMP, pSurface, 0, NULL ); + pSurface->Release(); +#endif +} + + +bool RageDisplay::IsWindowed() const { return g_Windowed; } +int RageDisplay::GetWidth() const { return g_CurrentWidth; } +int RageDisplay::GetHeight() const { return g_CurrentHeight; } +int RageDisplay::GetBPP() const { return g_CurrentBPP; } + +#define SEND_CURRENT_MATRICES \ + g_pd3dDevice->SetTransform( D3DTS_PROJECTION, (D3DMATRIX*)GetProjection() ); \ + RageMatrix m; \ + /* Convert to OpenGL-style "pixel-centered" coords */ \ + RageMatrixTranslation( &m, -0.5f, -0.5f, 0 ); \ + RageMatrixMultiply( &m, &m, GetModelViewTop() ); \ + g_pd3dDevice->SetTransform( D3DTS_WORLD, (D3DMATRIX*)&m ); + + +void RageDisplay::DrawQuads( const RageVertex v[], int iNumVerts ) +{ + ASSERT( (iNumVerts%4) == 0 ); + + if(iNumVerts == 0) + return; + + // there isn't a quad primitive in D3D, so we have to fake it with indexed triangles + int iNumQuads = iNumVerts/4; + int iNumTriangles = iNumQuads*2; + int iNumIndices = iNumTriangles*3; + + // make a temporary index buffer + static vector vIndices; + unsigned uOldSize = vIndices.size(); + unsigned uNewSize = max(uOldSize,(unsigned)iNumIndices); + vIndices.resize( uNewSize ); + for( Uint16 i=(Uint16)uOldSize/6; i<(Uint16)iNumQuads; i++ ) + { + vIndices[i*6+0] = i*4+0; + vIndices[i*6+1] = i*4+1; + vIndices[i*6+2] = i*4+2; + vIndices[i*6+3] = i*4+2; + vIndices[i*6+4] = i*4+3; + vIndices[i*6+5] = i*4+0; + } + + g_pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX ); + SEND_CURRENT_MATRICES; + g_pd3dDevice->DrawIndexedPrimitiveUP( + D3DPT_TRIANGLELIST, // PrimitiveType + 0, // MinIndex + iNumVerts, // NumVertices + iNumTriangles, // PrimitiveCount, + &vIndices[0], // pIndexData, + D3DFMT_INDEX16, // IndexDataFormat, + v, // pVertexStreamZeroData, + sizeof(RageVertex) // VertexStreamZeroStride + ); + + StatsAddVerts( iNumVerts ); +} +void RageDisplay::DrawFan( const RageVertex v[], int iNumVerts ) +{ + ASSERT( iNumVerts >= 3 ); + g_pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX ); + SEND_CURRENT_MATRICES; + g_pd3dDevice->DrawPrimitiveUP( + D3DPT_TRIANGLEFAN, // PrimitiveType + iNumVerts-2, // PrimitiveCount, + v, // pVertexStreamZeroData, + sizeof(RageVertex) + ); + StatsAddVerts( iNumVerts ); +} + +void RageDisplay::DrawStrip( const RageVertex v[], int iNumVerts ) +{ + ASSERT( iNumVerts >= 3 ); + g_pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX ); + SEND_CURRENT_MATRICES; + g_pd3dDevice->DrawPrimitiveUP( + D3DPT_TRIANGLESTRIP, // PrimitiveType + iNumVerts-2, // PrimitiveCount, + v, // pVertexStreamZeroData, + sizeof(RageVertex) + ); + StatsAddVerts( iNumVerts ); +} + +void RageDisplay::DrawTriangles( const RageVertex v[], int iNumVerts ) +{ + if( iNumVerts == 0 ) + return; + ASSERT( iNumVerts >= 3 ); + g_pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX ); + SEND_CURRENT_MATRICES; + g_pd3dDevice->DrawPrimitiveUP( + D3DPT_TRIANGLELIST, // PrimitiveType + iNumVerts/3, // PrimitiveCount, + v, // pVertexStreamZeroData, + sizeof(RageVertex) + ); + StatsAddVerts( iNumVerts ); +} + +void RageDisplay::DrawIndexedTriangles( const RageVertex v[], const Uint16 pIndices[], int iNumIndices ) +{ + if( iNumIndices == 0 ) + return; + g_pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX ); + SEND_CURRENT_MATRICES; + g_pd3dDevice->DrawIndexedPrimitiveUP( + D3DPT_TRIANGLELIST, // PrimitiveType + 0, // MinIndex + iNumIndices, // NumVertices + iNumIndices/3, // PrimitiveCount, + pIndices, // pIndexData, + D3DFMT_INDEX16, // IndexDataFormat, + v, // pVertexStreamZeroData, + sizeof(RageVertex) // VertexStreamZeroStride + ); + StatsAddVerts( iNumIndices ); +} + +void RageDisplay::DrawLineStrip( const RageVertex v[], int iNumVerts, float LineWidth ) +{ + ASSERT( iNumVerts >= 2 ); + g_pd3dDevice->SetRenderState( D3DRS_POINTSIZE, *((DWORD*)&LineWidth) ); // funky cast. See D3DRENDERSTATETYPE doc + g_pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX ); + SEND_CURRENT_MATRICES; + g_pd3dDevice->DrawPrimitiveUP( + D3DPT_LINESTRIP, // PrimitiveType + iNumVerts-1, // PrimitiveCount, + v, // pVertexStreamZeroData, + sizeof(RageVertex) + ); + StatsAddVerts( iNumVerts ); +} + +void RageDisplay::SetTexture( RageTexture* pTexture ) +{ + if( pTexture == NULL ) + { + g_pd3dDevice->SetTexture( 0, NULL ); + return; + } + + unsigned uTexHandle = pTexture->GetTexHandle(); + IDirect3DTexture8* pTex = (IDirect3DTexture8*)uTexHandle; + g_pd3dDevice->SetTexture( 0, pTex ); + + // Set palette (if any) + if( g_TexResourceToPaletteIndex.find(uTexHandle) != g_TexResourceToPaletteIndex.end() ) + { + int iPaletteIndex = g_TexResourceToPaletteIndex.find(uTexHandle)->second; +#ifndef _XBOX + g_pd3dDevice->SetCurrentTexturePalette( iPaletteIndex ); +#else + ASSERT(0); +#endif + } +} +void RageDisplay::SetTextureModeModulate() +{ + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); +} + +void RageDisplay::SetTextureModeGlow(GlowMode m) +{ + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG2 ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); + +} + +void RageDisplay::SetTextureFiltering( bool b ) +{ + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_MINFILTER, b ? D3DTEXF_LINEAR : D3DTEXF_POINT ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_MAGFILTER, b ? D3DTEXF_LINEAR : D3DTEXF_POINT ); +} + +void RageDisplay::SetBlendMode( BlendMode mode ) +{ + g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); + switch( mode ) + { + case BLEND_NORMAL: + g_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA ); + g_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); + break; + case BLEND_ADD: + g_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE ); + g_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE ); + break; + case BLEND_NO_EFFECT: + g_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ZERO ); + g_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE ); + break; + default: + ASSERT(0); + } +} + +bool RageDisplay::IsZBufferEnabled() const +{ + DWORD b; + g_pd3dDevice->GetRenderState( D3DRS_ZENABLE, &b ); + return b!=0; +} + +void RageDisplay::SetZBuffer( bool b ) +{ + g_pd3dDevice->SetRenderState( D3DRS_ZENABLE, b ); + g_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, b ); +} +void RageDisplay::ClearZBuffer() +{ + g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0x00000000 ); +} + +void RageDisplay::SetTextureWrapping( bool b ) +{ + int mode = b ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP; + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, mode ); + g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, mode ); +} + +void RageDisplay::SetMaterial( + float emissive[4], + float ambient[4], + float diffuse[4], + float specular[4], + float shininess + ) +{ + D3DMATERIAL8 mat; + memcpy( &mat.Diffuse, diffuse, sizeof(diffuse) ); + memcpy( &mat.Ambient, ambient, sizeof(ambient) ); + memcpy( &mat.Specular, specular, sizeof(specular) ); + memcpy( &mat.Emissive, emissive, sizeof(emissive) ); + mat.Power = shininess; + g_pd3dDevice->SetMaterial( &mat ); +} + +void RageDisplay::SetLighting( bool b ) +{ + g_pd3dDevice->SetRenderState( D3DRS_LIGHTING, b ); +} + +void RageDisplay::SetLightOff( int index ) +{ + g_pd3dDevice->LightEnable( index, false ); +} +void RageDisplay::SetLightDirectional( + int index, + RageColor ambient, + RageColor diffuse, + RageColor specular, + RageVector3 dir ) +{ + g_pd3dDevice->LightEnable( index, true ); + + D3DLIGHT8 light; + ZERO( light ); + memcpy( &light.Direction, &dir, sizeof(dir) ); + memcpy( &light.Direction, &dir, sizeof(dir) ); + memcpy( &light.Diffuse, diffuse, sizeof(diffuse) ); + memcpy( &light.Ambient, ambient, sizeof(ambient) ); + memcpy( &light.Specular, specular, sizeof(specular) ); + + g_pd3dDevice->SetLight( index, &light ); +} + +void RageDisplay::SetBackfaceCull( bool b ) +{ + g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, b ? D3DCULL_CCW : D3DCULL_NONE ); +} + +void RageDisplay::DeleteTexture( unsigned uTexHandle ) +{ + IDirect3DTexture8* pTex = (IDirect3DTexture8*) uTexHandle; + pTex->Release(); + + // Delete palette (if any) + if( g_TexResourceToPaletteIndex.find(uTexHandle) != g_TexResourceToPaletteIndex.end() ) + g_TexResourceToPaletteIndex.erase( g_TexResourceToPaletteIndex.find(uTexHandle) ); +} + + +unsigned RageDisplay::CreateTexture( + PixelFormat pixfmt, + SDL_Surface*& img ) +{ + // texture must be power of two + ASSERT( img->w == power_of_two(img->w) ); + ASSERT( img->h == power_of_two(img->h) ); + + + HRESULT hr; + IDirect3DTexture8* pTex; + hr = g_pd3dDevice->CreateTexture( img->w, img->h, 1, 0, D3DFORMATS[pixfmt], D3DPOOL_MANAGED, &pTex ); + + unsigned uTexHandle = (unsigned)pTex; + + if( pixfmt == FMT_PAL ) + { + int iPalIndex = GetUnusedPaletteIndex(); + + // Save palette + PALETTEENTRY pal[256]; + memset( pal, 0, sizeof(pal) ); + for( int i=0; iformat->palette->ncolors; i++ ) + { + SDL_Color c = img->format->palette->colors[i]; + pal[i].peRed = c.r; + pal[i].peGreen = c.g; + pal[i].peBlue = c.b; + bool bIsColorKey = img->flags & SDL_SRCCOLORKEY && (unsigned)i == img->format->colorkey; + pal[i].peFlags = bIsColorKey ? 0x00 : 0xFF; + } +#ifndef _XBOX + g_pd3dDevice->SetPaletteEntries( iPalIndex, pal ); +#else + ASSERT(0); +#endif + + ASSERT( g_TexResourceToPaletteIndex.find(uTexHandle) == g_TexResourceToPaletteIndex.end() ); + g_TexResourceToPaletteIndex[uTexHandle] = iPalIndex; + } + + UpdateTexture( uTexHandle, pixfmt, img, 0, 0, img->w, img->h ); + + return uTexHandle; +} + +void RageDisplay::UpdateTexture( + unsigned uTexHandle, + PixelFormat pixfmt, + SDL_Surface*& img, + int xoffset, int yoffset, int width, int height ) +{ + IDirect3DTexture8* pTex = (IDirect3DTexture8*)uTexHandle; + + RECT rect; + rect.left = xoffset; + rect.top = yoffset; + rect.right = width - xoffset; + rect.bottom = height - yoffset; + + D3DLOCKED_RECT lr; + pTex->LockRect( 0, &lr, &rect, 0 ); + + // copy each row + int bytes_per_pixel = img->format->BytesPerPixel; + for( int y=rect.top; ypixels + y*img->pitch + rect.left*bytes_per_pixel; + char* dst = (char*)lr.pBits + y*lr.Pitch + rect.left*bytes_per_pixel; + memcpy( dst, src, (rect.right-rect.left)*bytes_per_pixel ); + } + pTex->UnlockRect( 0 ); + +// SDL_SaveBMP( (SDL_Surface*)img, "testing-SDL.bmp" ); + +// D3DXSaveTextureToFile( +// "testing-D3D.bmp", +// D3DXIFF_BMP, +// pTex, +// NULL ); +} + +void RageDisplay::SetAlphaTest( bool b ) +{ + g_pd3dDevice->SetRenderState( D3DRS_ALPHATESTENABLE, b ); + g_pd3dDevice->SetRenderState( D3DRS_ALPHAREF, 0 ); + g_pd3dDevice->SetRenderState( D3DRS_ALPHAFUNC, D3DCMP_GREATER ); +} diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp new file mode 100644 index 0000000000..a8174ee2f7 --- /dev/null +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -0,0 +1,1001 @@ +#include "global.h" +/* +----------------------------------------------------------------------------- + Class: RageDisplay + + Desc: See header. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford + Glenn Maynard +----------------------------------------------------------------------------- +*/ + +/* + * This header pulls in GL headers and defines things that require them. + * This only needs to be included if you actually use these; most of the + * time, RageDisplay.h is sufficient. + */ + +#include "SDL_utils.h" +/* ours is more up-to-date */ +#define NO_SDL_GLEXT +#define __glext_h_ /* try harder to stop glext.h from being forced on us by someone else */ +#include "SDL_opengl.h" +#undef __glext_h_ + +#include "glext.h" + +/* Windows's broken gl.h defines GL_EXT_paletted_texture incompletely: */ +#ifndef GL_TEXTURE_INDEX_SIZE_EXT +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif +#include + +/* Not in glext.h: */ +typedef bool (APIENTRY * PWSWAPINTERVALEXTPROC) (int interval); + + +/* Extension functions we use. Put these in a namespace instead of in oglspecs_t, + * so they can be called like regular functions. */ +namespace GLExt { + extern PWSWAPINTERVALEXTPROC wglSwapIntervalEXT; + extern PFNGLCOLORTABLEPROC glColorTableEXT; + extern PFNGLCOLORTABLEPARAMETERIVPROC glGetColorTableParameterivEXT; +}; + +#include "RageDisplay.h" +#include "RageUtil.h" +#include "RageLog.h" +#include "RageTimer.h" +#include "RageException.h" +#include "RageTexture.h" +#include "RageTextureManager.h" +#include "RageMath.h" +#include "RageTypes.h" +#include "GameConstantsAndTypes.h" +#include "StepMania.h" +#include "RageUtil.h" + +#include "arch/arch.h" +#include "arch/LowLevelWindow/LowLevelWindow.h" + +#include + +RageDisplay* DISPLAY = NULL; + + +// +// Globals +// + +PWSWAPINTERVALEXTPROC GLExt::wglSwapIntervalEXT = NULL; +PFNGLCOLORTABLEPROC GLExt::glColorTableEXT = NULL; +PFNGLCOLORTABLEPARAMETERIVPROC GLExt::glGetColorTableParameterivEXT = NULL; +bool g_bAALinesBroken = false; +bool g_bEXT_texture_env_combine = true; +/* OpenGL system information that generally doesn't change at runtime. */ + +/* Range and granularity of points and lines: */ +float g_line_range[2]; +float g_line_granularity; +float g_point_range[2]; +float g_point_granularity; + +/* OpenGL version * 10: */ +int g_glVersion; + +/* Available extensions: */ +set g_glExts; + +/* We don't actually use normals (we don't tunr on lighting), there's just + * no GL_T2F_C4F_V3F. */ +const GLenum RageVertexFormat = GL_T2F_C4F_N3F_V3F; + + +LowLevelWindow *wind; + +void GetGLExtensions(set &ext) +{ + const char *buf = (const char *)glGetString(GL_EXTENSIONS); + + vector lst; + split(buf, " ", lst); + + for(unsigned i = 0; i < lst.size(); ++i) + ext.insert(lst[i]); +} + +RageDisplay::RageDisplay( bool windowed, int width, int height, int bpp, int rate, bool vsync ) +{ + LOG->Trace( "RageDisplay::RageDisplay()" ); + + wind = MakeLowLevelWindow(); + + SetVideoMode( windowed, width, height, bpp, rate, vsync ); + + // Log driver details + LOG->Info("OGL Vendor: %s", glGetString(GL_VENDOR)); + LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER)); + LOG->Info("OGL Version: %s", glGetString(GL_VERSION)); + LOG->Info("OGL Extensions: %s", glGetString(GL_EXTENSIONS)); + if( IsSoftwareRenderer() ) + LOG->Warn("This is a software renderer!"); + + + /* Log this, so if people complain that the radar looks bad on their + * system we can compare them: */ + glGetFloatv(GL_LINE_WIDTH_RANGE, g_line_range); + glGetFloatv(GL_LINE_WIDTH_GRANULARITY, &g_line_granularity); + LOG->Info("Line width range: %.3f-%.3f +%.3f", g_line_range[0], g_line_range[1], g_line_granularity); + + glGetFloatv(GL_POINT_SIZE_RANGE, g_point_range); + glGetFloatv(GL_POINT_SIZE_GRANULARITY, &g_point_granularity); + LOG->Info("Point size range: %.3f-%.3f +%.3f", g_point_range[0], g_point_range[1], g_point_granularity); +} + +void RageDisplay::Update(float fDeltaTime) +{ + wind->Update(fDeltaTime); +} + +bool RageDisplay::IsSoftwareRenderer() +{ + return + ( strcmp((const char*)glGetString(GL_VENDOR),"Microsoft Corporation")==0 ) && + ( strcmp((const char*)glGetString(GL_RENDERER),"GDI Generic")==0 ); +} + +RageDisplay::~RageDisplay() +{ + delete wind; +} + +bool HasExtension(CString ext) +{ + return g_glExts.find(ext) != g_glExts.end(); +} + +void SetupExtensions() +{ + double fGLVersion = atof( (const char *) glGetString(GL_VERSION) ); + g_glVersion = int(roundf(fGLVersion * 10)); + GetGLExtensions(g_glExts); + + /* Find extension functions and reset broken flags */ + GLExt::wglSwapIntervalEXT = (PWSWAPINTERVALEXTPROC) wind->GetProcAddress("wglSwapIntervalEXT"); + GLExt::glColorTableEXT = (PFNGLCOLORTABLEPROC) wind->GetProcAddress("glColorTableEXT"); + GLExt::glGetColorTableParameterivEXT = (PFNGLCOLORTABLEPARAMETERIVPROC) wind->GetProcAddress("glGetColorTableParameterivEXT"); + g_bAALinesBroken = false; + g_bEXT_texture_env_combine = HasExtension("GL_EXT_texture_env_combine"); + + // Checks for known bad drivers + CString sRenderer = (const char*)glGetString(GL_RENDERER); + + if( sRenderer.Left(12) == "3Dfx/Voodoo3" ) + { + LOG->Info("Anti-aliased lines are known to cause problems with this driver."); + g_bAALinesBroken = true; + + LOG->Info("Paletted textures are broken with this driver."); + GLExt::glColorTableEXT = NULL; + GLExt::glGetColorTableParameterivEXT = NULL; + } +} + +void DumpOpenGLDebugInfo() +{ +#if defined(WIN32) + /* Dump Windows pixel format data. */ + int Actual = GetPixelFormat(wglGetCurrentDC()); + + PIXELFORMATDESCRIPTOR pfd; + memset(&pfd, 0, sizeof(pfd)); + pfd.nSize=sizeof(pfd); + pfd.nVersion=1; + + int pfcnt = DescribePixelFormat(GetDC(g_hWndMain),1,sizeof(pfd),&pfd); + for (int i=1; i <= pfcnt; i++) + { + memset(&pfd, 0, sizeof(pfd)); + pfd.nSize=sizeof(pfd); + pfd.nVersion=1; + DescribePixelFormat(GetDC(g_hWndMain),i,sizeof(pfd),&pfd); + + bool skip = false; + + bool rgba = (pfd.iPixelType==PFD_TYPE_RGBA); + + bool mcd = ((pfd.dwFlags & PFD_GENERIC_FORMAT) && (pfd.dwFlags & PFD_GENERIC_ACCELERATED)); + bool soft = ((pfd.dwFlags & PFD_GENERIC_FORMAT) && !(pfd.dwFlags & PFD_GENERIC_ACCELERATED)); + bool icd = !(pfd.dwFlags & PFD_GENERIC_FORMAT) && !(pfd.dwFlags & PFD_GENERIC_ACCELERATED); + bool opengl = !!(pfd.dwFlags & PFD_SUPPORT_OPENGL); + bool window = !!(pfd.dwFlags & PFD_DRAW_TO_WINDOW); + bool dbuff = !!(pfd.dwFlags & PFD_DOUBLEBUFFER); + + if(!rgba || soft || !opengl || !window || !dbuff) + skip = true; + + /* Skip the above, unless it happens to be the one we chose. */ + if(skip && i != Actual) + continue; + + CString str = ssprintf("Mode %i: ", i); + if(i == Actual) str += "*** "; + if(skip) str += "(BOGUS) "; + if(soft) str += "software "; + if(icd) str += "ICD "; + if(mcd) str += "MCD "; + if(!rgba) str += "indexed "; + if(!opengl) str += "!OPENGL "; + if(!window) str += "!window "; + if(!dbuff) str += "!dbuff "; + + str += ssprintf("%i (%i%i%i) ", pfd.cColorBits, pfd.cRedBits, pfd.cGreenBits, pfd.cBlueBits); + if(pfd.cAlphaBits) str += ssprintf("%i alpha ", pfd.cAlphaBits); + if(pfd.cDepthBits) str += ssprintf("%i depth ", pfd.cDepthBits); + if(pfd.cStencilBits) str += ssprintf("%i stencil ", pfd.cStencilBits); + if(pfd.cAccumBits) str += ssprintf("%i accum ", pfd.cAccumBits); + + if(i == Actual && skip) + { + /* We chose a bogus format. */ + LOG->Warn("%s", str.c_str()); + } else + LOG->Info("%s", str.c_str()); + } +#endif +} + +void RageDisplay::ResolutionChanged() +{ + SetViewport(0,0); + + /* Clear any junk that's in the framebuffer. */ + Clear(); + Flip(); +} + +/* Set the video mode. In some cases, changing the video mode will reset + * the rendering context; returns true if we need to reload textures. */ +bool RageDisplay::SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync ) +{ +// LOG->Trace( "RageDisplay::SetVideoMode( %d, %d, %d, %d, %d, %d )", windowed, width, height, bpp, rate, vsync ); + bool NewOpenGLContext = wind->SetVideoMode( windowed, width, height, bpp, rate, vsync ); + + if(NewOpenGLContext) + { + /* We have a new OpenGL context, so we have to tell our textures that + * their OpenGL texture number is invalid. */ + if(TEXTUREMAN) + TEXTUREMAN->InvalidateTextures(); + } + + this->SetDefaultRenderStates(); + DumpOpenGLDebugInfo(); + + /* Now that we've initialized, we can search for extensions (some of which + * we may need to set up the video mode). */ + SetupExtensions(); + + /* Set vsync the Windows way, if we can. (What other extensions are there + * to do this, for other archs?) */ + if( GLExt::wglSwapIntervalEXT ) + GLExt::wglSwapIntervalEXT(vsync); + + ResolutionChanged(); + + return NewOpenGLContext; +} + +void RageDisplay::SetViewport(int shift_left, int shift_down) +{ + /* left and down are on a 0..SCREEN_WIDTH, 0..SCREEN_HEIGHT scale. + * Scale them to the actual viewport range. */ + shift_left = int( shift_left * float(wind->GetWidth()) / SCREEN_WIDTH ); + shift_down = int( shift_down * float(wind->GetWidth()) / SCREEN_WIDTH ); + + glViewport(shift_left, -shift_down, wind->GetWidth(), wind->GetHeight()); +} + +int RageDisplay::GetMaxTextureSize() const +{ + GLint size; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size); + return size; +} + +void RageDisplay::Clear() +{ + glClearColor( 0,0,0,1 ); + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); +} + +void RageDisplay::Flip() +{ + wind->SwapBuffers(); + ProcessStatsOnFlip(); +} + +bool RageDisplay::SupportsTextureFormat( PixelFormat pixfmt ) +{ + switch( pixfmt ) + { + case FMT_PAL: + return GLExt::glColorTableEXT && GLExt::glGetColorTableParameterivEXT; + default: + return true; // No way to query this in OGL. You pass it a format and hope it doesn't have to convert. + } +} + +void RageDisplay::SaveScreenshot( CString sPath ) +{ + ASSERT( sPath.Right(3).CompareNoCase("bmp") == 0 ); // we can only save bitmaps + + SDL_Surface *image = SDL_CreateRGBSurface( + SDL_SWSURFACE, wind->GetWidth(), wind->GetHeight(), + 24, 0x0000FF, 0x00FF00, 0xFF0000, 0x000000); + SDL_Surface *temp = SDL_CreateRGBSurface( + SDL_SWSURFACE, wind->GetWidth(), wind->GetHeight(), + 24, 0x0000FF, 0x00FF00, 0xFF0000, 0x000000); + + glReadPixels(0, 0, wind->GetWidth(), wind->GetHeight(), GL_RGB, + GL_UNSIGNED_BYTE, image->pixels); + + // flip vertically + int pitch = image->pitch; + for( int y=0; yGetHeight(); y++ ) + memcpy( + (char *)temp->pixels + pitch * y, + (char *)image->pixels + pitch * (wind->GetHeight()-1-y), + 3*wind->GetWidth() ); + + SDL_SaveBMP( temp, sPath ); + + SDL_FreeSurface( image ); + SDL_FreeSurface( temp ); +} + + +bool RageDisplay::IsWindowed() const { return wind->IsWindowed(); } +int RageDisplay::GetWidth() const { return wind->GetWidth(); } +int RageDisplay::GetHeight() const { return wind->GetHeight(); } +int RageDisplay::GetBPP() const { return wind->GetBPP(); } + + +void RageDisplay::DrawQuads( const RageVertex v[], int iNumVerts ) +{ + ASSERT( (iNumVerts%4) == 0 ); + + if(iNumVerts == 0) + return; + + glMatrixMode( GL_PROJECTION ); + glLoadMatrixf( (const float*)GetProjection() ); + glMatrixMode( GL_MODELVIEW ); + glLoadMatrixf( (const float*)GetModelViewTop() ); + +#if 1 + static float *Vertex, *Color, *Texture; + static int Size = 0; + if(iNumVerts > Size) + { + Size = iNumVerts; + delete [] Vertex; + delete [] Color; + delete [] Texture; + Vertex = new float[Size*3]; + Color = new float[Size*4]; + Texture = new float[Size*2]; + } + + for(unsigned i = 0; i < unsigned(iNumVerts); ++i) + { + Vertex[i*3+0] = v[i].p[0]; + Vertex[i*3+1] = v[i].p[1]; + Vertex[i*3+2] = v[i].p[2]; + Color[i*4+0] = v[i].c[0]; + Color[i*4+1] = v[i].c[1]; + Color[i*4+2] = v[i].c[2]; + Color[i*4+3] = v[i].c[3]; + Texture[i*2+0] = v[i].t[0]; + Texture[i*2+1] = v[i].t[1]; + } + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(3, GL_FLOAT, 0, Vertex); + + glEnableClientState(GL_COLOR_ARRAY); + glColorPointer(4, GL_FLOAT, 0, Color); + + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 0, Texture); + + glDisableClientState(GL_NORMAL_ARRAY); +#else + glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); +#endif + + glDrawArrays( GL_QUADS, 0, iNumVerts ); + + StatsAddVerts( iNumVerts ); +} +void RageDisplay::DrawFan( const RageVertex v[], int iNumVerts ) +{ + ASSERT( iNumVerts >= 3 ); + glMatrixMode( GL_PROJECTION ); + glLoadMatrixf( (const float*)GetProjection() ); + glMatrixMode( GL_MODELVIEW ); + glLoadMatrixf( (const float*)GetModelViewTop() ); + glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); + glDrawArrays( GL_TRIANGLE_FAN, 0, iNumVerts ); + StatsAddVerts( iNumVerts ); +} + +void RageDisplay::DrawStrip( const RageVertex v[], int iNumVerts ) +{ + ASSERT( iNumVerts >= 3 ); + glMatrixMode( GL_PROJECTION ); + glLoadMatrixf( (const float*)GetProjection() ); + glMatrixMode( GL_MODELVIEW ); + glLoadMatrixf( (const float*)GetModelViewTop() ); + glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); + glDrawArrays( GL_TRIANGLE_STRIP, 0, iNumVerts ); + StatsAddVerts( iNumVerts ); +} + +void RageDisplay::DrawTriangles( const RageVertex v[], int iNumVerts ) +{ + if( iNumVerts == 0 ) + return; + ASSERT( iNumVerts >= 3 ); + ASSERT( (iNumVerts%3) == 0 ); + glMatrixMode( GL_PROJECTION ); + glLoadMatrixf( (const float*)GetProjection() ); + glMatrixMode( GL_MODELVIEW ); + glLoadMatrixf( (const float*)GetModelViewTop() ); + glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); + glDrawArrays( GL_TRIANGLES, 0, iNumVerts ); + StatsAddVerts( iNumVerts ); +} + +void RageDisplay::DrawIndexedTriangles( const RageVertex v[], const Uint16 pIndices[], int iNumIndices ) +{ + if( iNumIndices == 0 ) + return; + ASSERT( iNumIndices >= 3 ); + ASSERT( (iNumIndices%3) == 0 ); + glMatrixMode( GL_PROJECTION ); + glLoadMatrixf( (const float*)GetProjection() ); + glMatrixMode( GL_MODELVIEW ); + glLoadMatrixf( (const float*)GetModelViewTop() ); + glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); + glDrawElements( GL_TRIANGLES, iNumIndices, GL_UNSIGNED_SHORT, pIndices ); + StatsAddVerts( iNumIndices ); +} + +/* Draw a line as a quad. GL_LINES with antialiasing off can draw line + * ends at odd angles--they're forced to axis-alignment regardless of the + * angle of the line. */ +void DrawPolyLine(const RageVertex &p1, const RageVertex &p2, float LineWidth ) +{ + /* soh cah toa strikes strikes again! */ + float opp = p2.p.x - p1.p.x; + float adj = p2.p.y - p1.p.y; + float hyp = powf(opp*opp + adj*adj, 0.5f); + + float lsin = opp/hyp; + float lcos = adj/hyp; + + RageVertex v[4]; + + v[0] = v[1] = p1; + v[2] = v[3] = p2; + + float ydist = lsin * LineWidth/2; + float xdist = lcos * LineWidth/2; + + v[0].p.x += xdist; + v[0].p.y -= ydist; + v[1].p.x -= xdist; + v[1].p.y += ydist; + v[2].p.x -= xdist; + v[2].p.y += ydist; + v[3].p.x += xdist; + v[3].p.y -= ydist; + + DISPLAY->DrawQuad(v); +} + +void RageDisplay::DrawLineStrip( const RageVertex v[], int iNumVerts, float LineWidth ) +{ + ASSERT( iNumVerts >= 2 ); + + glMatrixMode( GL_PROJECTION ); + glLoadMatrixf( (const float*)GetProjection() ); + glMatrixMode( GL_MODELVIEW ); + glLoadMatrixf( (const float*)GetModelViewTop() ); + + if( g_bAALinesBroken ) + { + /* Draw a line strip with rounded corners using polys. This is used on + * cards that have strange allergic reactions to antialiased points and + * lines. */ + int i; + for(i = 0; i < iNumVerts-1; ++i) + DrawPolyLine(v[i], v[i+1], LineWidth); + + /* Join the lines with circles so we get rounded corners. */ + GLUquadricObj *q = gluNewQuadric(); + for(i = 0; i < iNumVerts; ++i) + { + glPushMatrix(); + glColor4fv(v[i].c); + glTexCoord3fv(v[i].t); + glTranslatef(v[i].p.x, v[i].p.y, v[i].p.z); + + gluDisk(q, 0, LineWidth/2, 32, 32); + glPopMatrix(); + } + gluDeleteQuadric(q); + } + else + { + /* Draw a nice AA'd line loop. One problem with this is that point and line + * sizes don't always precisely match, which doesn't look quite right. + * It's worth it for the AA, though. */ + glEnable(GL_LINE_SMOOTH); + + /* Our line width is wrt the regular internal SCREEN_WIDTHxSCREEN_HEIGHT screen, + * but these width functions actually want raster sizes (that is, actual pixels). + * Scale the line width and point size by the average ratio of the scale. */ + float WidthVal = float(wind->GetWidth()) / SCREEN_WIDTH; + float HeightVal = float(wind->GetHeight()) / SCREEN_HEIGHT; + LineWidth *= (WidthVal + HeightVal) / 2; + + /* Clamp the width to the hardware max for both lines and points (whichever + * is more restrictive). */ + LineWidth = clamp(LineWidth, g_line_range[0], g_line_range[1]); + LineWidth = clamp(LineWidth, g_point_range[0], g_point_range[1]); + + /* Hmm. The granularity of lines and points might be different; for example, + * if lines are .5 and points are .25, we might want to snap the width to the + * nearest .5, so the hardware doesn't snap them to different sizes. Does it + * matter? */ + glLineWidth(LineWidth); + + /* Draw the line loop: */ + glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); + glDrawArrays( GL_LINE_STRIP, 0, iNumVerts ); + + glDisable(GL_LINE_SMOOTH); + + /* Round off the corners. This isn't perfect; the point is sometimes a little + * larger than the line, causing a small bump on the edge. Not sure how to fix + * that. */ + glPointSize(LineWidth); + + /* Hack: if the points will all be the same, we don't want to draw + * any points at all, since there's nothing to connect. That'll happen + * if both scale factors in the matrix are ~0. (Actually, I think + * it's true if two of the three scale factors are ~0, but we don't + * use this for anything 3d at the moment anyway ...) This is needed + * because points aren't scaled like regular polys--a zero-size point + * will still be drawn. */ + RageMatrix mat; + glGetFloatv( GL_MODELVIEW_MATRIX, (float*)mat ); + + if(mat.m[0][0] < 1e-5 && mat.m[1][1] < 1e-5) + return; + + glEnable(GL_POINT_SMOOTH); + + glInterleavedArrays( RageVertexFormat, sizeof(RageVertex), v ); + glDrawArrays( GL_POINTS, 0, iNumVerts ); + + glDisable(GL_POINT_SMOOTH); + } +} + +void RageDisplay::SetTexture( RageTexture* pTexture ) +{ + glEnable( GL_TEXTURE_2D ); + unsigned id = pTexture ? pTexture->GetTexHandle() : 0; + glBindTexture( GL_TEXTURE_2D, id ); +} +void RageDisplay::SetTextureModeModulate() +{ + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); +} + +void RageDisplay::SetTextureModeGlow(GlowMode m) +{ + if(m == GLOW_WHITEN && !g_bEXT_texture_env_combine) + m = GLOW_BRIGHTEN; /* we can't do GLOW_WHITEN */ + + switch(m) + { + case GLOW_BRIGHTEN: + glBlendFunc( GL_SRC_ALPHA, GL_ONE ); + return; + + case GLOW_WHITEN: + /* Source color is the diffuse color only: */ + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_COMBINE_RGB_EXT), GL_REPLACE); + glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_RGB_EXT), GL_PRIMARY_COLOR_EXT); + + /* Source alpha is texture alpha * diffuse alpha: */ + glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_COMBINE_ALPHA_EXT), GL_MODULATE); + glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_OPERAND0_ALPHA_EXT), GL_SRC_ALPHA); + glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_ALPHA_EXT), GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_OPERAND1_ALPHA_EXT), GL_SRC_ALPHA); + glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE1_ALPHA_EXT), GL_TEXTURE); + return; + } +} +void RageDisplay::SetTextureFiltering( bool b ) +{ + +} + +void RageDisplay::SetBlendMode( BlendMode mode ) +{ + glEnable(GL_BLEND); + + switch( mode ) + { + case BLEND_NORMAL: + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + break; + case BLEND_ADD: + glBlendFunc( GL_ONE, GL_ONE ); + break; + case BLEND_NO_EFFECT: + glBlendFunc( GL_ZERO, GL_ONE ); + break; + default: + ASSERT(0); + } +} + +bool RageDisplay::IsZBufferEnabled() const +{ + bool a; + glGetBooleanv( GL_DEPTH_TEST, (unsigned char*)&a ); + return a; +} + +void RageDisplay::SetZBuffer( bool b ) +{ + glDepthFunc(GL_LEQUAL); + if( b ) + glEnable( GL_DEPTH_TEST ); + else + glDisable( GL_DEPTH_TEST ); +} +void RageDisplay::ClearZBuffer() +{ + glClear( GL_DEPTH_BUFFER_BIT ); +} + +void RageDisplay::SetTextureWrapping( bool b ) +{ + GLenum mode = b ? GL_REPEAT : GL_CLAMP; + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, mode ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode ); +} + +void RageDisplay::SetMaterial( + float emissive[4], + float ambient[4], + float diffuse[4], + float specular[4], + float shininess + ) +{ + glMaterialfv( GL_FRONT, GL_EMISSION, emissive ); + glMaterialfv( GL_FRONT, GL_AMBIENT, ambient ); + glMaterialfv( GL_FRONT, GL_DIFFUSE, diffuse ); + glMaterialfv( GL_FRONT, GL_SPECULAR, specular ); + glMaterialf( GL_FRONT, GL_SHININESS, shininess ); +} + +void RageDisplay::SetLighting( bool b ) +{ + if( b ) glEnable( GL_LIGHTING ); + else glDisable( GL_LIGHTING ); +} + +void RageDisplay::SetLightOff( int index ) +{ + glDisable( GL_LIGHT0+index ); +} +void RageDisplay::SetLightDirectional( + int index, + RageColor ambient, + RageColor diffuse, + RageColor specular, + RageVector3 dir ) +{ + // Light coordinates are transformed by the modelview matrix, but + // we are being passed in world-space coords. + glPushMatrix(); + glLoadIdentity(); + + glEnable( GL_LIGHT0+index ); + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, specular); + float position[4] = {dir.x, dir.y, dir.z, 0}; + glLightfv(GL_LIGHT0, GL_POSITION, position); + + glPopMatrix(); +} + +void RageDisplay::SetBackfaceCull( bool b ) +{ + if( b ) + glEnable( GL_CULL_FACE ); + else + glDisable( GL_CULL_FACE ); +} + +const PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS] = { + { + /* B8G8R8A8 */ + 32, + { 0x000000FF, + 0x0000FF00, + 0x00FF0000, + 0xFF000000 } + }, { + /* B4G4R4A4 */ + 16, + { 0xF000, + 0x0F00, + 0x00F0, + 0x000F }, + }, { + /* B5G5R5A1 */ + 16, + { 0xF800, + 0x07C0, + 0x003E, + 0x0001 }, + }, { + /* B5G5R5 */ + 16, + { 0xF800, + 0x07C0, + 0x003E, + 0x0000 }, + }, { + /* B8G8R8 */ + 24, + { 0x0000FF, + 0x00FF00, + 0xFF0000, + 0x000000 } + }, { + /* Paletted */ + 8, + { 0,0,0,0 } /* N/A */ + } +}; + + +struct GLPixFmtInfo_t { + GLenum internalfmt; /* target format */ + GLenum format; /* target format */ + GLenum type; /* data format */ +} GL_PIXFMT_INFO[NUM_PIX_FORMATS] = { + /* XXX: GL_UNSIGNED_SHORT_4_4_4_4 is affected by endianness; GL_UNSIGNED_BYTE + * is not, but all SDL masks are affected by endianness, so GL_UNSIGNED_BYTE + * is reversed. This isn't endian-safe. */ + { + /* B8G8R8A8 */ + GL_RGBA8, + GL_RGBA, + GL_UNSIGNED_BYTE, + }, { + /* B4G4R4A4 */ + GL_RGBA4, + GL_RGBA, + GL_UNSIGNED_SHORT_4_4_4_4, + }, { + /* B5G5R5A1 */ + GL_RGB5_A1, + GL_RGBA, + GL_UNSIGNED_SHORT_5_5_5_1, + }, { + /* B5G5R5 */ + GL_RGB5, + GL_RGBA, + GL_UNSIGNED_SHORT_5_5_5_1, + }, { + /* B8G8R8 */ + GL_RGB8, + GL_RGB, + GL_UNSIGNED_BYTE, + }, { + /* Paletted */ + GL_COLOR_INDEX8_EXT, + GL_COLOR_INDEX, + GL_UNSIGNED_BYTE, + } +}; + + +void RageDisplay::DeleteTexture( unsigned uTexHandle ) +{ + unsigned int uTexID = uTexHandle; + glDeleteTextures(1,reinterpret_cast(&uTexID)); + + GLenum error = glGetError(); + ASSERT( error == GL_NO_ERROR ); +} + + +unsigned RageDisplay::CreateTexture( + PixelFormat pixfmt, + SDL_Surface*& img ) +{ + unsigned int uTexHandle; + glGenTextures(1, reinterpret_cast(&uTexHandle)); + ASSERT(uTexHandle); + + glBindTexture( GL_TEXTURE_2D, uTexHandle ); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + /* This is an experiment: some people are seeing skips when the danger + * background comes in. One hypothesis: we're loading the danger background, + * keeping it in memory without displaying it for several games, it gets + * swapped out of texture memory, and then we skip swapping it in. + * + * It's rather small, so I'm not entirely convinced this is what's happening. + * Let's try boosting the texture priority for the danger background and + * see if it goes away. If it does, I'll make texture pris a texture hint + * (or find another way to do this; perhaps we should do a dummy render of + * a texture when it's reused from our texture cache if it hasn't been used + * in a long time). */ + // TODO: Find a way to add this back in. -Chris +// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 0.5f); +// if(ID.filename.Find("danger") != -1) +// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 1.0f); + + // texture must be power of two + ASSERT( img->w == power_of_two(img->w) ); + ASSERT( img->h == power_of_two(img->h) ); + + /* TODO: Add this back in later. -Chris */ +// if( IsPackedPixelFormat(pixfmt) && g_bPackedPixelsCauseProblems ) +// { + /* HACK: + * GLDirect crashes if we give it packed pixel format. We need + * to convert to a non-packed format (FMT_RGBA8). However, we + * can still get 16-bit textures by passing it the appropriate + * internalformat; it'll simply truncate the extra bits. This + * means that it'll still use the dithering we gave it; we just + * have to do a bit of redundant conversion work. */ +// pixfmt = FMT_RGBA8; +// ConvertSDLSurface(img, img->w, img->h, PixFmtMasks[pixfmt].bpp, +// PixFmtMasks[pixfmt].masks[0], PixFmtMasks[pixfmt].masks[1], +// PixFmtMasks[pixfmt].masks[2], PixFmtMasks[pixfmt].masks[3]); +// } + + +//retry: + + if(pixfmt == FMT_PAL) + { + /* The image is paletted. Let's try to set up a paletted texture. */ + GLubyte palette[256*4]; + memset(palette, 0, sizeof(palette)); + int p = 0; + /* Copy the palette to the simple, unpacked data OGL expects. If + * we're color keyed, change it over as we go. */ + for(int i = 0; i < img->format->palette->ncolors; ++i) + { + palette[p++] = img->format->palette->colors[i].r; + palette[p++] = img->format->palette->colors[i].g; + palette[p++] = img->format->palette->colors[i].b; + + if(img->flags & SDL_SRCCOLORKEY && i == int(img->format->colorkey)) + palette[p++] = 0; + else + palette[p++] = 0xFF; /* opaque */ + } + + /* Set the palette. */ + GLExt::glColorTableEXT(GL_TEXTURE_2D, GL_RGBA8, 256, GL_RGBA, GL_UNSIGNED_BYTE, palette); + + GLint RealFormat = 0; + GLExt::glGetColorTableParameterivEXT(GL_TEXTURE_2D, GL_COLOR_TABLE_FORMAT, &RealFormat); + ASSERT( RealFormat == GL_RGBA8); /* This is a case I don't expect to happen. */ + } + + glPixelStorei(GL_UNPACK_ROW_LENGTH, img->pitch / img->format->BytesPerPixel); + + GLenum glTexFormat = GL_PIXFMT_INFO[pixfmt].internalfmt; + GLenum glImageFormat = GL_PIXFMT_INFO[pixfmt].format; + GLenum glImageType = GL_PIXFMT_INFO[pixfmt].type; + + glTexImage2D(GL_TEXTURE_2D, 0, glTexFormat, + img->w, img->h, 0, + glImageFormat, glImageType, img->pixels); + + GLenum error = glGetError(); + ASSERT( error == GL_NO_ERROR ); + + /* If we're paletted, and didn't get the 8-bit palette we asked for ...*/ + if( pixfmt == FMT_PAL ) + { + GLint size = 0; + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GLenum(GL_TEXTURE_INDEX_SIZE_EXT), &size); + if(size != 8) + { + /* I don't know any reason this should actually fail (paletted textures + * but no support for 8-bit palettes?), so let's just disable paletted + * textures the first time this happens. */ + LOG->Info("Expected an 8-bit palette, got a %i-bit one instead; disabling paletted textures", size); +// DISPLAY->DisablePalettedTexture(); + + /* TODO: Fix this */ +// ASSERT(0); +// pixfmt = FMT_RGBA8; +// ConvertSDLSurface(img, img->w, img->h, PixFmtMasks[pixfmt].bpp, +// PixFmtMasks[pixfmt].masks[0], PixFmtMasks[pixfmt].masks[1], +// PixFmtMasks[pixfmt].masks[2], PixFmtMasks[pixfmt].masks[3]); +// goto retry; + } + } + + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glFlush(); + + return uTexHandle; +} + + +void RageDisplay::UpdateTexture( + unsigned uTexHandle, + PixelFormat pixfmt, + SDL_Surface*& img, + int xoffset, int yoffset, int width, int height ) +{ + glBindTexture( GL_TEXTURE_2D, uTexHandle ); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + /* XXX: We should use m_lVidPitch; we might be padded. However, I can't + * find any codec that don't force the width to a multiple of at least + * 4 anyway, so I can't test it, so I'll leave it like this for now. */ + glPixelStorei(GL_UNPACK_ROW_LENGTH, img->w); + +// GLenum glTexFormat = GL_PIXFMT_INFO[pixfmt].internalfmt; + GLenum glImageFormat = GL_PIXFMT_INFO[pixfmt].format; + GLenum glImageType = GL_PIXFMT_INFO[pixfmt].type; + + glTexSubImage2D(GL_TEXTURE_2D, 0, + xoffset, yoffset, + width, height, + glImageFormat, glImageType, img->pixels); + + /* Must unset PixelStore when we're done! */ + glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glFlush(); +} + +void RageDisplay::SetAlphaTest( bool b ) +{ + glAlphaFunc( GL_GREATER, 0.01f ); + if( b ) + glEnable( GL_ALPHA_TEST ); + else + glDisable( GL_ALPHA_TEST ); +} diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index 2208864d1f..32003118d2 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -123,7 +123,7 @@ RageLog::~RageLog() void RageLog::ShowConsole() { -#if defined(WIN32) +#if defined(WIN32) || !defined(_XBOX) // create a new console window and attach standard handles AllocConsole(); freopen("CONOUT$","wb",stdout); @@ -133,7 +133,7 @@ void RageLog::ShowConsole() void RageLog::HideConsole() { -#if defined(WIN32) +#if defined(WIN32) || !defined(_XBOX) FreeConsole(); #endif } diff --git a/stepmania/src/RageMath.cpp b/stepmania/src/RageMath.cpp index d4f268cf62..c523095596 100644 --- a/stepmania/src/RageMath.cpp +++ b/stepmania/src/RageMath.cpp @@ -222,7 +222,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat ) { CString sError = ssprintf( "Unrecognized matrix command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() ); LOG->Warn( sError ); -#if defined(WIN32) // XXX arch? +#if defined(WIN32) || !defined(_XBOX) // XXX arch? if( DISPLAY->IsWindowed() ) MessageBox(NULL, sError, "MatrixCommand", MB_OK); #endif @@ -401,3 +401,88 @@ void RageQuatSlerp(RageVector4 *pOut, const RageVector4 &from, const RageVector4 pOut->z = scale0 * from.z + scale1 * to1[2]; pOut->w = scale0 * from.w + scale1 * to1[3]; } + +RageMatrix RageLookAt( + float eyex, float eyey, float eyez, + float centerx, float centery, float centerz, + float upx, float upy, float upz ) +{ + RageVector3 Z(eyex - centerx, eyey - centery, eyez - centerz); + RageVec3Normalize(&Z, &Z); + + RageVector3 Y(upx, upy, upz); + + RageVector3 X( + Y[1] * Z[2] - Y[2] * Z[1], + -Y[0] * Z[2] + Y[2] * Z[0], + Y[0] * Z[1] - Y[1] * Z[0]); + + Y = RageVector3( + Z[1] * X[2] - Z[2] * X[1], + -Z[0] * X[2] + Z[2] * X[0], + Z[0] * X[1] - Z[1] * X[0] ); + + RageVec3Normalize(&X, &X); + RageVec3Normalize(&Y, &Y); + + RageMatrix mat( + X[0], Y[0], Z[0], 0, + X[1], Y[1], Z[1], 0, + X[2], Y[2], Z[2], 0, + 0, 0, 0, 1 ); + + RageMatrix mat2; + RageMatrixTranslation(&mat2, -eyex, -eyey, -eyez); + + RageMatrix ret; + RageMatrixMultiply(&ret, &mat, &mat2); + + return ret; +} + +RageMatrix RageOrtho( float l, float r, float b, float t, float zn, float zf ) +{ + RageMatrix m( + 2/(r-l), 0, 0, 0, + 0, 2/(t-b), 0, 0, + 0, 0, 1/(zf-zn), 0, + (l+r)/(l-r), (t+b)/(b-t), zn/(zn-zf), 1 ); + return m; +} + +RageMatrix RageMatrixIdentity() +{ + RageMatrix m; + RageMatrixIdentity( &m ); + return m; +} + +RageMatrix RageMatrixFrustrum( + float left, + float right, + float bottom, + float top, + float znear, + float zfar ) // see glFrustrum docs +{ + float A = (right+left) / (right-left); + float B = (top+bottom) / (top-bottom); + float C = -1 * (zfar+znear) / (zfar-znear); + float D = -1 * (2*zfar*znear) / (zfar-znear); + RageMatrix m( + 2*znear/(right-left), 0, 0, 0, + 0, 2*znear/(top-bottom), 0, 0, + A, B, C, -1, + 0, 0, D, 0 ); + return m; +} + +RageMatrix RageMatrixPerspective(float fovy, float aspect, float zNear, float zFar) +{ + float ymax = zNear * tanf(fovy * PI / 360.0f); + float ymin = -ymax; + float xmin = ymin * aspect; + float xmax = ymax * aspect; + + return RageMatrixFrustrum(xmin, xmax, ymin, ymax, zNear, zFar); +} diff --git a/stepmania/src/RageMath.h b/stepmania/src/RageMath.h index 329c0f37fb..4914be502d 100644 --- a/stepmania/src/RageMath.h +++ b/stepmania/src/RageMath.h @@ -22,6 +22,7 @@ void RageVec3Normalize( RageVector3* pOut, const RageVector3* pV ); void RageVec3TransformCoord( RageVector3* pOut, const RageVector3* pV, const RageMatrix* pM ); void RageVec4TransformCoord( RageVector4* pOut, const RageVector4* pV, const RageMatrix* pM ); void RageMatrixIdentity( RageMatrix* pOut ); +RageMatrix RageMatrixIdentity(); void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatrix* pB ); void RageMatrixTranslation( RageMatrix* pOut, float x, float y, float z ); void RageMatrixScaling( RageMatrix* pOut, float x, float y, float z ); @@ -36,5 +37,18 @@ RageVector4 RageQuatFromH(float theta); RageVector4 RageQuatFromP(float theta); RageVector4 RageQuatFromR(float theta); void RageQuatMultiply( RageVector4* pOut, const RageVector4 &pA, const RageVector4 &pB ); +RageMatrix RageLookAt( + float eyex, float eyey, float eyez, + float centerx, float centery, float centerz, + float upx, float upy, float upz ); +RageMatrix RageOrtho( float l, float r, float b, float t, float zn, float zf ); +RageMatrix RageMatrixFrustrum( + float left, + float right, + float bottom, + float top, + float znear, + float zfar ); +RageMatrix RageMatrixPerspective(float fovy, float aspect, float zNear, float zFar); #endif diff --git a/stepmania/src/RageTexture.cpp b/stepmania/src/RageTexture.cpp index 2aceba1a86..e18849e61d 100644 --- a/stepmania/src/RageTexture.cpp +++ b/stepmania/src/RageTexture.cpp @@ -53,6 +53,7 @@ bool RageTextureID::operator<(const RageTextureID &rhs) const COMP(iMipMaps); COMP(iAlphaBits); COMP(iColorDepth); + COMP(iTransparencyOnly); COMP(bDither); COMP(bStretch); COMP(bHotPinkColorKey); @@ -68,6 +69,7 @@ bool RageTextureID::operator==(const RageTextureID &rhs) const iMipMaps == rhs.iMipMaps && iAlphaBits == rhs.iAlphaBits && iColorDepth == rhs.iColorDepth && + iTransparencyOnly == rhs.iTransparencyOnly && bDither == rhs.bDither && bStretch == rhs.bStretch && bHotPinkColorKey == rhs.bHotPinkColorKey; @@ -81,7 +83,7 @@ RageTexture::RageTexture( RageTextureID name ): m_iRefCount = 1; - SetActualID(); +// SetActualID(); m_iSourceWidth = m_iSourceHeight = 0; m_iTextureWidth = m_iTextureHeight = 0; m_iImageWidth = m_iImageHeight = 0; @@ -91,18 +93,18 @@ RageTexture::RageTexture( RageTextureID name ): /* Set the initial ActualID; this is what the actual texture will start * from. */ -void RageTexture::SetActualID() -{ - m_ActualID = m_ID; - - /* Texture color depth preference can be overridden. */ - if(m_ID.iColorDepth == -1) - m_ActualID.iColorDepth = TEXTUREMAN->GetTextureColorDepth(); - - /* The max texture size can never be higher than the preference, - * since it might be set to something to fix driver problems. */ - m_ActualID.iMaxSize = min(m_ActualID.iMaxSize, TEXTUREMAN->GetMaxTextureResolution()); -} +//void RageTexture::SetActualID() +//{ +// m_ActualID = m_ID; +// +// /* Texture color depth preference can be overridden. */ +// if(m_ID.iColorDepth == -1) +// m_ActualID.iColorDepth = TEXTUREMAN->GetTextureColorDepth(); +// +// /* The max texture size can never be higher than the preference, +// * since it might be set to something to fix driver problems. */ +// m_ActualID.iMaxSize = min(m_ActualID.iMaxSize, TEXTUREMAN->GetMaxTextureResolution()); +//} RageTexture::~RageTexture() { diff --git a/stepmania/src/RageTexture.h b/stepmania/src/RageTexture.h index 6cdae6b3be..3e611ef5c1 100644 --- a/stepmania/src/RageTexture.h +++ b/stepmania/src/RageTexture.h @@ -15,8 +15,6 @@ #include "RageTypes.h" -const int MAX_TEXTURE_FRAMES = 256; - /* A unique texture is identified by a RageTextureID. (Loading the * same file with two different dither settings is considered two * different textures, for example.) See RageTexture.cpp for explanations @@ -51,9 +49,9 @@ public: RageTexture( RageTextureID file ); virtual ~RageTexture() = 0; virtual void Update( float fDeltaTime ) {} - virtual void Reload() { SetActualID(); } + virtual void Reload() {} virtual void Invalidate() { } /* only called by RageTextureManager::InvalidateTextures */ - virtual unsigned int GetGLTextureID() = 0; // accessed by RageDisplay + virtual unsigned GetTexHandle() = 0; // accessed by RageDisplay // movie texture/animated texture stuff virtual void Play() {} @@ -92,22 +90,13 @@ public: /* The ID that we were asked to load: */ const RageTextureID &GetID() const { return m_ID; } - /* The ID that we actually got: */ - const RageTextureID &GetActualID() const { return m_ActualID; } - static void GetFrameDimensionsFromFileName( CString sPath, int* puFramesWide, int* puFramesHigh ); static int GetFrameCountFromFileName( CString sPath ); -private: - /* The file we were asked to load. (This is never changed.) */ - const RageTextureID m_ID; - - void SetActualID(); - protected: /* We might change settings when loading (due to hints, hardware * limitations, etc). The data actually loaded is here: */ - RageTextureID m_ActualID; + RageTextureID m_ID; int m_iSourceWidth, m_iSourceHeight; // dimensions of the original image loaded from disk int m_iTextureWidth, m_iTextureHeight; // dimensions of the texture in memory diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index 880d3f0e3a..f18ae03f42 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -60,15 +60,20 @@ RageTexture* RageTextureManager::LoadTexture( RageTextureID ID ) { Checkpoint( ssprintf( "RageTextureManager::LoadTexture(%s).", ID.filename.c_str() ) ); + if( ID.iColorDepth == -1 ) + ID.iColorDepth = m_iTextureColorDepth; + ID.iMaxSize = min( ID.iMaxSize, m_iMaxTextureResolution ); + /* We could have two copies of the same bitmap if there are equivalent but * different paths, e.g. "Bitmaps\me.bmp" and "..\Rage PC Edition\Bitmaps\me.bmp". */ std::map::iterator p = m_mapPathToTexture.find(ID); - while(p != m_mapPathToTexture.end()) + if(p != m_mapPathToTexture.end()) { /* Found the texture. Just increase the refcount and return it. */ - p->second->m_iRefCount++; + RageTexture* pTexture = p->second; + pTexture->m_iRefCount++; LOG->UnmapLog( "LoadTexture" ); - return p->second; + return pTexture; } // The texture is not already loaded. Load it. @@ -128,8 +133,19 @@ void RageTextureManager::DeleteTexture( RageTexture *t ) { ASSERT( t->m_iRefCount==0 ); LOG->Trace( "RageTextureManager: deleting '%s'.", t->GetID().filename.c_str() ); - m_mapPathToTexture.erase( t->GetID() ); // remove map entry - SAFE_DELETE( t ); // free the texture + + for( std::map::iterator i = m_mapPathToTexture.begin(); + i != m_mapPathToTexture.end(); i++ ) + { + if( i->second == t ) + { + m_mapPathToTexture.erase( i ); // remove map entry + SAFE_DELETE( t ); // free the texture + return; + } + } + + ASSERT(0); // we tried to delete a texture that wasn't loaded. } void RageTextureManager::GarbageCollect( GCType type ) diff --git a/stepmania/src/RageTypes.h b/stepmania/src/RageTypes.h index fa1014c221..10254fff8a 100644 --- a/stepmania/src/RageTypes.h +++ b/stepmania/src/RageTypes.h @@ -18,6 +18,7 @@ enum GlowMode { GLOW_BRIGHTEN, GLOW_WHITEN }; enum BlendMode { BLEND_NORMAL, BLEND_ADD, BLEND_NO_EFFECT }; + struct RageVector2 { public: @@ -154,8 +155,8 @@ inline unsigned char FTOC(float a) { if(a<0) a=0; if(a>1) a=1; return (unsigned * precision of a float for our calculations anyway. -Chris */ class RageVColor { - unsigned char r, g, b, a; public: + unsigned char b,g,r,a; // specific ordering required by Direct3D RageVColor() { } RageVColor(const RageColor &rc) { *this = rc; } @@ -187,10 +188,18 @@ typedef Rect RectF; // A structure for our custom vertex type. Note that these data structes have the same layout that D3D expects. struct RageVertex { +// Temporary hack. A better solution is coming. -Chris +#ifdef D3D + RageVector3 p; // position + RageVector3 n; // normal + RageVColor c; // diffuse color + RageVector2 t; // texture coordinates +#else RageVector2 t; // texture coordinates RageColor c; // diffuse color RageVector3 n; // normal RageVector3 p; // position +#endif }; /* nonstandard extension used : nameless struct/union diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 8cee098bd4..dbe3148f51 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -134,8 +134,8 @@ CString vssprintf( const char *fmt, va_list argList) } #ifdef WIN32 -#include "dxerr8.h" -#pragma comment(lib, "DxErr8.lib") +//#include "dxerr8.h" +//#pragma comment(lib, "DxErr8.lib") CString hr_ssprintf( int hr, const char *fmt, ...) { @@ -144,14 +144,16 @@ CString hr_ssprintf( int hr, const char *fmt, ...) CString s = vssprintf( fmt, va ); va_end(va); - return s += ssprintf( " (%s)", DXGetErrorString8(hr) ); + return s;// += ssprintf( " (%s)", DXGetErrorString8(hr) ); } CString werr_ssprintf( int err, const char *fmt, ...) { - char buf[1024]; + char buf[1024] = ""; +#ifndef _XBOX FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, buf, sizeof(buf), NULL); +#endif va_list va; va_start(va, fmt); diff --git a/stepmania/src/SDL_utils.cpp b/stepmania/src/SDL_utils.cpp index b601382f3b..f972f285cd 100644 --- a/stepmania/src/SDL_utils.cpp +++ b/stepmania/src/SDL_utils.cpp @@ -124,7 +124,13 @@ void mySDL_GetRGBAV(Uint32 pixel, const SDL_Surface *src, Uint8 *v) void mySDL_GetRGBAV(const Uint8 *p, const SDL_Surface *src, Uint8 *v) { Uint32 pixel = decodepixel(p, src->format->BytesPerPixel); - mySDL_GetRGBAV(pixel, src, v); + if( src->format->BytesPerPixel == 1 ) // paletted + { + memcpy( v, &src->format->palette->colors[pixel], sizeof(SDL_Color)); + v[3] = 0xFF; // full alpha + } + else // RGBA + mySDL_GetRGBAV(pixel, src, v); } diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index ecf1d9aa51..3bd07155f8 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -23,13 +23,10 @@ #include "GameConstantsAndTypes.h" #include "SDL_utils.h" -#include "RageDisplayInternal.h" - Sprite::Sprite() { m_pTexture = NULL; m_bDrawIfTextureNull = false; - m_iNumStates = 0; m_iCurState = 0; m_fSecsIntoState = 0.0; m_bUsingCustomTexCoords = false; @@ -120,32 +117,27 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID ) // Read in frames and delays from the sprite file, // overwriting the states that LoadFromTexture created. - for( int i=0; i= m_pTexture->GetNumFrames() ) + if( newState.iFrameIndex >= m_pTexture->GetNumFrames() ) RageException::Throw( "In '%s', %s is %d, but the texture %s only has %d frames.", - m_sSpritePath.c_str(), sFrameKey.c_str(), m_iStateToFrame[i], ID.filename.c_str(), m_pTexture->GetNumFrames() ); - m_fDelay[i] = 0.2f; - if( !ini.GetValueF( "Sprite", sDelayKey, m_fDelay[i] ) ) + m_sSpritePath.c_str(), sFrameKey.c_str(), newState.iFrameIndex, ID.filename.c_str(), m_pTexture->GetNumFrames() ); + + if( !ini.GetValueF( "Sprite", sDelayKey, newState.fDelay ) ) break; - if( m_iStateToFrame[i] == 0 && m_fDelay[i] > -0.00001f && m_fDelay[i] < 0.00001f ) // both values are empty - break; + if( i == 0 ) // the ini file defines at least one frame + m_States.clear(); // clear before adding - m_iNumStates = i+1; - } - - if( m_iNumStates == 0 ) - { - m_iNumStates = 1; - m_iStateToFrame[0] = 0; - m_fDelay[0] = 10; + m_States.push_back( newState ); } float f; @@ -183,6 +175,8 @@ bool Sprite::LoadFromTexture( RageTextureID ID ) * to reset Sprite::m_size, etc. */ UnloadTexture(); m_pTexture = TEXTUREMAN->LoadTexture( ID ); + ASSERT( m_pTexture->GetTextureWidth() >= 0 ); + ASSERT( m_pTexture->GetTextureHeight() >= 0 ); } ASSERT( m_pTexture != NULL ); @@ -192,13 +186,13 @@ bool Sprite::LoadFromTexture( RageTextureID ID ) Sprite::m_size.y = (float)m_pTexture->GetSourceFrameHeight(); // Assume the frames of this animation play in sequential order with 0.2 second delay. + m_States.clear(); for( int i=0; iGetNumFrames(); i++ ) { - m_iStateToFrame[i] = i; - m_fDelay[i] = 0.1f; + State newState = { i, 0.1f }; + m_States.push_back( newState ); } - m_iNumStates = m_pTexture->GetNumFrames(); return true; } @@ -211,16 +205,17 @@ void Sprite::Update( float fDeltaTime ) if( !m_bIsAnimating ) return; + if( !m_pTexture ) // no texture, nothing to animate + return; + // update animation m_fSecsIntoState += fDeltaTime; - if( m_fSecsIntoState > m_fDelay[m_iCurState] ) // it's time to switch frames + while( m_fSecsIntoState > m_States[m_iCurState].fDelay ) // it's time to switch frames { // increment frame and reset the counter - m_fSecsIntoState -= m_fDelay[m_iCurState]; // leave the left over time for the next frame - m_iCurState ++; - if( m_iCurState >= m_iNumStates ) - m_iCurState = 0; + m_fSecsIntoState -= m_States[m_iCurState].fDelay; // leave the left over time for the next frame + m_iCurState = (m_iCurState+1) % m_States.size(); } } @@ -301,7 +296,7 @@ void Sprite::DrawPrimitives() if( m_bShadow ) { DISPLAY->PushMatrix(); - DISPLAY->TranslateLocal( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units + DISPLAY->TranslateWorld( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units v[0].c = v[1].c = v[2].c = v[3].c = RageColor(0,0,0,0.5f*m_temp.diffuse[0].a); // semi-transparent black DISPLAY->DrawQuad( v ); DISPLAY->PopMatrix(); @@ -335,9 +330,9 @@ void Sprite::SetState( int iNewState ) // This assert will likely trigger if the "missing" theme element graphic // is loaded in place of a multi-frame sprite. We want to know about these // problems in debug builds, but they're not fatal. - DEBUG_ASSERT( iNewState >= 0 && iNewState < m_iNumStates ); + DEBUG_ASSERT( iNewState >= 0 && iNewState < (int)m_States.size() ); - CLAMP(iNewState, 0, m_iNumStates-1); + CLAMP(iNewState, 0, (int)m_States.size()-1); m_iCurState = iNewState; m_fSecsIntoState = 0.0; } @@ -389,7 +384,7 @@ void Sprite::SetCustomImageCoords( float fImageCoords[8] ) // order: top left, b const RectF *Sprite::GetCurrentTextureCoordRect() const { - unsigned int uFrameNo = m_iStateToFrame[m_iCurState]; + unsigned int uFrameNo = m_States[m_iCurState].iFrameIndex; return m_pTexture->GetTextureCoordRect( uFrameNo ); } diff --git a/stepmania/src/Sprite.h b/stepmania/src/Sprite.h index 454c1736f1..b9c8a1a318 100644 --- a/stepmania/src/Sprite.h +++ b/stepmania/src/Sprite.h @@ -17,11 +17,6 @@ #include "RageTexture.h" - -#define MAX_SPRITE_STATES 256 - - - class Sprite: public Actor { public: @@ -42,7 +37,7 @@ public: virtual void EnableAnimation( bool bEnable ); virtual void SetState( int iNewState ); - virtual int GetNumStates() { return m_iNumStates; }; + virtual int GetNumStates() { return m_States.size(); }; CString GetTexturePath() { return m_pTexture==NULL ? "" : m_pTexture->GetID().filename; }; void SetCustomTextureRect( const RectF &new_texcoord_frect ); @@ -66,9 +61,12 @@ protected: RageTexture* m_pTexture; bool m_bDrawIfTextureNull; - int m_iStateToFrame[MAX_SPRITE_STATES]; // array of indicies into m_rectBitmapFrames - float m_fDelay[MAX_SPRITE_STATES]; - int m_iNumStates; + struct State + { + int iFrameIndex; + float fDelay; // "seconds to show" + }; + vector m_States; int m_iCurState; float m_fSecsIntoState; // number of seconds that have elapsed since we switched to this frame diff --git a/stepmania/src/StdString.h b/stepmania/src/StdString.h index ec3998bd4d..90ea000951 100644 --- a/stepmania/src/StdString.h +++ b/stepmania/src/StdString.h @@ -260,8 +260,7 @@ #define STDSTRING_H // In non-Visual C++ and/or non-Win32 builds, we can't use some cool stuff. - -#if !defined(_MSC_VER) || !defined(_WIN32) +#if !defined(_MSC_VER) || !defined(_WIN32) || defined(_XBOX) #define SS_ANSI #endif @@ -271,7 +270,7 @@ // On non-Win32 platforms, there is no TCHAR.H so define what we need - #ifndef _WIN32 + #if !defined(_WIN32) || defined(_XBOX) typedef const char* PCSTR; typedef char* PSTR; @@ -590,7 +589,11 @@ inline void ssadd(std::string& sDst, PCSTR pA) #ifdef SS_ANSI inline int ssvsprintf(PSTR pA, size_t nCount, PCSTR pFmtA, va_list vl) { - return vsnprintf(pA, nCount, pFmtA, vl); + #if defined(_XBOX) + return _vsnprintf(pA, nCount, pFmtA, vl); + #else + return vsnprintf(pA, nCount, pFmtA, vl); + #endif } #else inline int ssnprintf(PSTR pA, size_t nCount, PCSTR pFmtA, va_list vl) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 63d1b41be8..1c22cef60c 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -23,6 +23,7 @@ #include "RageTimer.h" #include "RageException.h" #include "RageMath.h" +#include "RageDisplay.h" #include "arch/arch.h" #include "arch/LoadingWindow/LoadingWindow.h" @@ -438,10 +439,10 @@ bool HandleGlobalInputs( DeviceInput DeviceI, InputEventType type, GameInput Gam return true; } } - - if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F5)) // F5 conflicts with editor and AutoSync + + if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F5)) { - // pressed F6. Save Screenshot. + // Save Screenshot. CString sPath; for( int i=0; i<1000; i++ ) { diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 05e379dc6b..69cbb3872d 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -1,10 +1,11 @@ # Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 60000 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 +# TARGTYPE "Xbox Application" 0x0b01 -CFG=StepMania - Win32 Debug +CFG=StepMania - Win32 Debug D3D !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -13,89 +14,219 @@ CFG=StepMania - Win32 Debug !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "StepMania.mak" CFG="StepMania - Win32 Debug" +!MESSAGE NMAKE /f "StepMania.mak" CFG="StepMania - Win32 Debug D3D" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "StepMania - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "StepMania - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE "StepMania - Win32 Debug OGL" (based on "Win32 (x86) Application") +!MESSAGE "StepMania - Win32 Debug D3D" (based on "Win32 (x86) Application") +!MESSAGE "StepMania - Xbox Debug" (based on "Xbox Application") +!MESSAGE "StepMania - Win32 Release D3D" (based on "Win32 (x86) Application") +!MESSAGE "StepMania - Win32 Release OGL" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe -!IF "$(CFG)" == "StepMania - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../" -# PROP Intermediate_Dir "../Release6" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /Ob2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo /o"../StepMania-StackTrace.bsc" -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../release6/StepMania.pdb" /map /debug /machine:I386 -# SUBTRACT LINK32 /verbose /pdb:none -# Begin Special Build Tool -IntDir=.\../Release6 -TargetDir=\temp\stepmania -TargetName=StepMania -SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ -PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi -# End Special Build Tool - -!ELSEIF "$(CFG)" == "StepMania - Win32 Debug" +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Output_Dir "StepMania___Win32_Debug_OGL" +# PROP BASE Intermediate_Dir "StepMania___Win32_Debug_OGL" +# PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../" -# PROP Intermediate_Dir "../Debug6" +# PROP Output_Dir "Win32_Debug_OGL_VC6" +# PROP Intermediate_Dir "Win32_Debug_OGL_VC6" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DEBUG" /Fr /YX"global.h" /FD /c # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DEBUG" /Fr /YX"global.h" /FD /c +MTL=midl.exe # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +RSC=rc.exe # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" +# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # ADD LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # Begin Special Build Tool -IntDir=.\../Debug6 -TargetDir=\temp\stepmania +IntDir=.\Win32_Debug_OGL_VC6 +TargetDir=\stepmania\stepmania TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi +# End Special Build Tool + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "StepMania___Win32_Debug_D3D" +# PROP BASE Intermediate_Dir "StepMania___Win32_Debug_D3D" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Win32_Debug_D3D_VC6" +# PROP Intermediate_Dir "Win32_Debug_D3D_VC6" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DEBUG" /Fr /YX"global.h" /FD /c +# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "DEBUG" /D "D3D" /Fr /YX"global.h" /FD /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" +# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib +# ADD LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" +# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib +# Begin Special Build Tool +IntDir=.\Win32_Debug_D3D_VC6 +TargetDir=\stepmania\stepmania +TargetName=StepMania-debug +SOURCE="$(InputPath)" +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi +# End Special Build Tool + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "StepMania___Xbox_Debug" +# PROP BASE Intermediate_Dir "StepMania___Xbox_Debug" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "StepMania___Xbox_Debug___VC6" +# PROP Intermediate_Dir "StepMania___Xbox_Debug___VC6" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" +# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib +# ADD LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" +# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib +XBE=imagebld.exe +# ADD BASE XBE /nologo /stack:0x10000 /debug +# ADD XBE /nologo /stack:0x10000 /debug +XBCP=xbecopy.exe +# ADD BASE XBCP /NOLOGO +# ADD XBCP /NOLOGO +# Begin Special Build Tool +IntDir=.\StepMania___Xbox_Debug___VC6 +TargetDir=.\StepMania___Xbox_Debug___VC6 +TargetName=StepMania +SOURCE="$(InputPath)" +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi +# End Special Build Tool + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "StepMania___Win32_Release_D3D" +# PROP BASE Intermediate_Dir "StepMania___Win32_Release_D3D" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Win32_Release_D3D_VC6" +# PROP Intermediate_Dir "Win32_Release_D3D_VC6" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /GX /Zi /O2 /Ob2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /Ob2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "D3D" /FR /YX /FD /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo /o"../StepMania-StackTrace.bsc" +# ADD BSC32 /nologo /o"../StepMania-StackTrace.bsc" +LINK32=link.exe +# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../release6/StepMania.pdb" /map /debug /machine:I386 +# SUBTRACT BASE LINK32 /verbose /pdb:none +# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../release6/StepMania.pdb" /map /debug /machine:I386 /out:"../StepMania.exe" +# SUBTRACT LINK32 /verbose /pdb:none +# Begin Special Build Tool +IntDir=.\Win32_Release_D3D_VC6 +TargetDir=\stepmania\stepmania +TargetName=StepMania +SOURCE="$(InputPath)" +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi +# End Special Build Tool + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "StepMania___Win32_Release_OGL" +# PROP BASE Intermediate_Dir "StepMania___Win32_Release_OGL" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Win32_Release_OGL_VC6" +# PROP Intermediate_Dir "Win32_Release_OGL_VC6" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /GX /Zi /O2 /Ob2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /Ob2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /c +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo /o"../StepMania-StackTrace.bsc" +# ADD BSC32 /nologo /o"../StepMania-StackTrace.bsc" +LINK32=link.exe +# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../release6/StepMania.pdb" /map /debug /machine:I386 +# SUBTRACT BASE LINK32 /verbose /pdb:none +# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../release6/StepMania.pdb" /map /debug /machine:I386 /out:"../StepMania.exe" +# SUBTRACT LINK32 /verbose /pdb:none +# Begin Special Build Tool +IntDir=.\Win32_Release_OGL_VC6 +TargetDir=\stepmania\stepmania +TargetName=StepMania +SOURCE="$(InputPath)" +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -103,8 +234,11 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania # Begin Target -# Name "StepMania - Win32 Release" -# Name "StepMania - Win32 Debug" +# Name "StepMania - Win32 Debug OGL" +# Name "StepMania - Win32 Debug D3D" +# Name "StepMania - Xbox Debug" +# Name "StepMania - Win32 Release D3D" +# Name "StepMania - Win32 Release OGL" # Begin Group "Rage" # PROP Default_Filter "" @@ -114,6 +248,19 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania # Begin Source File SOURCE=.\regex.c + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -122,6 +269,19 @@ SOURCE=.\regex.h # Begin Source File SOURCE=.\SDL_dither.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -130,6 +290,19 @@ SOURCE=.\SDL_dither.h # Begin Source File SOURCE=.\SDL_rotozoom.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -138,6 +311,19 @@ SOURCE=.\SDL_rotozoom.h # Begin Source File SOURCE=.\SDL_utils.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -148,12 +334,25 @@ SOURCE=.\SDL_utils.h SOURCE=.\RageBitmapTexture.cpp -!IF "$(CFG)" == "StepMania - Win32 Release" - -!ELSEIF "$(CFG)" == "StepMania - Win32 Debug" +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" +# ADD BASE CPP /YX # ADD CPP /YX +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +# ADD BASE CPP /YX +# ADD CPP /YX + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +# ADD BASE CPP /YX +# ADD CPP /YX + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + !ENDIF # End Source File @@ -164,6 +363,19 @@ SOURCE=.\RageBitmapTexture.h # Begin Source File SOURCE=.\RageDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -171,11 +383,65 @@ SOURCE=.\RageDisplay.h # End Source File # Begin Source File -SOURCE=.\RageDisplayInternal.h +SOURCE=.\RageDisplay_D3D.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\RageDisplay_OGL.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +# PROP BASE Exclude_From_Build 1 +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File SOURCE=.\RageException.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -184,10 +450,36 @@ SOURCE=.\RageException.h # Begin Source File SOURCE=.\RageInput.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File SOURCE=.\RageInputDevice.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -196,6 +488,19 @@ SOURCE=.\RageInputDevice.h # Begin Source File SOURCE=.\RageLog.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -204,6 +509,19 @@ SOURCE=.\RageLog.h # Begin Source File SOURCE=.\RageMath.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -212,6 +530,19 @@ SOURCE=.\RageMath.h # Begin Source File SOURCE=.\RageSound.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -220,6 +551,19 @@ SOURCE=.\RageSound.h # Begin Source File SOURCE=.\RageSoundManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -232,6 +576,19 @@ SOURCE=.\RageSoundReader.h # Begin Source File SOURCE=.\RageSoundReader_Preload.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -240,6 +597,19 @@ SOURCE=.\RageSoundReader_Preload.h # Begin Source File SOURCE=.\RageSoundReader_Resample.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -248,6 +618,19 @@ SOURCE=.\RageSoundReader_Resample.h # Begin Source File SOURCE=.\RageSoundReader_SDL_Sound.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -256,6 +639,19 @@ SOURCE=.\RageSoundReader_SDL_Sound.h # Begin Source File SOURCE=.\RageSoundResampler.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -264,6 +660,19 @@ SOURCE=.\RageSoundResampler.h # Begin Source File SOURCE=.\RageTexture.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -272,6 +681,19 @@ SOURCE=.\RageTexture.h # Begin Source File SOURCE=.\RageTextureManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -280,6 +702,19 @@ SOURCE=.\RageTextureManager.h # Begin Source File SOURCE=.\RageThreads.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -288,6 +723,19 @@ SOURCE=.\RageThreads.h # Begin Source File SOURCE=.\RageTimer.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -300,6 +748,19 @@ SOURCE=.\RageTypes.h # Begin Source File SOURCE=.\RageUtil.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -308,6 +769,19 @@ SOURCE=.\RageUtil.h # Begin Source File SOURCE=.\RageUtil_CharConversions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -320,6 +794,19 @@ SOURCE=.\RageUtil_CharConversions.h # Begin Source File SOURCE=.\ArrowBackdrop.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -328,6 +815,19 @@ SOURCE=.\ArrowBackdrop.h # Begin Source File SOURCE=.\Character.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -336,6 +836,19 @@ SOURCE=.\Character.h # Begin Source File SOURCE=.\CodeDetector.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -344,6 +857,19 @@ SOURCE=.\CodeDetector.h # Begin Source File SOURCE=.\Course.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -352,6 +878,19 @@ SOURCE=.\Course.h # Begin Source File SOURCE=.\Font.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -360,6 +899,19 @@ SOURCE=.\Font.h # Begin Source File SOURCE=.\FontCharAliases.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -368,6 +920,19 @@ SOURCE=.\FontCharAliases.h # Begin Source File SOURCE=.\FontCharmaps.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -376,6 +941,19 @@ SOURCE=.\FontCharmaps.h # Begin Source File SOURCE=.\GameConstantsAndTypes.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -384,6 +962,19 @@ SOURCE=.\GameConstantsAndTypes.h # Begin Source File SOURCE=.\GameDef.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -392,6 +983,19 @@ SOURCE=.\GameDef.h # Begin Source File SOURCE=.\GameInput.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -404,6 +1008,19 @@ SOURCE=.\GameTypes.h # Begin Source File SOURCE=.\Grade.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -412,6 +1029,19 @@ SOURCE=.\Grade.h # Begin Source File SOURCE=.\Inventory.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -420,6 +1050,19 @@ SOURCE=.\Inventory.h # Begin Source File SOURCE=.\LyricsLoader.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -432,6 +1075,19 @@ SOURCE=.\ModeChoice.h # Begin Source File SOURCE=.\NoteData.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -440,6 +1096,19 @@ SOURCE=.\NoteData.h # Begin Source File SOURCE=.\NoteDataWithScoring.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -448,6 +1117,19 @@ SOURCE=.\NoteDataWithScoring.h # Begin Source File SOURCE=.\NoteFieldPositioning.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -456,6 +1138,19 @@ SOURCE=.\NoteFieldPositioning.h # Begin Source File SOURCE=.\Notes.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -464,6 +1159,19 @@ SOURCE=.\Notes.h # Begin Source File SOURCE=.\NotesLoader.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -472,6 +1180,19 @@ SOURCE=.\NotesLoader.h # Begin Source File SOURCE=.\NotesLoaderBMS.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -480,6 +1201,19 @@ SOURCE=.\NotesLoaderBMS.h # Begin Source File SOURCE=.\NotesLoaderDWI.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -488,6 +1222,19 @@ SOURCE=.\NotesLoaderDWI.h # Begin Source File SOURCE=.\NotesLoaderKSF.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -496,6 +1243,19 @@ SOURCE=.\NotesLoaderKSF.h # Begin Source File SOURCE=.\NotesLoaderSM.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -504,6 +1264,19 @@ SOURCE=.\NotesLoaderSM.h # Begin Source File SOURCE=.\NotesWriterDWI.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -512,6 +1285,19 @@ SOURCE=.\NotesWriterDWI.h # Begin Source File SOURCE=.\NotesWriterSM.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -520,6 +1306,19 @@ SOURCE=.\NotesWriterSM.h # Begin Source File SOURCE=.\NoteTypes.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -528,6 +1327,19 @@ SOURCE=.\NoteTypes.h # Begin Source File SOURCE=.\PlayerAI.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -536,6 +1348,19 @@ SOURCE=.\PlayerAI.h # Begin Source File SOURCE=.\PlayerNumber.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -544,6 +1369,19 @@ SOURCE=.\PlayerNumber.h # Begin Source File SOURCE=.\PlayerOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -552,6 +1390,19 @@ SOURCE=.\PlayerOptions.h # Begin Source File SOURCE=.\RandomSample.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -560,6 +1411,19 @@ SOURCE=.\RandomSample.h # Begin Source File SOURCE=.\RaveHelper.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -568,6 +1432,19 @@ SOURCE=.\RaveHelper.h # Begin Source File SOURCE=.\Song.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -576,6 +1453,19 @@ SOURCE=.\song.h # Begin Source File SOURCE=.\SongCacheIndex.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -584,6 +1474,19 @@ SOURCE=.\SongCacheIndex.h # Begin Source File SOURCE=.\SongOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -592,6 +1495,19 @@ SOURCE=.\SongOptions.h # Begin Source File SOURCE=.\StageStats.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -600,6 +1516,19 @@ SOURCE=.\StageStats.h # Begin Source File SOURCE=.\StyleDef.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -612,6 +1541,19 @@ SOURCE=.\StyleInput.h # Begin Source File SOURCE=.\TitleSubstitution.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -624,6 +1566,19 @@ SOURCE=.\TitleSubstitution.h # Begin Source File SOURCE=.\IniFile.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -632,6 +1587,19 @@ SOURCE=.\IniFile.h # Begin Source File SOURCE=.\MsdFile.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -654,6 +1622,19 @@ SOURCE=.\arch\LoadingWindow\LoadingWindow.h # Begin Source File SOURCE=.\arch\LoadingWindow\LoadingWindow_SDL.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -662,6 +1643,19 @@ SOURCE=.\arch\LoadingWindow\LoadingWindow_SDL.h # Begin Source File SOURCE=.\arch\LoadingWindow\LoadingWindow_Win32.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -674,6 +1668,19 @@ SOURCE=.\arch\LoadingWindow\LoadingWindow_Win32.h # Begin Source File SOURCE=.\arch\Sound\DSoundHelpers.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -686,6 +1693,19 @@ SOURCE=.\arch\Sound\RageSoundDriver.h # Begin Source File SOURCE=.\arch\Sound\RageSoundDriver_DSound.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -694,6 +1714,19 @@ SOURCE=.\arch\Sound\RageSoundDriver_DSound.h # Begin Source File SOURCE=.\arch\Sound\RageSoundDriver_DSound_Software.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -702,6 +1735,19 @@ SOURCE=.\arch\Sound\RageSoundDriver_DSound_Software.h # Begin Source File SOURCE=.\arch\Sound\RageSoundDriver_Null.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -710,6 +1756,19 @@ SOURCE=.\arch\Sound\RageSoundDriver_Null.h # Begin Source File SOURCE=.\arch\Sound\RageSoundDriver_WaveOut.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -730,6 +1789,19 @@ SOURCE=.\arch\ErrorDialog\ErrorDialog_null.h # Begin Source File SOURCE=.\arch\ErrorDialog\ErrorDialog_stdout.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -738,6 +1810,19 @@ SOURCE=.\arch\ErrorDialog\ErrorDialog_stdout.h # Begin Source File SOURCE=.\arch\ErrorDialog\ErrorDialog_Win32.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -758,6 +1843,19 @@ SOURCE=.\arch\ArchHooks\ArchHooks_none.h # Begin Source File SOURCE=.\arch\ArchHooks\ArchHooks_Win32.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -774,6 +1872,19 @@ SOURCE=.\arch\InputHandler\InputHandler.h # Begin Source File SOURCE=.\arch\InputHandler\InputHandler_SDL.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -782,6 +1893,19 @@ SOURCE=.\arch\InputHandler\InputHandler_SDL.h # Begin Source File SOURCE=.\arch\InputHandler\InputHandler_Win32_Pump.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -794,6 +1918,19 @@ SOURCE=.\arch\InputHandler\InputHandler_Win32_Pump.h # Begin Source File SOURCE=.\arch\MovieTexture\MovieTexture.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -802,6 +1939,19 @@ SOURCE=.\arch\MovieTexture\MovieTexture.h # Begin Source File SOURCE=.\arch\MovieTexture\MovieTexture_DShow.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -810,6 +1960,19 @@ SOURCE=.\arch\MovieTexture\MovieTexture_DShow.h # Begin Source File SOURCE=.\arch\MovieTexture\MovieTexture_DShowHelper.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -826,6 +1989,19 @@ SOURCE=.\arch\LowLevelWindow\LowLevelWindow.h # Begin Source File SOURCE=.\arch\LowLevelWindow\LowLevelWindow_SDL.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -835,6 +2011,19 @@ SOURCE=.\arch\LowLevelWindow\LowLevelWindow_SDL.h # Begin Source File SOURCE=.\arch\arch.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -858,6 +2047,19 @@ SOURCE=.\arch\arch_Win32.h # Begin Source File SOURCE=.\archutils\Win32\Crash.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -870,6 +2072,19 @@ SOURCE=.\archutils\Win32\CrashList.h # Begin Source File SOURCE=.\archutils\Win32\Disasm.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -878,6 +2093,19 @@ SOURCE=.\archutils\Win32\Disasm.h # Begin Source File SOURCE=.\archutils\Win32\Tls.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -887,6 +2115,19 @@ SOURCE=.\archutils\Win32\Tls.h # Begin Source File SOURCE=.\archutils\Win32\AppInstance.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -895,6 +2136,19 @@ SOURCE=.\archutils\Win32\AppInstance.h # Begin Source File SOURCE=.\archutils\Win32\DebugInfoHunt.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -903,6 +2157,19 @@ SOURCE=.\archutils\Win32\DebugInfoHunt.h # Begin Source File SOURCE=.\archutils\Win32\GotoURL.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -919,10 +2186,36 @@ SOURCE=.\StepMania.ICO # Begin Source File SOURCE=.\StepMania.RC + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File SOURCE=.\archutils\Win32\USB.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -933,12 +2226,25 @@ SOURCE=.\archutils\Win32\USB.h SOURCE=.\global.cpp -!IF "$(CFG)" == "StepMania - Win32 Release" - -!ELSEIF "$(CFG)" == "StepMania - Win32 Debug" +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" +# ADD BASE CPP /Yc"global.h" # ADD CPP /Yc"global.h" +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +# ADD BASE CPP /Yc"global.h" +# ADD CPP /Yc"global.h" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +# ADD BASE CPP /Yc"global.h" +# ADD CPP /Yc"global.h" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + !ENDIF # End Source File @@ -957,6 +2263,19 @@ SOURCE=.\StdString.h # Begin Source File SOURCE=.\StepMania.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -969,6 +2288,19 @@ SOURCE=.\StepMania.h # Begin Source File SOURCE=.\Actor.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -981,6 +2313,19 @@ SOURCE=.\ActorCollision.h # Begin Source File SOURCE=.\ActorFrame.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -989,6 +2334,19 @@ SOURCE=.\ActorFrame.h # Begin Source File SOURCE=.\ActorScroller.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1001,6 +2359,19 @@ SOURCE=.\ActorUtil.h # Begin Source File SOURCE=.\BitmapText.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1009,6 +2380,19 @@ SOURCE=.\BitmapText.h # Begin Source File SOURCE=.\mathlib.c + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1017,6 +2401,19 @@ SOURCE=.\mathlib.h # Begin Source File SOURCE=.\Model.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1025,6 +2422,19 @@ SOURCE=.\Model.h # Begin Source File SOURCE=.\ModelTypes.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1037,6 +2447,19 @@ SOURCE=.\Quad.h # Begin Source File SOURCE=.\Sprite.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1049,6 +2472,19 @@ SOURCE=.\Sprite.h # Begin Source File SOURCE=.\Banner.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1057,6 +2493,19 @@ SOURCE=.\Banner.h # Begin Source File SOURCE=.\BGAnimation.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1065,6 +2514,19 @@ SOURCE=.\BGAnimation.h # Begin Source File SOURCE=.\BGAnimationLayer.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1073,6 +2535,19 @@ SOURCE=.\BGAnimationLayer.h # Begin Source File SOURCE=.\CroppedSprite.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1081,6 +2556,19 @@ SOURCE=.\CroppedSprite.h # Begin Source File SOURCE=.\DifficultyIcon.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1089,6 +2577,19 @@ SOURCE=.\DifficultyIcon.h # Begin Source File SOURCE=.\FadingBanner.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1097,6 +2598,19 @@ SOURCE=.\FadingBanner.h # Begin Source File SOURCE=.\MeterDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1105,6 +2619,19 @@ SOURCE=.\MeterDisplay.h # Begin Source File SOURCE=.\Transition.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1117,6 +2644,19 @@ SOURCE=.\Transition.h # Begin Source File SOURCE=.\ActiveItemList.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1125,6 +2665,19 @@ SOURCE=.\ActiveItemList.h # Begin Source File SOURCE=.\ArrowEffects.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1133,6 +2686,19 @@ SOURCE=.\ArrowEffects.h # Begin Source File SOURCE=.\Background.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1141,6 +2707,19 @@ SOURCE=.\Background.h # Begin Source File SOURCE=.\Combo.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1149,6 +2728,19 @@ SOURCE=.\Combo.h # Begin Source File SOURCE=.\DancingCharacters.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1157,6 +2749,19 @@ SOURCE=.\DancingCharacters.h # Begin Source File SOURCE=.\EnemyFace.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1165,6 +2770,19 @@ SOURCE=.\EnemyFace.h # Begin Source File SOURCE=.\EnemyHealth.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1173,6 +2791,19 @@ SOURCE=.\EnemyHealth.h # Begin Source File SOURCE=.\GhostArrow.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1181,6 +2812,19 @@ SOURCE=.\GhostArrow.h # Begin Source File SOURCE=.\GhostArrowBright.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1189,6 +2833,19 @@ SOURCE=.\GhostArrowBright.h # Begin Source File SOURCE=.\GhostArrowRow.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1197,6 +2854,19 @@ SOURCE=.\GhostArrowRow.h # Begin Source File SOURCE=.\GrayArrow.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1205,6 +2875,19 @@ SOURCE=.\GrayArrow.h # Begin Source File SOURCE=.\GrayArrowRow.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1213,6 +2896,19 @@ SOURCE=.\GrayArrowRow.h # Begin Source File SOURCE=.\HoldGhostArrow.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1221,6 +2917,19 @@ SOURCE=.\HoldGhostArrow.h # Begin Source File SOURCE=.\HoldJudgment.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1229,6 +2938,19 @@ SOURCE=.\HoldJudgment.h # Begin Source File SOURCE=.\Judgment.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1237,6 +2959,19 @@ SOURCE=.\Judgment.h # Begin Source File SOURCE=.\LifeMeter.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1245,6 +2980,19 @@ SOURCE=.\LifeMeter.h # Begin Source File SOURCE=.\LifeMeterBar.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1253,6 +3001,19 @@ SOURCE=.\LifeMeterBar.h # Begin Source File SOURCE=.\LifeMeterBattery.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1261,6 +3022,19 @@ SOURCE=.\LifeMeterBattery.h # Begin Source File SOURCE=.\LyricDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1269,6 +3043,19 @@ SOURCE=.\LyricDisplay.h # Begin Source File SOURCE=.\NoteDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1277,6 +3064,19 @@ SOURCE=.\NoteDisplay.h # Begin Source File SOURCE=.\NoteField.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1285,6 +3085,19 @@ SOURCE=.\NoteField.h # Begin Source File SOURCE=.\Player.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1293,6 +3106,19 @@ SOURCE=.\Player.h # Begin Source File SOURCE=.\ScoreDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1301,6 +3127,19 @@ SOURCE=.\ScoreDisplay.h # Begin Source File SOURCE=.\ScoreDisplayBattle.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1309,6 +3148,19 @@ SOURCE=.\ScoreDisplayBattle.h # Begin Source File SOURCE=.\ScoreDisplayNormal.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1317,6 +3169,19 @@ SOURCE=.\ScoreDisplayNormal.h # Begin Source File SOURCE=.\ScoreDisplayOni.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1325,6 +3190,19 @@ SOURCE=.\ScoreDisplayOni.h # Begin Source File SOURCE=.\ScoreDisplayRave.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1333,6 +3211,19 @@ SOURCE=.\ScoreDisplayRave.h # Begin Source File SOURCE=.\ScoreKeeper.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1341,6 +3232,19 @@ SOURCE=.\ScoreKeeper.h # Begin Source File SOURCE=.\ScoreKeeperMAX2.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1349,6 +3253,19 @@ SOURCE=.\ScoreKeeperMAX2.h # Begin Source File SOURCE=.\TimingAssist.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1361,6 +3278,19 @@ SOURCE=.\TimingAssist.h # Begin Source File SOURCE=.\BPMDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1369,6 +3299,19 @@ SOURCE=.\BPMDisplay.h # Begin Source File SOURCE=.\CourseContentsList.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1377,6 +3320,19 @@ SOURCE=.\CourseContentsList.h # Begin Source File SOURCE=.\CourseEntryDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1385,6 +3341,19 @@ SOURCE=.\CourseEntryDisplay.h # Begin Source File SOURCE=.\DifficultyMeter.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1393,6 +3362,19 @@ SOURCE=.\DifficultyMeter.h # Begin Source File SOURCE=.\DifficultyRating.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1401,6 +3383,19 @@ SOURCE=.\DifficultyRating.h # Begin Source File SOURCE=.\EditMenu.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1409,6 +3404,19 @@ SOURCE=.\EditMenu.h # Begin Source File SOURCE=.\GradeDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1417,6 +3425,19 @@ SOURCE=.\GradeDisplay.h # Begin Source File SOURCE=.\GrooveGraph.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1425,6 +3446,19 @@ SOURCE=.\GrooveGraph.h # Begin Source File SOURCE=.\GrooveRadar.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1433,6 +3467,19 @@ SOURCE=.\GrooveRadar.h # Begin Source File SOURCE=.\GroupList.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1441,6 +3488,19 @@ SOURCE=.\GroupList.h # Begin Source File SOURCE=.\HelpDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1449,6 +3509,19 @@ SOURCE=.\HelpDisplay.h # Begin Source File SOURCE=.\JukeboxMenu.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1457,6 +3530,19 @@ SOURCE=.\JukeboxMenu.h # Begin Source File SOURCE=.\MenuElements.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1465,6 +3551,19 @@ SOURCE=.\MenuElements.h # Begin Source File SOURCE=.\MenuTimer.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1473,6 +3572,19 @@ SOURCE=.\MenuTimer.h # Begin Source File SOURCE=.\MusicBannerWheel.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1481,6 +3593,19 @@ SOURCE=.\MusicBannerWheel.h # Begin Source File SOURCE=.\MusicList.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1489,6 +3614,19 @@ SOURCE=.\MusicList.h # Begin Source File SOURCE=.\MusicSortDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1497,6 +3635,19 @@ SOURCE=.\MusicSortDisplay.h # Begin Source File SOURCE=.\MusicWheel.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1505,6 +3656,19 @@ SOURCE=.\MusicWheel.h # Begin Source File SOURCE=.\MusicWheelItem.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1513,6 +3677,19 @@ SOURCE=.\MusicWheelItem.h # Begin Source File SOURCE=.\OptionIcon.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1521,6 +3698,19 @@ SOURCE=.\OptionIcon.h # Begin Source File SOURCE=.\OptionIconRow.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1529,6 +3719,19 @@ SOURCE=.\OptionIconRow.h # Begin Source File SOURCE=.\OptionsCursor.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1537,6 +3740,19 @@ SOURCE=.\OptionsCursor.h # Begin Source File SOURCE=.\ScrollBar.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1545,6 +3761,19 @@ SOURCE=.\ScrollBar.h # Begin Source File SOURCE=.\ScrollingList.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1553,6 +3782,19 @@ SOURCE=.\ScrollingList.h # Begin Source File SOURCE=.\SnapDisplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1561,6 +3803,19 @@ SOURCE=.\SnapDisplay.h # Begin Source File SOURCE=.\TextBanner.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1569,6 +3824,19 @@ SOURCE=.\TextBanner.h # Begin Source File SOURCE=.\WheelNotifyIcon.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1581,6 +3849,19 @@ SOURCE=.\WheelNotifyIcon.h # Begin Source File SOURCE=.\Screen.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1589,6 +3870,19 @@ SOURCE=.\Screen.h # Begin Source File SOURCE=.\ScreenAlbums.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1597,6 +3891,19 @@ SOURCE=.\ScreenAlbums.h # Begin Source File SOURCE=.\ScreenAppearanceOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1605,6 +3912,19 @@ SOURCE=.\ScreenAppearanceOptions.h # Begin Source File SOURCE=.\ScreenAttract.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1613,6 +3933,19 @@ SOURCE=.\ScreenAttract.h # Begin Source File SOURCE=.\ScreenAutogenOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1621,6 +3954,19 @@ SOURCE=.\ScreenAutogenOptions.h # Begin Source File SOURCE=.\ScreenBackgroundOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1629,6 +3975,19 @@ SOURCE=.\ScreenBackgroundOptions.h # Begin Source File SOURCE=.\ScreenCaution.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1641,6 +4000,19 @@ SOURCE=.\ScreenCompany.h # Begin Source File SOURCE=.\ScreenCredits.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1649,6 +4021,19 @@ SOURCE=.\ScreenCredits.h # Begin Source File SOURCE=.\ScreenDemonstration.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1657,6 +4042,19 @@ SOURCE=.\ScreenDemonstration.h # Begin Source File SOURCE=.\ScreenEdit.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1666,12 +4064,25 @@ SOURCE=.\ScreenEdit.h SOURCE=.\ScreenEditMenu.cpp -!IF "$(CFG)" == "StepMania - Win32 Release" - -!ELSEIF "$(CFG)" == "StepMania - Win32 Debug" +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" +# ADD BASE CPP /YX"global.h" # ADD CPP /YX"global.h" +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +# ADD BASE CPP /YX"global.h" +# ADD CPP /YX"global.h" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +# ADD BASE CPP /YX"global.h" +# ADD CPP /YX"global.h" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + !ENDIF # End Source File @@ -1682,6 +4093,19 @@ SOURCE=.\ScreenEditMenu.h # Begin Source File SOURCE=.\ScreenEvaluation.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1690,6 +4114,19 @@ SOURCE=.\ScreenEvaluation.h # Begin Source File SOURCE=.\ScreenEz2SelectMusic.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1698,6 +4135,19 @@ SOURCE=.\ScreenEz2SelectMusic.h # Begin Source File SOURCE=.\ScreenEz2SelectPlayer.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1706,6 +4156,19 @@ SOURCE=.\ScreenEz2SelectPlayer.h # Begin Source File SOURCE=.\ScreenGameOver.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1714,6 +4177,19 @@ SOURCE=.\ScreenGameOver.h # Begin Source File SOURCE=.\ScreenGameplay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1722,6 +4198,19 @@ SOURCE=.\ScreenGameplay.h # Begin Source File SOURCE=.\ScreenGameplayOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1730,6 +4219,19 @@ SOURCE=.\ScreenGameplayOptions.h # Begin Source File SOURCE=.\ScreenGraphicOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1738,6 +4240,19 @@ SOURCE=.\ScreenGraphicOptions.h # Begin Source File SOURCE=.\ScreenHowToPlay.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1746,6 +4261,19 @@ SOURCE=.\ScreenHowToPlay.h # Begin Source File SOURCE=.\ScreenInputOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1754,6 +4282,19 @@ SOURCE=.\ScreenInputOptions.h # Begin Source File SOURCE=.\ScreenInstructions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1762,6 +4303,19 @@ SOURCE=.\ScreenInstructions.h # Begin Source File SOURCE=.\ScreenIntroMovie.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1770,6 +4324,19 @@ SOURCE=.\ScreenIntroMovie.h # Begin Source File SOURCE=.\ScreenJukebox.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1778,6 +4345,19 @@ SOURCE=.\ScreenJukebox.h # Begin Source File SOURCE=.\ScreenJukeboxMenu.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1786,6 +4366,19 @@ SOURCE=.\ScreenJukeboxMenu.h # Begin Source File SOURCE=.\ScreenLogo.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1794,6 +4387,19 @@ SOURCE=.\ScreenLogo.h # Begin Source File SOURCE=.\ScreenMachineOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1802,6 +4408,19 @@ SOURCE=.\ScreenMachineOptions.h # Begin Source File SOURCE=.\ScreenMapControllers.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1818,6 +4437,19 @@ SOURCE=.\ScreenMessage.h # Begin Source File SOURCE=.\ScreenMiniMenu.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1826,6 +4458,19 @@ SOURCE=.\ScreenMiniMenu.h # Begin Source File SOURCE=.\ScreenMusicScroll.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1834,6 +4479,19 @@ SOURCE=.\ScreenMusicScroll.h # Begin Source File SOURCE=.\ScreenNameEntry.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1842,6 +4500,19 @@ SOURCE=.\ScreenNameEntry.h # Begin Source File SOURCE=.\ScreenOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1850,6 +4521,19 @@ SOURCE=.\ScreenOptions.h # Begin Source File SOURCE=.\ScreenOptionsMenu.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1858,6 +4542,19 @@ SOURCE=.\ScreenOptionsMenu.h # Begin Source File SOURCE=.\ScreenPlayerOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1866,6 +4563,19 @@ SOURCE=.\ScreenPlayerOptions.h # Begin Source File SOURCE=.\ScreenPrompt.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1874,6 +4584,19 @@ SOURCE=.\ScreenPrompt.h # Begin Source File SOURCE=.\ScreenRanking.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1882,6 +4605,19 @@ SOURCE=.\ScreenRanking.h # Begin Source File SOURCE=.\ScreenRaveOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1890,6 +4626,19 @@ SOURCE=.\ScreenRaveOptions.h # Begin Source File SOURCE=.\ScreenSandbox.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1898,6 +4647,19 @@ SOURCE=.\ScreenSandbox.h # Begin Source File SOURCE=.\ScreenSelect.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1906,6 +4668,19 @@ SOURCE=.\ScreenSelect.h # Begin Source File SOURCE=.\ScreenSelectCharacter.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1914,6 +4689,19 @@ SOURCE=.\ScreenSelectCharacter.h # Begin Source File SOURCE=.\ScreenSelectCourse.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1922,6 +4710,19 @@ SOURCE=.\ScreenSelectCourse.h # Begin Source File SOURCE=.\ScreenSelectDifficulty.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1930,6 +4731,19 @@ SOURCE=.\ScreenSelectDifficulty.h # Begin Source File SOURCE=.\ScreenSelectDifficultyEX.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1938,6 +4752,19 @@ SOURCE=.\ScreenSelectDifficultyEX.h # Begin Source File SOURCE=.\ScreenSelectGame.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1946,6 +4773,19 @@ SOURCE=.\ScreenSelectGame.h # Begin Source File SOURCE=.\ScreenSelectGroup.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1954,6 +4794,19 @@ SOURCE=.\ScreenSelectGroup.h # Begin Source File SOURCE=.\ScreenSelectMode.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1962,6 +4815,19 @@ SOURCE=.\ScreenSelectMode.h # Begin Source File SOURCE=.\ScreenSelectMusic.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1970,6 +4836,19 @@ SOURCE=.\ScreenSelectMusic.h # Begin Source File SOURCE=.\ScreenSelectStyle.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1978,6 +4857,19 @@ SOURCE=.\ScreenSelectStyle.h # Begin Source File SOURCE=.\ScreenSelectStyle5th.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1986,6 +4878,19 @@ SOURCE=.\ScreenSelectStyle5th.h # Begin Source File SOURCE=.\ScreenSongOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -1994,6 +4899,19 @@ SOURCE=.\ScreenSongOptions.h # Begin Source File SOURCE=.\ScreenSoundOptions.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2002,6 +4920,19 @@ SOURCE=.\ScreenSoundOptions.h # Begin Source File SOURCE=.\ScreenStage.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2010,6 +4941,19 @@ SOURCE=.\ScreenStage.h # Begin Source File SOURCE=.\ScreenStyleSplash.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2018,6 +4962,19 @@ SOURCE=.\ScreenStyleSplash.h # Begin Source File SOURCE=.\ScreenTest.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2026,6 +4983,19 @@ SOURCE=.\ScreenTest.h # Begin Source File SOURCE=.\ScreenTestFonts.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2034,6 +5004,19 @@ SOURCE=.\ScreenTestFonts.h # Begin Source File SOURCE=.\ScreenTestSound.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2042,6 +5025,19 @@ SOURCE=.\ScreenTestSound.h # Begin Source File SOURCE=.\ScreenTextEntry.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2050,6 +5046,19 @@ SOURCE=.\ScreenTextEntry.h # Begin Source File SOURCE=.\ScreenTitleMenu.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2058,6 +5067,19 @@ SOURCE=.\ScreenTitleMenu.h # Begin Source File SOURCE=.\ScreenUnlock.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2078,6 +5100,19 @@ SOURCE=.\ScreenWarning.h # Begin Source File SOURCE=.\AnnouncerManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2086,6 +5121,19 @@ SOURCE=.\AnnouncerManager.h # Begin Source File SOURCE=.\FontManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2094,6 +5142,19 @@ SOURCE=.\FontManager.h # Begin Source File SOURCE=.\GameManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2102,6 +5163,19 @@ SOURCE=.\GameManager.h # Begin Source File SOURCE=.\GameState.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2110,6 +5184,19 @@ SOURCE=.\GameState.h # Begin Source File SOURCE=.\InputFilter.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2118,6 +5205,19 @@ SOURCE=.\InputFilter.h # Begin Source File SOURCE=.\InputMapper.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2126,6 +5226,19 @@ SOURCE=.\InputMapper.h # Begin Source File SOURCE=.\InputQueue.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2134,6 +5247,19 @@ SOURCE=.\InputQueue.h # Begin Source File SOURCE=.\NoteSkinManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2142,6 +5268,19 @@ SOURCE=.\NoteSkinManager.h # Begin Source File SOURCE=.\PrefsManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2150,6 +5289,19 @@ SOURCE=.\PrefsManager.h # Begin Source File SOURCE=.\ScreenManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2158,6 +5310,19 @@ SOURCE=.\ScreenManager.h # Begin Source File SOURCE=.\SongManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2166,6 +5331,19 @@ SOURCE=.\SongManager.h # Begin Source File SOURCE=.\ThemeManager.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2174,6 +5352,19 @@ SOURCE=.\ThemeManager.h # Begin Source File SOURCE=.\UnlockSystem.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug OGL" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL" + +!ENDIF + # End Source File # Begin Source File @@ -2182,6 +5373,10 @@ SOURCE=.\UnlockSystem.h # End Group # Begin Source File +SOURCE=.\cursor1.cur +# End Source File +# Begin Source File + SOURCE=.\error.bmp # End Source File # Begin Source File diff --git a/stepmania/src/StepMania.sln b/stepmania/src/StepMania.sln index 972bef8cf8..2ef8e32911 100644 --- a/stepmania/src/StepMania.sln +++ b/stepmania/src/StepMania.sln @@ -3,16 +3,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StepMania", "StepMania.vcpr EndProject Global GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release + ConfigName.0 = Debug D3D + ConfigName.1 = Debug OGL + ConfigName.2 = Release D3D + ConfigName.3 = Release OGL EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution - {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.ActiveCfg = Debug|Win32 - {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.Build.0 = Debug|Win32 - {670745A6-106B-420D-A2A9-D4F89A23986E}.Release.ActiveCfg = Release|Win32 - {670745A6-106B-420D-A2A9-D4F89A23986E}.Release.Build.0 = Release|Win32 + {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug D3D.ActiveCfg = Debug D3D|Win32 + {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug D3D.Build.0 = Debug D3D|Win32 + {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug OGL.ActiveCfg = Debug OGL|Win32 + {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug OGL.Build.0 = Debug OGL|Win32 + {670745A6-106B-420D-A2A9-D4F89A23986E}.Release D3D.ActiveCfg = Release D3D|Win32 + {670745A6-106B-420D-A2A9-D4F89A23986E}.Release D3D.Build.0 = Release D3D|Win32 + {670745A6-106B-420D-A2A9-D4F89A23986E}.Release OGL.ActiveCfg = Release OGL|Win32 + {670745A6-106B-420D-A2A9-D4F89A23986E}.Release OGL.Build.0 = Release OGL|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution DPBuild = 5 diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 15855ecdbc..2156276cbd 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -12,7 +12,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1454,7 +1614,34 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ RelativePath="RageDisplay.h"> + RelativePath="RageDisplay_D3D.cpp"> + + + + + + + + + + + + + + diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp index 7000c6ef96..6c8c1cd8cb 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp @@ -28,7 +28,6 @@ #include "RageUtil.h" #include "RageLog.h" #include "RageException.h" -#include "RageDisplayInternal.h" #include "archutils/win32/tls.h" @@ -44,10 +43,11 @@ MovieTexture_DShow::MovieTexture_DShow( RageTextureID ID ) : { LOG->Trace( "RageBitmapTexture::RageBitmapTexture()" ); - m_uGLTextureID = 0; + m_uTexHandle = 0; buffer = NULL; buffer_lock = SDL_CreateSemaphore(1); buffer_finished = SDL_CreateSemaphore(0); + m_img = NULL; Create(); CreateFrameRects(); @@ -98,8 +98,9 @@ MovieTexture_DShow::~MovieTexture_DShow() } LOG->Trace("MovieTexture_DShow: shutdown ok"); LOG->Flush(); - if(m_uGLTextureID) - glDeleteTextures(1, &m_uGLTextureID); + if(m_uTexHandle) + DISPLAY->DeleteTexture( m_uTexHandle ); + SDL_FreeSurface( m_img ); SDL_DestroySemaphore(buffer_lock); SDL_DestroySemaphore(buffer_finished); @@ -134,32 +135,40 @@ void MovieTexture_DShow::Update(float fDeltaTime) /* Just in case we were invalidated: */ CreateTexture(); - glBindTexture( GL_TEXTURE_2D, m_uGLTextureID ); + // DirectShow feeds us in BGR8 + SDL_Surface *fromDShow = SDL_CreateRGBSurfaceFrom( + (void*)buffer, m_iSourceWidth, m_iSourceHeight, + 24, + m_iSourceWidth*3, + 0xFF0000, + 0x00FF00, + 0x0000FF, + 0x000000 ); - glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + /* We don't want to actually blend the alpha channel over the destination converted + * surface; we want to simply blit it, so make sure SDL_SRCALPHA is not on. */ + SDL_SetAlpha( fromDShow, 0, SDL_ALPHA_OPAQUE ); - /* XXX: We should use m_lVidPitch; we might be padded. However, I can't - * find any codec that don't force the width to a multiple of at least - * 4 anyway, so I can't test it, so I'll leave it like this for now. */ - glPixelStorei(GL_UNPACK_ROW_LENGTH, m_iSourceWidth); + SDL_Rect area; + area.x = area.y = 0; + area.w = short(fromDShow->w); + area.h = short(fromDShow->h); - VDCHECKPOINT; + SDL_BlitSurface(fromDShow, &area, m_img, &area); - glTexSubImage2D(GL_TEXTURE_2D, 0, + DISPLAY->UpdateTexture( + m_uTexHandle, + m_PixelFormat, + m_img, 0, 0, - min(m_iSourceWidth, m_iTextureWidth), - min(m_iSourceHeight, m_iTextureHeight), - GL_BGR, GL_UNSIGNED_BYTE, buffer); + min(m_iSourceWidth,m_iTextureWidth), min(m_iSourceHeight,m_iTextureHeight) ); - /* Must unset PixelStore when we're done! */ - glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glFlush(); + SDL_FreeSurface( fromDShow ); buffer = NULL; + VDCHECKPOINT; + LOG->Trace("processed, signalling"); /* Start the decoding thread again. */ @@ -187,7 +196,7 @@ void MovieTexture_DShow::Create() { HRESULT hr; - m_ActualID.iAlphaBits = 0; + m_ID.iAlphaBits = 0; if( FAILED( hr=CoInitialize(NULL) ) ) RageException::Throw( hr_ssprintf(hr, "Could not CoInitialize") ); @@ -208,7 +217,7 @@ void MovieTexture_DShow::Create() // Add the source filter CComPtr pFSrc; // Source Filter WCHAR wFileName[MAX_PATH]; - MultiByteToWideChar(CP_ACP, 0, m_ActualID.filename.c_str(), -1, wFileName, MAX_PATH); + MultiByteToWideChar(CP_ACP, 0, m_ID.filename.c_str(), -1, wFileName, MAX_PATH); // if this fails, it's probably because the user doesn't have DivX installed if( FAILED( hr = m_pGB->AddSourceFilter( wFileName, L"SOURCE", &pFSrc ) ) ) @@ -236,14 +245,17 @@ void MovieTexture_DShow::Create() // Pass us to our TextureRenderer. pCTR->SetRenderTarget(this); + /* Cap the max texture size to the hardware max. */ + m_ID.iMaxSize = min( m_ID.iMaxSize, DISPLAY->GetMaxTextureSize() ); + // The graph is built, now get the set the output video width and height. // The source and image width will always be the same since we can't scale the video m_iSourceWidth = pCTR->GetVidWidth(); m_iSourceHeight = pCTR->GetVidHeight(); /* image size cannot exceed max size */ - m_iImageWidth = min( m_iSourceWidth, m_ActualID.iMaxSize ); - m_iImageHeight = min( m_iSourceHeight, m_ActualID.iMaxSize ); + m_iImageWidth = min( m_iSourceWidth, m_ID.iMaxSize ); + m_iImageHeight = min( m_iSourceHeight, m_ID.iMaxSize ); /* Texture dimensions need to be a power of two; jump to the next. */ m_iTextureWidth = power_of_two(m_iImageWidth); @@ -283,14 +295,13 @@ void MovieTexture_DShow::NewData(const char *data) void MovieTexture_DShow::CreateTexture() { - if(m_uGLTextureID) + if(m_uTexHandle) return; - glGenTextures(1, &m_uGLTextureID); - glBindTexture( GL_TEXTURE_2D, m_uGLTextureID ); - - /* Initialize the texture and set it to black. */ - string buf(m_iTextureWidth*m_iTextureHeight*3, 0); + /* Have to free our frame holder becuase we might need a different + * PixelFormat than before. */ + if( m_img ) + SDL_FreeSurface( m_img ); /* My test clip (a high-res, MPEG1 video) goes from 12 fps to 14 fps * if I use a 16-bit internalformat instead of a 32-bit one; that's a @@ -303,12 +314,17 @@ void MovieTexture_DShow::CreateTexture() * Some way to figure this out dynamically would be nice, but it's probably * impossible. (For example, 24-bit textures may even be cheaper on pure * AGP cards; 16-bit requires a conversion.) */ - int internalformat = GL_RGB8; + m_PixelFormat = FMT_RGB8; if(TEXTUREMAN->GetTextureColorDepth() == 16) - internalformat = GL_RGB5; + m_PixelFormat = FMT_RGB5; - glTexImage2D(GL_TEXTURE_2D, 0, internalformat, - m_iTextureWidth, m_iTextureHeight, 0, GL_BGR, GL_UNSIGNED_BYTE, buf.data()); + m_img = SDL_CreateRGBSurfaceSane(SDL_SWSURFACE, m_iTextureWidth, m_iTextureHeight, PIXEL_FORMAT_DESC[m_PixelFormat].bpp, + PIXEL_FORMAT_DESC[m_PixelFormat].masks[0], PIXEL_FORMAT_DESC[m_PixelFormat].masks[1], + PIXEL_FORMAT_DESC[m_PixelFormat].masks[2], PIXEL_FORMAT_DESC[m_PixelFormat].masks[3]); + + m_uTexHandle = DISPLAY->CreateTexture( + m_PixelFormat, + m_img ); } bool MovieTexture_DShow::PlayMovie() diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h index d63de640e4..101e390529 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h +++ b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h @@ -36,7 +36,7 @@ typedef char TCHAR, *PTCHAR; #include "RageDisplay.h" #include "RageTexture.h" #include "RageThreads.h" - +struct SDL_Surface; //----------------------------------------------------------------------------- @@ -48,7 +48,7 @@ public: MovieTexture_DShow( RageTextureID ID ); virtual ~MovieTexture_DShow(); /* only called by RageTextureManager::InvalidateTextures */ - void Invalidate() { m_uGLTextureID = 0; } + void Invalidate() { m_uTexHandle = 0; } void Update(float fDeltaTime); virtual void Reload(); @@ -66,6 +66,8 @@ public: private: const char *buffer; SDL_sem *buffer_lock, *buffer_finished; + SDL_Surface* m_img; // last frame in PixelFormat that is being used by graphics card + PixelFormat m_PixelFormat; // format being used by graphics card void Create(); @@ -74,8 +76,8 @@ private: void SkipUpdates(); void StopSkippingUpdates(); - unsigned int GetGLTextureID() { return m_uGLTextureID; } - unsigned int m_uGLTextureID; + unsigned GetTexHandle() { return m_uTexHandle; } + unsigned m_uTexHandle; CComPtr m_pGB; // GraphBuilder bool m_bLoop; diff --git a/stepmania/src/global.h b/stepmania/src/global.h index 0b649997d6..edfe23890c 100644 --- a/stepmania/src/global.h +++ b/stepmania/src/global.h @@ -131,6 +131,11 @@ inline float cosf(float x) { return float(cos(double(x))); } inline float acosf(float x) { return float(acos(double(x))); } #endif +#ifdef _XBOX +#include +#include +#include +#endif /* Don't include our own headers here, since they tend to change often. */