rbutil: extend game file installation

RbUtil will now install freely distributable data files for Duke Nukem 3D,
Quake, SGT-Puzzles (fonts), Wolfenstein 3-D, and Another World. Currently
the urls point to my personal server, pending upload to the main download
server.

Change-Id: I2806fd1ad7e9bb0fcb7aee5444840708e6e63032
This commit is contained in:
Franklin Wei 2019-10-30 01:17:16 -04:00
parent ec8b3d3147
commit 26b55ba5f0
4 changed files with 50 additions and 7 deletions

View file

@ -42,6 +42,11 @@ const static struct {
{ SystemInfo::DailyVoiceUrl, "daily_voice_url", "" }, { SystemInfo::DailyVoiceUrl, "daily_voice_url", "" },
{ SystemInfo::ReleaseVoiceUrl, "release_voice_url", "" }, { SystemInfo::ReleaseVoiceUrl, "release_voice_url", "" },
{ SystemInfo::DoomUrl, "doom_url", "" }, { SystemInfo::DoomUrl, "doom_url", "" },
{ SystemInfo::Duke3DUrl, "duke3d_url", "" },
{ SystemInfo::PuzzFontsUrl, "puzzfonts_url", "" },
{ SystemInfo::QuakeUrl, "quake_url", "" },
{ SystemInfo::Wolf3DUrl, "wolf3d_url", "" },
{ SystemInfo::XWorldUrl, "xworld_url", "" },
{ SystemInfo::ReleaseUrl, "release_url", "" }, { SystemInfo::ReleaseUrl, "release_url", "" },
{ SystemInfo::DailyUrl, "daily_url", "" }, { SystemInfo::DailyUrl, "daily_url", "" },
{ SystemInfo::BuildInfoUrl, "build_info_url", "" }, { SystemInfo::BuildInfoUrl, "build_info_url", "" },

View file

@ -44,6 +44,11 @@ class SystemInfo : public QObject
DailyFontUrl, DailyFontUrl,
DailyVoiceUrl, DailyVoiceUrl,
DoomUrl, DoomUrl,
Duke3DUrl,
QuakeUrl,
PuzzFontsUrl,
Wolf3DUrl,
XWorldUrl,
ReleaseUrl, ReleaseUrl,
ReleaseVoiceUrl, ReleaseVoiceUrl,
ReleaseFontUrl, ReleaseFontUrl,

View file

@ -483,22 +483,51 @@ void SelectiveInstallWidget::installThemes(void)
} }
} }
static const struct {
const char *name;
const char *pluginpath;
SystemInfo::SystemInfos zipurl; // add new games to SystemInfo
} GamesList[] = {
{ "Doom", "/.rockbox/rocks/games/doom.rock", SystemInfo::DoomUrl },
{ "Duke3D", "/.rockbox/rocks/games/duke3d.rock", SystemInfo::Duke3DUrl },
{ "Quake", "/.rockbox/rocks/games/quake.rock", SystemInfo::QuakeUrl },
{ "Puzzles fonts", "/.rockbox/rocks/games/sgt-blackbox.rock", SystemInfo::PuzzFontsUrl },
{ "Wolf3D", "/.rockbox/rocks/games/wolf3d.rock", SystemInfo::Wolf3DUrl },
{ "XWorld", "/.rockbox/rocks/games/xworld.rock", SystemInfo::XWorldUrl },
};
void SelectiveInstallWidget::installGamefiles(void) void SelectiveInstallWidget::installGamefiles(void)
{ {
if(ui.gamefileCheckbox->isChecked()) { if(ui.gamefileCheckbox->isChecked()) {
// check if installed Rockbox has doom plugin. If not disable doom. // build a list of zip urls that we need, then install
if(!QFileInfo(m_mountpoint + "/.rockbox/rocks/games/doom.rock").exists()) { QStringList gameUrls;
m_logger->addItem(tr("Your installation doesn't require game files, skipping."), LOGINFO); QStringList gameNames;
emit installSkipped(false);
for(unsigned int i = 0; i < sizeof(GamesList) / sizeof(GamesList[0]); i++)
{
// check if installed Rockbox has this plugin.
if(QFileInfo(m_mountpoint + GamesList[i].pluginpath).exists()) {
gameNames.append(GamesList[i].name);
gameUrls.append(SystemInfo::value(GamesList[i].zipurl).toString());
LOG_INFO() << gameUrls.at(gameUrls.size() - 1);
} }
}
if(gameUrls.size() == 0)
{
m_logger->addItem(tr("Your installation doesn't require any game files, skipping."), LOGINFO);
emit installSkipped(false);
return;
}
LOG_INFO() << "installing gamefiles"; LOG_INFO() << "installing gamefiles";
// create new zip installer // create new zip installer
if(m_zipinstaller != NULL) m_zipinstaller->deleteLater(); if(m_zipinstaller != NULL) m_zipinstaller->deleteLater();
m_zipinstaller = new ZipInstaller(this); m_zipinstaller = new ZipInstaller(this);
m_zipinstaller->setUrl(SystemInfo::value(SystemInfo::DoomUrl).toString()); m_zipinstaller->setUrl(gameUrls);
m_zipinstaller->setLogSection("Game Addons"); m_zipinstaller->setLogSection(gameNames);
m_zipinstaller->setLogVersion(); m_zipinstaller->setLogVersion();
m_zipinstaller->setMountPoint(m_mountpoint); m_zipinstaller->setMountPoint(m_mountpoint);
if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
@ -523,4 +552,3 @@ void SelectiveInstallWidget::changeEvent(QEvent *e)
QWidget::changeEvent(e); QWidget::changeEvent(e);
} }
} }

View file

@ -25,6 +25,11 @@ daily_font_url=http://download.rockbox.org/daily/fonts/rockbox-fonts.zip
; other ; other
manual_url=http://download.rockbox.org/manual/%MANUALBASENAME%.%EXTENSION% manual_url=http://download.rockbox.org/manual/%MANUALBASENAME%.%EXTENSION%
doom_url=http://download.rockbox.org/useful/rockdoom.zip doom_url=http://download.rockbox.org/useful/rockdoom.zip
duke3d_url=http://www.fwei.tk/pub/rockboxgames/duke3d.zip
quake_url=http://www.fwei.tk/pub/rockboxgames/quake.zip
puzzfonts_url=http://www.fwei.tk/pub/rockboxgames/sgt-fonts.zip
wolf3d_url=http://www.fwei.tk/pub/rockboxgames/wolf3d.zip
xworld_url=http://www.fwei.tk/pub/rockboxgames/xworld.zip
rbutil_url=http://download.rockbox.org/rbutil/ rbutil_url=http://download.rockbox.org/rbutil/
; [platforms] is used to determine the order in the device tree. ; [platforms] is used to determine the order in the device tree.