summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/src/osd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/src/osd')
-rw-r--r--scripts/src/osd/modules.lua60
-rw-r--r--scripts/src/osd/sdl.lua124
-rw-r--r--scripts/src/osd/sdl_cfg.lua18
-rw-r--r--scripts/src/osd/windows.lua10
-rw-r--r--scripts/src/osd/windows_cfg.lua2
5 files changed, 90 insertions, 124 deletions
diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua
index 87e684a50f6..1dfa4317a48 100644
--- a/scripts/src/osd/modules.lua
+++ b/scripts/src/osd/modules.lua
@@ -89,7 +89,6 @@ function osdmodulesbuild()
MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.h",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.h",
MAME_DIR .. "src/osd/modules/opengl/osd_opengl.h",
- MAME_DIR .. "src/osd/modules/opengl/SDL1211_opengl.h",
}
defines {
"USE_OPENGL=1",
@@ -101,18 +100,39 @@ function osdmodulesbuild()
end
end
- if USE_BGFX == 1 then
- files {
- MAME_DIR .. "src/osd/modules/render/drawbgfx.cpp",
- }
- defines {
- "USE_BGFX"
- }
- includedirs {
- MAME_DIR .. "3rdparty/bgfx/include",
- MAME_DIR .. "3rdparty/bx/include",
- }
- end
+ files {
+ MAME_DIR .. "src/osd/modules/render/drawbgfx.cpp",
+ MAME_DIR .. "src/osd/modules/render/binpacker.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/blendreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/cullreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/depthreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/effect.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/effectmanager.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/effectreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/chain.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/chainreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/chainentry.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/chainentryreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/inputpair.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/shadermanager.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/statereader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/slider.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/sliderreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/parameter.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/paramreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/target.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/targetmanager.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/texture.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/texturemanager.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/uniform.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/uniformreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/writereader.cpp",
+ }
+ includedirs {
+ MAME_DIR .. "3rdparty/bgfx/include",
+ MAME_DIR .. "3rdparty/bx/include",
+ MAME_DIR .. "3rdparty/rapidjson/include",
+ }
if _OPTIONS["NO_USE_MIDI"]=="1" then
defines {
@@ -356,14 +376,6 @@ newoption {
},
}
-if not _OPTIONS["NO_OPENGL"] then
- if _OPTIONS["targetos"]=="os2" then
- _OPTIONS["NO_OPENGL"] = "1"
- else
- _OPTIONS["NO_OPENGL"] = "0"
- end
-end
-
newoption {
trigger = "USE_DISPATCH_GL",
description = "Use GL-dispatching",
@@ -374,11 +386,7 @@ newoption {
}
if not _OPTIONS["USE_DISPATCH_GL"] then
- if USE_BGFX == 1 then
- _OPTIONS["USE_DISPATCH_GL"] = "0"
- else
- _OPTIONS["USE_DISPATCH_GL"] = "1"
- end
+ _OPTIONS["USE_DISPATCH_GL"] = "0"
end
newoption {
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 6acb5a2d262..cb5bd6debdc 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -39,29 +39,23 @@ function maintargetosdoptions(_target,_subtarget)
end
if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" then
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- links {
- "SDL2_ttf",
- }
- else
- links {
- "SDL_ttf",
- }
- end
+ links {
+ "SDL2_ttf",
+ }
local str = backtick("pkg-config --libs fontconfig")
addlibfromstring(str)
addoptionsfromstring(str)
end
if _OPTIONS["targetos"]=="windows" then
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
links {
"SDL2.dll",
}
else
- links {
- "SDL.dll",
- }
+ local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
end
links {
"psapi",
@@ -93,16 +87,21 @@ function maintargetosdoptions(_target,_subtarget)
configuration { "mingw*" or "vs*" }
targetprefix "sdl"
+ links {
+ "psapi"
+ }
configuration { }
end
function sdlconfigcmd()
- if not _OPTIONS["SDL_INSTALL_ROOT"] then
- return _OPTIONS["SDL_LIBVER"] .. "-config"
+ if _OPTIONS["targetos"]=="asmjs" then
+ return "sdl2-config"
+ elseif not _OPTIONS["SDL_INSTALL_ROOT"] then
+ return _OPTIONS['TOOLCHAIN'] .. "pkg-config sdl2"
else
- return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin",_OPTIONS["SDL_LIBVER"]) .. "-config"
+ return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin","sdl2") .. "-config"
end
end
@@ -148,23 +147,6 @@ if not _OPTIONS["NO_USE_XINPUT"] then
end
newoption {
- trigger = "SDL_LIBVER",
- description = "Choose SDL version",
- allowed = {
- { "sdl", "SDL" },
- { "sdl2", "SDL 2" },
- },
-}
-
-if not _OPTIONS["SDL_LIBVER"] then
- if _OPTIONS["targetos"]=="os2" then
- _OPTIONS["SDL_LIBVER"] = "sdl"
- else
- _OPTIONS["SDL_LIBVER"] = "sdl2"
- end
-end
-
-newoption {
trigger = "SDL2_MULTIAPI",
description = "Use couriersud's multi-keyboard patch for SDL 2.1? (this API was removed prior to the 2.0 release)",
allowed = {
@@ -192,16 +174,16 @@ if not _OPTIONS["SDL_FRAMEWORK_PATH"] then
end
newoption {
- trigger = "MACOSX_USE_LIBSDL",
- description = "Use SDL library on OS (rather than framework)",
+ trigger = "USE_LIBSDL",
+ description = "Use SDL library on OS (rather than framework/dll)",
allowed = {
- { "0", "Use framework" },
+ { "0", "Use framework/dll" },
{ "1", "Use library" },
},
}
-if not _OPTIONS["MACOSX_USE_LIBSDL"] then
- _OPTIONS["MACOSX_USE_LIBSDL"] = "0"
+if not _OPTIONS["USE_LIBSDL"] then
+ _OPTIONS["USE_LIBSDL"] = "0"
end
@@ -235,10 +217,6 @@ elseif _OPTIONS["targetos"]=="os2" then
SYNC_IMPLEMENTATION = "os2"
end
-if _OPTIONS["SDL_LIBVER"]=="sdl" then
- USE_BGFX = 0
-end
-
if BASE_TARGETOS=="unix" then
if _OPTIONS["targetos"]=="macosx" then
local os_version = str_to_version(backtick("sw_vers -productVersion"))
@@ -255,39 +233,27 @@ if BASE_TARGETOS=="unix" then
"-weak_framework Metal",
}
end
- if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
linkoptions {
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
}
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- links {
- "SDL2.framework",
- }
- else
- links {
- "SDL.framework",
- }
- end
+ links {
+ "SDL2.framework",
+ }
else
- local str = backtick(sdlconfigcmd() .. " --libs | sed 's/-lSDLmain//'")
+ local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'")
addlibfromstring(str)
addoptionsfromstring(str)
end
else
if _OPTIONS["NO_X11"]=="1" then
_OPTIONS["USE_QTDEBUG"] = "0"
- USE_BGFX = 0
else
libdirs {
"/usr/X11/lib",
"/usr/X11R6/lib",
"/usr/openwin/lib",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl" then
- links {
- "X11",
- }
- end
end
local str = backtick(sdlconfigcmd() .. " --libs")
addlibfromstring(str)
@@ -404,13 +370,6 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.h",
MAME_DIR .. "src/osd/modules/debugger/osx/debugosx.h",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl" then
- -- SDLMain_tmpl isn't necessary for SDL2
- files {
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.mm",
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.h",
- }
- end
end
files {
@@ -425,18 +384,17 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/sdl/video.h",
MAME_DIR .. "src/osd/sdl/window.cpp",
MAME_DIR .. "src/osd/sdl/window.h",
+ MAME_DIR .. "src/osd/modules/osdwindow.cpp",
MAME_DIR .. "src/osd/modules/osdwindow.h",
MAME_DIR .. "src/osd/sdl/output.cpp",
MAME_DIR .. "src/osd/sdl/watchdog.cpp",
MAME_DIR .. "src/osd/sdl/watchdog.h",
MAME_DIR .. "src/osd/modules/render/drawsdl.cpp",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- files {
- MAME_DIR .. "src/osd/modules/render/draw13.cpp",
- MAME_DIR .. "src/osd/modules/render/blit13.h",
- }
- end
+ files {
+ MAME_DIR .. "src/osd/modules/render/draw13.cpp",
+ MAME_DIR .. "src/osd/modules/render/blit13.h",
+ }
project ("ocore_" .. _OPTIONS["osd"])
@@ -529,14 +487,14 @@ if _OPTIONS["with-tools"] then
}
if _OPTIONS["targetos"] == "windows" then
- if _OPTIONS["SDL_LIBVER"] == "sdl2" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
links {
"SDL2.dll",
}
else
- links {
- "SDL.dll",
- }
+ local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
end
links {
"psapi",
@@ -547,12 +505,14 @@ if _OPTIONS["with-tools"] then
files {
MAME_DIR .. "src/osd/sdl/main.cpp",
}
- elseif _OPTIONS["targetos"] == "macosx" and _OPTIONS["SDL_LIBVER"] == "sdl" then
- -- SDLMain_tmpl isn't necessary for SDL2
- files {
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.mm",
- }
end
+
+ configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+ configuration { }
+
+ strip()
end
@@ -594,4 +554,6 @@ if _OPTIONS["targetos"] == "macosx" and _OPTIONS["with-tools"] then
files {
MAME_DIR .. "src/osd/sdl/aueffectutil.mm",
}
+
+ strip()
end
diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua
index dd902d1fe60..bdeb7274ef1 100644
--- a/scripts/src/osd/sdl_cfg.lua
+++ b/scripts/src/osd/sdl_cfg.lua
@@ -56,18 +56,12 @@ if _OPTIONS["NO_USE_MIDI"]~="1" and _OPTIONS["targetos"]=="linux" then
}
end
-if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- defines {
- "SDLMAME_SDL2=1",
- }
- if _OPTIONS["SDL2_MULTIAPI"]=="1" then
- defines {
- "SDL2_MULTIAPI",
- }
- end
-else
+defines {
+ "SDLMAME_SDL2=1",
+}
+if _OPTIONS["SDL2_MULTIAPI"]=="1" then
defines {
- "SDLMAME_SDL2=0",
+ "SDL2_MULTIAPI",
}
end
@@ -81,7 +75,7 @@ if BASE_TARGETOS=="unix" then
"SDLMAME_UNIX",
}
if _OPTIONS["targetos"]=="macosx" then
- if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
buildoptions {
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
}
diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua
index fd508e645c5..154d4732bc1 100644
--- a/scripts/src/osd/windows.lua
+++ b/scripts/src/osd/windows.lua
@@ -152,16 +152,17 @@ project ("osd_" .. _OPTIONS["osd"])
}
files {
- MAME_DIR .. "src/osd/modules/render/drawd3d.cpp",
- MAME_DIR .. "src/osd/modules/render/drawd3d.h",
MAME_DIR .. "src/osd/modules/render/d3d/d3d9intf.cpp",
+ MAME_DIR .. "src/osd/modules/render/d3d/d3dintf.h",
MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.cpp",
MAME_DIR .. "src/osd/modules/render/d3d/d3dcomm.h",
MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.h",
- MAME_DIR .. "src/osd/modules/render/d3d/d3dintf.h",
- MAME_DIR .. "src/osd/modules/render/drawdd.cpp",
+ MAME_DIR .. "src/osd/modules/render/drawd3d.cpp",
+ MAME_DIR .. "src/osd/modules/render/drawd3d.h",
MAME_DIR .. "src/osd/modules/render/drawgdi.cpp",
+ MAME_DIR .. "src/osd/modules/render/drawgdi.h",
MAME_DIR .. "src/osd/modules/render/drawnone.cpp",
+ MAME_DIR .. "src/osd/modules/render/drawnone.h",
MAME_DIR .. "src/osd/windows/input.cpp",
MAME_DIR .. "src/osd/windows/input.h",
MAME_DIR .. "src/osd/windows/output.cpp",
@@ -170,6 +171,7 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/windows/video.h",
MAME_DIR .. "src/osd/windows/window.cpp",
MAME_DIR .. "src/osd/windows/window.h",
+ MAME_DIR .. "src/osd/modules/osdwindow.cpp",
MAME_DIR .. "src/osd/modules/osdwindow.h",
MAME_DIR .. "src/osd/windows/winmenu.cpp",
MAME_DIR .. "src/osd/windows/winmain.cpp",
diff --git a/scripts/src/osd/windows_cfg.lua b/scripts/src/osd/windows_cfg.lua
index 19ef05c3ce9..3e656017816 100644
--- a/scripts/src/osd/windows_cfg.lua
+++ b/scripts/src/osd/windows_cfg.lua
@@ -50,7 +50,7 @@ end
if _OPTIONS["USE_SDL"]=="1" then
defines {
- "SDLMAME_SDL2=0",
+ "SDLMAME_SDL2=1",
"USE_XINPUT=0",
"USE_SDL=1",
"USE_SDL_SOUND",