From f80df5bdf0a7554aa93c811e4989f790083206a1 Mon Sep 17 00:00:00 2001 From: Martin Doucha Date: Mon, 15 Jun 2020 22:16:16 +0200 Subject: [PATCH] Play animations from bundled VVF files Playback from the old ANIMS.DAT is no longer needed. --- signus/src/anims.cpp | 17 +++++------------ signus/src/global.cpp | 8 +------- signus/src/global.h | 3 --- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/signus/src/anims.cpp b/signus/src/anims.cpp index 85417742..d2bcf205 100644 --- a/signus/src/anims.cpp +++ b/signus/src/anims.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include "global.h" @@ -897,23 +898,15 @@ void VVFStream::reset(void) { } int open_anim_file(File &file, const char *name) { - int num; + char fullname[PATH_MAX]; - if (!AnimsDF) { - return 0; - } - - num = AnimsDF->lookfor(name, 0, AnimsDF->getcount() - 1); - - if (num < 0) { - return 0; - } + snprintf(fullname, PATH_MAX, "anims/%s.vvf", name); + multipath_fopen(file, fullname, File::READ); - if (!file.open(AnimsDF->filename(), File::READ)) { + if (!file.isOpen()) { return 0; } - file.seek(AnimsDF->getinfo(num)->offset, SEEK_SET); return 1; } diff --git a/signus/src/global.cpp b/signus/src/global.cpp index d16ddeff..3de3bb1e 100644 --- a/signus/src/global.cpp +++ b/signus/src/global.cpp @@ -289,7 +289,7 @@ void ApplyINI() -TDataFile *GraphicsDF, *GraphicsI18nDF, *TextsDF, *AnimsDF; +TDataFile *GraphicsDF, *GraphicsI18nDF, *TextsDF; TFont *NormalFont; TFont *HugeFont; @@ -395,12 +395,6 @@ int InitGlobal() { GraphicsDF = new TDataFile("graphics-common.dat", dfOpenRead, NULL); GraphicsI18nDF = new TDataFile("graphics.dat", dfOpenRead, NULL); - if (test_file_exists("anims.dat")) { - AnimsDF = new TDataFile("anims.dat", dfOpenRead); - } else if (test_file_exists("ANIMS.DAT")) { - AnimsDF = new TDataFile("ANIMS.DAT", dfOpenRead); - } - char fontfile[PATH_MAX]; char fontfileTiny[PATH_MAX]; snprintf(fontfile, PATH_MAX, "%s/nolang/FreeSans.ttf", diff --git a/signus/src/global.h b/signus/src/global.h index 986e65a3..6bc135ca 100644 --- a/signus/src/global.h +++ b/signus/src/global.h @@ -148,9 +148,6 @@ extern TDataFile *GraphicsDF, *GraphicsI18nDF; // Datovy soubor s texty: extern TDataFile *TextsDF; -// Cutscene data file -extern TDataFile *AnimsDF; - // Oba textove fonty: extern TFont *NormalFont; extern TFont *HugeFont;