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:
Chris Danford
2003-01-31 22:34:04 +00:00
parent 7c470cf9c8
commit ebce24b57e
5 changed files with 56 additions and 2 deletions
+2
View File
@@ -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. options for importing existing patterns into a new Notes pattern.
NEW FEATURE: Jukebox mode. Like demonstration, but plays entire songs NEW FEATURE: Jukebox mode. Like demonstration, but plays entire songs
and loops. and loops.
NEW FEATURE: F6 to save screenshot. Saved in StepMania program directory
as "screenshotXXXX.bmp".
----------------------- Version 3.01 --------------------------- ----------------------- Version 3.01 ---------------------------
CHANGE: Simplified NoteSkin tap graphic format. Old NoteSkins will need to CHANGE: Simplified NoteSkin tap graphic format. Old NoteSkins will need to
+26
View File
@@ -435,6 +435,32 @@ void RageDisplay::DisablePalettedTexture()
m_oglspecs->EXT_paletted_texture = false; 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 bool RageDisplay::IsWindowed() const
{ {
return true; // FIXME return true; // FIXME
+2
View File
@@ -87,6 +87,8 @@ public:
const oglspecs_t &GetSpecs() const { return *m_oglspecs; } const oglspecs_t &GetSpecs() const { return *m_oglspecs; }
void DisablePalettedTexture(); void DisablePalettedTexture();
void SaveScreenshot( CString sPath );
protected: protected:
void AddVerts( const RageVertex v[], int iNumVerts ); void AddVerts( const RageVertex v[], int iNumVerts );
void SetBlendMode(int src, int dst); void SetBlendMode(int src, int dst);
+16
View File
@@ -433,6 +433,22 @@ static void HandleInputEvents(float fDeltaTime)
} }
ApplyGraphicOptions(); 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)) if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_RETURN))
{ {
+8
View File
@@ -1493,6 +1493,14 @@ SOURCE=.\ScreenInstructions.h
# End Source File # End Source File
# Begin 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 SOURCE=.\ScreenLogo.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File