From 22134748e14f0639a27a9dc80094c5b80ce85bbf Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Tue, 9 Nov 2010 17:49:14 +0200 Subject: [PATCH] Create default ddraw.ini if it doesn't exist --- main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/main.c b/main.c index b0e9bab..cae349d 100644 --- a/main.c +++ b/main.c @@ -463,6 +463,26 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk GetCurrentDirectoryA(sizeof(cwd), cwd); snprintf(ini_path, sizeof(ini_path), "%s\\ddraw.ini", cwd); + if(GetFileAttributes(ini_path) == 0xFFFFFFFF) + { + FILE *fh = fopen(ini_path, "w"); + fputs( + "[ddraw]\n" + "width=640\n" + "height=400\n" + "; bits per pixel, possible values: 16, 24 and 32, 0 = auto\n" + "bpp=0\n" + "windowed=true\n" + "; real rendering rate, -1 = vsync, 0 = unlimited, n = cap\n" + "maxfps=120\n" + "; scaling filter, nearest = sharp, linear = smooth\n" + "filter=nearest\n" + "; mouse sensitivity scaling\n" + "adjmouse=false\n" + , fh); + fclose(fh); + } + GetPrivateProfileStringA("ddraw", "renderer", "opengl", tmp, sizeof(tmp), ini_path); if(tolower(tmp[0]) == 'd') {