MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / loadBattlescapeResources

Method loadBattlescapeResources

src/Resource/XcomResourcePack.cpp:745–905  ·  view source on GitHub ↗

* Loads the resources required by the Battlescape. */

Source from the content-addressed store, hash-verified

743 * Loads the resources required by the Battlescape.
744 */
745void XcomResourcePack::loadBattlescapeResources()
746{
747 // Load Battlescape ICONS
748 std::ostringstream s;
749 s << "UFOGRAPH/" << "SPICONS.DAT";
750 _sets["SPICONS.DAT"] = new SurfaceSet(32, 24);
751 _sets["SPICONS.DAT"]->loadDat(CrossPlatform::getDataFile(s.str()));
752
753 s.str("");
754 std::ostringstream s2;
755 s << "UFOGRAPH/" << "CURSOR.PCK";
756 s2 << "UFOGRAPH/" << "CURSOR.TAB";
757 _sets["CURSOR.PCK"] = new SurfaceSet(32, 40);
758 _sets["CURSOR.PCK"]->loadPck(CrossPlatform::getDataFile(s.str()), CrossPlatform::getDataFile(s2.str()));
759
760 s.str("");
761 s2.str("");
762 s << "UFOGRAPH/" << "SMOKE.PCK";
763 s2 << "UFOGRAPH/" << "SMOKE.TAB";
764 _sets["SMOKE.PCK"] = new SurfaceSet(32, 40);
765 _sets["SMOKE.PCK"]->loadPck(CrossPlatform::getDataFile(s.str()), CrossPlatform::getDataFile(s2.str()));
766
767 s.str("");
768 s2.str("");
769 s << "UFOGRAPH/" << "HIT.PCK";
770 s2 << "UFOGRAPH/" << "HIT.TAB";
771 _sets["HIT.PCK"] = new SurfaceSet(32, 40);
772 _sets["HIT.PCK"]->loadPck(CrossPlatform::getDataFile(s.str()), CrossPlatform::getDataFile(s2.str()));
773
774 s.str("");
775 s2.str("");
776 s << "UFOGRAPH/" << "X1.PCK";
777 s2 << "UFOGRAPH/" << "X1.TAB";
778 _sets["X1.PCK"] = new SurfaceSet(128, 64);
779 _sets["X1.PCK"]->loadPck(CrossPlatform::getDataFile(s.str()), CrossPlatform::getDataFile(s2.str()));
780
781 s.str("");
782 _sets["MEDIBITS.DAT"] = new SurfaceSet(52, 58);
783 s << "UFOGRAPH/" << "MEDIBITS.DAT";
784 _sets["MEDIBITS.DAT"]->loadDat (CrossPlatform::getDataFile(s.str()));
785
786 s.str("");
787 _sets["DETBLOB.DAT"] = new SurfaceSet(16, 16);
788 s << "UFOGRAPH/" << "DETBLOB.DAT";
789 _sets["DETBLOB.DAT"]->loadDat (CrossPlatform::getDataFile(s.str()));
790
791 // Load Battlescape Terrain (only blacks are loaded, others are loaded just in time)
792 std::string bsets[] = {"BLANKS.PCK"};
793
794 for (size_t i = 0; i < sizeof(bsets)/sizeof(bsets[0]); ++i)
795 {
796 std::ostringstream s;
797 s << "TERRAIN/" << bsets[i];
798 std::string tab = CrossPlatform::noExt(bsets[i]) + ".TAB";
799 std::ostringstream s2;
800 s2 << "TERRAIN/" << tab;
801 _sets[bsets[i]] = new SurfaceSet(32, 40);
802 _sets[bsets[i]]->loadPck(CrossPlatform::getDataFile(s.str()), CrossPlatform::getDataFile(s2.str()));

Callers

nothing calls this directly

Calls 13

getDataFileFunction · 0.85
noExtFunction · 0.85
getFolderContentsFunction · 0.85
ExceptionClass · 0.85
loadPckMethod · 0.80
getFrameMethod · 0.80
loadScrMethod · 0.80
loadSpkMethod · 0.80
unlockMethod · 0.80
getDataFolderFunction · 0.50
loadDatMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected