|
@@ -38,13 +38,14 @@ bool MyShowCursor(bool show)
|
|
|
cursor_visible = show;
|
|
|
ShowCursor(show);
|
|
|
|
|
|
return !show;
|
|
|
}
|
|
|
|
|
|
/** Helper function needed by dynamically loading libraries
|
|
|
/**
|
|
|
* Helper function needed by dynamically loading libraries
|
|
|
* XXX: Hurray for MS only having an ANSI GetProcAddress function
|
|
|
* on normal windows and no Wide version except for in Windows Mobile/CE */
|
|
|
bool LoadLibraryList(Function proc[], const char *dll)
|
|
|
{
|
|
|
while (*dll != '\0') {
|
|
|
HMODULE lib;
|
|
@@ -628,13 +629,14 @@ const TCHAR *OTTD2FS(const char *name)
|
|
|
*s = '\0';
|
|
|
return system_buf;
|
|
|
#endif /* UNICODE */
|
|
|
}
|
|
|
|
|
|
|
|
|
/** Convert to OpenTTD's encoding from that of the environment in
|
|
|
/**
|
|
|
* Convert to OpenTTD's encoding from that of the environment in
|
|
|
* UNICODE. OpenTTD encoding is UTF8, local is wide
|
|
|
* @param name pointer to a valid string that will be converted
|
|
|
* @param utf8_buf pointer to a valid buffer that will receive the converted string
|
|
|
* @param buflen length in characters of the receiving buffer
|
|
|
* @return pointer to utf8_buf. If conversion fails the string is of zero-length */
|
|
|
char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen)
|
|
@@ -646,13 +648,14 @@ char *convert_from_fs(const wchar_t *nam
|
|
|
}
|
|
|
|
|
|
return utf8_buf;
|
|
|
}
|
|
|
|
|
|
|
|
|
/** Convert from OpenTTD's encoding to that of the environment in
|
|
|
/**
|
|
|
* Convert from OpenTTD's encoding to that of the environment in
|
|
|
* UNICODE. OpenTTD encoding is UTF8, local is wide
|
|
|
* @param name pointer to a valid string that will be converted
|
|
|
* @param utf16_buf pointer to a valid wide-char buffer that will receive the
|
|
|
* converted string
|
|
|
* @param buflen length in wide characters of the receiving buffer
|
|
|
* @return pointer to utf16_buf. If conversion fails the string is of zero-length */
|
|
@@ -664,13 +667,14 @@ wchar_t *convert_to_fs(const char *name,
|
|
|
utf16_buf[0] = '\0';
|
|
|
}
|
|
|
|
|
|
return utf16_buf;
|
|
|
}
|
|
|
|
|
|
/** Our very own SHGetFolderPath function for support of windows operating
|
|
|
/**
|
|
|
* Our very own SHGetFolderPath function for support of windows operating
|
|
|
* systems that don't have this function (eg Win9x, etc.). We try using the
|
|
|
* native function, and if that doesn't exist we will try a more crude approach
|
|
|
* of environment variables and hope for the best */
|
|
|
HRESULT OTTDSHGetFolderPath(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)
|
|
|
{
|
|
|
static HRESULT (WINAPI *SHGetFolderPath)(HWND, int, HANDLE, DWORD, LPTSTR) = NULL;
|