File tree Expand file tree Collapse file tree 9 files changed +105
-39
lines changed Expand file tree Collapse file tree 9 files changed +105
-39
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ umodel.cfg
33
33
# Executable files and pdb
34
34
umodel [-_ ]* .exe
35
35
umodel * .pdb
36
- SDL2.dll
37
36
Tools /** /* .exe
38
37
Tools /** /* .pdb
39
38
* todo.md
Original file line number Diff line number Diff line change @@ -637,21 +637,17 @@ extern bool GUseDebugger;
637
637
#endif
638
638
639
639
640
- #if RENDERING
641
- # define appMilliseconds () SDL_GetTicks()
642
- #else
643
- # ifdef _WIN32
644
- # if !defined(WINAPI) // detect <windows.h>
645
- extern " C" {
646
- __declspec (dllimport) unsigned long __stdcall GetTickCount();
647
- }
648
- # endif
649
- # else
650
- // Local implementation of GetTickCount() for non-Windows platforms
651
- unsigned long GetTickCount ();
640
+ #ifdef _WIN32
641
+ # if !defined(WINAPI) // detect <windows.h>
642
+ extern " C" {
643
+ __declspec (dllimport) unsigned long __stdcall GetTickCount();
644
+ }
652
645
# endif
653
- # define appMilliseconds () GetTickCount()
654
- #endif // RENDERING
646
+ #else
647
+ // Local implementation of GetTickCount() for non-Windows platforms
648
+ unsigned long GetTickCount ();
649
+ #endif
650
+ #define appMilliseconds () GetTickCount()
655
651
656
652
// Allow operation of enum class as with regular integer
657
653
#define BITFIELD_ENUM (Enum ) \
Original file line number Diff line number Diff line change @@ -251,13 +251,8 @@ GenerateMakefile
251
251
# Perform a build
252
252
# if $target is empty, whole project will be built, otherwise a single file
253
253
case " $PLATFORM " in
254
- " vc-win32" )
254
+ " vc-win32" | " vc-win64 " )
255
255
Make $makefile $target || exit 1
256
- [ $render -eq 1 ] && cp $root /libs/SDL2/x86/SDL2.dll .
257
- ;;
258
- " vc-win64" )
259
- Make $makefile $target || exit 1
260
- [ $render -eq 1 ] && cp $root /libs/SDL2/x64/SDL2.dll .
261
256
;;
262
257
" mingw32" |" cygwin" )
263
258
PATH=/bin:/usr/bin:$PATH # configure paths for Cygwin
Original file line number Diff line number Diff line change @@ -166,6 +166,9 @@ sources(COMP_LIBS) = {
166
166
pop(INCLUDES)
167
167
pop(DEFINES)
168
168
169
+ # SDL2
170
+ !include $R/libs/SDL2/SDL2.project
171
+
169
172
# oodle SDK support
170
173
!include $R/libs/oodle/oodle.project
171
174
@@ -192,9 +195,6 @@ sources(UE4_LIBS) = {
192
195
#------------------------------------------------
193
196
194
197
OBJDIR = $R/obj/$PRJ-$PLATFORM
195
- !if "$PLATFORM" ne "osx"
196
- STDLIBS += SDL2 # disabled in macOS build
197
- !endif
198
198
INCLUDES += . $R/Core $R/Unreal $LIBINCLUDES
199
199
OPTIONS += $WARNINGS
200
200
@@ -212,11 +212,3 @@ OPTIONS += $WARNINGS
212
212
libs/tracy/TracyClient.cpp
213
213
}
214
214
!endif
215
-
216
- !if "$PLATFORM" eq "win32"
217
- INCLUDES += $R/libs/includewin32
218
- LIBRARIES += $R/libs/SDL2/x86
219
- !elif "$PLATFORM" eq "win64"
220
- INCLUDES += $R/libs/includewin32
221
- LIBRARIES += $R/libs/SDL2/x64
222
- !endif
Original file line number Diff line number Diff line change
1
+ # perl highlighting
2
+
3
+ !if "$PLATFORM" ne "osx"
4
+ STDLIBS += SDL2 # disabled in macOS build
5
+ !endif
6
+
7
+ !if "$PLATFORM" eq "win32"
8
+ INCLUDES += $R/libs/includewin32
9
+ LIBRARIES += $R/libs/SDL2/x86
10
+ !elif "$PLATFORM" eq "win64"
11
+ INCLUDES += $R/libs/includewin32
12
+ LIBRARIES += $R/libs/SDL2/x64
13
+ !endif
14
+
15
+ !if "$COMPILER" eq "VisualC"
16
+ # Delay loading of SDL2.dll
17
+ LINKFLAGS += -DELAYLOAD:SDL2.dll
18
+ STDLIBS += delayimp
19
+ # Delay loader helper function
20
+ sources(MAIN) = $R/libs/SDL2/SDL2Loader.cpp
21
+ !endif
Original file line number Diff line number Diff line change
1
+ #include < windows.h>
2
+ #include < delayimp.h>
3
+
4
+ // Reference:
5
+ // https://docs.microsoft.com/en-us/cpp/build/reference/understanding-the-helper-function
6
+
7
+ // Core external functions
8
+ void appPrintf (const char *, ...);
9
+ void appError (const char *, ...);
10
+
11
+ static const char * DllPaths[] =
12
+ {
13
+ #ifndef _WIN64
14
+ " SDL2.dll" ,
15
+ " libs\\ SDL2\\ x86\\ SDL2.dll"
16
+ #else
17
+ " SDL2_64.dll" ,
18
+ " libs\\ SDL2\\ x64\\ SDL2.dll"
19
+ #endif
20
+ };
21
+
22
+ static FARPROC WINAPI delayHook (unsigned dliNotify, PDelayLoadInfo pdli)
23
+ {
24
+ if (dliNotify == dliNotePreLoadLibrary)
25
+ {
26
+ if (stricmp (pdli->szDll , " SDL2.dll" ) == 0 )
27
+ {
28
+ // Find SDL2.dll in local folder, then in libs. Use a different file name for Win64 builds.
29
+ for (const char * DllName : DllPaths)
30
+ {
31
+ HANDLE hDll = LoadLibrary (DllName);
32
+ if (hDll)
33
+ return (FARPROC) hDll;
34
+ }
35
+ appError (" SDL2.dll was not found, terminating..." );
36
+ }
37
+ else
38
+ {
39
+ // Actually can simply return NULL, and let CRT to find a DLL itself
40
+ appError (" Unknown DelayLoad: %s" , pdli->szDll );
41
+ }
42
+ }
43
+
44
+ return NULL ;
45
+ }
46
+
47
+ ExternC const PfnDliHook __pfnDliNotifyHook2 = delayHook;
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
archive=" umodel_win32.zip"
3
- filelist=" umodel.exe readme.txt SDL2.dll"
3
+ filelist=" umodel.exe umodel_64.exe readme.txt SDL2.dll SDL2_64 .dll"
4
4
5
- for i in $filelist ; do
6
- if [ ! -f $i ]; then
7
- echo " ERROR: unable to find \" $i \" "
8
- exit 1
9
- fi
10
- done
5
+ # Build 32 and 64 bit executables
6
+ ./build.sh || exit 1
7
+ ./build.sh --64 || exit 1
11
8
12
9
if grep -q -E " (PRIVATE BUILD)" umodel.exe; then
13
10
echo " ERROR: this is a private build"
@@ -19,5 +16,21 @@ if grep -q -E "(DEBUG BUILD)" umodel.exe; then
19
16
exit
20
17
fi
21
18
19
+ # Copy SDL2.dll locally
20
+ cp libs/SDL2/x86/SDL2.dll .
21
+ cp libs/SDL2/x64/SDL2.dll ./SDL2_64.dll
22
+
23
+ # Verify for presence of all files
24
+ for i in $filelist ; do
25
+ if [ ! -f $i ]; then
26
+ echo " ERROR: unable to find \" $i \" "
27
+ exit 1
28
+ fi
29
+ done
30
+
31
+ # Create an archive
22
32
rm -f $archive
23
33
pkzipc -add $archive -level=9 $filelist
34
+
35
+ # Remove SDL2.dll files, these are required only for packaging
36
+ rm -f SDL2.dll SDL2_64.dll
Original file line number Diff line number Diff line change @@ -216,6 +216,9 @@ Oodle
216
216
217
217
Changes
218
218
~~~~~~~
219
+ 05.07.2021
220
+ - providing Win32 and Win64 builds of UE Viewer
221
+
219
222
30.05.2021
220
223
- Mass Effect Legendary Edition support
221
224
You can’t perform that action at this time.
0 commit comments