diff --git a/stepmania/NEWS b/stepmania/NEWS index a9c8076343..16a32e7e2c 100644 --- a/stepmania/NEWS +++ b/stepmania/NEWS @@ -11,6 +11,8 @@ NEW FEATURE: New Edit menus with ability to delete Notes patterns and new options for importing existing patterns into a new Notes pattern. NEW FEATURE: Jukebox mode. Like demonstration, but plays entire songs and loops. +NEW FEATURE: F6 to save screenshot. Saved in StepMania program directory + as "screenshotXXXX.bmp". ----------------------- Version 3.01 --------------------------- CHANGE: Simplified NoteSkin tap graphic format. Old NoteSkins will need to diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index e8f5818bc1..b6036199f3 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -435,6 +435,32 @@ void RageDisplay::DisablePalettedTexture() 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, g_CurrentWidth, g_CurrentHeight, + 24, 0x0000FF, 0x00FF00, 0xFF0000, 0x000000); + SDL_Surface *temp = SDL_CreateRGBSurface( + SDL_SWSURFACE, g_CurrentWidth, g_CurrentHeight, + 24, 0x0000FF, 0x00FF00, 0xFF0000, 0x000000); + + glReadPixels(0, 0, g_CurrentWidth, g_CurrentHeight, GL_RGB, + GL_UNSIGNED_BYTE, image->pixels); + + // flip vertically + for( int y=0; ypixels + 3 * g_CurrentWidth * y, + (char *)image->pixels + 3 * g_CurrentWidth * (g_CurrentHeight-y), + 3*g_CurrentWidth ); + + SDL_SaveBMP( temp, sPath ); + SDL_FreeSurface( temp ); +} + + bool RageDisplay::IsWindowed() const { return true; // FIXME diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index d8a03263bc..ccad602638 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -87,6 +87,8 @@ public: const oglspecs_t &GetSpecs() const { return *m_oglspecs; } void DisablePalettedTexture(); + void SaveScreenshot( CString sPath ); + protected: void AddVerts( const RageVertex v[], int iNumVerts ); void SetBlendMode(int src, int dst); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index b6b79068a2..132edaddd1 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -433,6 +433,22 @@ static void HandleInputEvents(float fDeltaTime) } ApplyGraphicOptions(); } + else if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F6)) + { + if(type != IET_FIRST_PRESS) continue; + + // pressed F6. Save Screenshot. + int i=0; + CString sPath; + for( i=0; i<1000; i++ ) + { + sPath = ssprintf("screen%04d.bmp",i); + if( !DoesFileExist(sPath) ) + break; + } + DISPLAY->SaveScreenshot( sPath ); + SCREENMAN->SystemMessage( "Saved screenshot: " + sPath ); + } if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_RETURN)) { diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 312346c839..a236d74b20 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -60,7 +60,7 @@ IntDir=.\../Release6 TargetDir=\stepmania\stepmania TargetName=StepMania 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 @@ -95,7 +95,7 @@ IntDir=.\../Debug6 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 @@ -1493,6 +1493,14 @@ SOURCE=.\ScreenInstructions.h # End Source File # Begin Source File +SOURCE=.\ScreenJukebox.cpp +# End Source File +# Begin Source File + +SOURCE=.\ScreenJukebox.h +# End Source File +# Begin Source File + SOURCE=.\ScreenLogo.cpp # End Source File # Begin Source File