Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/CLIHELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ On _non_ RaspiOS-based RetroPie-Installments put the file from

In either case: Open a new bash and press ++tab++ key twice to see it in action.

### Disable Terminal Colors

By default Skyscraper will use ANSI terminal colors. However, colors will be not
be used in the output when you run Skyscraper via a serial console or you apply
file redirection e.g., `Skyscraper ... > out.log`. In any case you can manually
enforce no color output by setting the environment variable `NO_COLOR` to a
non-zero value (a value of zero will show colors). For example:

```bash
NO_COLOR=1 Skyscraper ...
```

The [no-color.org](https://no-color.org) website has additional information.

## Short Options

The most prevalent short options you will use are most likely [`-s`](#-s-module)
Expand Down
159 changes: 81 additions & 78 deletions skyscraper.pro
Original file line number Diff line number Diff line change
Expand Up @@ -85,114 +85,117 @@ CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT

include(win32/skyscraper.pro)

HEADERS += src/skyscraper.h \
src/netmanager.h \
src/netcomm.h \
src/xmlreader.h \
src/settings.h \
HEADERS += \
src/abstractfrontend.h \
src/abstractscraper.h \
src/arcadedb.h \
src/attractmode.h \
src/batocera.h \
src/cache.h \
src/cli.h \
src/compositor.h \
src/config.h \
src/strtools.h \
src/imgtools.h \
src/esgamelist.h \
src/scraperworker.h \
src/cache.h \
src/localscraper.h \
src/importscraper.h \
src/gameentry.h \
src/abstractscraper.h \
src/abstractfrontend.h \
src/crc32.h \
src/emulationstation.h \
src/esde.h \
src/batocera.h \
src/attractmode.h \
src/pegasus.h \
src/openretro.h \
src/thegamesdb.h \
src/zxinfodk.h \
src/screenscraper.h \
src/crc32.h \
src/mobygames.h \
src/gamebase.h \
src/igdb.h \
src/arcadedb.h \
src/platform.h \
src/layer.h \
src/fxshadow.h \
src/esgamelist.h \
src/fxbalance.h \
src/fxblur.h \
src/fxmask.h \
src/fxframe.h \
src/fxrounded.h \
src/fxstroke.h \
src/fxbrightness.h \
src/fxcolorize.h \
src/fxcontrast.h \
src/fxbalance.h \
src/fxopacity.h \
src/fxframe.h \
src/fxgamebox.h \
src/fxhue.h \
src/fxsaturation.h \
src/fxcolorize.h \
src/fxmask.h \
src/fxopacity.h \
src/fxrotate.h \
src/fxrounded.h \
src/fxsaturation.h \
src/fxscanlines.h \
src/fxshadow.h \
src/fxstroke.h \
src/gamebase.h \
src/gameentry.h \
src/igdb.h \
src/imgtools.h \
src/importscraper.h \
src/layer.h \
src/localscraper.h \
src/mobygames.h \
src/nametools.h \
src/netcomm.h \
src/netmanager.h \
src/nocolor.h \
src/openretro.h \
src/pathtools.h \
src/queue.h
src/pegasus.h \
src/platform.h \
src/queue.h \
src/scraperworker.h \
src/screenscraper.h \
src/settings.h \
src/skyscraper.h \
src/strtools.h \
src/thegamesdb.h \
src/xmlreader.h \
src/zxinfodk.h

SOURCES += src/main.cpp \
src/skyscraper.cpp \
src/netmanager.cpp \
src/netcomm.cpp \
src/xmlreader.cpp \
src/settings.cpp \
src/abstractfrontend.cpp \
src/abstractscraper.cpp \
src/arcadedb.cpp \
src/attractmode.cpp \
src/batocera.cpp \
src/cache.cpp \
src/cli.cpp \
src/compositor.cpp \
src/config.cpp \
src/strtools.cpp \
src/imgtools.cpp \
src/esgamelist.cpp \
src/scraperworker.cpp \
src/cache.cpp \
src/localscraper.cpp \
src/importscraper.cpp \
src/gameentry.cpp \
src/abstractscraper.cpp \
src/abstractfrontend.cpp \
src/crc32.cpp \
src/emulationstation.cpp \
src/esde.cpp \
src/batocera.cpp \
src/attractmode.cpp \
src/pegasus.cpp \
src/openretro.cpp \
src/thegamesdb.cpp \
src/zxinfodk.cpp \
src/screenscraper.cpp \
src/crc32.cpp \
src/mobygames.cpp \
src/gamebase.cpp \
src/igdb.cpp \
src/arcadedb.cpp \
src/platform.cpp \
src/layer.cpp \
src/fxshadow.cpp \
src/esgamelist.cpp \
src/fxbalance.cpp \
src/fxblur.cpp \
src/fxmask.cpp \
src/fxframe.cpp \
src/fxrounded.cpp \
src/fxstroke.cpp \
src/fxbrightness.cpp \
src/fxcolorize.cpp \
src/fxcontrast.cpp \
src/fxbalance.cpp \
src/fxopacity.cpp \
src/fxframe.cpp \
src/fxgamebox.cpp \
src/fxhue.cpp \
src/fxsaturation.cpp \
src/fxcolorize.cpp \
src/fxmask.cpp \
src/fxopacity.cpp \
src/fxrotate.cpp \
src/fxrounded.cpp \
src/fxsaturation.cpp \
src/fxscanlines.cpp \
src/fxshadow.cpp \
src/fxstroke.cpp \
src/gamebase.cpp \
src/gameentry.cpp \
src/igdb.cpp \
src/imgtools.cpp \
src/importscraper.cpp \
src/layer.cpp \
src/localscraper.cpp \
src/mobygames.cpp \
src/nametools.cpp \
src/netcomm.cpp \
src/netmanager.cpp \
src/nocolor.cpp \
src/openretro.cpp \
src/pathtools.cpp \
src/queue.cpp
src/pegasus.cpp \
src/platform.cpp \
src/queue.cpp \
src/scraperworker.cpp \
src/screenscraper.cpp \
src/settings.cpp \
src/skyscraper.cpp \
src/strtools.cpp \
src/thegamesdb.cpp \
src/xmlreader.cpp \
src/zxinfodk.cpp

SUBDIRS += \
win32/skyscraper.pro
6 changes: 3 additions & 3 deletions src/abstractfrontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ AbstractFrontend::~AbstractFrontend() {}
void AbstractFrontend::setConfig(Settings *config) { this->config = config; }

void AbstractFrontend::sortEntries(QList<GameEntry> &gameEntries) {
printf("Sorting entries...");
ncprintf("Sorting entries...");
int dots = 0;
std::sort(gameEntries.begin(), gameEntries.end(),
[&dots](const GameEntry a, const GameEntry b) -> bool {
if (dots % 1000 == 0) {
printf(".");
ncprintf(".");
fflush(stdout);
}
dots++;
Expand All @@ -60,7 +60,7 @@ void AbstractFrontend::sortEntries(QList<GameEntry> &gameEntries) {

return firstTitle < secondTitle;
});
printf(" \033[1;32mDone!\033[0m\n");
ncprintf(" \033[1;32mDone!\033[0m\n");
}

QString AbstractFrontend::getTargetFilePath(const GameEntry::Types t,
Expand Down
17 changes: 9 additions & 8 deletions src/abstractscraper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ void AbstractScraper::getGameData(GameEntry &game) {
netComm->request(game.url);
q.exec();
data = netComm->getData();
// printf("URL IS: '%s'\n", game.url.toStdString().c_str());
// printf("DATA IS:\n'%s'\n", data.data());
// ncprintf("URL IS: '%s'\n", game.url.toStdString().c_str());
// ncprintf("DATA IS:\n'%s'\n", data.data());
populateGameEntry(game);
}

Expand Down Expand Up @@ -743,13 +743,14 @@ QVariantMap AbstractScraper::readJson(const QString &filename) {
}
}
if (!canRead) {
printf("\033[1;31mFile '%s' not found or not readable. Please "
"fix.\nNot scraping...\n\033[0m",
filename.toUtf8().constData());
ncprintf("\033[1;31mFile '%s' not found or not readable. Please "
"fix.\nNot scraping...\n\033[0m",
filename.toUtf8().constData());
} else if (jsonObj.isEmpty()) {
printf("\033[1;31mFile '%s' has invalid JSON format. Please fix.\nNot "
"scraping...\n\033[0m",
filename.toUtf8().constData());
ncprintf(
"\033[1;31mFile '%s' has invalid JSON format. Please fix.\nNot "
"scraping...\n\033[0m",
filename.toUtf8().constData());
}
return m;
}
Expand Down
23 changes: 12 additions & 11 deletions src/attractmode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ void AttractMode::skipExisting(QList<GameEntry> &gameEntries,
QSharedPointer<Queue> queue) {
gameEntries = oldEntries;

printf("Resolving missing entries...");
ncprintf("Resolving missing entries...");
int dots = 0;
for (auto const &ge : gameEntries) {
dots++;
if (dots % 100 == 0) {
printf(".");
ncprintf(".");
fflush(stdout);
}
for (auto qi = queue->begin(), end = queue->end(); qi != end; ++qi) {
Expand All @@ -99,7 +99,7 @@ void AttractMode::skipExisting(QList<GameEntry> &gameEntries,
}
}
}
printf(" \033[1;32mDone!\033[0m\n");
ncprintf(" \033[1;32mDone!\033[0m\n");
}

void AttractMode::preserveFromOld(GameEntry &entry) {
Expand Down Expand Up @@ -161,7 +161,7 @@ void AttractMode::assembleList(QString &finalOutput,

for (auto &entry : gameEntries) {
if (++dots % dotMod == 0) {
printf(".");
ncprintf(".");
fflush(stdout);
}

Expand Down Expand Up @@ -209,8 +209,9 @@ void AttractMode::assembleList(QString &finalOutput,

void AttractMode::checkReqs() {
if (config->frontendExtra.isEmpty()) {
printf("Frontend 'attractmode' requires emulator set with '-e'. Check "
"'--help' for more information.\n");
ncprintf(
"Frontend 'attractmode' requires emulator set with '-e'. Check "
"'--help' for more information.\n");
emit die(
1, "incomplete configuration",
"Frontend 'attractmode' requires '-e' or 'emulator=' to be set");
Expand All @@ -230,7 +231,7 @@ void AttractMode::checkReqs() {
}
}

printf("Looking for emulator cfg file:\n");
ncprintf("Looking for emulator cfg file:\n");

// For RetroPie this is linked directly to
// /opt/retropie/configs/all/attractmode/emulators/
Expand All @@ -241,7 +242,7 @@ void AttractMode::checkReqs() {
return;
}

printf("Cannot locate emulator cfg file, exiting...\n");
ncprintf("Cannot locate emulator cfg file, exiting...\n");
emit die(1,
QString("can neither access '%1' nor '%2")
.arg(config->frontendExtra)
Expand All @@ -251,14 +252,14 @@ void AttractMode::checkReqs() {

bool AttractMode::checkEmulatorFile(QString fileName) {
QFileInfo info(fileName);
printf("Trying '%s'... ", info.absoluteFilePath().toStdString().c_str());
ncprintf("Trying '%s'... ", info.absoluteFilePath().toStdString().c_str());

if (info.exists() && info.isFile()) {
config->frontendExtra = info.absoluteFilePath();
printf("\033[1;32mFound!\033[0m\n\n");
ncprintf("\033[1;32mFound!\033[0m\n\n");
return true;
} else {
printf("Not found!\n");
ncprintf("Not found!\n");
return false;
}
}
Expand Down
Loading
Loading