mirror of https://github.com/OpenMW/openmw.git
Replace mwscript program serialization into a vector with simple struct
Mostly to avoid string literal lookup by index with iteration over all preciding literals and calling strlen. This is very inefficient. In genral this makes code much more straightforward but also makes it portable since now int and float of different sizes are properly supported.7220-lua-add-a-general-purpose-lexical-parser
parent
60eede6a1d
commit
b88f0d2dbd
@ -0,0 +1,20 @@
|
||||
#ifndef OPENMW_COMPONENTS_INTERPRETER_PROGRAM_H
|
||||
#define OPENMW_COMPONENTS_INTERPRETER_PROGRAM_H
|
||||
|
||||
#include "types.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Interpreter
|
||||
{
|
||||
struct Program
|
||||
{
|
||||
std::vector<Type_Code> mInstructions;
|
||||
std::vector<Type_Integer> mIntegers;
|
||||
std::vector<Type_Float> mFloats;
|
||||
std::vector<std::string> mStrings;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue