%{ /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License as published by the Free | | Software Foundation; either version 2 of the License, or (at your | | option) any later version. | | | | Heroes is distributed in the hope that it will be useful, but WITHOUT | | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | | for more details. | | | | You should have received a copy of the GNU General Public License along | | with this program; if not, write to the Free Software Foundation, Inc., | | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | `------------------------------------------------------------------------*/ #include "system.h" #include "rsc_files_hash.h" #include "fstrcmp.h" %} struct rsc_file; %% arrow-img, "$(data-dir)/pics/arrow.pcx", 0,0,true big-font, "$(data-dir)/pics/fontbig.pcx", 0,0,true bonus-font, "$(data-dir)/pics/typonus.pcx", 0,0,true brown-bonus-img, "$(data-dir)/pics/bonusb.pcx", 0,0,true data-dir, "$(prefix)/"FORWARD_RELATIVE_PKGDATADIR,0,0,true editor-img, "$(data-dir)/pics/edit.pcx", 0,0,true editor-preview-prefix, "$(data-dir)/pics/editp", 0,0,true end-scroller-bg-img, "$(data-dir)/pics/background.pcx", 0,0,true extra-levels-dir, "$(data-dir)/extralvl/", 0,0,true saved-games-file, "$(user-dir)/savedgames", 0,0,true hedlite-output-dir, "$(user-dir)/levels/", 0,0,true help-font, "$(data-dir)/pics/fontread.pcx", 0,0,true help-pictures-img, "$(data-dir)/pics/helpics.pcx", 0,0,true home-dir, "is initialized from $HOME", 0,0,true intro-erase-img, "$(data-dir)/pics/erase.pcx", 0,0,true intro-logos-img, "$(data-dir)/pics/olympus.pcx", 0,0,true intro-splash-img, "$(data-dir)/pics/heroes.pcx", 0,0,true intro-vehicles-img, "$(data-dir)/pics/intro.pcx", 0,0,true jukebox-font, "$(data-dir)/pics/fontdeck.pcx", 0,0,true jukebox-img, "$(data-dir)/pics/jukebox.pcx", 0,0,true levels-dir, "$(data-dir)/levels/", 0,0,true locale-dir, "$(prefix)/"FORWARD_RELATIVE_LOCALEDIR, 0,0,true main-font, "$(data-dir)/pics/fontem.pcx", 0,0,true menu-pictures-img, "$(data-dir)/pics/fontem2.pcx", 0,0,true new-level-menu-img, "$(data-dir)/pics/newlevel.pcx", 0,0,true plug-in-dir, "$(prefix)/"FORWARD_RELATIVE_PLUGINDIR, 0,0,true pref-file, "$(user-dir)/preferences", 0,0,true prefix, PREFIX, 0,0,true purple-bonus-img, "$(data-dir)/pics/bonusa.pcx", 0,0,true score-file, "$(user-dir)/scores", 0,0,true sfx-conf-txt, "$(data-dir)/sfx/sfx.conf", 0,0,true sfx-dir, "$(data-dir)/sfx/", 0,0,true system-conf, "$(data-dir)/etc/heroesrc", 0,0,true sys-dir, "/var/games/heroes", 0,0,true tiles-sets-dir, "$(data-dir)/tilesets/", 0,0,true trails-img, "$(data-dir)/pics/trail.pcx", 0,0,true user-conf, "$(user-dir)/heroesrc", 0,0,true user-dir, "$(home-dir)/.heroes", 0,0,true vehicles-img, "$(data-dir)/pics/vehic.pcx", 0,0,true %% void print_rsc_files (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (rsc_set[i].name[0]) { if (rsc_set[i].modified_value) { printf ("%24s = %s\n", rsc_set[i].name, rsc_set[i].modified_value); printf ("%16s (default: %s)\n", "", rsc_set[i].value); } else printf ("%24s = %s\n", rsc_set[i].name, rsc_set[i].value); } } } const char * get_rsc_approx (const char *rsc_name) { int i; const char *res = 0; double best_weight = 0.7; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (rsc_set[i].name[0]) { double weight = fstrcmp (rsc_name, rsc_set[i].name); if (weight > best_weight) { best_weight = weight; res = rsc_set[i].name; } } } return res; } void free_modified_rsc (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) XFREE (rsc_set[i].modified_value); }