Changeset - r24282:dbf80d461c25
[Not reviewed]
master
0 4 0
TechGeekNZ - 4 years ago 2020-06-20 05:12:31
git@tech.geek.nz
Cleanup: Give `TakeScreenshot` a more sensible name
4 files changed with 15 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/screenshot.cpp
Show inline comments
 
@@ -845,12 +845,12 @@ static void ScreenshotConfirmationCallba
 
}
 

	
 
/**
 
 * Take a screenshot.
 
 * Ask for confirmation if the screenshot will be huge. Delegates to \c MakeScreenshot to perform the action.
 
 * Make a screenshot.
 
 * Ask for confirmation first if the screenshot will be huge.
 
 * @param t Screenshot type: World, defaultzoom, heightmap or viewport screenshot
 
 * @see MakeScreenshot
 
 */
 
void TakeScreenshot(ScreenshotType t)
 
void MakeScreenshotWithConfirm(ScreenshotType t)
 
{
 
	ViewPort vp;
 
	SetupScreenshotViewport(t, &vp);
 
@@ -868,11 +868,11 @@ void TakeScreenshot(ScreenshotType t)
 

	
 
/**
 
 * Make a screenshot.
 
 * No questions asked, just do it.
 
 * Unconditionally take a screenshot of the requested type.
 
 * @param t    the type of screenshot to make.
 
 * @param name the name to give to the screenshot.
 
 * @return true iff the screenshot was made successfully
 
 * @see TakeScreenshot
 
 * @see MakeScreenshotWithConfirm
 
 */
 
bool MakeScreenshot(ScreenshotType t, const char *name)
 
{
src/screenshot.h
Show inline comments
 
@@ -27,7 +27,7 @@ enum ScreenshotType {
 

	
 
void SetupScreenshotViewport(ScreenshotType t, struct ViewPort *vp);
 
bool MakeHeightmapScreenshot(const char *filename);
 
void TakeScreenshot(ScreenshotType t);
 
void MakeScreenshotWithConfirm(ScreenshotType t);
 
bool MakeScreenshot(ScreenshotType t, const char *name);
 
bool MakeMinimapWorldScreenshot();
 

	
src/screenshot_gui.cpp
Show inline comments
 
@@ -39,7 +39,7 @@ struct ScreenshotWindow : Window {
 
			case WID_SC_TAKE_HEIGHTMAP:   st = SC_HEIGHTMAP;   break;
 
			case WID_SC_TAKE_MINIMAP:     st = SC_MINIMAP;     break;
 
		}
 
		TakeScreenshot(st);
 
		MakeScreenshotWithConfirm(st);
 
	}
 
};
 

	
src/toolbar_gui.cpp
Show inline comments
 
@@ -2086,10 +2086,10 @@ struct MainToolbarWindow : Window {
 
			case MTHK_BUILD_TREES: ShowBuildTreesToolbar(); break;
 
			case MTHK_MUSIC: ShowMusicWindow(); break;
 
			case MTHK_AI_DEBUG: ShowAIDebugWindow(); break;
 
			case MTHK_SMALL_SCREENSHOT: TakeScreenshot(SC_VIEWPORT); break;
 
			case MTHK_ZOOMEDIN_SCREENSHOT: TakeScreenshot(SC_ZOOMEDIN); break;
 
			case MTHK_DEFAULTZOOM_SCREENSHOT: TakeScreenshot(SC_DEFAULTZOOM); break;
 
			case MTHK_GIANT_SCREENSHOT: TakeScreenshot(SC_WORLD); break;
 
			case MTHK_SMALL_SCREENSHOT: MakeScreenshotWithConfirm(SC_VIEWPORT); break;
 
			case MTHK_ZOOMEDIN_SCREENSHOT: MakeScreenshotWithConfirm(SC_ZOOMEDIN); break;
 
			case MTHK_DEFAULTZOOM_SCREENSHOT: MakeScreenshotWithConfirm(SC_DEFAULTZOOM); break;
 
			case MTHK_GIANT_SCREENSHOT: MakeScreenshotWithConfirm(SC_WORLD); break;
 
			case MTHK_CHEATS: if (!_networking) ShowCheatWindow(); break;
 
			case MTHK_TERRAFORM: ShowTerraformToolbar(); break;
 
			case MTHK_EXTRA_VIEWPORT: ShowExtraViewPortWindowForTileUnderCursor(); break;
 
@@ -2461,10 +2461,10 @@ struct ScenarioEditorToolbarWindow : Win
 
			case MTEHK_SIGN:                   cbf = ToolbarScenPlaceSign(this); break;
 
			case MTEHK_MUSIC:                  ShowMusicWindow(); break;
 
			case MTEHK_LANDINFO:               cbf = PlaceLandBlockInfo(); break;
 
			case MTEHK_SMALL_SCREENSHOT:       TakeScreenshot(SC_VIEWPORT); break;
 
			case MTEHK_ZOOMEDIN_SCREENSHOT:    TakeScreenshot(SC_ZOOMEDIN); break;
 
			case MTEHK_DEFAULTZOOM_SCREENSHOT: TakeScreenshot(SC_DEFAULTZOOM); break;
 
			case MTEHK_GIANT_SCREENSHOT:       TakeScreenshot(SC_WORLD); break;
 
			case MTEHK_SMALL_SCREENSHOT:       MakeScreenshotWithConfirm(SC_VIEWPORT); break;
 
			case MTEHK_ZOOMEDIN_SCREENSHOT:    MakeScreenshotWithConfirm(SC_ZOOMEDIN); break;
 
			case MTEHK_DEFAULTZOOM_SCREENSHOT: MakeScreenshotWithConfirm(SC_DEFAULTZOOM); break;
 
			case MTEHK_GIANT_SCREENSHOT:       MakeScreenshotWithConfirm(SC_WORLD); break;
 
			case MTEHK_ZOOM_IN:                ToolbarZoomInClick(this); break;
 
			case MTEHK_ZOOM_OUT:               ToolbarZoomOutClick(this); break;
 
			case MTEHK_TERRAFORM:              ShowEditorTerraformToolbar(); break;
0 comments (0 inline, 0 general)