Skip to content

Commit

Permalink
Add proper -usedidx messages
Browse files Browse the repository at this point in the history
Because -usedidx doesn't extract anything.
  • Loading branch information
Voros2 committed Aug 16, 2017
1 parent 6f2e674 commit 115658e
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions src/extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,11 @@ void XTRextractWAD(const char *doomwad, const char *DataDir, const char
** GRAPHICS
*/
if (select & BGRAPHIC) {
Phase("EX35", "Extracting graphics...");
if ((cusage != NULL) == false) {

This comment has been minimized.

Copy link
@fragglet

fragglet Sep 4, 2017

Heads-up: doing something like this:

if (something == false) {

or

if (something == true) {

is never necessary. In fact it makes code harder to read. Instead you can just do:

if (!something) {

or

if (something) {

In this particular case you could have just written:

if (cusage == NULL) {
Phase("EX35", "Extracting graphics...");
} else {
Phase("UX01", "Reading graphics...");
}
ostart = 0x80000000L;
osize = 0;
for (EntryFound = false, p = 0; p < pnb; p++) {
Expand Down Expand Up @@ -620,7 +624,11 @@ void XTRextractWAD(const char *doomwad, const char *DataDir, const char
** SPRITES
*/
if (select & BSPRITE) {
Phase("EX40", "Extracting sprites...");
if ((cusage != NULL) == false) {
Phase("EX40", "Extracting sprites...");
} else {
Phase("UX02", "Reading sprites...");
}
ostart = 0x80000000L;
osize = 0;
for (EntryFound = false, p = 0; p < pnb; p++) {
Expand Down Expand Up @@ -659,7 +667,11 @@ void XTRextractWAD(const char *doomwad, const char *DataDir, const char
** PATCHES
*/
if (select & BPATCH) {
Phase("EX45", "Extracting patches...");
if ((cusage != NULL) == false) {
Phase("EX45", "Extracting patches...");
} else {
Phase("UX03", " Reading patches...");
}
for (EntryFound = false, p = 0; p < pnb; p++) {
if ((piden[p] & EMASK) == EPATCH) {
if (EntryFound != true) {
Expand Down Expand Up @@ -692,7 +704,11 @@ void XTRextractWAD(const char *doomwad, const char *DataDir, const char
** FLATS
*/
if (select & BFLAT) {
Phase("EX50", "Extracting flats...");
if ((cusage != NULL) == false) {
Phase("EX50", "Extracting flats...");
} else {
Phase("UX05", "Reading flats...");
}
ostart = 0x80000000L;
osize = 0;
for (EntryFound = false, p = 0; p < pnb; p++) {
Expand Down Expand Up @@ -729,7 +745,11 @@ void XTRextractWAD(const char *doomwad, const char *DataDir, const char
/* Extract all sneaps */
if (select & BSNEAP) {
ENTRY type = ESNEAP;
Phase("EX55", "Extracting %s...", entry_type_plural(type));
if ((cusage != NULL) == false) {
Phase("EX55", "Extracting %s...", entry_type_plural(type));
} else {
Phase("UX06", " Reading %s...", entry_type_plural(type));
}
ostart = 0x80000000L;
osize = 0;

Expand Down Expand Up @@ -773,7 +793,11 @@ void XTRextractWAD(const char *doomwad, const char *DataDir, const char
/* Extract all sneats */
if (select & BSNEAT) {
ENTRY type = ESNEAT;
Phase("EX60", "Extracting %s...", entry_type_plural(type));
if ((cusage != NULL) == false) {
Phase("EX60", "Extracting %s...", entry_type_plural(type));
} else {
Phase("UX07", "Reading %s...", entry_type_plural(type));
}
ostart = 0x80000000L;
osize = 0;

Expand Down

0 comments on commit 115658e

Please sign in to comment.