• R/O
  • SSH
  • HTTPS

iris-fmw: Commit


Commit MetaInfo

Revision267 (tree)
Time2012-01-22 23:49:24
Authorshirayanagi

Log Message

angelscript 更新

Change Summary

Incremental Difference

--- trunk/external/windows/setup/angelscript/vcbuild2010.bat (revision 266)
+++ trunk/external/windows/setup/angelscript/vcbuild2010.bat (revision 267)
@@ -2,9 +2,76 @@
22 pushd "%~dp0"
33 call _setenv.bat
44
5-call vcbuild.bat 2010
5+SET VSYEAR=2010
6+SET VSVER=vs2010
7+
8+if not exist "%ANGELSCRIPT_ROOT%" goto error
9+if not exist "%ANGELSCRIPT_SDK_ROOT%" goto error
10+
11+SET ANGELSCRIPT_LIB=%ANGELSCRIPT_SDK_ROOT%\lib
12+
13+rem ビルド
14+call "%BAT_TOOLS_ROOT%\msbuildvars.bat" %VSVER%
15+
16+cd "%ANGELSCRIPT_SDK_ROOT%"
617 if errorlevel 1 goto error
718
19+cd projects
20+if errorlevel 1 goto error
21+
22+cd msvc%VSMAJOR%
23+if errorlevel 1 goto error
24+
25+SET PROJECT_NAME=angelscript
26+
27+rem build
28+
29+rem MD
30+rem x86
31+msbuild /p:Configuration=Debug /p:Platform=Win32 /t:Rebuild %PROJECT_NAME%.sln
32+if errorlevel 1 goto error
33+msbuild /p:Configuration=Release /p:Platform=Win32 /t:Rebuild %PROJECT_NAME%.sln
34+if errorlevel 1 goto error
35+
36+rem x64
37+msbuild /p:Configuration=Debug /p:Platform=x64 /t:Rebuild %PROJECT_NAME%.sln
38+rem if errorlevel 1 goto error
39+msbuild /p:Configuration=Release /p:Platform=x64 /t:Rebuild %PROJECT_NAME%.sln
40+rem if errorlevel 1 goto error
41+
42+@echo F | xcopy /Y /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%.lib" "%ANGELSCRIPT_LIB%\%PROJECT_NAME%_static_md%VSYEAR%.lib"
43+@echo F | xcopy /Y /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%d.lib" "%ANGELSCRIPT_LIB%\%PROJECT_NAME%_static_md%VSYEAR%d.lib"
44+@echo F | xcopy /Y /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%64.lib" "%ANGELSCRIPT_LIB%\%PROJECT_NAME%_static_md%VSYEAR%_x64.lib"
45+@echo F | xcopy /Y /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%64d.lib" "%ANGELSCRIPT_LIB%\%PROJECT_NAME%_static_md%VSYEAR%_x64d.lib"
46+
47+rem MT
48+@echo | sed -e "s/<RuntimeLibrary>MultiThreadedDebugDLL</<RuntimeLibrary>MultiThreadedDebug</g" %PROJECT_NAME%.vcxproj > %PROJECT_NAME%.tmp
49+@echo | sed -e "s/<RuntimeLibrary>MultiThreadedDLL</<RuntimeLibrary>MultiThreaded</g" %PROJECT_NAME%.tmp > %PROJECT_NAME%-mt.vcxproj
50+del %PROJECT_NAME%.tmp
51+
52+rem x86
53+msbuild /p:Configuration=Debug /p:Platform=Win32 /t:Rebuild %PROJECT_NAME%-mt.vcxproj
54+if errorlevel 1 goto error
55+msbuild /p:Configuration=Release /p:Platform=Win32 /t:Rebuild %PROJECT_NAME%-mt.vcxproj
56+if errorlevel 1 goto error
57+
58+rem x64
59+msbuild /p:Configuration=Debug /p:Platform=x64 /t:Rebuild %PROJECT_NAME%-mt.vcxproj
60+rem if errorlevel 1 goto error
61+msbuild /p:Configuration=Release /p:Platform=x64 /t:Rebuild %PROJECT_NAME%-mt.vcxproj
62+rem if errorlevel 1 goto error
63+
64+@echo F | xcopy /Y /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%.lib" "%ANGELSCRIPT_LIB%\%PROJECT_NAME%_static_mt%VSYEAR%.lib"
65+@echo F | xcopy /Y /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%-mtd.lib" "%ANGELSCRIPT_LIB%\%PROJECT_NAME%_static_mt%VSYEAR%d.lib"
66+@echo F | xcopy /Y /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%64.lib" "%ANGELSCRIPT_LIB%\%PROJECT_NAME%_static_mt%VSYEAR%_x64.lib"
67+@echo F | xcopy /Y /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%-mt64d.lib" "%ANGELSCRIPT_LIB%\%PROJECT_NAME%_static_mt%VSYEAR%_x64d.lib"
68+
69+:clean
70+del /F /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%.lib"
71+del /F /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%-mtd.lib"
72+del /F /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%64.lib"
73+del /F /Q "%ANGELSCRIPT_LIB%\%PROJECT_NAME%-mt64d.lib"
74+
875 popd
976
1077 goto end
--- trunk/framework/src/script/angelscript/AsCompiler.cpp (nonexistent)
+++ trunk/framework/src/script/angelscript/AsCompiler.cpp (revision 267)
@@ -0,0 +1,89 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsCompiler.cpp
5+ * @brief AsCompiler ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#define INCG_IRIS_AsCompiler_CPP_
18+
19+//======================================================================
20+// include
21+#include "AsCompiler.h"
22+#include "../../fnd/memory/FndMemBuffer.h"
23+#include "../../fnd/io/FndFile.h"
24+#include "../../iris_debug.h"
25+
26+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
27+
28+namespace iris {
29+namespace as
30+{
31+
32+/**********************************************************************//**
33+ *
34+ * コンストラクタ
35+ *
36+*//***********************************************************************/
37+CAsCompiler::CAsCompiler(asIScriptModule* module)
38+ : m_pModule(module)
39+{
40+}
41+
42+/**********************************************************************//**
43+ *
44+ * デストラクタ
45+ *
46+*//***********************************************************************/
47+CAsCompiler::~CAsCompiler(void)
48+{
49+}
50+
51+/**********************************************************************//**
52+ *
53+ * インクルード
54+ *
55+ -----------------------------------------------------------------------
56+ * @param [in] lpszFileName = ファイルパス
57+ * @return 成否
58+*//***********************************************************************/
59+bool CAsCompiler::Include(const char* lpszFileName)
60+{
61+ if( m_pModule == nullptr ) return false;
62+ fnd::CFile file;
63+ if( !file.Open(lpszFileName, fnd::FOPEN_READ) ) return false;
64+ u32 size = file.GetSize();
65+ fnd::CMemBuffer buf;
66+ buf.Alloc(size);
67+ file.Read(buf, size);
68+ int r = m_pModule->AddScriptSection(lpszFileName, static_cast<const char*>(buf.GetAddr()), size);
69+ return AS_SUCCEEDED(r);
70+}
71+
72+/**********************************************************************//**
73+ *
74+ * ビルド
75+ *
76+ -----------------------------------------------------------------------
77+ * @return 結果
78+*//***********************************************************************/
79+int CAsCompiler::Build(void)
80+{
81+ IRIS_ASSERT(m_pModule != nullptr);
82+ int ret = m_pModule->Build();
83+ return ret;
84+}
85+
86+} // end of namespace as
87+} // end of namespace iris
88+
89+#endif
--- trunk/framework/src/script/angelscript/AsModule.h (nonexistent)
+++ trunk/framework/src/script/angelscript/AsModule.h (revision 267)
@@ -0,0 +1,54 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsModule.h
5+ * @brief angelscript システム ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_AsModule_H_
18+#define INCG_IRIS_AsModule_H_
19+
20+//======================================================================
21+// include
22+#include "as_inchead.h"
23+#include "../../fnd/container/FndWrapObject.h"
24+
25+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
26+
27+namespace iris {
28+namespace as
29+{
30+
31+//======================================================================
32+// class
33+/**
34+ * @ingroup as
35+ * @brief AngelScript Module クラス
36+*/
37+class CAsModule : public fnd::CWrapObject<asIScriptModule*>
38+{
39+ typedef fnd::CWrapObject<asIScriptModule*> _Mybase;
40+ friend class CAsSystem;
41+public:
42+ // コンストラクタ
43+ CAsModule(void);
44+ explicit CAsModule(asIScriptModule* ptr);
45+ // デストラクタ
46+ ~CAsModule(void);
47+};
48+
49+} // end of namespace as
50+} // end of namespace iris
51+
52+#endif
53+
54+#endif
--- trunk/framework/src/script/angelscript/AsError.h (nonexistent)
+++ trunk/framework/src/script/angelscript/AsError.h (revision 267)
@@ -0,0 +1,68 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsError.h
5+ * @brief angelscript エラー ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ *
11+ * @par copyright
12+ * Copyright (C) 2012 Takazumi Shirayanagi\n
13+ * The new BSD License is applied to this software.
14+ * see iris_LICENSE.txt
15+*/
16+//-----------------------------------------------------------------------
17+//======================================================================
18+#ifndef INCG_IRIS_AsError_H_
19+#define INCG_IRIS_AsError_H_
20+
21+//======================================================================
22+// include
23+#include "as_inchead.h"
24+#include "../../iris_debug.h"
25+
26+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
27+
28+namespace iris {
29+namespace as
30+{
31+
32+//======================================================================
33+// function
34+void AsFormatMessage (int Error, LPTSTR lpBuf, size_t size);
35+void AsFormatMessageA(int Error, LPSTR lpBuf, size_t size);
36+void AsFormatMessageW(int Error, LPWSTR lpBuf, size_t size);
37+
38+} // end of namespace as
39+} // end of namespace iris
40+
41+//======================================================================
42+// define
43+#ifdef _IRIS_DEBUG
44+
45+#define SCAS_ERROR(Error) do { if( AS_FAILED(Error) ) { TCHAR err_str[256]; ::iris::as::AsFormatMessage(Error, err_str, 256); dprintf(TEXT("*** FILED: ") TEXT(__FILE__) TEXT("(%d) :<%s>.\n") , __LINE__, err_str); } } while(0)
46+#define SCAS_ERROR2(Error, comm) do { if( AS_FAILED(Error) ) { TCHAR err_str[256]; ::iris::as::AsFormatMessage(Error, err_str, 256); dprintf(TEXT("*** FILED: ") TEXT(__FILE__) TEXT("(%d) %s:<%s>.\n"), __LINE__, comm, err_str); } } while(0)
47+#define SCAS_CHECK_RESULT(exp) do { ASRESULT Error = (exp); if( AS_FAILED(Error) ) { \
48+ TCHAR err_str[256]; iris::as::AsFormatMessage(Error, err_str, 256); \
49+ dprintf(TEXT("*** FAILED: ") TEXT(__FILE__) TEXT("(%d) %s: <%s>.\n"), __LINE__, TEXT(#exp), err_str); \
50+ } } while(0)
51+#define SCAS_DO_CHECK_RESULT(exp, todo) do { ASRESULT Error = (exp); if( AS_FAILED(Error) ) { \
52+ TCHAR err_str[256]; iris::as::AsFormatMessage(Error, err_str, 256); \
53+ dprintf(TEXT("*** FAILED: ") TEXT(__FILE__) TEXT("(%d) %s: <%s>.\n"), __LINE__, TEXT(#exp), err_str); \
54+ todo; \
55+ } } while(0)
56+
57+#else
58+
59+#define SCAS_ERROR(Error) (void)(0)
60+#define SCAS_ERROR2(Error, comm) (void)(0)
61+#define SCAS_CHECK_RESULT(exp) exp
62+#define SCAS_DO_CHECK_RESULT(exp, todo) do { if( AS_FAILED(exp) ) { todo; } } while(0)
63+
64+#endif
65+
66+#endif
67+
68+#endif
--- trunk/framework/src/script/angelscript/as_inchead.h (revision 266)
+++ trunk/framework/src/script/angelscript/as_inchead.h (revision 267)
@@ -29,6 +29,8 @@
2929 * @defgroup as
3030 */
3131
32+#define AS_FAILED(res) (res<0)
33+#define AS_SUCCEEDED(res) (res>=0)
3234
3335 #endif
3436
--- trunk/framework/src/script/angelscript/AsCompiler.h (nonexistent)
+++ trunk/framework/src/script/angelscript/AsCompiler.h (revision 267)
@@ -0,0 +1,63 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsCompiler.h
5+ * @brief angelscript コンパイラ ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_AsCompiler_H_
18+#define INCG_IRIS_AsCompiler_H_
19+
20+//======================================================================
21+// include
22+#include "AsModule.h"
23+
24+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
25+
26+namespace iris {
27+namespace as
28+{
29+
30+//======================================================================
31+// class
32+/**
33+ * @ingroup as
34+ * @brief AngelScript Compiler クラス
35+*/
36+class CAsCompiler : public INonCopyable<CAsCompiler>
37+{
38+ asIScriptModule* m_pModule; //!< モジュール
39+public:
40+ // コンストラクタ
41+ CAsCompiler(asIScriptModule* module);
42+ // デストラクタ
43+ ~CAsCompiler(void);
44+
45+public:
46+ // ファイルインクルード
47+ bool Include(const char* lpszFileName);
48+ // ビルド
49+ int Build(void);
50+
51+public:
52+ // モジュールの設定
53+ void SetModule(asIScriptModule* module) { m_pModule = module; }
54+ // モジュールの取得
55+ asIScriptModule* GetModule(void) const { return m_pModule; }
56+};
57+
58+} // end of namespace as
59+} // end of namespace iris
60+
61+#endif
62+
63+#endif
--- trunk/framework/src/script/angelscript/AsVM.cpp (nonexistent)
+++ trunk/framework/src/script/angelscript/AsVM.cpp (revision 267)
@@ -0,0 +1,105 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsVM.cpp
5+ * @brief angelscript Virtual Machine ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#define INCG_IRIS_AsVM_CPP_
18+
19+//======================================================================
20+// include
21+#include "AsVM.h"
22+#include "../../iris_debug.h"
23+
24+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
25+
26+namespace iris {
27+namespace as
28+{
29+
30+/**********************************************************************//**
31+ *
32+ * コンストラクタ
33+ *
34+*//***********************************************************************/
35+CAsVM::CAsVM(void)
36+{
37+}
38+
39+/**********************************************************************//**
40+ *
41+ * デストラクタ
42+ *
43+*//***********************************************************************/
44+CAsVM::~CAsVM(void)
45+{
46+}
47+
48+/**********************************************************************//**
49+ *
50+ * 初期化
51+ *
52+ -----------------------------------------------------------------------
53+ * @param [in] compiler = コンパイラ
54+ * @return 結果
55+*//***********************************************************************/
56+bool CAsVM::Initialize(CAsSystem& system, const CAsCompiler& compiler)
57+{
58+ if( m_Context.IsValid() ) return true; // すでに初期化済み
59+
60+ // モジュールを取得
61+ asIScriptModule* module = compiler.GetModule();
62+ if( module == nullptr ) return false;
63+ asIScriptEngine* engine = module->GetEngine();
64+ if( engine == nullptr ) return false;
65+ m_Module.ref() = module;
66+
67+ // コンテキストを作成
68+ if( !system.CreateContext(m_Context) ) return false;
69+ return true;
70+}
71+
72+/**********************************************************************//**
73+ *
74+ * 実行
75+ *
76+ -----------------------------------------------------------------------
77+ * @param [in] entry = エントリー関数名
78+*//***********************************************************************/
79+bool CAsVM::Run(const char* entry)
80+{
81+ IRIS_ASSERT( m_Context.IsValid() );
82+ // 名前引き
83+ asIScriptFunction* func = m_Module->GetFunctionByName(entry);
84+ if( func == nullptr )
85+ {
86+ // 定義引き
87+ func = m_Module->GetFunctionByDecl(entry);
88+ if( func = nullptr ) return false;
89+ }
90+
91+ if( !m_Context.Prepare(func) ) return false;
92+
93+ while(1)
94+ {
95+ int ret = m_Context.Execute();
96+
97+ if( ret == asEXECUTION_FINISHED ) break;
98+ }
99+ return true;
100+}
101+
102+} // end of namespace as
103+} // end of namespace iris
104+
105+#endif
--- trunk/framework/src/script/angelscript/AsContext.cpp (revision 266)
+++ trunk/framework/src/script/angelscript/AsContext.cpp (revision 267)
@@ -59,7 +59,7 @@
5959 {
6060 IRIS_ASSERT( m_pContext != nullptr );
6161 int ret = m_pContext->Prepare(funcId);
62- return ret >= 0;
62+ return AS_SUCCEEDED(ret);
6363 }
6464
6565 /**********************************************************************//**
@@ -74,20 +74,62 @@
7474 {
7575 IRIS_ASSERT( m_pContext != nullptr );
7676 int ret = m_pContext->Prepare(func);
77- return ret >= 0;
77+ return AS_SUCCEEDED(ret);
7878 }
7979
8080 /**********************************************************************//**
8181 *
82+ * 事前登録解除
83+ *
84+ -----------------------------------------------------------------------
85+ * @return 成否
86+*//***********************************************************************/
87+bool CAsContext::Unprepare(void)
88+{
89+ IRIS_ASSERT( m_pContext != nullptr );
90+ int ret = m_pContext->Unprepare();
91+ return AS_SUCCEEDED(ret);
92+}
93+
94+/**********************************************************************//**
95+ *
96+ * 引数登録
97+ *
98+ -----------------------------------------------------------------------
99+ * @param [in] arg = 引数のインデックス
100+ * @param [in] value = 値
101+*//***********************************************************************/
102+template<>
103+void CAsContext::SetArgument<asBYTE>(asUINT arg, asBYTE value)
104+{
105+ IRIS_ASSERT( m_pContext != nullptr );
106+ m_pContext->SetArgByte(arg, value);
107+}
108+
109+/**********************************************************************//**
110+ *
82111 * 実行
83112 *
84113 -----------------------------------------------------------------------
114+ * @return 結果
115+*//***********************************************************************/
116+int CAsContext::Execute(void)
117+{
118+ IRIS_ASSERT( m_pContext != nullptr );
119+ return m_pContext->Execute();
120+}
121+
122+/**********************************************************************//**
123+ *
124+ * 実行
125+ *
126+ -----------------------------------------------------------------------
85127 * @return 成否
86128 *//***********************************************************************/
87-bool CAsContext::Execute(void)
129+int CAsContext::Suspend(void)
88130 {
89131 IRIS_ASSERT( m_pContext != nullptr );
90- return false;
132+ return m_pContext->Suspend();
91133 }
92134
93135 /**********************************************************************//**
--- trunk/framework/src/script/angelscript/AsSystem.cpp (revision 266)
+++ trunk/framework/src/script/angelscript/AsSystem.cpp (revision 267)
@@ -103,6 +103,34 @@
103103
104104 /**********************************************************************//**
105105 *
106+ * モジュールの作成
107+ *
108+ -----------------------------------------------------------------------
109+ * @param [in] lpszModuleName = モジュール名
110+ * @return モジュール
111+*//***********************************************************************/
112+asIScriptModule* CAsSystem::CreateModule(LPCSTR lpszModuleName)
113+{
114+ IRIS_ASSERT( m_pEngine != nullptr );
115+ return m_pEngine->GetModule(lpszModuleName, asGM_CREATE_IF_NOT_EXISTS);
116+}
117+
118+/**********************************************************************//**
119+ *
120+ * モジュールの取得
121+ *
122+ -----------------------------------------------------------------------
123+ * @param [in] lpszModuleName = モジュール名
124+ * @return モジュール
125+*//***********************************************************************/
126+asIScriptModule* CAsSystem::GetModule(LPCSTR lpszModuleName)
127+{
128+ IRIS_ASSERT( m_pEngine != nullptr );
129+ return m_pEngine->GetModule(lpszModuleName);
130+}
131+
132+/**********************************************************************//**
133+ *
106134 * コンテキスト Detach
107135 *
108136 -----------------------------------------------------------------------
--- trunk/framework/src/script/angelscript/AsModule.cpp (nonexistent)
+++ trunk/framework/src/script/angelscript/AsModule.cpp (revision 267)
@@ -0,0 +1,61 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsModule.cpp
5+ * @brief AsModule ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#define INCG_IRIS_AsModule_CPP_
18+
19+//======================================================================
20+// include
21+#include "AsModule.h"
22+#include "../../iris_debug.h"
23+
24+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
25+
26+namespace iris {
27+namespace as
28+{
29+
30+/**********************************************************************//**
31+ *
32+ * コンストラクタ
33+ *
34+*//***********************************************************************/
35+CAsModule::CAsModule(void)
36+{
37+}
38+
39+/**********************************************************************//**
40+ *
41+ * コンストラクタ
42+ *
43+*//***********************************************************************/
44+CAsModule::CAsModule(asIScriptModule* ptr)
45+: _Mybase(ptr)
46+{
47+}
48+
49+/**********************************************************************//**
50+ *
51+ * デストラクタ
52+ *
53+*//***********************************************************************/
54+CAsModule::~CAsModule(void)
55+{
56+}
57+
58+} // end of namespace as
59+} // end of namespace iris
60+
61+#endif
--- trunk/framework/src/script/angelscript/AsVM.h (nonexistent)
+++ trunk/framework/src/script/angelscript/AsVM.h (revision 267)
@@ -0,0 +1,60 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsVM.h
5+ * @brief angelscript システム ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_AsVM_H_
18+#define INCG_IRIS_AsVM_H_
19+
20+//======================================================================
21+// include
22+#include "AsSystem.h"
23+#include "AsCompiler.h"
24+
25+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
26+
27+namespace iris {
28+namespace as
29+{
30+
31+//======================================================================
32+// class
33+/**
34+ * @ingroup as
35+ * @brief AngelScript Virtual Machine クラス
36+*/
37+class CAsVM : public INonCopyable<CAsVM>
38+{
39+protected:
40+ CAsContext m_Context;
41+ CAsModule m_Module;
42+public:
43+ // コンストラクタ
44+ CAsVM(void);
45+ // デストラクタ
46+ ~CAsVM(void);
47+
48+public:
49+ // 初期化
50+ bool Initialize(CAsSystem& system, const CAsCompiler& compiler);
51+ // 実行
52+ bool Run(const char* entry);
53+};
54+
55+} // end of namespace as
56+} // end of namespace iris
57+
58+#endif
59+
60+#endif
--- trunk/framework/src/script/angelscript/AsContext.h (revision 266)
+++ trunk/framework/src/script/angelscript/AsContext.h (revision 267)
@@ -50,8 +50,18 @@
5050 // 関数ID設定
5151 bool Prepare(int funcId);
5252 bool Prepare(asIScriptFunction* func);
53+ // 解除
54+ bool Unprepare(void);
55+
56+ // 引数登録
57+ template<typename T>
58+ void SetArgument(asUINT arg, T value);
59+
60+public:
5361 // 実効
54- bool Execute(void);
62+ int Execute(void);
63+ // 停止
64+ int Suspend(void);
5565 // 終了処理
5666 void Terminate(void);
5767 // 強制停止
--- trunk/framework/src/script/angelscript/AsSystem.h (revision 266)
+++ trunk/framework/src/script/angelscript/AsSystem.h (revision 267)
@@ -58,6 +58,12 @@
5858 bool CreateContext(CAsContext& context);
5959
6060 public:
61+ // モジュールの作成
62+ asIScriptModule* CreateModule(LPCSTR lpszModuleName);
63+ // モジュールの取得
64+ asIScriptModule* GetModule(LPCSTR lpszModuleName);
65+
66+public:
6167 ptr GetEngine(void) const { return m_pEngine; }
6268
6369 private:
--- trunk/framework/src/script/angelscript/AsError.cpp (nonexistent)
+++ trunk/framework/src/script/angelscript/AsError.cpp (revision 267)
@@ -0,0 +1,161 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsError.cpp
5+ * @brief angelscript エラー ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ *
11+ * @par copyright
12+ * Copyright (C) 2012 Takazumi Shirayanagi\n
13+ * The new BSD License is applied to this software.
14+ * see iris_LICENSE.txt
15+*/
16+//-----------------------------------------------------------------------
17+//======================================================================
18+#define INCG_IRIS_AsError_CPP_
19+
20+//======================================================================
21+// include
22+#include "AsError.h"
23+
24+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
25+
26+//======================================================================
27+// define
28+#define TEXTA(t) t
29+#define TEXTW(t) L##t
30+
31+#define SCAS_SWITCH_ERROR_MESSAGE_(func, text) \
32+ switch( Error ) \
33+ { \
34+ case asSUCCESS: \
35+ func(lpBuf, size, text("SUCCESS")); \
36+ break; \
37+ case asERROR: \
38+ func(lpBuf, size, text("ERROR")); \
39+ break; \
40+ case asCONTEXT_ACTIVE: \
41+ func(lpBuf, size, text("CONTEXT_ACTIVE")); \
42+ break; \
43+ case asCONTEXT_NOT_FINISHED: \
44+ func(lpBuf, size, text("CONTEXT_NOT_FINISHED")); \
45+ break; \
46+ case asCONTEXT_NOT_PREPARED: \
47+ func(lpBuf, size, text("CONTEXT_NOT_PREPARED")); \
48+ break; \
49+ case asINVALID_ARG: \
50+ func(lpBuf, size, text("INVALID_ARG")); \
51+ break; \
52+ case asNO_FUNCTION: \
53+ func(lpBuf, size, text("NO_FUNCTION")); \
54+ break; \
55+ case asNOT_SUPPORTED: \
56+ func(lpBuf, size, text("NOT_SUPPORTED")); \
57+ break; \
58+ case asINVALID_NAME: \
59+ func(lpBuf, size, text("INVALID_NAME")); \
60+ break; \
61+ case asNAME_TAKEN: \
62+ func(lpBuf, size, text("NAME_TAKEN")); \
63+ break; \
64+ case asINVALID_DECLARATION: \
65+ func(lpBuf, size, text("INVALID_DECLARATION")); \
66+ break; \
67+ case asINVALID_OBJECT: \
68+ func(lpBuf, size, text("INVALID_OBJECT")); \
69+ break; \
70+ case asINVALID_TYPE: \
71+ func(lpBuf, size, text("INVALID_TYPE")); \
72+ break; \
73+ case asALREADY_REGISTERED: \
74+ func(lpBuf, size, text("ALREADY_REGISTERED")); \
75+ break; \
76+ case asMULTIPLE_FUNCTIONS: \
77+ func(lpBuf, size, text("MULTIPLE_FUNCTIONS")); \
78+ break; \
79+ case asNO_MODULE: \
80+ func(lpBuf, size, text("NO_MODULE")); \
81+ break; \
82+ case asNO_GLOBAL_VAR: \
83+ func(lpBuf, size, text("NO_GLOBAL_VAR")); \
84+ break; \
85+ case asINVALID_CONFIGURATION: \
86+ func(lpBuf, size, text("INVALID_CONFIGURATION")); \
87+ break; \
88+ case asINVALID_INTERFACE: \
89+ func(lpBuf, size, text("INVALID_INTERFACE")); \
90+ break; \
91+ case asCANT_BIND_ALL_FUNCTIONS: \
92+ func(lpBuf, size, text("CANT_BIND_ALL_FUNCTIONS")); \
93+ break; \
94+ case asLOWER_ARRAY_DIMENSION_NOT_REGISTERED: \
95+ func(lpBuf, size, text("LOWER_ARRAY_DIMENSION_NOT_REGISTERED")); \
96+ break; \
97+ case asWRONG_CONFIG_GROUP: \
98+ func(lpBuf, size, text("WRONG_CONFIG_GROUP")); \
99+ break; \
100+ case asCONFIG_GROUP_IS_IN_USE: \
101+ func(lpBuf, size, text("CONFIG_GROUP_IS_IN_USE")); \
102+ break; \
103+ case asILLEGAL_BEHAVIOUR_FOR_TYPE: \
104+ func(lpBuf, size, text("ILLEGAL_BEHAVIOUR_FOR_TYPE")); \
105+ break; \
106+ case asWRONG_CALLING_CONV: \
107+ func(lpBuf, size, text("WRONG_CALLING_CONV")); \
108+ break; \
109+ case asBUILD_IN_PROGRESS: \
110+ func(lpBuf, size, text("BUILD_IN_PROGRESS")); \
111+ break; \
112+ case asINIT_GLOBAL_VARS_FAILED: \
113+ func(lpBuf, size, text("INIT_GLOBAL_VARS_FAILED")); \
114+ break; \
115+ }
116+
117+
118+namespace iris {
119+namespace as
120+{
121+
122+//======================================================================
123+// function
124+/**********************************************************************//**
125+ *
126+ * エラー文字列の取得
127+ *
128+ ----------------------------------------------------------------------
129+ * @param [in] Error = エラー値
130+ * @param [out] lpBuf = 出力バッファ
131+ * @param [in] size = 出力バッファサイズ
132+*//***********************************************************************/
133+void AsFormatMessage (int Error, LPTSTR lpBuf, size_t size)
134+{
135+#ifdef UNICODE
136+ AsFormatMessageW(Error, lpBuf, size);
137+#else
138+ AsFormatMessageA(Error, lpBuf, size);
139+#endif
140+}
141+/**
142+ * @ref AsFormatMessage
143+*/
144+void AsFormatMessageA(int Error, LPSTR lpBuf, size_t size)
145+{
146+ if( lpBuf == nullptr ) return;
147+ SCAS_SWITCH_ERROR_MESSAGE_(strcpy_s, TEXTA);
148+}
149+/**
150+ * @ref AsFormatMessage
151+*/
152+void AsFormatMessageW(int Error, LPWSTR lpBuf, size_t size)
153+{
154+ if( lpBuf == nullptr ) return;
155+ SCAS_SWITCH_ERROR_MESSAGE_(wcscpy_s, TEXTW);
156+}
157+
158+} // end of namespace as
159+} // end of namespace iris
160+
161+#endif
--- trunk/framework/src/fnd/container/FndWrapObject.h (revision 266)
+++ trunk/framework/src/fnd/container/FndWrapObject.h (revision 267)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2010-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2010-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -60,7 +60,7 @@
6060 const value_ptr operator & (void) const { return ptr(); }
6161 value_ref operator * (void) { return ref(); }
6262 const value_type& operator * (void) const { return ref(); }
63- _Myt& operator = (const value_type obj) { m_object = obj; return *this; }
63+ _Myt& operator = (value_type obj) { m_object = obj; return *this; }
6464 _Myt& operator = (const _Myt& obj) { m_object = obj.m_object; return *this; }
6565 #if defined(_IRIS_HAS_NULLPTR_T)
6666 _Myt& operator = (const nullptr_t& null) { m_object = null; return *this; }
Show on old repository browser