Files @ r15386:717f25b0b15f
Branch filter:

Location: cpp/openttd-patchpack/source/src/screenshot.h

rubidium
(svn r20039) -Fix [FS#3907]: instead of loading the intro game when loading a savegame fails on the dedicated server, generate a new game.
Generating a new game is the least bad solution:
* loading the intro game: desyncs due to GM_MENU on the server and GM_NORMAL on the clients, NewGRFs not being loaded on the server but being loaded on the client;
* creating an empty map: OpenTTD will go crazy due to missing towns. Also clients can't properly join because of the missing towns;
* loading the last saved game: doesn't always exist and loading it might fail causing an infinite loop;
* stopping being a server: breaks the dedicated server horribly; if you loaded the game via rcon you can't connect with it anymore as you can't join the server;
* generating a new game: should always succeed, although people might think a scenario loaded fine because there are no companies and such.
/* $Id$ */

/*
 * This file is part of OpenTTD.
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 */

/** @file screenshot.h Functions to make screenshots. */

#ifndef SCREENSHOT_H
#define SCREENSHOT_H

void InitializeScreenshotFormats();

const char *GetScreenshotFormatDesc(int i);
void SetScreenshotFormat(int i);

/** Type of requested screenshot */
enum ScreenshotType {
	SC_VIEWPORT, ///< Screenshot of viewport
	SC_RAW,      ///< Raw screenshot from blitter buffer
	SC_WORLD,    ///< World screenshot
};

bool MakeScreenshot(ScreenshotType t, const char *name);

extern char _screenshot_format_name[8];
extern uint _num_screenshot_formats;
extern uint _cur_screenshot_format;
extern char _full_screenshot_name[MAX_PATH];

#endif /* SCREENSHOT_H */