Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
Bonzomatic
Commits
14f90e50
Commit
14f90e50
authored
May 20, 2019
by
Gargaj
Browse files
fix issue where windows folder isn't on C (fixes #112)
parent
c26ed62b
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
14f90e50
...
...
@@ -446,11 +446,11 @@ elseif (UNIX)
set
(
PLATFORM_LIBS GL
)
elseif
(
WIN32
)
if
(
${
BONZOMATIC_WINDOWS_FLAVOR
}
MATCHES
"DX11"
)
set
(
PLATFORM_LIBS d3d11 d3dcompiler dxguid DXGI winmm
)
set
(
PLATFORM_LIBS d3d11 d3dcompiler dxguid DXGI winmm
shlwapi
)
elseif
(
${
BONZOMATIC_WINDOWS_FLAVOR
}
MATCHES
"DX9"
)
set
(
PLATFORM_LIBS d3d9 d3dx9 winmm
)
set
(
PLATFORM_LIBS d3d9 d3dx9 winmm
shlwapi
)
else
()
set
(
PLATFORM_LIBS opengl32 glu32 winmm
)
set
(
PLATFORM_LIBS opengl32 glu32 winmm
shlwapi
)
endif
()
endif
()
set
(
BZC_PROJECT_LIBS
${
BZC_PROJECT_LIBS
}
${
PLATFORM_LIBS
}
)
...
...
src/platform_w32_common/Misc.cpp
View file @
14f90e50
#include <string>
#include <Windows.h>
#include <tchar.h>
#include <Shlobj.h>
#include <Shlwapi.h>
#include <map>
...
...
@@ -67,16 +69,23 @@ namespace Misc
const
char
*
GetDefaultFontPath
()
{
char
windowsPath
[
MAX_PATH
];
if
(
SHGetFolderPath
(
NULL
,
CSIDL_WINDOWS
,
NULL
,
0
,
windowsPath
)
!=
S_OK
)
{
return
NULL
;
}
const
char
*
fontPaths
[]
=
{
"
c:
\\
Windows
\\
Fonts
\\
cour.ttf"
,
"Fonts
\\
cour.ttf"
,
NULL
};
for
(
int
i
=
0
;
fontPaths
[
i
];
++
i
)
{
if
(
FileExists
(
fontPaths
[
i
]))
static
char
fullPath
[
MAX_PATH
]
=
{
0
};
PathCombineA
(
fullPath
,
windowsPath
,
fontPaths
[
i
]
);
if
(
FileExists
(
fullPath
))
{
return
f
ont
Path
s
[
i
]
;
return
f
ull
Path
;
}
}
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment