1
0
Fork 0
forked from fte/fteqw

Fix recent class bug, as well as the 'no spinny model' bug.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5283 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-08-03 11:08:04 +00:00
parent d7aee05d47
commit 61c0b9f83b
3 changed files with 12 additions and 16 deletions

View file

@ -1911,7 +1911,7 @@ int PDECL PR_LoadEnts(pubprogfuncs_t *ppf, const char *file, void *ctx, void (PD
pbool resethunk=0;
pbool isloadgame;
if (file && !strncmp(file, "loadgame", 8))
{
{ //this is internally inserted for legacy saved games.
isloadgame = true;
numents = -1;
file+=8;

View file

@ -5601,8 +5601,8 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail)
found = true;
break;
}
if ((unsigned int)basicindex < pp[i].ofs+(pp[i].arraysize?pp[i].arraysize:1)) //if we found one with the index
basicindex = pp[i].ofs+(pp[i].arraysize?pp[i].arraysize:1); //make sure we don't union it.
if ((unsigned int)basicindex < pp[i].ofs+pp[i].type->size*(pp[i].arraysize?pp[i].arraysize:1)) //if we found one with the index
basicindex = pp[i].ofs+pp[i].type->size*(pp[i].arraysize?pp[i].arraysize:1); //make sure we don't union it.
}
}
}

View file

@ -294,7 +294,7 @@ optimisations_t optimisations[] =
{&opt_locals_overlapping, "lo", 2, FLAG_KILLSDEBUGGERS, "locals_overlapping", "Store all locals in a single section of the pr_globals. Vastly reducing it. This effectivly does the job of overlaptemps.\nHowever, locals are no longer automatically initialised to 0 (and never were in the case of recursion, but at least then its the same type).\nIf locals appear uninitialised, fteqcc will disable this optimisation for the affected functions, you can optionally get a warning about these locals using: #pragma warning enable F302"},
{&opt_vectorcalls, "vc", 4, FLAG_KILLSDEBUGGERS, "vectorcalls", "Where a function is called with just a vector, this causes the function call to store three floats instead of one vector. This can save a good number of pr_globals where those vectors contain many duplicate coordinates but do not match entirly."},
{&opt_classfields, "cf", 2, FLAG_KILLSDEBUGGERS, "class_fields", "Strip class field names. This will harm debugging and can result in 'gibberish' names appearing in saved games. Has no effect on engines other than FTEQW, which will not recognise these anyway."},
// {&opt_stripunusedfields, "uf", 4, 0, "strip_unused_fields","FIXME: needs relocs. Strips any fields that have no references. This may result in extra warnings at load time, or disabling support for mapper-specified alpha in engines that do not provide that."},
{&opt_stripunusedfields, "uf", 4, FLAG_KILLSDEBUGGERS, "strip_unused_fields","Strips any fields that have no references. This may result in extra warnings at load time, or disabling support for mapper-specified alpha in engines that do not provide that. FIXME: this is a little pointless until relocs are properly implemented."},
{NULL}
};
@ -966,22 +966,18 @@ void QCC_DetermineNeededSymbols(QCC_def_t *endsyssym)
}
}
//non-system fields should maybe be present too.
/* for (; sym; sym = sym->next)
if (!opt_stripunusedfields)
{
if (sym->constant && sym->type->type == ev_field && !opt_stripunusedfields)
for (; sym; sym = sym->next)
{
sym->symbolheader->used = true; //fields should always be present, annoyingly enough, as they're often used to silence map warnings.
//FIXME: we want to strip these. fte/dp extensions.qc have a LOT of fields that could be stripped.
sym->referenced = true; //FIXME
if (sym->constant && sym->type->type == ev_field)
{
sym->symbolheader->used = true;
sym->referenced = true;
}
}
// else if (sym->constant && sym->type->type == ev_function)
// { //non-builtins must be present, because of spawn functions and other entrypoints.
// unsigned int fnum = sym->symboldata[0]._int;
// if (fnum < numfunctions && functions[fnum].code == -1)
// sym->symbolheader->used = true;
// }
}
*/
for (i=0 ; i<numstatements ; i++)
{