Esempio n. 1
0
//
// INStatsManager::loadStats
//
// Load saved statistics from disk.
//
void INStatsManager::loadStats()
{
   char *statsText = NULL;
   qstring path;

   path = usergamepath;
   path.pathConcatenate("stats.csv");

   if((statsText = M_LoadStringFromFile(path.constPtr())))
   {
      pImpl->parseCSVScores(statsText);
      efree(statsText);
   }
}
Esempio n. 2
0
//
// D_addResourceScriptToZip
//
// Add a file from the resource directory as a script lump.
//
static void D_addResourceScriptToZip(ziparchive_t *zip, const char *filename)
{
   qstring srcpath;

   srcpath = filename;
   D_MakeResourceFilePath(srcpath);

   char *text;
   if(!(text = M_LoadStringFromFile(srcpath.constPtr())))
      I_Error("D_addResourceScript: unable to load resource %s\n", srcpath.constPtr());

   Zip_AddFile(zip, filename, reinterpret_cast<byte *>(text), 
               static_cast<uint32_t>(strlen(text)), ZIP_FILE_TEXT, true);
}