Exemple #1
0
static int screenshot_get_next_path(char *path, char *extension)
{
	char *screenshotPath = osinterface_get_orct2_homesubfolder("screenshot");
	if (!osinterface_ensure_directory_exists(screenshotPath)) {
		free(screenshotPath);

		fprintf(stderr, "Unable to save screenshots in OpenRCT2 screenshot directory.\n");
		return -1;
	}

	int i;
	for (i = 1; i < 1000; i++) {
		RCT2_GLOBAL(0x013CE952, uint16) = i;

		// Glue together path and filename
		sprintf(path, "%s%cSCR%d%s", screenshotPath, osinterface_get_path_separator(), i, extension);

		if (!osinterface_file_exists(path)) {
			return i;
		}
	}

	free(screenshotPath);
	return -1;
}
Exemple #2
0
static void get_plugin_path(char *path)
{
	char *homePath = osinterface_get_orct2_homefolder();
	sprintf(path, "%s%c%s", homePath, osinterface_get_path_separator(), "plugin.dat");
	free(homePath);
}