Skip to content

Commit

Permalink
dat-to-json rev1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alsed committed Sep 24, 2024
1 parent 7e0680c commit 2d0a4de
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 158 deletions.
62 changes: 62 additions & 0 deletions data/gamedata/mission.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/game/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ struct mStr {
ar(CEREAL_NVP(Lun));
ar(CEREAL_NVP(Lun));
ar(CEREAL_NVP(mEq));
ar(CEREAL_NVP(mCrew));
ar(CEREAL_NVP(mVab));
ar(CEREAL_NVP(PCat));
ar(CEREAL_NVP(LMAd));
Expand Down
2 changes: 1 addition & 1 deletion src/game/fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ try_find_file(const char *name, const char *mode, int type)
char *where = "";
const char *newmode = mode;

DEBUG2("looking for file `%s'", name);
TRACE2("looking for file `%s'", name);

/** \note allows write access only to savegame files */
if (type != FT_SAVE) {
Expand Down
8 changes: 5 additions & 3 deletions src/game/future.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ void DrawFuture(char plr, int mis, char pad, MissionNavigator &nav)
/* lines of text are 1:8,30 2:8,37 3:8,44 */
switch (pad) { // These used to say Pad 1, 2, 3 -Leon
case 0:
draw_string(8, 30, "PAD A:");
draw_string(8, 30, "PAD: A");
break;

case 1:
draw_string(8, 30, "PAD B:");
draw_string(8, 30, "PAD: B");
break;

case 2:
draw_string(8, 30, "PAD C:");
draw_string(8, 30, "PAD: C");
break;
}

Expand Down Expand Up @@ -1006,6 +1006,8 @@ void Future(char plr)
Data->P[plr].Future[pad].Duration = duration;

int Ok = HardCrewAssign(plr, pad, misType, NewType);
DEBUG5("HardCrewAssign(plr %d, pad %d, misType %d, mCrew %d)", plr, pad, misType, NewType);
DEBUG2("Ok = %d", Ok);

local2.copyTo(display::graphics.legacyScreen(), 74, 3);

Expand Down
8 changes: 4 additions & 4 deletions src/game/mc2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ MissionParse(char plr, struct mStr &misType, char pad)
STEP = 0;
loc = pad;

char MCode[misType.Code.length() + 1];
memset(MCode, 0, sizeof(*MCode));
char *MCode = new char[misType.Code.length() + 1];
std::strcpy(MCode, misType.Code.c_str());
DEBUG2("MCode: %s", MCode);

for (i = 0; MCode[i] != '|'; ++i) {
switch (MCode[i]) {
Expand All @@ -108,8 +108,7 @@ MissionParse(char plr, struct mStr &misType, char pad)

// printf(" :Delay of %d seasons\n", MCode[i + 1] - 0x30);
for (j = 0; j < (MCode[i + 1] - 0x30); j++) {
MissionSteps(plr, MCode[i + 2], STEP++, loc - pad,
misType);
MissionSteps(plr, MCode[i + 2], STEP++, loc - pad, misType);
}

i += 2;
Expand Down Expand Up @@ -177,6 +176,7 @@ MissionParse(char plr, struct mStr &misType, char pad)
break;
}
}
delete MCode;
}


Expand Down
5 changes: 2 additions & 3 deletions src/game/mis_m.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ void BranchIfAlive(int *FNote);
*/
void GetFailStat(struct XFails *Now, char *FName, int rnum)
{
DEBUG2("->GetFailStat(struct XFails *Now,char *FName,int rnum %d)",
rnum);
DEBUG3("->GetFailStat(XFails *Now, FName %s, rnum %d)", FName, rnum);
assert(Now != NULL);

for (int i = 0; i < Assets->fails.size(); i++) {
Expand Down Expand Up @@ -398,7 +397,7 @@ void MisCheck(char plr, char mpad)
if (tomflag) {
GetFailStat(&Now, Mev[STEP].FName, 7595);
} else {
DEBUG3("Failing !tomflag - calling GetFailStat(&Now, Mev[STEP].FName %s, MEV[STEP].rnum %d))", Mev[STEP].FName, Mev[STEP].rnum);
DEBUG1("Failing !tomflag - calling GetFailStat");
GetFailStat(&Now, Mev[STEP].FName, Mev[STEP].rnum); // all others
}

Expand Down
4 changes: 2 additions & 2 deletions src/game/mission_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ std::vector<struct mStr> GetMissionData()

cereal::JSONInputArchive ar(file);
ar(CEREAL_NVP(missionData));
INFO1("missionData successfully uploaded.");
DEBUG1("missionData successfully uploaded.");
return missionData;
}

Expand All @@ -274,7 +274,7 @@ struct mStr GetMissionPlan(const int code)
}

mStr mission = missionData[code];
INFO2("mission plan `%d' loaded.", code);
TRACE2("mission plan `%d' loaded.", code);

return mission;
}
Expand Down
6 changes: 3 additions & 3 deletions src/game/mmfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ mm_open_fp(mm_file *mf, FILE *file)
goto err;
}

DEBUG1("trying theora decoder...");
TRACE1("trying theora decoder...");
res = init_theora(mf, &pg);

if (res < 0) {
Expand All @@ -430,7 +430,7 @@ mm_open_fp(mm_file *mf, FILE *file)
have_theora = !!res * MEDIA_VIDEO;
}

DEBUG1("trying vorbis decoder...");
TRACE1("trying vorbis decoder...");
res = init_vorbis(mf, &pg);

if (res < 0) {
Expand All @@ -442,7 +442,7 @@ mm_open_fp(mm_file *mf, FILE *file)
if (have_vorbis) {
unsigned c = 0, r = 0;
mm_audio_info(mf, &c, &r);
INFO3("audio %u channel(s) at %u Hz", c, r);
TRACE3("audio %u channel(s) at %u Hz", c, r);
}

if (have_theora) {
Expand Down
Loading

0 comments on commit 2d0a4de

Please sign in to comment.