added F6 to save screenshot. (currently this conflicts with the editor's use of F6, but it won't after the editor UI changes)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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; y<g_CurrentHeight; y++ )
|
||||
memcpy(
|
||||
(char *)temp->pixels + 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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user