Start of menu embeds.
This commit is contained in:
parent
9fef1c8a3f
commit
a1a54548d5
12 changed files with 172 additions and 35 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1,2 +1,3 @@
|
|||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.xcf filter=lfs diff=lfs merge=lfs -text
|
||||
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -46,3 +46,6 @@ singe/Framework_singe.h
|
|||
singe/controls_cfg.h
|
||||
videotest/indexing/
|
||||
Makefile.in
|
||||
singe/menuBackground.mkv
|
||||
singe/menuBackground_mkv.h
|
||||
singe/Menu_singe.h
|
||||
|
|
BIN
singe/180503_01_PurpleGrid.mp4
(Stored with Git LFS)
Normal file
BIN
singe/180503_01_PurpleGrid.mp4
(Stored with Git LFS)
Normal file
Binary file not shown.
|
@ -40,6 +40,22 @@ function utilDeepCopy(orig)
|
|||
end
|
||||
|
||||
|
||||
function utilDump(o)
|
||||
if type(o) == 'table' then
|
||||
local s = '{ '
|
||||
for k,v in pairs(o) do
|
||||
if type(k) ~= 'number' then
|
||||
k = '"'..k..'"'
|
||||
end
|
||||
s = s .. '['..k..'] = ' .. utilDump(v) .. ','
|
||||
end
|
||||
return s .. '} '
|
||||
else
|
||||
return tostring(o)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
SCANCODE = {
|
||||
A = { name = "A", value = 4 },
|
||||
B = { name = "B", value = 5 },
|
||||
|
|
87
singe/Menu.singe
Normal file
87
singe/Menu.singe
Normal file
|
@ -0,0 +1,87 @@
|
|||
--[[
|
||||
*
|
||||
* Singe 2
|
||||
* Copyright (C) 2006-2020 Scott Duensing <scott@kangaroopunch.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*
|
||||
--]]
|
||||
|
||||
|
||||
dofile("Singe/Framework.singe")
|
||||
|
||||
|
||||
function compareTitles(a, b)
|
||||
return a.TITLE < b.TITLE
|
||||
end
|
||||
|
||||
|
||||
-- Search for games.dat files in subdirectories
|
||||
FOUND_GAMES = {}
|
||||
for dir in lfs.dir(".") do
|
||||
if dir ~= "." and dir ~= ".." then
|
||||
local dirattr = lfs.attributes(dir)
|
||||
if dirattr.mode == "directory" then
|
||||
for file in lfs.dir(dir .. "/.") do
|
||||
if file == "games.dat" then
|
||||
-- Load games.dat
|
||||
dofile(dir .. "/games.dat")
|
||||
for key,value in pairs(GAMES) do
|
||||
table.insert(FOUND_GAMES, value)
|
||||
end
|
||||
GAMES = {}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(FOUND_GAMES, compareTitles)
|
||||
|
||||
|
||||
font = fontLoad("ActionMax/font_LED_Real.ttf", 32);
|
||||
|
||||
vid = videoLoad("ActionMax/video_BlueThunder.mkv");
|
||||
videoPlay(vid)
|
||||
|
||||
discPlay()
|
||||
overlaySetResolution(vldpGetWidth(), vldpGetHeight())
|
||||
colorForeground(255, 0, 0, 255)
|
||||
|
||||
|
||||
|
||||
function box(x1, y1, x2, y2)
|
||||
|
||||
overlayLine(x1, y1, x2, y1)
|
||||
overlayLine(x2, y1, x2, y2)
|
||||
overlayLine(x2, y2, x1, y2)
|
||||
overlayLine(x1, y2, x1, y1)
|
||||
|
||||
end
|
||||
|
||||
|
||||
function onOverlayUpdate()
|
||||
|
||||
overlayClear()
|
||||
|
||||
overlayPrint(1, 1, "Overlay is " .. overlayGetWidth() .. "x" .. overlayGetHeight())
|
||||
|
||||
box(50, 50, 250, 430)
|
||||
videoDraw(vid, 300, 100, 620, 300)
|
||||
fontPrint(300, 310, "Font Test")
|
||||
|
||||
return(OVERLAY_UPDATED)
|
||||
|
||||
end
|
|
@ -31,5 +31,7 @@
|
|||
#include "indexing.h"
|
||||
#include "Framework_singe.h"
|
||||
#include "controls_cfg.h"
|
||||
#include "Menu_singe.h"
|
||||
#include "menuBackground_mkv.h"
|
||||
|
||||
#undef EMBED_HERE
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "indexing.h"
|
||||
#include "Framework_singe.h"
|
||||
#include "controls_cfg.h"
|
||||
#include "Menu_singe.h"
|
||||
#include "menuBackground_mkv.h"
|
||||
|
||||
|
||||
#endif // EMBEDDED_H
|
||||
|
|
|
@ -72,7 +72,7 @@ GAMES = {
|
|||
DESCRIPTION = "Shootout beneath the ocean!"
|
||||
},
|
||||
{
|
||||
TITLE = "The Rescue of Pops Ghostly",
|
||||
TITLE = "Rescue of Pops Ghostly, The",
|
||||
SCRIPT = "ActionMax/PopsGhostly.singe",
|
||||
VIDEO = "ActionMax/frame_PopsGhostly.txt",
|
||||
DATA = "ActionMax",
|
||||
|
|
|
@ -125,6 +125,14 @@ void showUsage(char *name, char *message) {
|
|||
temp = utilCreateString("Singe%cFramework.singe", utilGetPathSeparator());
|
||||
created |= extractFile(temp, Framework_singe, Framework_singe_len);
|
||||
free(temp);
|
||||
// Singe/Menu.singe
|
||||
temp = utilCreateString("Singe%cMenu.singe", utilGetPathSeparator());
|
||||
created |= extractFile(temp, Menu_singe, Menu_singe_len);
|
||||
free(temp);
|
||||
// Singe/menuBackground.mkv
|
||||
temp = utilCreateString("Singe%cmenuBackground.mkv", utilGetPathSeparator());
|
||||
created |= extractFile(temp, menuBackground_mkv, menuBackground_mkv_len);
|
||||
free(temp);
|
||||
// Singe/controls.cfg.example
|
||||
temp = utilCreateString("Singe%ccontrols.cfg.example", utilGetPathSeparator());
|
||||
created |= extractFile(temp, controls_cfg, controls_cfg_len);
|
||||
|
|
|
@ -29,12 +29,14 @@ if [[ -z $1 ]]; then
|
|||
G_THIRDPARTY=$(pwd)/thirdparty
|
||||
G_DEST="$(pwd)/../thirdparty-build/${G_PLATFORM}/${G_BITS}"
|
||||
G_TYPE=static
|
||||
G_PROJECT=$(pwd)
|
||||
else
|
||||
G_THIRDPARTY=$1
|
||||
G_BITS=$3
|
||||
G_PLATFORM=$4
|
||||
G_DEST=$2/$4/$3
|
||||
G_TYPE=static
|
||||
G_TYPE=$5
|
||||
G_PROJECT=$6
|
||||
fi
|
||||
|
||||
G_INSTALLED="${G_DEST}/installed"
|
||||
|
@ -553,7 +555,9 @@ if [[ ! -e "${G_INSTALLED}/lib/everything.a" ]]; then
|
|||
popd
|
||||
fi
|
||||
|
||||
rm font.h icon.h kangarooPunchLogo.h singeLogo.h laserDisc.h magnifyingGlass.h indexing.h Framework_singe.h controls_cfg.h
|
||||
pushd "${G_PROJECT}"
|
||||
|
||||
rm font.h icon.h kangarooPunchLogo.h singeLogo.h laserDisc.h magnifyingGlass.h indexing.h Framework_singe.h controls_cfg.h Menu_singe.h || true
|
||||
|
||||
# === Overlay Font ===
|
||||
createEmbeddedImage font
|
||||
|
@ -582,6 +586,16 @@ createEmbeddedBinary Framework.singe Framework_singe.h FRAMEWORK_SINGE_H
|
|||
# === Default Config ===
|
||||
createEmbeddedBinary controls.cfg controls_cfg.h CONTROLS_CFG_H
|
||||
|
||||
# === Singe Menu App ===
|
||||
createEmbeddedBinary Menu.singe Menu_singe.h MENU_SINGE_H
|
||||
|
||||
# === Singe Menu Background Video ===
|
||||
if [[ ! -f menuBackground.mkv ]]; then
|
||||
ffmpeg -i 180503_01_PurpleGrid.mp4 -filter:v 'crop=ih/3*4:ih' -vf scale=720:480 -c:v libx264 -c:a copy menuBackground.mkv
|
||||
createEmbeddedBinary menuBackground.mkv menuBackground_mkv.h MENUBACKGROUND_MKV_H
|
||||
fi
|
||||
|
||||
popd
|
||||
|
||||
# Clean Uo
|
||||
case "${G_PLATFORM}" in
|
||||
|
|
|
@ -3150,8 +3150,8 @@ void singe(SDL_Window *window, SDL_Renderer *renderer) {
|
|||
SDL_Rect windowTarget;
|
||||
SDL_Rect sindenWhite;
|
||||
SDL_Rect sindenBlack;
|
||||
SDL_Color sindenWhiteColor;
|
||||
SDL_Color sindenBlackColor;
|
||||
SDL_Color sindenWhiteColor = { 255, 255, 255, 255 };
|
||||
SDL_Color sindenBlackColor = { 0, 0, 0, 255 };;
|
||||
SDL_Texture *overlayTexture = NULL;
|
||||
SpriteT *sprite = NULL;
|
||||
SpriteT *spriteTemp = NULL;
|
||||
|
@ -3531,9 +3531,9 @@ void singe(SDL_Window *window, SDL_Renderer *renderer) {
|
|||
}
|
||||
|
||||
// Grab mouse
|
||||
// _global.mouseGrabbed = true;
|
||||
// SDL_SetWindowGrab(_global.window, SDL_TRUE);
|
||||
// SDL_ShowCursor(SDL_DISABLE);
|
||||
_global.mouseGrabbed = true;
|
||||
SDL_SetWindowGrab(_global.window, SDL_TRUE);
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
|
||||
// Clear axis cache
|
||||
for (x=0; x<AXIS_COUNT; x++) {
|
||||
|
|
|
@ -51,10 +51,10 @@ platformLinux:PLATFORM="linux"
|
|||
platformMingw:PLATFORM="mingw"
|
||||
platformPi:PLATFORM="pi"
|
||||
|
||||
# === Third Party Builds ===
|
||||
# === Third Party Builds === ***FIX*** Running this in the build causes issues with incomplete generated header files
|
||||
|
||||
static {
|
||||
BUILDTHIRDARGS = \"$$PWD/thirdparty\" \"$$OUT_PWD/../thirdparty-build\" $$BITNESS $$PLATFORM $$LIBTYPE
|
||||
static_FALSE {
|
||||
BUILDTHIRDARGS = \"$$PWD/thirdparty\" \"$$OUT_PWD/../thirdparty-build\" $$BITNESS $$PLATFORM $$LIBTYPE \"$$PWD\"
|
||||
|
||||
platformLinux {
|
||||
BUILDTHIRD.commands = bash $$PWD/preBuild.sh $$BUILDTHIRDARGS
|
||||
|
@ -152,7 +152,9 @@ HEADERS += \
|
|||
laserDisc.h \
|
||||
magnifyingGlass.h \
|
||||
indexing.h \
|
||||
controls_cfg.h
|
||||
controls_cfg.h \
|
||||
Menu_singe.h \
|
||||
menuBackground_mkv.h
|
||||
|
||||
SOURCES += \
|
||||
$$ARGPARSER_SOURCES \
|
||||
|
@ -252,7 +254,8 @@ OTHER_FILES += \
|
|||
singe.rc \
|
||||
controls.cfg \
|
||||
Framework.singe \
|
||||
games.dat
|
||||
games.dat \
|
||||
Menu.singe
|
||||
|
||||
platformLinux {
|
||||
#QMAKE_POST_LINK += bash $$PWD/postLink.sh "$$PWD" "$$DESTDIR" "$$TARGET"
|
||||
|
@ -267,5 +270,3 @@ platformLinux {
|
|||
|
||||
write_file("source.inc.sh", FILEINFO)
|
||||
}
|
||||
|
||||
debug:message("Debugging")
|
||||
|
|
Loading…
Add table
Reference in a new issue