Skip to content
Browse files

Add event decoding

  • Loading branch information...
1 parent 8e41eef commit 5d078e4b33e3ec0d23f177e97834f64fa513f52c @willglynn willglynn committed Dec 21, 2011
Showing with 19 additions and 7 deletions.
  1. +0 −5 src/game/data_missions.c
  2. +19 −2 src/utils/data_decoder.c
View
5 src/game/data_missions.c
@@ -1,5 +0,0 @@
-#include "Buzz_inc.h"
-
-struct mStr missions[] = {
-
-};
View
21 src/utils/data_decoder.c
@@ -121,6 +121,21 @@ void write_custom_men(FILE * fp) {
write_men(fp, "custom_men");
}
+void write_events(FILE * fp)
+{
+ struct event {
+ char description[250];
+ } __attribute__((packed)) record;
+
+ printf("struct event_t events[] = {\n");
+ while (fread(&record, sizeof(record), 1, fp)) {
+ RecordStart();
+ String(description);
+ RecordEnd();
+ }
+ printf("};\n\n");
+}
+
void decode(const char * dir, const char * filename, void(*function)(FILE *))
{
char full_path[512];
@@ -151,9 +166,11 @@ int main(int argc, char ** argv)
}
decode(argv[1], "mission.dat", write_mission);
-
+
decode(argv[1], "crew.dat", write_historical_men);
decode(argv[1], "user.dat", write_custom_men);
-
+
+ decode(argv[1], "event.dat", write_events);
+
return 0;
}

0 comments on commit 5d078e4

Please sign in to comment.
Something went wrong with that request. Please try again.