- export 'GetChecksum' as part of FLevelLocals in ZScript

This commit is contained in:
Rachael Alexanderson 2018-01-06 19:59:49 -05:00
parent 16333320d0
commit 9fd78e90ad
2 changed files with 15 additions and 0 deletions

View file

@ -116,6 +116,7 @@
#include "events.h"
#include "types.h"
#include "i_time.h"
#include "scripting/vm/vm.h"
#include "fragglescript/t_fs.h"
@ -552,6 +553,18 @@ void MapData::GetChecksum(uint8_t cksum[16])
md5.Final(cksum);
}
DEFINE_ACTION_FUNCTION(FLevelLocals, GetChecksum)
{
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
char md5string[33];
for(int j = 0; j < 16; ++j)
{
sprintf(md5string + j * 2, "%02x", level.md5[j]);
}
ACTION_RETURN_STRING((const char*)md5string);
}
//===========================================================================
//

View file

@ -555,6 +555,8 @@ struct LevelLocals native
native static clearscope vector2 Vec2Diff(vector2 v1, vector2 v2);
native static clearscope vector3 Vec3Diff(vector3 v1, vector3 v2);
native String GetChecksum() const;
String TimeFormatted(bool totals = false)
{