2012-09-23 22:11:08 +04:00
|
|
|
#ifndef OPENMW_ESM_SCPT_H
|
|
|
|
#define OPENMW_ESM_SCPT_H
|
2010-02-22 14:09:43 +01:00
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2012-09-23 22:41:41 +04:00
|
|
|
#include "esmcommon.hpp"
|
2010-02-22 14:09:43 +01:00
|
|
|
|
2011-04-08 17:58:21 +04:00
|
|
|
namespace ESM
|
|
|
|
{
|
2010-02-22 14:09:43 +01:00
|
|
|
|
2012-10-01 00:51:54 +04:00
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2010-02-22 14:09:43 +01:00
|
|
|
/*
|
|
|
|
* Script definitions
|
|
|
|
*/
|
|
|
|
|
2012-09-30 23:34:53 +04:00
|
|
|
class Script
|
2010-02-22 14:09:43 +01:00
|
|
|
{
|
2010-07-04 20:17:10 -07:00
|
|
|
public:
|
2013-09-24 13:17:28 +02:00
|
|
|
static unsigned int sRecordId;
|
|
|
|
|
2011-04-08 17:58:21 +04:00
|
|
|
struct SCHDstruct
|
|
|
|
{
|
2014-07-25 10:37:34 +02:00
|
|
|
/// Data from script-precompling in the editor.
|
|
|
|
/// \warning Do not use them. OpenCS currently does not precompile scripts.
|
2012-09-17 11:37:50 +04:00
|
|
|
int mNumShorts, mNumLongs, mNumFloats, mScriptDataSize, mStringTableSize;
|
2011-04-08 17:58:21 +04:00
|
|
|
}; // 52 bytes
|
|
|
|
|
2012-10-26 22:22:55 +04:00
|
|
|
std::string mId;
|
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
SCHDstruct mData;
|
2011-04-08 17:58:21 +04:00
|
|
|
|
2014-07-25 10:37:34 +02:00
|
|
|
/// Variable names generated by script-precompiling in the editor.
|
|
|
|
/// \warning Do not use this field. OpenCS currently does not precompile scripts.
|
|
|
|
std::vector<std::string> mVarNames;
|
|
|
|
|
|
|
|
/// Bytecode generated from script-precompiling in the editor.
|
|
|
|
/// \warning Do not use this field. OpenCS currently does not precompile scripts.
|
|
|
|
std::vector<unsigned char> mScriptData;
|
|
|
|
|
|
|
|
/// Script source code
|
|
|
|
std::string mScriptText;
|
2011-04-08 17:58:21 +04:00
|
|
|
|
|
|
|
void load(ESMReader &esm);
|
2013-09-16 12:32:35 +02:00
|
|
|
void save(ESMWriter &esm) const;
|
2013-04-07 15:17:35 +02:00
|
|
|
|
|
|
|
void blank();
|
|
|
|
///< Set record to default state (does not touch the ID/index).
|
2010-02-22 14:09:43 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|