Browse Source

make saved game case-insensitive

Wei Mingzhi 7 years ago
parent
commit
1c25300206
2 changed files with 6 additions and 3 deletions
  1. 4 1
      uigame.c
  2. 2 2
      video.c

+ 4 - 1
uigame.c

@@ -24,8 +24,11 @@
 
 static WORD GetSavedTimes(int saveslot)
 {
-	FILE *fp = fopen(va("%s/%d%s", gConfig.pszSavePath, saveslot, ".rpg"), "rb");
+	FILE *fp;
 	WORD wSavedTimes = 0;
+	char buf[1024];
+	sprintf(buf, "%d%s", saveslot, ".rpg");
+	fp = UTIL_OpenFileForMode(buf, "rb");
 	if (fp != NULL)
 	{
 		if (fread(&wSavedTimes, sizeof(WORD), 1, fp) == 1)

+ 2 - 2
video.c

@@ -783,13 +783,13 @@ VIDEO_SaveScreenshot(
 #ifdef _WIN32
 	SYSTEMTIME st;
 	GetLocalTime(&st);
-	sprintf(filename, "%s%04d%02d%02d%02d%02d%02d%03d.bmp", gConfig.pszSavePath, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
+	sprintf(filename, "%s/%04d%02d%02d%02d%02d%02d%03d.bmp", gConfig.pszSavePath, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
 #else
 	struct timeval tv;
 	struct tm *ptm;
 	gettimeofday(&tv, NULL);
 	ptm = localtime(&tv.tv_sec);
-	sprintf(filename, "%s%04d%02d%02d%02d%02d%02d%03d.bmp", gConfig.pszSavePath, ptm->tm_year + 1900, ptm->tm_mon, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec, (int)(tv.tv_usec / 1000));
+	sprintf(filename, "%s/%04d%02d%02d%02d%02d%02d%03d.bmp", gConfig.pszSavePath, ptm->tm_year + 1900, ptm->tm_mon, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec, (int)(tv.tv_usec / 1000));
 #endif
 	
 	//