RingRacers/libs/ACSVM/include/ACSVM/Jump.cpp
Sally Coolatta 26477941ed Attempt using ACSVM to implement
It's having trouble linking the dll on Windows currently
2022-10-03 01:23:58 -04:00

44 lines
1,011 B
C++

//-----------------------------------------------------------------------------
//
// Copyright (C) 2015 David Hill
//
// See COPYING for license information.
//
//-----------------------------------------------------------------------------
//
// Jump class.
//
//-----------------------------------------------------------------------------
#include "Jump.hpp"
#include "BinaryIO.hpp"
//----------------------------------------------------------------------------|
// Extern Functions |
//
namespace ACSVM
{
//
// JumpMap::loadJumps
//
void JumpMap::loadJumps(Byte const *data, std::size_t count)
{
table.alloc(count);
std::size_t iter = 0;
for(auto &jump : table)
{
Word caseVal = ReadLE4(data + iter); iter += 4;
Word codeIdx = ReadLE4(data + iter); iter += 4;
new(&jump) HashMapFixed<Word, Word>::Elem{caseVal, codeIdx, nullptr};
}
table.build();
}
}
// EOF