X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=dungeon.c;h=fea3c6d217cda8d48857e75ee6f88e4820190a80;hp=2e5d29686ad4faf4d75fa995a444652b472c07ef;hb=25077d0b4eb1d6a85140c01092be7203ca64a49c;hpb=44abab29e31359eb21038ee2ba8f8f43480b4caa diff --git a/dungeon.c b/dungeon.c index 2e5d296..fea3c6d 100644 --- a/dungeon.c +++ b/dungeon.c @@ -17,6 +17,7 @@ #include #include #include +#include "newdb.h" #include "common.h" // Global variables for use in functions below that can gradually disappear as code is cleaned up @@ -30,10 +31,7 @@ long LINUSE; long TRVS; long TRNVLS; long TABNDX; -long OBJSND[NOBJECTS + 1]; -long OBJTXT[NOBJECTS + 1]; -long KEY[LOCSIZ + 1]; -long LOCSND[LOCSIZ + 1]; +long KEY[NLOCATIONS + 1]; long LINES[LINSIZ + 1]; long TRAVEL[TRVSIZ + 1]; long KTAB[TABSIZ + 1]; @@ -301,20 +299,14 @@ static void read_hints(FILE* database) } } -/* Read the sound/text info, store in OBJSND, OBJTXT, LOCSND. */ +/* Read the sound/text info */ static void read_sound_text(FILE* database) { long K; while ((K = GETNUM(database)) != -1) { long KK = GETNUM(NULL); long I = GETNUM(NULL); - if (I != 0) { - OBJSND[K] = (KK > 0 ? KK : 0); - OBJTXT[K] = (I > 0 ? I : 0); - continue; - } - - LOCSND[K] = KK; + /* this stuff is in YAML now */ } } @@ -329,13 +321,8 @@ static int read_database(FILE* database) * pointer-words in lines. PTEXT(N) points to * message for game.prop(N)=0. Successive prop messages are * found by chasing pointers. */ - for (int I = 1; I <= NOBJECTS; I++) { - OBJSND[I] = 0; - OBJTXT[I] = 0; - } - for (int I = 1; I <= LOCSIZ; I++) { + for (int I = 1; I <= NLOCATIONS; I++) { KEY[I] = 0; - LOCSND[I] = 0; } LINUSE = 1; @@ -444,10 +431,7 @@ static void write_file(FILE* header_file) fprintf(header_file, "\n"); // content variables - write_1d(header_file, OBJSND, NOBJECTS + 1, "OBJSND"); - write_1d(header_file, OBJTXT, NOBJECTS + 1, "OBJTXT"); - write_1d(header_file, KEY, LOCSIZ + 1, "KEY"); - write_1d(header_file, LOCSND, LOCSIZ + 1, "LOCSND"); + write_1d(header_file, KEY, NLOCATIONS + 1, "KEY"); write_1d(header_file, TRAVEL, TRVSIZ + 1, "TRAVEL"); write_1d(header_file, KTAB, TABSIZ + 1, "KTAB"); write_1d(header_file, ATAB, TABSIZ + 1, "ATAB");