- moved getatoken to scriptfile.cpp so common.cpp could be removed.

This commit is contained in:
Christoph Oelckers 2020-07-14 19:51:54 +02:00
parent f9c03760a3
commit 2f3d405f8b
3 changed files with 18 additions and 35 deletions

View file

@ -771,7 +771,6 @@ set (PCH_SOURCES
# Todo: Split out the license-safe code from this.
build/src/animvpx.cpp
build/src/clip.cpp
build/src/common.cpp
build/src/defs.cpp
build/src/engine.cpp
build/src/mdsprite.cpp

View file

@ -1,34 +0,0 @@
#define LIBDIVIDE_BODY
#include "compat.h"
#include "build.h"
#include "scriptfile.h"
#include "baselayer.h"
#include "common.h"
#include "../../glbackend/glbackend.h"
// def/clipmap handling
//////////
int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens)
{
char *tok;
int32_t i;
if (!sf) return T_ERROR;
tok = scriptfile_gettoken(sf);
if (!tok) return T_EOF;
for (i=ntokens-1; i>=0; i--)
{
if (!Bstrcasecmp(tok, tl[i].text))
return tl[i].tokenid;
}
return T_ERROR;
}

View file

@ -438,3 +438,21 @@ void scriptfile_clearsymbols(void)
symbtablength = 0;
symbtaballoclength = 0;
}
int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens)
{
char *tok;
int32_t i;
if (!sf) return T_ERROR;
tok = scriptfile_gettoken(sf);
if (!tok) return T_EOF;
for (i=ntokens-1; i>=0; i--)
{
if (!Bstrcasecmp(tok, tl[i].text))
return tl[i].tokenid;
}
return T_ERROR;
}