Grog-Knight

some game in C++
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/Grog-Knight

commit 1ec2aed2f01023994be88012f2029f5eae311fcf
parent b1f35c1fd4fef2c33931a332b0c3902bc2406a5a
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Fri, 13 Feb 2015 11:43:08 +0100

Rebasing Master Manually

Diffstat:
AConfig/ActorDef/empty.txt | 2++
AConfig/Level/empty.txt | 2++
AConfig/defaults.lua | 2++
AConfig/input_bindings.ini | 1+
AConfig/tuning.lua | 1+
AContributing.md | 183+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ALICENSE | 202+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/ClientGame.xcodeproj/project.pbxproj | 675+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/ClientGame.xcodeproj/project.xcworkspace/contents.xcworkspacedata | 7+++++++
AMACOSX/ClientGame.xcodeproj/project.xcworkspace/xcshareddata/ClientGame.xccheckout | 41+++++++++++++++++++++++++++++++++++++++++
AMACOSX/ClientGame.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | 8++++++++
AMACOSX/ClientGame.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/UserInterfaceState.xcuserstate | 0
AMACOSX/ClientGame.xcodeproj/xcshareddata/xcschemes/ClientGame.xcscheme | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/ClientGame.xcodeproj/xcuserdata/lsolofri.xcuserdatad/xcschemes/xcschememanagement.plist | 19+++++++++++++++++++
AMACOSX/Resources/Scripts/autocomplete.lua | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/Resources/Scripts/conf_load.lua | 327+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/Resources/Scripts/pref_load.lua | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/Resources/Scripts/start.lua | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/Resources/Scripts/sugar.lua | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/Resources/Scripts/util.lua | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/platforms/ios/ClientGameInfo.plist | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/platforms/ios/Default-568h@2x.png | 0
AMACOSX/platforms/ios/Default-Landscape.png | 0
AMACOSX/platforms/ios/Default-Landscape@2x.png | 0
AMACOSX/platforms/ios/Default.png | 0
AMACOSX/platforms/ios/Default@2x.png | 0
AMACOSX/platforms/ios/Icon-72.png | 0
AMACOSX/platforms/ios/Icon-72@2x.png | 0
AMACOSX/platforms/ios/Icon-Small-50.png | 0
AMACOSX/platforms/ios/Icon-Small-50@2x.png | 0
AMACOSX/platforms/ios/Icon-Small.png | 0
AMACOSX/platforms/ios/Icon-Small@2x.png | 0
AMACOSX/platforms/ios/Icon.png | 0
AMACOSX/platforms/ios/Icon@2x.png | 0
AMACOSX/platforms/ios/iPhoneMain.cpp | 29+++++++++++++++++++++++++++++
AMACOSX/platforms/ios/iPhoneMain.h | 8++++++++
AMACOSX/platforms/ios/iTunesArtwork | 0
AMACOSX/platforms/ios/iTunesArtwork@2x | 0
AMACOSX/platforms/mac/ClientGameInfo.plist | 24++++++++++++++++++++++++
AMACOSX/platforms/mac/angel.icns | 0
AMACOSX/platforms/win/ClientGame.rc | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMACOSX/platforms/win/angel.ico | 0
AMACOSX/platforms/win/resource.h | 16++++++++++++++++
AMACOSX/stdafx.h | 10++++++++++
AMakefile | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/MapExample.json | 41+++++++++++++++++++++++++++++++++++++++++
AREADME.md | 34++++++++++++++++++++++++++++++++++
AResources/Fonts/Inconsolata.otf | 0
AResources/Images/DefaultSkin.png | 0
AResources/Scripts/autocomplete.lua | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AResources/Scripts/client_start.lua | 2++
AResources/Scripts/conf_load.lua | 327+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AResources/Scripts/pref_load.lua | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AResources/Scripts/start.lua | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AResources/Scripts/sugar.lua | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AResources/Scripts/util.lua | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AResources/Sounds/empty.txt | 0
ASources/inc/main.hpp | 7+++++++
ASources/src/main.cpp | 38++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/Attributions/base-angel.txt | 177+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/Attributions/devil-libs.txt | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/Attributions/fmod.txt | 3+++
ATools/BuildScripts/Attributions/lgpl.txt | 485+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/Attributions/ogg-vorbis.txt | 31+++++++++++++++++++++++++++++++
ATools/BuildScripts/Attributions/openal-soft.txt | 19+++++++++++++++++++
ATools/BuildScripts/Doc/angel-header.png | 0
ATools/BuildScripts/Doc/footer.html | 15+++++++++++++++
ATools/BuildScripts/Doc/footer_host.html | 25+++++++++++++++++++++++++
ATools/BuildScripts/angel_build.lua | 363+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/build_cache/empty.txt | 2++
ATools/BuildScripts/build_cache/swigout.txt | 29899+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/CHANGES.txt | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/LICENCE.txt | 21+++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/README.txt | 185+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/config.ld | 10++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/01-introduction.md | 294+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/02-arrays.md | 440+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/03-strings.md | 176+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/04-paths.md | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/05-dates.md | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/06-data.md | 815+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/07-functional.md | 407+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/08-additional.md | 364+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/docs/manual/09-discussion.md | 48++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/seesubst.lua | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/sipscan.lua | 33+++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/symbols.lua | 222+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/test-cmp.lua | 4++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/test-listcallbacks.lua | 10++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/test-pretty.lua | 13+++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/test-symbols.lua | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/testapp.lua | 5+++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/testclone.lua | 38++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/testconfig.lua | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/testglobal.lua | 27+++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/testinputfields.lua | 13+++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/testinputfields2.lua | 8++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/testxml.lua | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/examples/which.lua | 30++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/Date.lua | 555+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/List.lua | 613+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/Map.lua | 113+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/MultiMap.lua | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/OrderedMap.lua | 151++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/Set.lua | 153+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/app.lua | 165+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/array2d.lua | 501+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/class.lua | 180+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/comprehension.lua | 286+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/config.lua | 176+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/data.lua | 606+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/dir.lua | 475+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/file.lua | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/func.lua | 376+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/init.lua | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/input.lua | 173+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/lapp.lua | 400+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/lexer.lua | 456+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/luabalanced.lua | 264+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/operator.lua | 201+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/path.lua | 398+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/permute.lua | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/platf/luajava.lua | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/pretty.lua | 285+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/seq.lua | 551+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/sip.lua | 342+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/strict.lua | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/stringio.lua | 158+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/stringx.lua | 440+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/tablex.lua | 817+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/template.lua | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/test.lua | 135+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/text.lua | 243+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/utils.lua | 550+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/lua/pl/xml.lua | 689+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/run.lua | 34++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/lua/bar.lua | 10++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/lua/foo/args.lua | 9+++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-args.lua | 37+++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-array.lua | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-class.lua | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-compare-no-order.lua | 13+++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-comprehension.lua | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-config.lua | 206+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-data.lua | 175+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-date.lua | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-dir.lua | 38++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-fenv.lua | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-func.lua | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-job-query.lua | 20++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-lapp.lua | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-lexer.lua | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-map.lua | 17+++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-move.lua | 12++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-path.lua | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-pretty-number.lua | 31+++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-pretty.lua | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-pylib.lua | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-relpath.lua | 21+++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-seq.lua | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-set.lua | 158+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-sip.lua | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-strict.lua | 10++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-stringio.lua | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-stringx.lua | 272+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-substitute.lua | 41+++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-tablex.lua | 139+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-text.lua | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-vector.lua | 115+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-xml.lua | 389+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/lua-lib/penlight-1.0.2/tests/testp.lua | 13+++++++++++++
ATools/BuildScripts/mac-specific/CheckFreeType.lua | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/mac-specific/CopyResources.lua | 143+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/publish.lua | 112+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/publish_mac.lua | 124+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/BuildScripts/swig_wrap.lua | 169+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATools/Mac360/360ControllerInstall.0.11.dmg | 0
ATools/Mac360/360ControllerSource.0.11.zip | 0
Abuild.lua | 7+++++++
Ascript_interface.i | 7+++++++
180 files changed, 52677 insertions(+), 0 deletions(-)

diff --git a/Config/ActorDef/empty.txt b/Config/ActorDef/empty.txt @@ -0,0 +1 @@ +-- Actor definitions go in this directory. (See the example in IntroGame.)+ \ No newline at end of file diff --git a/Config/Level/empty.txt b/Config/Level/empty.txt @@ -0,0 +1 @@ +-- Level definitions go in this directory. (See the example in IntroGame.)+ \ No newline at end of file diff --git a/Config/defaults.lua b/Config/defaults.lua @@ -0,0 +1 @@ +-- Any tables that you put in here will be loaded into Preferences+ \ No newline at end of file diff --git a/Config/input_bindings.ini b/Config/input_bindings.ini @@ -0,0 +1 @@ +; This is the key-bindings file. diff --git a/Config/tuning.lua b/Config/tuning.lua @@ -0,0 +1 @@ +-- This file is used for tuning variables. diff --git a/Contributing.md b/Contributing.md @@ -0,0 +1,183 @@ +# How to Contribute + +Wanna contribute ? Nice :D + +There are some code rules, to keep the project and the code readable. + +### Releases: +> Base code's rules +Louis <louis@ne02ptzero.me> + +# Code Norm + +### Base + +##### Style +The K & R style is __REQUIRED__ + +```cpp +if (TRUE) { + /* Some code */ +} else { + /* Some code again */ +} +``` + +##### Naming convention + +For function's name, go with the Javascript Naming rules: + +```cpp +void myAwesomeFunction(void) { + /* Some code */ +} +``` +##### File name convention + +For a class file, respect the Javascript naming rules (^) +`MyClassName.cpp` +`MyClassName.hpp` +Of course, the name of the class file must the respect the name of the class itself. + + +For a main, or outside-class functions, the Unix convention. +`main.cpp` +`my_awesome_functions.cpp` + +> Author's note: +> +> Seems like a little complicated, but we can actually make the difference between class and functions with a ls. + +### Class + +##### Headers + +A header file __must have__ a protection against infinite inclusion: +```cpp +#ifdef __CLASS__ +# define __CLASS__ +/* Header's code */ +#endif +``` + +Also, for a class, please the respect this template: + +```cpp +class MyClass { + // Public first + public: + /* Constructors and Destructors */ + MyClass(); + ... + + /* Functions */ + void makeSomeStuff(void); + ... + + /* Variables */ + int n; + ... + + // Then, private, same order as public. + private: + ... +}; +``` +The order is this one: public, protected, private. + +### Comments + + +##### Base Header +A header file comment is required: + +```cpp +/** + * File: FileName.cpp + * Creation: YYYY-MM-DD HH:MM + * Username <username@mail.com> + */ +``` + +##### License +Also, we are on the Apache License, so __EACH__ file would have the following header: +```cpp +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +``` + +#### Function comment header +A header to __EACH__ function is required too, except one-line function (Getters and setters). +```cpp +/** + * What the function do (In a few words) + * @param: First Parameter name (type) + * @param: Second Parameter name (type) + * ... + * @return: The return variable name + */ + +/* EXAMPLE */ + +/** + * Count and return the length of a string. + * @param: str (const char *) + * @return: n + */ +size_t strlen(const char *str) { + /* Some code */ + return n; +} +``` + +# Git rules + +### Commit + +A Commit norm is also required: +``` +Action(target): Title +<Blank line> +Description of the commit +Can be two lines +<Blank line> +``` + +Here action is the basic code change on a project (Add, Fix, Feat (Features), Bug, Doc). +The target is where your commit is making change (Core, Graphic design, physic motor, etc....) + +**Example:** +``` +git commit -m "Add(Core): Add a debug function + +I've added a debug function, to close the issue #154 +Also, we gain 1.3s at the build. + +" +``` + +### Build + +*For main contributors:* +Be careful, the build verification is made __after__ your push. so look at the travis icon for build. + +*For pull requests* +Travis automatically makes the build, so if it failed, we can send you the debug as a comment to your pull request. + +Happy contributing :) diff --git a/LICENSE b/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2015 Louis Solofrizzo, Vincent Rey, Ryad Kharif, Lois Pearron, Matthieu Maudet, Valentin Diridolou + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/MACOSX/ClientGame.xcodeproj/project.pbxproj b/MACOSX/ClientGame.xcodeproj/project.pbxproj @@ -0,0 +1,675 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXAggregateTarget section */ + 3401564D15A9199300E4C8BF /* LuaExe */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 3401564E15A9199300E4C8BF /* Build configuration list for PBXAggregateTarget "LuaExe" */; + buildPhases = ( + 3401565215A919B200E4C8BF /* Build Lua */, + ); + dependencies = ( + ); + name = LuaExe; + productName = LuaExe; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 342C29A20E2AFD3A0061D881 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3433A92B0E2AB09B00A02B4E /* IOKit.framework */; }; + 343C17421319544C003637EA /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 343C174013195432003637EA /* OpenAL.framework */; }; + 345AAF4A11CB39A3002B4471 /* libfmodex.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34810A050E679FE500246544 /* libfmodex.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 3462B41814FC67280049A886 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3462B41614FC67280049A886 /* Cocoa.framework */; }; + 34810A150E67A38B00246544 /* libfmodex.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34810A050E679FE500246544 /* libfmodex.dylib */; }; + 34974A330E2925BE0018A032 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34974A310E2925BE0018A032 /* main.cpp */; }; + 34974A3B0E2926460018A032 /* stdafx.h in Headers */ = {isa = PBXBuildFile; fileRef = 34974A2F0E2925BE0018A032 /* stdafx.h */; }; + 34974B2F0E2926FB0018A032 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34A18C9B0E284445001C79A5 /* OpenGL.framework */; }; + 34974B3A0E2927E00018A032 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34974B390E2927E00018A032 /* AGL.framework */; }; + 34A6E2A71527568800BEA400 /* AngelLuaWrapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34A6E2A61527568800BEA400 /* AngelLuaWrapping.cpp */; settings = {COMPILER_FLAGS = "-w"; }; }; + 34A6E2C0152758E100BEA400 /* angel.icns in Copy Icon */ = {isa = PBXBuildFile; fileRef = 34A6E2AA1527573600BEA400 /* angel.icns */; }; + 34A6E51B1527811300BEA400 /* libAngel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34A6E3291527632500BEA400 /* libAngel.a */; }; + 34E7629C1338C70F00BA9A3C /* libIL.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34E7627C1338C6F600BA9A3C /* libIL.dylib */; }; + 34E7629D1338C70F00BA9A3C /* libILU.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34E7627D1338C6F600BA9A3C /* libILU.dylib */; }; + 34E7629E1338C70F00BA9A3C /* libILUT.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34E7627E1338C6F600BA9A3C /* libILUT.dylib */; }; + 34E7629F1338C70F00BA9A3C /* libjpeg.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34E7627F1338C6F600BA9A3C /* libjpeg.dylib */; }; + 34E762A11338C70F00BA9A3C /* libmng.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34E762811338C6F600BA9A3C /* libmng.dylib */; }; + 34E762A31338C70F00BA9A3C /* libtiff.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34E762831338C6F600BA9A3C /* libtiff.dylib */; }; + 34E762BE1338C7C500BA9A3C /* liblcms.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34E762BB1338C7C000BA9A3C /* liblcms.dylib */; }; + 34E762D31338CA9900BA9A3C /* libIL.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E7627C1338C6F600BA9A3C /* libIL.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 34E762D41338CA9900BA9A3C /* libILU.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E7627D1338C6F600BA9A3C /* libILU.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 34E762D51338CA9900BA9A3C /* libILUT.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E7627E1338C6F600BA9A3C /* libILUT.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 34E762D61338CA9900BA9A3C /* libjpeg.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E7627F1338C6F600BA9A3C /* libjpeg.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 34E762D71338CA9900BA9A3C /* liblcms.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E762BB1338C7C000BA9A3C /* liblcms.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 34E762D81338CA9900BA9A3C /* libmng.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E762811338C6F600BA9A3C /* libmng.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 34E762DA1338CA9900BA9A3C /* libtiff.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E762831338C6F600BA9A3C /* libtiff.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 34E76405133979E000BA9A3C /* libpng.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E76403133979E000BA9A3C /* libpng.dylib */; }; + 34E76406133979EA00BA9A3C /* libpng.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34E76403133979E000BA9A3C /* libpng.dylib */; }; + 34EB439E15A59E1000CF9CD8 /* libjasper.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34EB439D15A59E1000CF9CD8 /* libjasper.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 34EB43A915A59E2800CF9CD8 /* libjasper.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 34EB439D15A59E1000CF9CD8 /* libjasper.dylib */; }; + 34EB43AB15A59EA800CF9CD8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E76381133967E200BA9A3C /* libz.dylib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 34A6E3281527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 345AAD0811CB3710002B4471; + remoteInfo = Angel; + }; + 34A6E32A1527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 34A18BA70E284044001C79A5; + remoteInfo = Box2D; + }; + 34A6E32C1527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 343C16CD13194490003637EA; + remoteInfo = Vorbis; + }; + 34A6E32E1527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 343C16BB13194433003637EA; + remoteInfo = Ogg; + }; + 34A6E3301527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 34A18C510E284362001C79A5; + remoteInfo = GLFW; + }; + 34A6E3321527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 346E3BB90E28637A00E6C79E; + remoteInfo = FTGL; + }; + 34A6E3341527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3406447911E7DE4200033B1D; + remoteInfo = FreeType; + }; + 34A6E3361527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3433A8D10E2AADDE00A02B4E; + remoteInfo = HIDUtilities; + }; + 34A6E33A1527632500BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 34EECBDC11CB922100667B26; + remoteInfo = Lua; + }; + 34A6E33F1527633800BEA400 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 3401560615A918BF00E4C8BF; + remoteInfo = LuaExe; + }; + 34FB48A71639001B002EB836 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 34FB467C1638F773002EB836; + remoteInfo = GWEN; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 34D6C173134763AD00D82C14 /* Copy Icon */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 7; + files = ( + 34A6E2C0152758E100BEA400 /* angel.icns in Copy Icon */, + ); + name = "Copy Icon"; + runOnlyForDeploymentPostprocessing = 0; + }; + 34F1FD350E5D27710065CD22 /* Copy Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 34E7629C1338C70F00BA9A3C /* libIL.dylib in Copy Frameworks */, + 34E7629D1338C70F00BA9A3C /* libILU.dylib in Copy Frameworks */, + 34E7629E1338C70F00BA9A3C /* libILUT.dylib in Copy Frameworks */, + 34EB43A915A59E2800CF9CD8 /* libjasper.dylib in Copy Frameworks */, + 34E762BE1338C7C500BA9A3C /* liblcms.dylib in Copy Frameworks */, + 34E7629F1338C70F00BA9A3C /* libjpeg.dylib in Copy Frameworks */, + 34E762A11338C70F00BA9A3C /* libmng.dylib in Copy Frameworks */, + 34E762A31338C70F00BA9A3C /* libtiff.dylib in Copy Frameworks */, + 34E76406133979EA00BA9A3C /* libpng.dylib in Copy Frameworks */, + 34810A150E67A38B00246544 /* libfmodex.dylib in Copy Frameworks */, + ); + name = "Copy Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 3433A92B0E2AB09B00A02B4E /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; + 3433A9330E2AB0E000A02B4E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; }; + 343C174013195432003637EA /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; + 3462B41614FC67280049A886 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; + 34713D900EA6D6F800AF58CA /* Config */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Config; path = ../Config; sourceTree = "<group>"; }; + 34713D990EA6D71100AF58CA /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = "<group>"; }; + 347CFFE411DC239200761E0E /* script_interface.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; name = script_interface.i; path = ../script_interface.i; sourceTree = "<group>"; }; + 347CFFF111DC243000761E0E /* build.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = build.lua; path = ../build.lua; sourceTree = "<group>"; }; + 34810A040E679FE500246544 /* libfmodexL.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfmodexL.dylib; path = ../Angel/Libraries/FMOD/libfmodexL.dylib; sourceTree = "<group>"; }; + 34810A050E679FE500246544 /* libfmodex.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfmodex.dylib; path = ../Angel/Libraries/FMOD/libfmodex.dylib; sourceTree = "<group>"; }; + 34974A2F0E2925BE0018A032 /* stdafx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdafx.h; sourceTree = "<group>"; }; + 34974A310E2925BE0018A032 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../Sources/src/main.cpp; sourceTree = "<group>"; }; + 34974B390E2927E00018A032 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = "<absolute>"; }; + 34A18C9B0E284445001C79A5 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; + 34A6E2A61527568800BEA400 /* AngelLuaWrapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AngelLuaWrapping.cpp; path = ../Angel/Scripting/Interfaces/AngelLuaWrapping.cpp; sourceTree = "<group>"; }; + 34A6E2AA1527573600BEA400 /* angel.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = angel.icns; path = platforms/mac/angel.icns; sourceTree = SOURCE_ROOT; }; + 34A6E2AB1527573600BEA400 /* ClientGameInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = ClientGameInfo.plist; path = platforms/mac/ClientGameInfo.plist; sourceTree = SOURCE_ROOT; }; + 34A6E3171527632500BEA400 /* Angel.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Angel.xcodeproj; path = ../Angel/Angel.xcodeproj; sourceTree = "<group>"; }; + 34D34D980E2C34430053994C /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = "<absolute>"; }; + 34E7627C1338C6F600BA9A3C /* libIL.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libIL.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/libIL.dylib"; sourceTree = "<group>"; }; + 34E7627D1338C6F600BA9A3C /* libILU.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libILU.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/libILU.dylib"; sourceTree = "<group>"; }; + 34E7627E1338C6F600BA9A3C /* libILUT.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libILUT.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/libILUT.dylib"; sourceTree = "<group>"; }; + 34E7627F1338C6F600BA9A3C /* libjpeg.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libjpeg.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/libjpeg.dylib"; sourceTree = "<group>"; }; + 34E762811338C6F600BA9A3C /* libmng.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmng.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/libmng.dylib"; sourceTree = "<group>"; }; + 34E762831338C6F600BA9A3C /* libtiff.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libtiff.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/libtiff.dylib"; sourceTree = "<group>"; }; + 34E762BB1338C7C000BA9A3C /* liblcms.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = liblcms.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/liblcms.dylib"; sourceTree = "<group>"; }; + 34E76381133967E200BA9A3C /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + 34E76403133979E000BA9A3C /* libpng.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpng.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/libpng.dylib"; sourceTree = "<group>"; }; + 34EB439D15A59E1000CF9CD8 /* libjasper.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libjasper.dylib; path = "../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib/libjasper.dylib"; sourceTree = "<group>"; }; + 8D1107320486CEB800E47090 /* ClientGame.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ClientGame.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 34A6E51B1527811300BEA400 /* libAngel.a in Frameworks */, + 345AAF4A11CB39A3002B4471 /* libfmodex.dylib in Frameworks */, + 34E762D31338CA9900BA9A3C /* libIL.dylib in Frameworks */, + 34E762D41338CA9900BA9A3C /* libILU.dylib in Frameworks */, + 34E762D51338CA9900BA9A3C /* libILUT.dylib in Frameworks */, + 34EB439E15A59E1000CF9CD8 /* libjasper.dylib in Frameworks */, + 34E762D61338CA9900BA9A3C /* libjpeg.dylib in Frameworks */, + 34E762D81338CA9900BA9A3C /* libmng.dylib in Frameworks */, + 34E762DA1338CA9900BA9A3C /* libtiff.dylib in Frameworks */, + 34E76405133979E000BA9A3C /* libpng.dylib in Frameworks */, + 34E762D71338CA9900BA9A3C /* liblcms.dylib in Frameworks */, + 34EB43AB15A59EA800CF9CD8 /* libz.dylib in Frameworks */, + 34974B2F0E2926FB0018A032 /* OpenGL.framework in Frameworks */, + 34974B3A0E2927E00018A032 /* AGL.framework in Frameworks */, + 342C29A20E2AFD3A0061D881 /* IOKit.framework in Frameworks */, + 343C17421319544C003637EA /* OpenAL.framework in Frameworks */, + 3462B41814FC67280049A886 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D1107320486CEB800E47090 /* ClientGame.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 29B97314FDCFA39411CA2CEA /* ClientGame */ = { + isa = PBXGroup; + children = ( + 347CFFE811DC23E100761E0E /* Angel Support */, + 34713D900EA6D6F800AF58CA /* Config */, + 34713D990EA6D71100AF58CA /* Resources */, + 347CFFE411DC239200761E0E /* script_interface.i */, + 347CFFF111DC243000761E0E /* build.lua */, + 34974A310E2925BE0018A032 /* main.cpp */, + 34A18C990E284421001C79A5 /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = ClientGame; + sourceTree = "<group>"; + }; + 347CFFE811DC23E100761E0E /* Angel Support */ = { + isa = PBXGroup; + children = ( + 34A6E3171527632500BEA400 /* Angel.xcodeproj */, + 34A6E2AA1527573600BEA400 /* angel.icns */, + 34A6E2AB1527573600BEA400 /* ClientGameInfo.plist */, + 34974A2F0E2925BE0018A032 /* stdafx.h */, + 34A6E2A61527568800BEA400 /* AngelLuaWrapping.cpp */, + ); + name = "Angel Support"; + sourceTree = "<group>"; + }; + 34A18C990E284421001C79A5 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 34E7627C1338C6F600BA9A3C /* libIL.dylib */, + 34E7627D1338C6F600BA9A3C /* libILU.dylib */, + 34E7627E1338C6F600BA9A3C /* libILUT.dylib */, + 34EB439D15A59E1000CF9CD8 /* libjasper.dylib */, + 34E7627F1338C6F600BA9A3C /* libjpeg.dylib */, + 34E762BB1338C7C000BA9A3C /* liblcms.dylib */, + 34E762811338C6F600BA9A3C /* libmng.dylib */, + 34E762831338C6F600BA9A3C /* libtiff.dylib */, + 34810A040E679FE500246544 /* libfmodexL.dylib */, + 34810A050E679FE500246544 /* libfmodex.dylib */, + 34E76403133979E000BA9A3C /* libpng.dylib */, + 34E76381133967E200BA9A3C /* libz.dylib */, + 3433A9330E2AB0E000A02B4E /* CoreFoundation.framework */, + 3433A92B0E2AB09B00A02B4E /* IOKit.framework */, + 34974B390E2927E00018A032 /* AGL.framework */, + 3462B41614FC67280049A886 /* Cocoa.framework */, + 34A18C9B0E284445001C79A5 /* OpenGL.framework */, + 34D34D980E2C34430053994C /* ForceFeedback.framework */, + 343C174013195432003637EA /* OpenAL.framework */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 34A6E3181527632500BEA400 /* Products */ = { + isa = PBXGroup; + children = ( + 34A6E3291527632500BEA400 /* libAngel.a */, + 34A6E32B1527632500BEA400 /* libBox2D.a */, + 34A6E32D1527632500BEA400 /* libVorbis.a */, + 34A6E32F1527632500BEA400 /* libOgg.a */, + 34A6E3311527632500BEA400 /* libGLFW.a */, + 34FB48A81639001B002EB836 /* libGWEN.a */, + 34A6E3331527632500BEA400 /* libFTGL.a */, + 34A6E3351527632500BEA400 /* libFreeType.a */, + 34A6E3371527632500BEA400 /* libHIDUtilities.a */, + 34A6E33B1527632500BEA400 /* libLua.a */, + ); + name = Products; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 34974A490E29265E0018A032 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 34974A3B0E2926460018A032 /* stdafx.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D1107260486CEB800E47090 /* ClientGame */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ClientGame" */; + buildPhases = ( + 34388F3B11E3EF61002A79B1 /* Generate Lua Wrapping */, + 34974A490E29265E0018A032 /* Headers */, + 8D11072C0486CEB800E47090 /* Sources */, + 34D6C173134763AD00D82C14 /* Copy Icon */, + 34F1FD350E5D27710065CD22 /* Copy Frameworks */, + 8D11072E0486CEB800E47090 /* Frameworks */, + 341822660E2B176D003EC89B /* Copy Resources */, + ); + buildRules = ( + ); + dependencies = ( + 34A6E3401527633800BEA400 /* PBXTargetDependency */, + ); + name = ClientGame; + productInstallPath = "$(HOME)/Applications"; + productName = ClientGame; + productReference = 8D1107320486CEB800E47090 /* ClientGame.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ClientGame" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* ClientGame */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 34A6E3181527632500BEA400 /* Products */; + ProjectRef = 34A6E3171527632500BEA400 /* Angel.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* ClientGame */, + 3401564D15A9199300E4C8BF /* LuaExe */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 34A6E3291527632500BEA400 /* libAngel.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libAngel.a; + remoteRef = 34A6E3281527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34A6E32B1527632500BEA400 /* libBox2D.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libBox2D.a; + remoteRef = 34A6E32A1527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34A6E32D1527632500BEA400 /* libVorbis.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libVorbis.a; + remoteRef = 34A6E32C1527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34A6E32F1527632500BEA400 /* libOgg.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libOgg.a; + remoteRef = 34A6E32E1527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34A6E3311527632500BEA400 /* libGLFW.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libGLFW.a; + remoteRef = 34A6E3301527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34A6E3331527632500BEA400 /* libFTGL.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libFTGL.a; + remoteRef = 34A6E3321527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34A6E3351527632500BEA400 /* libFreeType.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libFreeType.a; + remoteRef = 34A6E3341527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34A6E3371527632500BEA400 /* libHIDUtilities.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libHIDUtilities.a; + remoteRef = 34A6E3361527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34A6E33B1527632500BEA400 /* libLua.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libLua.a; + remoteRef = 34A6E33A1527632500BEA400 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34FB48A81639001B002EB836 /* libGWEN.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libGWEN.a; + remoteRef = 34FB48A71639001B002EB836 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3401565215A919B200E4C8BF /* Build Lua */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Build Lua"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"${PROJECT_DIR}/Libraries/angel-lua-build\"\nmake -f Makefile-mac\n\n"; + }; + 341822660E2B176D003EC89B /* Copy Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Set the FMOD library to be loaded properly\ninstall_name_tool -change ./libfmodex.dylib @executable_path/../Frameworks/libfmodex.dylib \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n# Why on earth does this need to happen here?\nif [ ! -d \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" ]; then\n\tmkdir -p \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\"\nfi\n\n# Copy over all the images, sounds, fonts, and scripts\n\"${PROJECT_DIR}/../Angel/Libraries/angel-lua-build/lua\" \"${PROJECT_DIR}/../Tools/BuildScripts/mac-specific/CopyResources.lua\"\n\n# Run the publish step if we're building in Release\nif [ ${CONFIGURATION} == \"Release\" ]; then\n \"${PROJECT_DIR}/../Angel/Libraries/angel-lua-build/lua\" ../Tools/BuildScripts/publish_mac.lua -i \"${PROJECT_DIR}\" -o \"${PROJECT_DIR}/Published\" -g ClientGame.app\nfi"; + showEnvVarsInLog = 0; + }; + 34388F3B11E3EF61002A79B1 /* Generate Lua Wrapping */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate Lua Wrapping"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PROJECT_DIR}/../Angel/Libraries/angel-lua-build/lua\" ../Tools/BuildScripts/swig_wrap.lua -p \"${PROJECT_DIR}/..\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34974A330E2925BE0018A032 /* main.cpp in Sources */, + 34A6E2A71527568800BEA400 /* AngelLuaWrapping.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 34A6E3401527633800BEA400 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = LuaExe; + targetProxy = 34A6E33F1527633800BEA400 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 3401564F15A9199300E4C8BF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 3401565015A9199300E4C8BF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(PROJECT_DIR)/stdafx.h"; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + "\"$(PROJECT_DIR)/../Angel/Libraries/Box2D-2.2.1\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/FMOD/inc\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/glfw-3.0.3/include\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/libogg-1.3.0/include\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/libvorbis-1.3.2/include\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/lua-5.2.1/src\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/HID Utilities\"", + "\"$(PROJECT_DIR)/../Angel\"", + ); + INFOPLIST_FILE = platforms/mac/ClientGameInfo.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "\"$(PROJECT_DIR)/../Angel/Libraries/FMOD\"", + "\"$(SRCROOT)/../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib\"", + ); + PRODUCT_NAME = ClientGame; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(PROJECT_DIR)/stdafx.h"; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + "\"$(PROJECT_DIR)/../Angel/Libraries/Box2D-2.2.1\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/FMOD/inc\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/glfw-3.0.3/include\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/libogg-1.3.0/include\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/libvorbis-1.3.2/include\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/lua-5.2.1/src\"", + "\"$(PROJECT_DIR)/../Angel/Libraries/HID Utilities\"", + "\"$(PROJECT_DIR)/../Angel\"", + ); + INFOPLIST_FILE = platforms/mac/ClientGameInfo.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "\"$(PROJECT_DIR)/../Angel/Libraries/FMOD\"", + "\"$(SRCROOT)/../Angel/Libraries/DevIL-SDK-1.7.8/mac/lib\"", + ); + PRODUCT_NAME = ClientGame; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "RELEASE=0", + "DEBUG=1", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx10.8; + VALID_ARCHS = i386; + WARNING_CFLAGS = "-Wno-write-strings"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=0", + "RELEASE=1", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = NO; + SDKROOT = macosx10.8; + VALID_ARCHS = i386; + WARNING_CFLAGS = "-Wno-write-strings"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3401564E15A9199300E4C8BF /* Build configuration list for PBXAggregateTarget "LuaExe" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3401564F15A9199300E4C8BF /* Debug */, + 3401565015A9199300E4C8BF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ClientGame" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ClientGame" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/MACOSX/ClientGame.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MACOSX/ClientGame.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "self:ClientGame"> + </FileRef> +</Workspace> diff --git a/MACOSX/ClientGame.xcodeproj/project.xcworkspace/xcshareddata/ClientGame.xccheckout b/MACOSX/ClientGame.xcodeproj/project.xcworkspace/xcshareddata/ClientGame.xccheckout @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDESourceControlProjectFavoriteDictionaryKey</key> + <false/> + <key>IDESourceControlProjectIdentifier</key> + <string>6B03EA37-2108-4294-ABEB-487EDCBBC0CF</string> + <key>IDESourceControlProjectName</key> + <string>ClientGame</string> + <key>IDESourceControlProjectOriginsDictionary</key> + <dict> + <key>41EEE985-9611-45CE-8678-E8A9A314B646</key> + <string>http://github.com/angel2d/angel2d</string> + </dict> + <key>IDESourceControlProjectPath</key> + <string>Code/ClientGame/ClientGame.xcodeproj/project.xcworkspace</string> + <key>IDESourceControlProjectRelativeInstallPathDictionary</key> + <dict> + <key>41EEE985-9611-45CE-8678-E8A9A314B646</key> + <string>../../../..</string> + </dict> + <key>IDESourceControlProjectURL</key> + <string>http://github.com/angel2d/angel2d</string> + <key>IDESourceControlProjectVersion</key> + <integer>110</integer> + <key>IDESourceControlProjectWCCIdentifier</key> + <string>41EEE985-9611-45CE-8678-E8A9A314B646</string> + <key>IDESourceControlProjectWCConfigurations</key> + <array> + <dict> + <key>IDESourceControlRepositoryExtensionIdentifierKey</key> + <string>public.vcs.git</string> + <key>IDESourceControlWCCIdentifierKey</key> + <string>41EEE985-9611-45CE-8678-E8A9A314B646</string> + <key>IDESourceControlWCCName</key> + <string>angel2d</string> + </dict> + </array> +</dict> +</plist> diff --git a/MACOSX/ClientGame.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/MACOSX/ClientGame.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key> + <false/> +</dict> +</plist> diff --git a/MACOSX/ClientGame.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/UserInterfaceState.xcuserstate b/MACOSX/ClientGame.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ. diff --git a/MACOSX/ClientGame.xcodeproj/xcshareddata/xcschemes/ClientGame.xcscheme b/MACOSX/ClientGame.xcodeproj/xcshareddata/xcschemes/ClientGame.xcscheme @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0500" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "8D1107260486CEB800E47090" + BuildableName = "ClientGame.app" + BlueprintName = "ClientGame" + ReferencedContainer = "container:ClientGame.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <Testables> + </Testables> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "8D1107260486CEB800E47090" + BuildableName = "ClientGame.app" + BlueprintName = "ClientGame" + ReferencedContainer = "container:ClientGame.xcodeproj"> + </BuildableReference> + </MacroExpansion> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Debug" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "NO" + allowLocationSimulation = "NO"> + <BuildableProductRunnable> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "8D1107260486CEB800E47090" + BuildableName = "ClientGame.app" + BlueprintName = "ClientGame" + ReferencedContainer = "container:ClientGame.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "8D1107260486CEB800E47090" + BuildableName = "ClientGame.app" + BlueprintName = "ClientGame" + ReferencedContainer = "container:ClientGame.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/MACOSX/ClientGame.xcodeproj/xcuserdata/lsolofri.xcuserdatad/xcschemes/xcschememanagement.plist b/MACOSX/ClientGame.xcodeproj/xcuserdata/lsolofri.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>SuppressBuildableAutocreation</key> + <dict> + <key>3401564D15A9199300E4C8BF</key> + <dict> + <key>primary</key> + <true/> + </dict> + <key>8D1107260486CEB800E47090</key> + <dict> + <key>primary</key> + <true/> + </dict> + </dict> +</dict> +</plist> diff --git a/MACOSX/Resources/Scripts/autocomplete.lua b/MACOSX/Resources/Scripts/autocomplete.lua @@ -0,0 +1,87 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +local tabSplits = "[%.%:]" + +function getAutoCompletions(inc) + local forReturn = {} + + local return_prefix = "" + local remainder = inc + local searchTab = _G + local break_ind = remainder:find(tabSplits) + while (break_ind ~= nil) do + return_prefix = return_prefix .. remainder:sub(1, break_ind) + local prefix = remainder:sub(1, break_ind-1) + remainder = remainder:sub(break_ind+1, -1) + local prefTab = searchTab[prefix] + if (prefTab ~= nil) then + if (type(prefTab) == "table") then + searchTab = prefTab + elseif (type(prefTab) == "userdata") then + -- check if we have a .fn table + local m = getmetatable(prefTab) + if (m == nil) then + searchTab = nil + break + end + if (type(m[".fn"]) == "table") then + searchTab = m[".fn"] + end + else + searchTab = nil + break + end + else + searchTab = nil + break + end + break_ind = remainder:find(tabSplits) + end + + if (searchTab ~= nil) then + for name, val in pairs(searchTab) do + if (name:sub(1, #remainder) == remainder) then + if (type(val) == "function") then + name = name .. "(" + end + table.insert(forReturn, return_prefix .. tostring(name)) + end + end + end + + return forReturn +end + +function printAutoCompletions(inc) + ac = getAutoCompletions(inc) + if (type(ac) == "table") then + table.foreach(ac, print) + end +end diff --git a/MACOSX/Resources/Scripts/conf_load.lua b/MACOSX/Resources/Scripts/conf_load.lua @@ -0,0 +1,327 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +require "lfs" +require "util" + +TUNING_FILE_PATH = "Config/tuning.lua" + +local angelActorDefs = {} +setmetatable(angelActorDefs, {__index = _G}) + +local angelLevelDefs = {} + +local configUpdateTime = nil + + +-- Load tuning variable definitions from Config/tuning.lua. +function LoadTuningVariables() + local loadedTuning = {} + + loadFileIn(TUNING_FILE_PATH, loadedTuning) + + for var_name, data in pairs(loadedTuning) do + -- Don't load this from the file if we've been tuning it from the console. + if not (theTuning:IsRuntimeTuned(var_name)) then + if (data.type == "float") then + theTuning:SetFloat(var_name, data.value) + elseif (data.type == "int") then + theTuning:SetInt(var_name, data.value) + elseif (data.type == "string") then + theTuning:SetString(var_name, data.value) + elseif (data.type == "vector") then + theTuning:SetVector(var_name, data.value) + else + print("WARNING: " .. var_name .. " of unknown variable type.") + end + end + end +end + +-- Saves the current tuning variables back to the tuning.lua file, appending +-- any new ones that have been declared. +function SaveTuningVariables() + local truth = {"true", "1", "one", "yes", "on", "t"} + local tabDataPat = "(VARNAME[%s*]=[%s*]%{)(.*)(%})" -- finds tables of given names + local valDataPat = "(value[%s*]=[%s*])([^%s,]*)([,%s]*)" -- gets the data from those tables + local vecPat = "^%{%s*[%d%.]+%s*,%s*[%d%.]+%s*%}$" -- tells if a string is expressing a Vector2 + + -- load the file's data again, for comparison + local fileTuning = {} + + loadFileIn(TUNING_FILE_PATH, fileTuning) + local f = assert(io.open(TUNING_FILE_PATH, "r")) + local fileString = f:read("*all") + f:close() + + for _, v in pairs(theTuning:GetVariables()) do + if (fileTuning[v] ~= nil) then + -- already in the config file; find and change + local readonly = false + + -- first check to see if we're readonly + if (fileTuning[v].readonly ~= nil) then + if (type(fileTuning[v].readonly) == "boolean") then + readonly = fileTuning[v].readonly + else + for _, truthtest in pairs(truth) do + if (truthtest == fileTuning[v].readonly) then + readonly = true + end + end + if (fileTuning[v].readonly == 1) then + readonly = true + end + end + end + + -- skip this variable if it's readonly + if (readonly ~= true) then + -- extract existing data + local mtabdata = tabDataPat:gsub("VARNAME", v) + local prefix, data, postfix = fileString:match(mtabdata) + + local newVal = nil + if (fileTuning[v].type == "vector") then + newVal = theTuning:GetVector(v) + elseif (fileTuning[v].type == "float") then + newVal = theTuning:GetFloat(v) + elseif (fileTuning[v].type == "int") then + newVal = theTuning:GetInt(v) + elseif (fileTuning[v].type == "string") then + newVal = theTuning:GetString(v) + end + + -- we've got a new value, and the variable is not readonly + if (newVal ~= nil) then + local before, val, after = data:match(valDataPat) + local inString = before .. val .. after + local outString = before + if (fileTuning[v].type == "vector") then + outString = outString .. tostring(newVal) + elseif (fileTuning[v].type == "float") then + outString = outString .. string.format("%f", newVal) + elseif (fileTuning[v].type == "int") then + outString = outString .. string.format("%i", newVal) + elseif (fileTuning[v].type == "string") then + outString = outString .. tostring(newVal) + end + outString = outString .. after + local oldValData = prefix .. data .. postfix + local newValData = prefix .. data:gsub(inString, outString) .. postfix + local _begin, _end = fileString:find(oldValData, 1, true) + fileString = fileString:sub(1, _begin-1) .. newValData .. fileString:sub(_end+1, -1) + else + -- wtf, it's not any kind of acceptable tuning variable + end + end + else + -- not in the config file; add to the end + local valString = theTuning:GetString(v) + local valType = nil + -- see if we can make a vector from it + if (valString:match(vecPat) ~= nil) then + valType = "vector" + end + -- or coerce it into a number + if (tonumber(valString) ~= nil) then + valType = "float" + -- do we care about seeing if it should be an int? I'm going to go ahead and say no... + end + -- oh well, it's just a string then + if (valType == nil) then + valType = "string" + valString = '"' .. valString .. '"' + end + local outString = string.format("\n\n%s = {\n type = \"%s\", \n value = %s, \n}\n", v, valType, valString) + fileString = fileString .. outString + end + end + + -- write out the changes + f = assert(io.open(TUNING_FILE_PATH, "w")) + f:write(fileString) + f:close() +end + +-- Load actor definitions from Config/ActorDef/*.lua. +-- +-- Instantiate an Actor from a definition with Actor.Create(<name>) +-- +-- If called a second time, it will reload the file, so the definitions +-- will be updated, but any existing Actors that were created from them +-- remain the same. +function ReloadActorDefs() + cd = "Config/ActorDef/" + for f in lfs.dir(cd) do + if (not f:starts(".") and f:ends(".lua")) then + loadFileIn(cd .. f, angelActorDefs) + end + end +end + +-- Apply a configuration value to an Actor. +-- +-- We check for different forms the name might take: +-- If the config file listed "display_name", we would try to call +-- SetDisplayName, DisplayName, and display_name. Once one is found, +-- we stop trying. An error prints if no suitable match is found. +function _ApplyToActor(actor, config, value) + -- generate potential names + local pieces = config:split("_") + for i, piece in ipairs(pieces) do + pieces[i] = piece:gsub("^%l", string.upper) + end + local camel_case_name = table.concat(pieces) + local name_checks = {config, camel_case_name, "Set"..camel_case_name} + + -- see if any of those are in the actor's table + local fname = nil + for _, name in ipairs(name_checks) do + if ("function" == type(actor[name])) then + fname = name + break + end + end + + -- call the function if we can + if (nil == fname) then + print( string.format("WARNING: No method or attribute found for %s, %s, or %s", table.unpack(name_checks)) ) + else + actor[fname](actor, value) + end +end + +-- Instantiate an Actor from a previously loaded definition file. +-- +-- Returns the Actor -- it still has to be added to the World to +-- receive Update and Render calls. +function Actor_Create(actor_type) + local desc = angelActorDefs[actor_type] + if (desc == nil) then + print("ERROR: Actor definition " .. actor_type .. " not loaded.") + return nil + end + local class_name = desc.class + if (class_name == nil) then + class_name = "Actor" + end + if (type(_G[class_name][".constructor"]) ~= "function") then + print("ERROR: No class called " .. class_name .. " is available.") + return nil + end + local a = _G[class_name]() + + for config, value in pairs(desc) do + if (config ~= "class") then + _ApplyToActor(a, config, value) + end + end + + return a +end + +-- Instantiate an Actor and pass it back to the engine for use. +-- +-- This is used internally by the engine so it can directly get +-- at Actors that it instantiates with Create calls. (Otherwise +-- we would have to jump through some hoops to find them in +-- memory.) You probably shouldn't call this directly. +-- NB: This function also disowns the Actor so Lua won't +-- garbage-collect it. +function Actor_CreateAndRegister(actor_type) + a = Actor_Create(actor_type) + Actor_SetScriptCreatedActor(a) +end + +-- Instantiate and add all Actors described in a previously loaded +-- Level definition file. +-- +-- Call theWorld:ResetWorld() to remove all existing Actors beforehand +-- if you want to start over. +function LoadLevel(levelName) + local levelDef = angelLevelDefs[levelName] + if (levelDef == nil) then + print("Level definition " .. levelName .. " not loaded.") + return + end + + for name, desc in pairs(levelDef) do + local a = nil + + if (desc["def"] ~= nil and desc["class"] ~= nil) then + print("Actor " .. name .. " has both class and definition attributes. Invalid.") + return + end + + if (desc["def"] ~= nil) then + a = Actor_Create(desc["def"]) + elseif (desc["class"]~= nil and type(_G[desc["class"]][".constructor"]) == "function") then + a = _G[desc["class"]]() + else + print("Actor " .. name .. " has no definition specified.") + end + + if (a ~= nil) then + a:SetName(name) + local layer = tonumber(desc["layer"]) + if (layer == nil) then + layer = 0 + end + for config, value in pairs(desc) do + if (config ~= "def" and config ~= "class") then + _ApplyToActor(a, config, value) + end + end + theWorld:Add(a, layer) + local mt = getmetatable(a) + if (type(mt[".fn"]["InitPhysics"]) == "function") then + a:InitPhysics() + end + end + end +end + +-- Loads all levels in the Config/Level directory into the working +-- definitions list. +-- +-- Can be called again to reload all the level definitions. +function ReloadLevelDefs() + ld = "Config/Level/" + for f in lfs.dir(ld) do + if (not f:starts(".") and f:ends(".lua")) then + levelName = f:sub(1, f:find(".lua")-1) + angelLevelDefs[levelName] = {} + setmetatable(angelLevelDefs[levelName], {__index = _G}) + loadFileIn(ld .. f, angelLevelDefs[levelName]) + end + end +end + + diff --git a/MACOSX/Resources/Scripts/pref_load.lua b/MACOSX/Resources/Scripts/pref_load.lua @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +-- set up paths +if (package.path == nil) then + package.path = "" +end +package.path = package.path .. ";./Resources/Scripts/?.lua" + +require "lfs" +require "util" + +-- Load a file, and insert its values into the Angel preferences +function LoadAndInsertFile(prefPath) + local loadedPrefs = {} + + local attributes, err = lfs.attributes(prefPath) + if (attributes ~= nil) then + loadFileIn(prefPath, loadedPrefs) + + for category, var_list in pairs(loadedPrefs) do + for variable, value in pairs(var_list) do + if (type(value) == "number") then + if (math.floor(value) == value) then + angel.Preferences_GetInstance():SetInt(category, variable, value) + else + angel.Preferences_GetInstance():SetFloat(category, variable, value) + end + elseif (type(value) == "boolean") then + if (value) then + angel.Preferences_GetInstance():SetInt(category, variable, 1) + else + angel.Preferences_GetInstance():SetInt(category, variable, 0) + end + else + angel.Preferences_GetInstance():SetString(category, variable, value) + end + end + end + end +end + +function LoadPreferences() + -- Load base preferences file + LoadAndInsertFile(angel.Preferences_GetInstance():GetDefaultPath()) + + -- Load user overrides + LoadAndInsertFile(angel.Preferences_GetInstance():GetUserPrefsPath()) +end + +function errorHandler(err) + print(err) +end + +local status, err = xpcall(LoadPreferences, errorHandler) diff --git a/MACOSX/Resources/Scripts/start.lua b/MACOSX/Resources/Scripts/start.lua @@ -0,0 +1,94 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +-- set up paths +if (package.path == nil) then + package.path = "" +end +package.path = package.path .. ";./Resources/Scripts/?.lua" + +require "util" + +function catchExit() + print("Can't exit game from console.") +end + +if (ANGEL_MOBILE == false) then + function angelPrint(...) + local arg = {...} + local str + str = "" + for i=1, #arg do + if (str ~= "") then + str = str .. '\t' + end + str = str .. tostring(arg[i]) + end + LuaWrite(str) + end +end + +function angelStart() + -- merge everything into the global namespace + for k, v in pairs(angel) do + if (nil == _G[k]) then -- keep from overriding any built-ins + _G[k] = v + end + end + angel = nil + + -- override the built-in exit + os.exit = catchExit + + -- override printing to go to in-game console + if (ANGEL_MOBILE == false) then + print = angelPrint + io.write = angelPrint + end + + -- stir up some syntactic sugar + require("sugar") + + -- configuration loading + require("conf_load") + ReloadActorDefs() + ReloadLevelDefs() + + -- autocompletion + require("autocomplete") + + -- run the client code + require("client_start") +end + +function errorHandler(err) + print(err) +end + +local status, err = xpcall(angelStart, errorHandler) diff --git a/MACOSX/Resources/Scripts/sugar.lua b/MACOSX/Resources/Scripts/sugar.lua @@ -0,0 +1,101 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +require "util" + +-- Singleton shortcuts +theWorld = World_GetInstance() +theTagList = TagCollection_GetInstance() +theSwitchboard = Switchboard_GetInstance() +theCamera = Camera_GetInstance() +theSound = SoundDevice_GetInstance() +theTuning = Tuning_GetInstance() +thePrefs = Preferences_GetInstance() +if (ANGEL_MOBILE == false) then + theControllerManager = ControllerManager_GetInstance() + sysLog = CompoundLog_GetSystemLog() +end + +-- Input accessors +if (ANGEL_MOBILE == false) then + theController = theControllerManager:GetController() + controllerOne = theController + controllerTwo = theControllerManager:GetController(1) +end + +-- Convenience functions +function reset() + theWorld:ResetWorld() +end + +function tune(varName, newVal) + if (type(newVal) == "table") then + theTuning:SetVector(varName, newVal) + elseif (type(newVal) == "number") then + theTuning:SetFloat(varName, newVal) + else + theTuning:SetString(varName, tostring(newVal)) + end + + theTuning:AddToRuntimeTuningList(varName) +end + +-- COLOR_MAP and paint form a convenience function for setting a color and tag +-- at the same time. More importantly, it's a good goldspike to ensure that +-- the scripting <-> engine glue is functioning. (Note that it passes a +-- a table instead of a Color object, stress testing the input typemaps.) +COLOR_MAP = { + white = {1.0, 1.0, 1.0}, + black = {0.0, 0.0, 0.0}, + red = {1.0, 0.0, 0.0}, + green = {0.0, 1.0, 0.0}, + blue = {0.0, 0.0, 1.0}, + yellow = {1.0, 1.0, 0.0}, + magenta = {1.0, 0.0, 1.0}, + cyan = {0.0, 1.0, 1.0}, + purple = {0.5, 0.0, 1.0}, + orange = {1.0, 0.5, 0.0}, +} + +function paint(a, colorName) + colTable = COLOR_MAP[colorName] + + if (colTable == nil) then + print("No color " .. colorName .. " defined.") + return + end + + for name, val in pairs(COLOR_MAP) do + a:Untag(name) + end + a:SetColor(colTable) + a:Tag(colorName) +end + +addClassMethod("Actor", "Paint", paint) diff --git a/MACOSX/Resources/Scripts/util.lua b/MACOSX/Resources/Scripts/util.lua @@ -0,0 +1,69 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +function string:split(sep) + local sep, fields = sep or " ", {} + local pattern = string.format("([^%s]+)", sep) + self:gsub(pattern, function(c) fields[#fields+1] = c end) + return fields +end + +function string:starts(startString) + return string.sub(self, 1, string.len(startString)) == startString +end + +function string:ends(endString) + return endString == '' or string.sub(self, -string.len(endString)) == endString +end + +function loadFileIn(filename, environment) + if (environment == nil) then + print "ERROR: Cannot load into nil environment." + end + local f, err = loadfile(filename, "bt", environment) + if (f == nil) then + print(err) + return + end + return f() +end + +function addClassMethod(className, methodName, method) + if ("function" ~= type(method)) then + print ("WARNING: " .. method .. " is not a function.") + end + local reg = debug.getregistry() + local classTable = reg["SWIG"][className] + if (classTable == nil) then + print("WARNING: No class called " .. className .. " to give " .. method .. ".") + return + end + classTable[".fn"][tostring(methodName)] = method +end + diff --git a/MACOSX/platforms/ios/ClientGameInfo.plist b/MACOSX/platforms/ios/ClientGameInfo.plist @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundleDisplayName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIconFiles</key> + <array> + <string>Icon.png</string> + <string>Icon@2x.png</string> + <string>Icon-72.png</string> + <string>Icon-72@2x.png</string> + <string>Icon-Small.png</string> + <string>Icon-Small@2x.png</string> + <string>Icon-Small-50.png</string> + <string>Icon-Small-50@2x.png</string> + </array> + <key>CFBundleIdentifier</key> + <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>UIRequiredDeviceCapabilities</key> + <array> + <string>armv7</string> + </array> + <key>UIStatusBarHidden</key> + <true/> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationLandscapeRight</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + </array> + <key>UISupportedInterfaceOrientations~ipad</key> + <array> + <string>UIInterfaceOrientationLandscapeRight</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + </array> +</dict> +</plist> diff --git a/MACOSX/platforms/ios/Default-568h@2x.png b/MACOSX/platforms/ios/Default-568h@2x.png Binary files differ. diff --git a/MACOSX/platforms/ios/Default-Landscape.png b/MACOSX/platforms/ios/Default-Landscape.png Binary files differ. diff --git a/MACOSX/platforms/ios/Default-Landscape@2x.png b/MACOSX/platforms/ios/Default-Landscape@2x.png Binary files differ. diff --git a/MACOSX/platforms/ios/Default.png b/MACOSX/platforms/ios/Default.png Binary files differ. diff --git a/MACOSX/platforms/ios/Default@2x.png b/MACOSX/platforms/ios/Default@2x.png Binary files differ. diff --git a/MACOSX/platforms/ios/Icon-72.png b/MACOSX/platforms/ios/Icon-72.png Binary files differ. diff --git a/MACOSX/platforms/ios/Icon-72@2x.png b/MACOSX/platforms/ios/Icon-72@2x.png Binary files differ. diff --git a/MACOSX/platforms/ios/Icon-Small-50.png b/MACOSX/platforms/ios/Icon-Small-50.png Binary files differ. diff --git a/MACOSX/platforms/ios/Icon-Small-50@2x.png b/MACOSX/platforms/ios/Icon-Small-50@2x.png Binary files differ. diff --git a/MACOSX/platforms/ios/Icon-Small.png b/MACOSX/platforms/ios/Icon-Small.png Binary files differ. diff --git a/MACOSX/platforms/ios/Icon-Small@2x.png b/MACOSX/platforms/ios/Icon-Small@2x.png Binary files differ. diff --git a/MACOSX/platforms/ios/Icon.png b/MACOSX/platforms/ios/Icon.png Binary files differ. diff --git a/MACOSX/platforms/ios/Icon@2x.png b/MACOSX/platforms/ios/Icon@2x.png Binary files differ. diff --git a/MACOSX/platforms/ios/iPhoneMain.cpp b/MACOSX/platforms/ios/iPhoneMain.cpp @@ -0,0 +1,29 @@ +// This file is only relevant to the iPhone build of Angel. If you're building +// a desktop app, you can ignore it. + + +#include "iPhoneMain.h" + + +// This function is called by the iPhone setup process -- it's put here +// so that you don't have to slog through a bunch of Objective-C UI code +// if you don't want to. +void AngelGameInit() +{ + //adds a grid so you can more easily place Actors + GridActor *g = new GridActor(); + g->SetMinCoord(Vector2(-20, -15)); + g->SetMaxCoord(Vector2( 20, 15)); + theWorld.Add(g, -1); + + + + //YOUR GAME SETUP CODE HERE + + + + + + + +} diff --git a/MACOSX/platforms/ios/iPhoneMain.h b/MACOSX/platforms/ios/iPhoneMain.h @@ -0,0 +1,7 @@ +// This file is only relevant to the iPhone build of Angel. If you're building +// a desktop app, you can ignore it. + + + +//Exporting the header for your initialization code +void AngelGameInit();+ \ No newline at end of file diff --git a/MACOSX/platforms/ios/iTunesArtwork b/MACOSX/platforms/ios/iTunesArtwork Binary files differ. diff --git a/MACOSX/platforms/ios/iTunesArtwork@2x b/MACOSX/platforms/ios/iTunesArtwork@2x Binary files differ. diff --git a/MACOSX/platforms/mac/ClientGameInfo.plist b/MACOSX/platforms/mac/ClientGameInfo.plist @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIdentifier</key> + <string>com.yourcompany.${PRODUCT_NAME:identifier}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1.0</string> + <key>CFBundleIconFile</key> + <string>angel</string> + <key>NSHighResolutionCapable</key> + <true/> +</dict> +</plist> diff --git a/MACOSX/platforms/mac/angel.icns b/MACOSX/platforms/mac/angel.icns Binary files differ. diff --git a/MACOSX/platforms/win/ClientGame.rc b/MACOSX/platforms/win/ClientGame.rc @@ -0,0 +1,72 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "WinResrc.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "angel.ico" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/MACOSX/platforms/win/angel.ico b/MACOSX/platforms/win/angel.ico Binary files differ. diff --git a/MACOSX/platforms/win/resource.h b/MACOSX/platforms/win/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ClientGame.rc +// +#define IDI_ICON1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/MACOSX/stdafx.h b/MACOSX/stdafx.h @@ -0,0 +1,10 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + + +#include "Angel.h" + + +// TODO: reference additional headers your program requires here diff --git a/Makefile b/Makefile @@ -0,0 +1,83 @@ +ANGEL_DISABLE_FMOD := $(shell sed -rn 's/^[[:space:]]*\#define[[:space:]]+ANGEL_DISABLE_FMOD[[:space:]]+([[:digit:]])[[:space:]]*$$/\1/p' Angel/AngelConfig.h) +ANGEL_DISABLE_DEVIL := $(shell sed -rn 's/^[[:space:]]*\#define[[:space:]]+ANGEL_DISABLE_DEVIL[[:space:]]+([[:digit:]])[[:space:]]*$$/\1/p' Angel/AngelConfig.h) +CXX = g++ +TARGET = rogue-like +ANGEL_FLAGS = -D ANGEL_RELEASE +ARCH := $(shell uname -m) +ALLEGRO_LIBS := $(shell allegro-config --libs 2>/dev/null) +CWD := $(shell pwd) +CODE_DIR := $(shell dirname "$(CWD)") +LIBANGEL = Angel/libangel.a +LUA = Angel/Libraries/angel-lua-build/lua +WRAPPER = Angel/Scripting/Interfaces/AngelLuaWrapping.cpp + +INCLUDE = \ + -IAngel \ + -IAngel/Libraries/glfw-3.0.3/include \ + -IAngel/Libraries/Box2D-2.2.1 \ + -IAngel/Libraries/FTGL/include \ + -IAngel/Libraries/lua-5.2.1/src \ + -I/usr/include/freetype2 +ifneq ($(ANGEL_DISABLE_FMOD), 1) + INCLUDE += -IAngel/Libraries/FMOD/inc +endif + +LIBS = \ + $(LIBANGEL) \ + Angel/Libraries/glfw-3.0.3/src/libglfw3.a \ + Angel/Libraries/Box2D-2.2.1/Build/Box2D/libBox2D.a \ + Angel/Libraries/FTGL/unix/src/.libs/libftgl.a \ + Angel/Libraries/gwen/lib/linux/gmake/libgwen_static.a \ + Angel/Libraries/angel-lua-build/liblua.a + +ifneq ($(ANGEL_DISABLE_FMOD), 1) + ifeq ($(ARCH),x86_64) + LIBS += Angel/Libraries/FMOD/lib/libfmodex64.so + else + LIBS += Angel/Libraries/FMOD/lib/libfmodex.so + endif +endif + +SHLIBS = -lGL -lGLU -ldl -lfreetype -lXrandr -lX11 -lpthread -lrt -lXxf86vm -lXi +SHLIBS += $(ALLEGRO_LIBS) +ifeq ($(ANGEL_DISABLE_FMOD), 1) + SHLIBS += -lopenal -lvorbisfile +endif +ifneq ($(ANGEL_DISABLE_DEVIL),1) + SHLIBS += -lIL -lILU -lILUT +else + SHLIBS += -lpng +endif + +SYSSRCS = \ + $(WRAPPER) + +SRCS = $(wildcard Sources/src/*.cpp) + +SYSOBJS = $(patsubst %.cpp,%.o,$(SYSSRCS)) +OBJS = $(patsubst %.cpp,%.o,$(SRCS)) + +.PHONY: clean all SWIG-Wrapper + +%.o: %.cpp + $(CXX) -c $(INCLUDE) -Wno-write-strings -Wno-deprecated -o $@ $^ + +all: $(TARGET) + +publish: $(TARGET) + $(LUA) Tools/BuildScripts/publish_linux.lua -i $(CWD) -e ClientGame + +SWIG-Wrapper: + $(LUA) Tools/BuildScripts/swig_wrap.lua -p "$(CWD)" + +$(WRAPPER): SWIG-Wrapper + +$(TARGET): $(LIBANGEL) $(OBJS) $(SYSOBJS) $(WRAPPER) + $(CXX) -o $@ $(OBJS) $(SYSOBJS) $(LIBS) $(SHLIBS) $(ANGEL_FLAGS) + cp -p Angel/Scripting/EngineScripts/*.lua Resources/Scripts + +clean: + rm -f $(OBJS) $(SYSOBJS) $(TARGET) + +$(LIBANGEL): + cd Angel && make diff --git a/Maps/MapExample.json b/Maps/MapExample.json @@ -0,0 +1,41 @@ +{ + "General" : { + "name": "Example Map", + "callbacks": "SomeCallback", + "world": "Basic", + "id": "1" + }, + "Blocks": { + "1": { + "type": "ground", + "sprite": "/path/to/png" + }, + "2": { + "type": "wall", + "sprite": "/path/to/png" + }, + "3": { + "type": "corner", + "orientation": "90", + "sprite": "/path/to/png" + }, + "4": { + "heritage": "1", + "attribute": "start" + }, + "5": { + "heritage": "1", + "attribute": "end", + "nextMap": "2" + } + }, + "Map": { + { + {2,0,0,0,0,0,2}, + {2,0,0,0,0,0,2}, + {2,0,0,0,0,0,2}, + {2,0,0,0,0,0,2}, + {3,4,1,1,1,5,3} + } + } +} diff --git a/README.md b/README.md @@ -0,0 +1,34 @@ +# Rogue-Like +[![Build Status](https://travis-ci.org/Ne02ptzero/rogue-like.svg?branch=build)](https://travis-ci.org/Ne02ptzero/rogue-like) + +[![Join the chat at https://gitter.im/Ne02ptzero/rogue-like](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Ne02ptzero/rogue-like?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +### First draft on open project thoughts and timeline + +Our goal is to create a video game based on the quite popular genre hybrid Rogue-Like. It is a very broad type of game, but the main idea behind it is always the same. A playthrough that isn’t too long (can be finished in an hour or so) but a huge replayability. Each time you run through the game, you’ll encounter different enemies, bosses, objects, map layout, and finishing a playthrough is rewarding in itself for the player as it unlocks new objects/enemies/levels in order to alter the gameplay for the next run. The death is permanent, and once your character dies, you have to restart from the beginning. + +There are quite a few games available that use this concept. Overall, Rogue Legacy, Binding of Isaac, Faster Than Light depict it very well as they all offer this kind of gameplay. However, not a game is similar to the other. For example, Rogue Legacy is a 2D scrolling game with plateformer elements. Isaac is a 2D game where the gameplay is more inspired by “shoot them up” kind of games, and the view is overworld. Faster Than Light is an overworld game aswell, but the gameplay revolves more around unit-management. + +On the topic of our game, we are looking to create a 2D scrolling game with procedural-based map construction, using already existing tools such as a C++ open-sourced graphic and physics engine, in order to focus more heavily on the game itself. + +## Installation: + +### Linux and OSX +**Clone**: + +``` +git clone --recursive http://github.com/Ne02ptzero/rogue-like +``` + + +## About: +This project use [Angel2d](https://github.com/angel2d/angel2d), [Documentation](http://docs.angel2d.com/) + +### Authors: + +*Vincent Rey* (N0ich) <vin100.rey@gmail.com> + +*Louis Solofrizzo* (Ne02ptzero) <louis@ne02ptzero.me> + +### Contributing +[Here :)](Contributing.md) diff --git a/Resources/Fonts/Inconsolata.otf b/Resources/Fonts/Inconsolata.otf Binary files differ. diff --git a/Resources/Images/DefaultSkin.png b/Resources/Images/DefaultSkin.png Binary files differ. diff --git a/Resources/Scripts/autocomplete.lua b/Resources/Scripts/autocomplete.lua @@ -0,0 +1,87 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +local tabSplits = "[%.%:]" + +function getAutoCompletions(inc) + local forReturn = {} + + local return_prefix = "" + local remainder = inc + local searchTab = _G + local break_ind = remainder:find(tabSplits) + while (break_ind ~= nil) do + return_prefix = return_prefix .. remainder:sub(1, break_ind) + local prefix = remainder:sub(1, break_ind-1) + remainder = remainder:sub(break_ind+1, -1) + local prefTab = searchTab[prefix] + if (prefTab ~= nil) then + if (type(prefTab) == "table") then + searchTab = prefTab + elseif (type(prefTab) == "userdata") then + -- check if we have a .fn table + local m = getmetatable(prefTab) + if (m == nil) then + searchTab = nil + break + end + if (type(m[".fn"]) == "table") then + searchTab = m[".fn"] + end + else + searchTab = nil + break + end + else + searchTab = nil + break + end + break_ind = remainder:find(tabSplits) + end + + if (searchTab ~= nil) then + for name, val in pairs(searchTab) do + if (name:sub(1, #remainder) == remainder) then + if (type(val) == "function") then + name = name .. "(" + end + table.insert(forReturn, return_prefix .. tostring(name)) + end + end + end + + return forReturn +end + +function printAutoCompletions(inc) + ac = getAutoCompletions(inc) + if (type(ac) == "table") then + table.foreach(ac, print) + end +end diff --git a/Resources/Scripts/client_start.lua b/Resources/Scripts/client_start.lua @@ -0,0 +1,2 @@ +-- Put any Lua code you want to run at game startup here. + diff --git a/Resources/Scripts/conf_load.lua b/Resources/Scripts/conf_load.lua @@ -0,0 +1,327 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +require "lfs" +require "util" + +TUNING_FILE_PATH = "Config/tuning.lua" + +local angelActorDefs = {} +setmetatable(angelActorDefs, {__index = _G}) + +local angelLevelDefs = {} + +local configUpdateTime = nil + + +-- Load tuning variable definitions from Config/tuning.lua. +function LoadTuningVariables() + local loadedTuning = {} + + loadFileIn(TUNING_FILE_PATH, loadedTuning) + + for var_name, data in pairs(loadedTuning) do + -- Don't load this from the file if we've been tuning it from the console. + if not (theTuning:IsRuntimeTuned(var_name)) then + if (data.type == "float") then + theTuning:SetFloat(var_name, data.value) + elseif (data.type == "int") then + theTuning:SetInt(var_name, data.value) + elseif (data.type == "string") then + theTuning:SetString(var_name, data.value) + elseif (data.type == "vector") then + theTuning:SetVector(var_name, data.value) + else + print("WARNING: " .. var_name .. " of unknown variable type.") + end + end + end +end + +-- Saves the current tuning variables back to the tuning.lua file, appending +-- any new ones that have been declared. +function SaveTuningVariables() + local truth = {"true", "1", "one", "yes", "on", "t"} + local tabDataPat = "(VARNAME[%s*]=[%s*]%{)(.*)(%})" -- finds tables of given names + local valDataPat = "(value[%s*]=[%s*])([^%s,]*)([,%s]*)" -- gets the data from those tables + local vecPat = "^%{%s*[%d%.]+%s*,%s*[%d%.]+%s*%}$" -- tells if a string is expressing a Vector2 + + -- load the file's data again, for comparison + local fileTuning = {} + + loadFileIn(TUNING_FILE_PATH, fileTuning) + local f = assert(io.open(TUNING_FILE_PATH, "r")) + local fileString = f:read("*all") + f:close() + + for _, v in pairs(theTuning:GetVariables()) do + if (fileTuning[v] ~= nil) then + -- already in the config file; find and change + local readonly = false + + -- first check to see if we're readonly + if (fileTuning[v].readonly ~= nil) then + if (type(fileTuning[v].readonly) == "boolean") then + readonly = fileTuning[v].readonly + else + for _, truthtest in pairs(truth) do + if (truthtest == fileTuning[v].readonly) then + readonly = true + end + end + if (fileTuning[v].readonly == 1) then + readonly = true + end + end + end + + -- skip this variable if it's readonly + if (readonly ~= true) then + -- extract existing data + local mtabdata = tabDataPat:gsub("VARNAME", v) + local prefix, data, postfix = fileString:match(mtabdata) + + local newVal = nil + if (fileTuning[v].type == "vector") then + newVal = theTuning:GetVector(v) + elseif (fileTuning[v].type == "float") then + newVal = theTuning:GetFloat(v) + elseif (fileTuning[v].type == "int") then + newVal = theTuning:GetInt(v) + elseif (fileTuning[v].type == "string") then + newVal = theTuning:GetString(v) + end + + -- we've got a new value, and the variable is not readonly + if (newVal ~= nil) then + local before, val, after = data:match(valDataPat) + local inString = before .. val .. after + local outString = before + if (fileTuning[v].type == "vector") then + outString = outString .. tostring(newVal) + elseif (fileTuning[v].type == "float") then + outString = outString .. string.format("%f", newVal) + elseif (fileTuning[v].type == "int") then + outString = outString .. string.format("%i", newVal) + elseif (fileTuning[v].type == "string") then + outString = outString .. tostring(newVal) + end + outString = outString .. after + local oldValData = prefix .. data .. postfix + local newValData = prefix .. data:gsub(inString, outString) .. postfix + local _begin, _end = fileString:find(oldValData, 1, true) + fileString = fileString:sub(1, _begin-1) .. newValData .. fileString:sub(_end+1, -1) + else + -- wtf, it's not any kind of acceptable tuning variable + end + end + else + -- not in the config file; add to the end + local valString = theTuning:GetString(v) + local valType = nil + -- see if we can make a vector from it + if (valString:match(vecPat) ~= nil) then + valType = "vector" + end + -- or coerce it into a number + if (tonumber(valString) ~= nil) then + valType = "float" + -- do we care about seeing if it should be an int? I'm going to go ahead and say no... + end + -- oh well, it's just a string then + if (valType == nil) then + valType = "string" + valString = '"' .. valString .. '"' + end + local outString = string.format("\n\n%s = {\n type = \"%s\", \n value = %s, \n}\n", v, valType, valString) + fileString = fileString .. outString + end + end + + -- write out the changes + f = assert(io.open(TUNING_FILE_PATH, "w")) + f:write(fileString) + f:close() +end + +-- Load actor definitions from Config/ActorDef/*.lua. +-- +-- Instantiate an Actor from a definition with Actor.Create(<name>) +-- +-- If called a second time, it will reload the file, so the definitions +-- will be updated, but any existing Actors that were created from them +-- remain the same. +function ReloadActorDefs() + cd = "Config/ActorDef/" + for f in lfs.dir(cd) do + if (not f:starts(".") and f:ends(".lua")) then + loadFileIn(cd .. f, angelActorDefs) + end + end +end + +-- Apply a configuration value to an Actor. +-- +-- We check for different forms the name might take: +-- If the config file listed "display_name", we would try to call +-- SetDisplayName, DisplayName, and display_name. Once one is found, +-- we stop trying. An error prints if no suitable match is found. +function _ApplyToActor(actor, config, value) + -- generate potential names + local pieces = config:split("_") + for i, piece in ipairs(pieces) do + pieces[i] = piece:gsub("^%l", string.upper) + end + local camel_case_name = table.concat(pieces) + local name_checks = {config, camel_case_name, "Set"..camel_case_name} + + -- see if any of those are in the actor's table + local fname = nil + for _, name in ipairs(name_checks) do + if ("function" == type(actor[name])) then + fname = name + break + end + end + + -- call the function if we can + if (nil == fname) then + print( string.format("WARNING: No method or attribute found for %s, %s, or %s", table.unpack(name_checks)) ) + else + actor[fname](actor, value) + end +end + +-- Instantiate an Actor from a previously loaded definition file. +-- +-- Returns the Actor -- it still has to be added to the World to +-- receive Update and Render calls. +function Actor_Create(actor_type) + local desc = angelActorDefs[actor_type] + if (desc == nil) then + print("ERROR: Actor definition " .. actor_type .. " not loaded.") + return nil + end + local class_name = desc.class + if (class_name == nil) then + class_name = "Actor" + end + if (type(_G[class_name][".constructor"]) ~= "function") then + print("ERROR: No class called " .. class_name .. " is available.") + return nil + end + local a = _G[class_name]() + + for config, value in pairs(desc) do + if (config ~= "class") then + _ApplyToActor(a, config, value) + end + end + + return a +end + +-- Instantiate an Actor and pass it back to the engine for use. +-- +-- This is used internally by the engine so it can directly get +-- at Actors that it instantiates with Create calls. (Otherwise +-- we would have to jump through some hoops to find them in +-- memory.) You probably shouldn't call this directly. +-- NB: This function also disowns the Actor so Lua won't +-- garbage-collect it. +function Actor_CreateAndRegister(actor_type) + a = Actor_Create(actor_type) + Actor_SetScriptCreatedActor(a) +end + +-- Instantiate and add all Actors described in a previously loaded +-- Level definition file. +-- +-- Call theWorld:ResetWorld() to remove all existing Actors beforehand +-- if you want to start over. +function LoadLevel(levelName) + local levelDef = angelLevelDefs[levelName] + if (levelDef == nil) then + print("Level definition " .. levelName .. " not loaded.") + return + end + + for name, desc in pairs(levelDef) do + local a = nil + + if (desc["def"] ~= nil and desc["class"] ~= nil) then + print("Actor " .. name .. " has both class and definition attributes. Invalid.") + return + end + + if (desc["def"] ~= nil) then + a = Actor_Create(desc["def"]) + elseif (desc["class"]~= nil and type(_G[desc["class"]][".constructor"]) == "function") then + a = _G[desc["class"]]() + else + print("Actor " .. name .. " has no definition specified.") + end + + if (a ~= nil) then + a:SetName(name) + local layer = tonumber(desc["layer"]) + if (layer == nil) then + layer = 0 + end + for config, value in pairs(desc) do + if (config ~= "def" and config ~= "class") then + _ApplyToActor(a, config, value) + end + end + theWorld:Add(a, layer) + local mt = getmetatable(a) + if (type(mt[".fn"]["InitPhysics"]) == "function") then + a:InitPhysics() + end + end + end +end + +-- Loads all levels in the Config/Level directory into the working +-- definitions list. +-- +-- Can be called again to reload all the level definitions. +function ReloadLevelDefs() + ld = "Config/Level/" + for f in lfs.dir(ld) do + if (not f:starts(".") and f:ends(".lua")) then + levelName = f:sub(1, f:find(".lua")-1) + angelLevelDefs[levelName] = {} + setmetatable(angelLevelDefs[levelName], {__index = _G}) + loadFileIn(ld .. f, angelLevelDefs[levelName]) + end + end +end + + diff --git a/Resources/Scripts/pref_load.lua b/Resources/Scripts/pref_load.lua @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +-- set up paths +if (package.path == nil) then + package.path = "" +end +package.path = package.path .. ";./Resources/Scripts/?.lua" + +require "lfs" +require "util" + +-- Load a file, and insert its values into the Angel preferences +function LoadAndInsertFile(prefPath) + local loadedPrefs = {} + + local attributes, err = lfs.attributes(prefPath) + if (attributes ~= nil) then + loadFileIn(prefPath, loadedPrefs) + + for category, var_list in pairs(loadedPrefs) do + for variable, value in pairs(var_list) do + if (type(value) == "number") then + if (math.floor(value) == value) then + angel.Preferences_GetInstance():SetInt(category, variable, value) + else + angel.Preferences_GetInstance():SetFloat(category, variable, value) + end + elseif (type(value) == "boolean") then + if (value) then + angel.Preferences_GetInstance():SetInt(category, variable, 1) + else + angel.Preferences_GetInstance():SetInt(category, variable, 0) + end + else + angel.Preferences_GetInstance():SetString(category, variable, value) + end + end + end + end +end + +function LoadPreferences() + -- Load base preferences file + LoadAndInsertFile(angel.Preferences_GetInstance():GetDefaultPath()) + + -- Load user overrides + LoadAndInsertFile(angel.Preferences_GetInstance():GetUserPrefsPath()) +end + +function errorHandler(err) + print(err) +end + +local status, err = xpcall(LoadPreferences, errorHandler) diff --git a/Resources/Scripts/start.lua b/Resources/Scripts/start.lua @@ -0,0 +1,94 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +-- set up paths +if (package.path == nil) then + package.path = "" +end +package.path = package.path .. ";./Resources/Scripts/?.lua" + +require "util" + +function catchExit() + print("Can't exit game from console.") +end + +if (ANGEL_MOBILE == false) then + function angelPrint(...) + local arg = {...} + local str + str = "" + for i=1, #arg do + if (str ~= "") then + str = str .. '\t' + end + str = str .. tostring(arg[i]) + end + LuaWrite(str) + end +end + +function angelStart() + -- merge everything into the global namespace + for k, v in pairs(angel) do + if (nil == _G[k]) then -- keep from overriding any built-ins + _G[k] = v + end + end + angel = nil + + -- override the built-in exit + os.exit = catchExit + + -- override printing to go to in-game console + if (ANGEL_MOBILE == false) then + print = angelPrint + io.write = angelPrint + end + + -- stir up some syntactic sugar + require("sugar") + + -- configuration loading + require("conf_load") + ReloadActorDefs() + ReloadLevelDefs() + + -- autocompletion + require("autocomplete") + + -- run the client code + require("client_start") +end + +function errorHandler(err) + print(err) +end + +local status, err = xpcall(angelStart, errorHandler) diff --git a/Resources/Scripts/sugar.lua b/Resources/Scripts/sugar.lua @@ -0,0 +1,101 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +require "util" + +-- Singleton shortcuts +theWorld = World_GetInstance() +theTagList = TagCollection_GetInstance() +theSwitchboard = Switchboard_GetInstance() +theCamera = Camera_GetInstance() +theSound = SoundDevice_GetInstance() +theTuning = Tuning_GetInstance() +thePrefs = Preferences_GetInstance() +if (ANGEL_MOBILE == false) then + theControllerManager = ControllerManager_GetInstance() + sysLog = CompoundLog_GetSystemLog() +end + +-- Input accessors +if (ANGEL_MOBILE == false) then + theController = theControllerManager:GetController() + controllerOne = theController + controllerTwo = theControllerManager:GetController(1) +end + +-- Convenience functions +function reset() + theWorld:ResetWorld() +end + +function tune(varName, newVal) + if (type(newVal) == "table") then + theTuning:SetVector(varName, newVal) + elseif (type(newVal) == "number") then + theTuning:SetFloat(varName, newVal) + else + theTuning:SetString(varName, tostring(newVal)) + end + + theTuning:AddToRuntimeTuningList(varName) +end + +-- COLOR_MAP and paint form a convenience function for setting a color and tag +-- at the same time. More importantly, it's a good goldspike to ensure that +-- the scripting <-> engine glue is functioning. (Note that it passes a +-- a table instead of a Color object, stress testing the input typemaps.) +COLOR_MAP = { + white = {1.0, 1.0, 1.0}, + black = {0.0, 0.0, 0.0}, + red = {1.0, 0.0, 0.0}, + green = {0.0, 1.0, 0.0}, + blue = {0.0, 0.0, 1.0}, + yellow = {1.0, 1.0, 0.0}, + magenta = {1.0, 0.0, 1.0}, + cyan = {0.0, 1.0, 1.0}, + purple = {0.5, 0.0, 1.0}, + orange = {1.0, 0.5, 0.0}, +} + +function paint(a, colorName) + colTable = COLOR_MAP[colorName] + + if (colTable == nil) then + print("No color " .. colorName .. " defined.") + return + end + + for name, val in pairs(COLOR_MAP) do + a:Untag(name) + end + a:SetColor(colTable) + a:Tag(colorName) +end + +addClassMethod("Actor", "Paint", paint) diff --git a/Resources/Scripts/util.lua b/Resources/Scripts/util.lua @@ -0,0 +1,69 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +function string:split(sep) + local sep, fields = sep or " ", {} + local pattern = string.format("([^%s]+)", sep) + self:gsub(pattern, function(c) fields[#fields+1] = c end) + return fields +end + +function string:starts(startString) + return string.sub(self, 1, string.len(startString)) == startString +end + +function string:ends(endString) + return endString == '' or string.sub(self, -string.len(endString)) == endString +end + +function loadFileIn(filename, environment) + if (environment == nil) then + print "ERROR: Cannot load into nil environment." + end + local f, err = loadfile(filename, "bt", environment) + if (f == nil) then + print(err) + return + end + return f() +end + +function addClassMethod(className, methodName, method) + if ("function" ~= type(method)) then + print ("WARNING: " .. method .. " is not a function.") + end + local reg = debug.getregistry() + local classTable = reg["SWIG"][className] + if (classTable == nil) then + print("WARNING: No class called " .. className .. " to give " .. method .. ".") + return + end + classTable[".fn"][tostring(methodName)] = method +end + diff --git a/Resources/Sounds/empty.txt b/Resources/Sounds/empty.txt diff --git a/Sources/inc/main.hpp b/Sources/inc/main.hpp @@ -0,0 +1,7 @@ +#ifndef __MAIN__ +# define __MAIN__ + +# include "../../Angel/Angel.h" + + +#endif diff --git a/Sources/src/main.cpp b/Sources/src/main.cpp @@ -0,0 +1,38 @@ +#include "../inc/main.hpp" + + +int main(int argc, char* argv[]) +{ + // get things going + // optional parameters: + // int windowWidth default: 1024 + // int windowHeight default: 768 + // std::string windowName default: "Angel Engine" + // bool antiAliasing default: false + // bool fullScreen default: false + // bool resizable default: false + theWorld.Initialize(1024, 768, "Test", false, false, false); + + //adds the default grid so you can more easily place Actors + //theWorld.Add(new GridActor(), -1); + + //YOUR GAME SETUP CODE HERE + + + + + + + + + + + + // do all your setup first, because this function won't return until you're exiting + theWorld.StartGame(); + + // any cleanup can go here + theWorld.Destroy(); + + return 0; +} diff --git a/Tools/BuildScripts/Attributions/base-angel.txt b/Tools/BuildScripts/Attributions/base-angel.txt @@ -0,0 +1,177 @@ +----------------- +Angel +Copyright © 2008-2014, Shane Liesegang +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of any + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +----------------- +GLFW +http://glfw.sourceforge.net/ +Copyright © 2002-2006 Marcus Geelnard +Copyright © 2006-2012 Camilla Berglund <elmindreda@elmindreda.org> + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would + be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. +----------------- +Lua 5.2.1 +Copyright © 1994-2012 Lua.org, PUC-Rio. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +----------------- +LuaFileSystem 1.5.0 +Copyright © 2003 Kepler Project. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +----------------- +FreeType2 +Portions of this software are copyright © 2011 The FreeType +Project (www.freetype.org). All rights reserved. +----------------- +GWEN +Copyright © 2010 Facepunch Studios. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +----------------- +Box2D +http://www.box2d.org/ +Copyright © 2006-2010 Erin Catto http://www.gphysics.com +----------------- +A* Algorithm Implementation using STL is +Copyright © 2001-2005 Justin Heyes-Jones +----------------- +FTGL +http://ftgl.wiki.sourceforge.net/ +Copyright © 2001-2003 Henry Maddocks + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +----------------- +LibPNG 1.4.1 +http://www.libpng.org/ +Libpng is OSI Certified Open Source Software. OSI Certified is a certification +mark of the Open Source Initiative. +Copyright © 1998-2010 Glenn Randers-Pehrson. +Version 0.96 Copyright © 1996, 1997 Andreas Dilger. +Version 0.88 Copyright © 1995, 1996 Guy Eric Schalnat, Group 42, Inc. +----------------- +ZLib 1.2.3 +http://www.zlib.net/ +Copyright © 1995-2005 Jean-loup Gailly and Mark Adler. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, +IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT +ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Permission to use, copy and distribute this software and its documentation for +any purpose is hereby granted without fee, provided that the above copyright +notices and this permission notice appear in all copies of the software and +related documentation. diff --git a/Tools/BuildScripts/Attributions/devil-libs.txt b/Tools/BuildScripts/Attributions/devil-libs.txt @@ -0,0 +1,100 @@ +----------------- +This software uses the DevIL cross-platform image library. +Copyright © 2000-2009 by Denton Woods +See http://openil.sourceforge.net for details. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +----------------- +LibJPEG 8a +http://www.ijg.org/ +This software is copyright © 1991-2010, Thomas G. Lane. All Rights Reserved. +----------------- +LibTIFF 3.9.2 +http://www.remotesensing.org/libtiff/ +Copyright © 1988-2009 Sam Leffler +Copyright © 1991-2009 Silicon Graphics, Inc. +----------------- +LibMNG 1.0.10 +http://www.libmng.com/ +Copyright © 2000-2007 Gerard Juyn (gerard@libmng.com). +----------------- +LittleCMS 1.19 +http://littlecms.com/ +Copyright © 1998-2007 Marti Maria Saguer. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +----------------- +JasPer 1.900.1 +http://www.ece.uvic.ca/~mdadams/jasper/ +Copyright © 2001-2006 Michael David Adams +Copyright © 1999-2000 Image Power, Inc. +Copyright © 1999-2000 The University of British Columbia + +All rights reserved. + +Permission is hereby granted, free of charge, to any person (the "User") +obtaining a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including without +limitation the rights to use, copy, modify, merge, publish, distribute, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +1. The above copyright notices and this permission notice (which includes the +disclaimer below) shall be included in all copies or substantial portions of +the Software. + +2. The name of a copyright holder shall not be used to endorse or promote +products derived from the Software without specific prior written permission. + +THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO +USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. THE +SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE PROVIDED BY THE +COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE THE PATENT OR OTHER +INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. EACH COPYRIGHT HOLDER +DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS BROUGHT BY ANY OTHER ENTITY +BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR OTHERWISE. AS A +CONDITION TO EXERCISING THE RIGHTS GRANTED HEREUNDER, EACH USER HEREBY ASSUMES +SOLE RESPONSIBILITY TO SECURE ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, +IF ANY. THE SOFTWARE IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN +MISSION-CRITICAL SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR +FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL +SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE +FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, PERSONAL +INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). +THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY EXPRESS OR IMPLIED WARRANTY OF +FITNESS FOR HIGH RISK ACTIVITIES. diff --git a/Tools/BuildScripts/Attributions/fmod.txt b/Tools/BuildScripts/Attributions/fmod.txt @@ -0,0 +1,3 @@ +----------------- +FMOD Sound System +copyright © Firelight Technologies Pty, Ltd., 1994-2012. diff --git a/Tools/BuildScripts/Attributions/lgpl.txt b/Tools/BuildScripts/Attributions/lgpl.txt @@ -0,0 +1,485 @@ +----------------- + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + + Copyright (C) 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/Tools/BuildScripts/Attributions/ogg-vorbis.txt b/Tools/BuildScripts/Attributions/ogg-vorbis.txt @@ -0,0 +1,31 @@ +----------------- +LibOgg 1.3.0 +LibVorbis 1.3.2 +Copyright © 2002-2008, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Tools/BuildScripts/Attributions/openal-soft.txt b/Tools/BuildScripts/Attributions/openal-soft.txt @@ -0,0 +1,19 @@ +----------------- +OpenAL Soft 1.13 +Copyright © 1999-2007 by authors. + +This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + +You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +Or go to http://www.gnu.org/copyleft/lgpl.html diff --git a/Tools/BuildScripts/Doc/angel-header.png b/Tools/BuildScripts/Doc/angel-header.png Binary files differ. diff --git a/Tools/BuildScripts/Doc/footer.html b/Tools/BuildScripts/Doc/footer.html @@ -0,0 +1,15 @@ +<hr class="footer"> + +<address class="footer"><small><a rel="license" href="http://creativecommons.org/licenses/BSD/"><img alt="BSD License" style="border-width:0" src="http://creativecommons.org/images/license/40bsd.png" align="middle"/></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Software" property="dc:title" rel="dc:type">Angel</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/BSD/">BSD-style License</a>.</small></address></address> + +<br/> + +<address class="footer"><small><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/us/88x31.png" /></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">Angel Documentation</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</small></address> + +<br/> + +<address class="footer"><small> +Generated on $datetime for $projectname by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" class="footer"/></a> $doxygenversion</small></address> + +</body> +</html> diff --git a/Tools/BuildScripts/Doc/footer_host.html b/Tools/BuildScripts/Doc/footer_host.html @@ -0,0 +1,25 @@ +<hr class="footer"> + +<address class="footer"><small><a rel="license" href="http://creativecommons.org/licenses/BSD/"><img alt="BSD License" style="border-width:0" src="http://creativecommons.org/images/license/40bsd.png" align="middle"/></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Software" property="dc:title" rel="dc:type">Angel</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/BSD/">BSD-style License</a>.</small></address></address> + +<br/> + +<address class="footer"><small><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/us/88x31.png" /></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">Angel Documentation</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</small></address> + +<br/> + +<address class="footer"><small> +Generated on $datetime for $projectname by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" class="footer"/></a> $doxygenversion</small></address> + +<script type="text/javascript"> +var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); +document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); +</script> +<script type="text/javascript"> +try { +var pageTracker = _gat._getTracker("UA-332303-6"); +pageTracker._trackPageview(); +} catch(err) {}</script> + +</body> +</html> diff --git a/Tools/BuildScripts/angel_build.lua b/Tools/BuildScripts/angel_build.lua @@ -0,0 +1,363 @@ +------------------------------------------------------------------------------ +-- Copyright (C) 2008-2014, Shane Liesegang +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- * Neither the name of the copyright holder nor the names of any +-- contributors may be used to endorse or promote products derived from +-- this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-- POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------ + +require "lfs" +require "io" + +if (package.path == nil) then + package.path = "" +end +local mydir = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] +if (mydir == nil) then + mydir = "." +end +package.path = mydir .. "?.lua;" .. package.path +package.path = package.path .. ";" .. mydir .. "lua-lib/penlight-1.0.2/lua/?/init.lua" +package.path = package.path .. ";" .. mydir .. "lua-lib/penlight-1.0.2/lua/?.lua" +package.path = package.path .. ";" .. mydir .. "lua-lib/penlight-1.0.2/lua/pl/?.lua" + +require "pl" + +-- whether this file is hidden and should thus be ignored +-- (mostly used for skipping .svn directories) +function _isdotfile(filePath) + if (path.basename(filePath):sub(1,1) == ".") then + return true + else + return false + end +end + +-- because the penlight copy function doesn't preserve case on windows. :-( +function copyfile(from, to) + if (path.is_windows) then + os.execute(string.format('copy /Y "%s" "%s" > nul', from, to)) + else + dir.copyfile(from, to, true) + end +end + +-- this and makedirs blatantly copied from penlight, but without +-- normalizing the case on Windows, because that is dumb +local dirpat +if path.is_windows then + dirpat = '(.+)\\[^\\]+$' +else + dirpat = '(.+)/[^/]+$' +end + +-- makes a path recursively +-- (there was some good reason at some point to re-implement this here instead +-- of using the penlight version) +function makedirs(p) + -- windows root drive case + if(p:find('^%a:$')) then + return true + end + + if not path.isdir(p) then + local subp = p:match(dirpat) + if not (makedirs(subp)) then + io.stderr:write("ERROR: Cannot create " .. subp .. "\n") + os.exit(1) + end + return lfs.mkdir(p) + else + return true + end +end + +-- recursively copy a directory and its files from src to dst +function recursive_copy(src, dst) + if (_isdotfile(src)) then + -- print("Skipping " .. path.basename(src)) + return + end + + if (not path.exists(src)) then + return + end + + if (not path.exists(dst)) then + makedirs(dst) + end + + local names = dir.getfiles(src, "") + for _, name in pairs(names) do + if (not _isdotfile(name)) then + name = path.basename(name) + local srcname = fulljoin(src, name) + local dstname = fulljoin(dst, name) + copyfile(srcname, dstname) + end + end + + local dirs = dir.getdirectories(src, "") + for _, dirname in pairs(dirs) do + dirname = path.basename(dirname) + local srcname = fulljoin(src, dirname) + local dstname = fulljoin(dst, dirname) + recursive_copy(srcname, dstname) + end +end + +-- split a string into a table along a single separator character +function string:split(sep) + local sep, fields = sep or " ", {} + local pattern = string.format("([^%s]+)", sep) + self:gsub(pattern, function(c) fields[#fields+1] = c end) + return fields +end + +--trim leading and following whitespace from a string +function string:trim() + return self:match("^%s*(.-)%s*$") +end + +-- <sigh> the penlight library only joins paths one at a time. :-( +-- (this also corrects for its inability to deal with quoted paths) +function fulljoin(...) + local arg = {...} + local isQuoted = false + -- check to see if any of the paths have quotes in them + for i, v in ipairs(arg) do + if (v:find('"')) then + isQuoted = true + arg[i] = v:gsub('"', '') + end + end + + local for_return = "" + for i, v in ipairs(arg) do + for_return = path.join(for_return, v) + end + + if (isQuoted) then + for_return = '"' .. for_return .. '"' + end + return for_return +end + +-- load a file using the passed table as its environment +function loadFileIn(filename, environment) + if (environment == nil) then + print "ERROR: Cannot load into nil environment." + end + local f, err = loadfile(filename, "bt", environment) + if (f == nil) then + print(err) + return + end + return f() +end + +-- get the absolute path to the current file +function get_file_location() + local file_location = debug.getinfo(2,'S').source + if (file_location:sub(1,1) == "@") then + file_location = file_location:sub(2, -1) + end + return (path.dirname(path.abspath(file_location))) +end + +-- correct a given attributions file to claim the used libraries +function correct_attributions(filename, att_dir, disable_devil, disable_fmod) + local function append_to(file_handle, newfile) + local newfile_handle = assert(io.open(newfile, "r")) + local newtext = newfile_handle:read("*all") + newfile_handle:close() + file_handle:write(newtext) + end + + local lgpl = false + + local f = assert(io.open(filename, "a+")) + append_to(f, fulljoin(att_dir, "base-angel.txt")) + if (disable_devil ~= 1) then + append_to(f, fulljoin(att_dir, "devil-libs.txt")) + lgpl = true + end + if (disable_fmod == 1) then + append_to(f, fulljoin(att_dir, "ogg-vorbis.txt")) + if (path.is_windows) then + append_to(f, fulljoin(att_dir, "openal-soft.txt")) + lgpl = true + end + else + append_to(f, fulljoin(att_dir, "fmod.txt")) + end + + if (lgpl) then + append_to(f, fulljoin(att_dir, "lgpl.txt")) + end + + f:close() +end + +-- make sure that the installed SWIG is up to date +function check_swig_version(path) + local f = assert(io.popen(path.." -version", 'r')) + local s = assert(f:read('*a')) + f:close() + + version = s:match("\n%s*SWIG Version%s+([^%s]*)") + vparts = version:split(".") + + -- check that we're at at least 2.0.6 + local old = false + if (tonumber(vparts[1]) < 2) then + old = true + elseif ((tonumber(vparts[2]) < 1) and (tonumber(vparts[3]) < 6)) then + old = true + end + + if (old) then + io.stderr:write("ERROR: swig version "..version.." is too old for Angel; update to at least 2.0.6.\n") + os.exit(1) + end +end + +-- find a local install of SWIG +function get_swig_path() + local platform = app.platform() + local angelSwigPath = path.join("..", "..", "Angel", "Libraries", "swig", "angelSwig") + + local libPath = path.join(angelSwigPath, "swiglib") + local exePath = "" + if (platform == "Windows") then + exePath = path.join(angelSwigPath, "windows", "swig.exe") + elseif (platform == "OSX") then + exePath = path.join(angelSwigPath, "mac", "swig") + elseif (platform == "Linux") then + exePath = path.join(angelSwigPath, "linux", "swig") + end + + return exePath .. " -I" .. libPath .. " -I" .. path.join(libPath, "lua") +end + +function find_in_table(haystack, needle) + for _,v in pairs(haystack) do + if v == needle then + return true + end + end + return false +end + +-- generate typemap inheritance for SWIG factories +function generate_typemaps(interface_directory, additional_defines) + local swig = get_swig_path() + local junkfile = fulljoin(interface_directory, "..", "..", "..", "Tools", "BuildScripts", "build_cache", "swigout.txt") + local inheritance_file = "" + if (find_in_table(additional_defines, "INTROGAME")) then + inheritance_file = fulljoin(interface_directory, "inheritance_intro.i") + else + inheritance_file = fulljoin(interface_directory, "inheritance.i") + end + if (not path.exists(inheritance_file:gsub('"', ''))) then + -- need to make sure we have at least a blank file for swig to include + -- when it runs to get the type data + local inheritance_handle = assert(io.open(inheritance_file:gsub('"', ''), "w")) + inheritance_handle:close() + end + local swig_options = "" + if (additional_defines ~= nil) then + swig_options = swig_options .. " -D" .. table.concat(additional_defines, " -D") + end + swig_options = swig_options .. " -c++ -lua -Werror -debug-typedef -I" .. interface_directory .. " -o " .. junkfile .. " " .. fulljoin(interface_directory, "angel.i") + + local exe_string = swig .. swig_options + local f = assert(io.popen(exe_string, 'r')) + local s = assert(f:read('*a')) + f:close() + + local separator = "-------------------------------------------------------------" + local class_data = {} + local immediate_class_data = {} + local class_pattern = "Type scope '(%w+)'" + local inh_patterh = "Inherits from '(%w+)'" + local splits = s:split(separator) + for _, v in pairs(splits) do + local _, _, class = v:find(class_pattern) + if (class ~= nil) then + local lines = v:split("\n") + if (#lines == 1) then + -- no inheritance here + else + immediate_class_data[class] = {} + for i=1,#lines do -- skip the first line + local _, _, base = lines[i]:find(inh_patterh) + if (base ~= nil) then + if (class_data[base] == nil) then + class_data[base] = {} + end + table.insert(class_data[base], class) + table.insert(immediate_class_data[class], base) + end + end + end + end + end + + local sortf = function(class1, class2) + local parents1 = immediate_class_data[class1] + local parents2 = immediate_class_data[class2] + if (parents1 == nil and parents2 == nil) then + return false + end + if (parents1 ~= nil) then + for _, p in pairs(parents1) do + if (p == class2) then + -- the second class is a parent of the first + return true + end + end + end + return false + end + + local out_strings = {} + for base, descendants in pairs(class_data) do + table.sort(class_data[base], sortf) + table.insert(out_strings, "%factory("..base.."*, "..table.concat(descendants, ", ")..");") + end + table.sort(out_strings) + + local out_string = "%include <factory.i>\n\n" .. table.concat(out_strings, "\n") + + local out_file = assert(io.open(inheritance_file:gsub('"', ''), "r")) + local current_file = out_file:read("*a") + out_file:close() + if (current_file ~= out_string) then + out_file = assert(io.open(inheritance_file:gsub('"', ''), "w")) + out_file:write(out_string) + out_file:close() + end +end + diff --git a/Tools/BuildScripts/build_cache/empty.txt b/Tools/BuildScripts/build_cache/empty.txt @@ -0,0 +1 @@ +(this file intentionally left empty.)+ \ No newline at end of file diff --git a/Tools/BuildScripts/build_cache/swigout.txt b/Tools/BuildScripts/build_cache/swigout.txt @@ -0,0 +1,29899 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGLUA +#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA +#define SWIG_LUA_MODULE_GLOBAL + + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template<typename T> class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); + SwigValueWrapper(const SwigValueWrapper<T>& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template <typename T> T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if (<obj is ok>) { + if (<need new object>) { + *ptr = <ptr to new allocated object>; + return SWIG_NEWOBJ; + } else { + *ptr = <ptr to old object>; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class<int>" == "Class<int >", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * luarun.swg + * + * This file contains the runtime support for Lua modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lua.h" +#include "lauxlib.h" +#include <stdlib.h> /* for malloc */ +#include <assert.h> /* for a few sanity tests */ + +/* ----------------------------------------------------------------------------- + * Lua flavors + * ----------------------------------------------------------------------------- */ + +#define SWIG_LUA_FLAVOR_LUA 1 +#define SWIG_LUA_FLAVOR_ELUA 2 +#define SWIG_LUA_FLAVOR_ELUAC 3 + +#if !defined(SWIG_LUA_TARGET) +# error SWIG_LUA_TARGET not defined +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) +# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) +#else /* SWIG_LUA_FLAVOR_LUA */ +# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 +# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 +# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} +# define LSTRVAL LRO_STRVAL +#endif + +/* ----------------------------------------------------------------------------- + * compatibility defines + * ----------------------------------------------------------------------------- */ + +/* History of Lua C API length functions: In Lua 5.0 (and before?) + there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen", + but a compatibility define of "lua_strlen" was added. In Lua 5.2, + this function was again renamed, to "lua_rawlen" (to emphasize that + it doesn't call the "__len" metamethod), and the compatibility + define of lua_strlen was removed. All SWIG uses have been updated + to "lua_rawlen", and we add our own defines of that here for older + versions of Lua. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 +# define lua_rawlen lua_strlen +#elif LUA_VERSION_NUM == 501 +# define lua_rawlen lua_objlen +#endif + + +/* lua_pushglobaltable is the recommended "future-proof" way to get + the global table for Lua 5.2 and later. Here we define + lua_pushglobaltable ourselves for Lua versions before 5.2. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) +#endif + + +/* -------------------------------------------------------------------------- + * Helper functions for error handling + * -------------------------------------------------------------------------- */ + +/* Push the string STR on the Lua stack, like lua_pushstring, but + prefixed with the the location of the innermost Lua call-point + (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pusherrstring (lua_State *L, const char *str) +{ + luaL_where (L, 1); + lua_pushstring (L, str); + lua_concat (L, 2); +} + +/* Push a formatted string generated from FMT and following args on + the Lua stack, like lua_pushfstring, but prefixed with the the + location of the innermost Lua call-point (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...) +{ + va_list argp; + va_start(argp, fmt); + luaL_where(L, 1); + lua_pushvfstring(L, fmt, argp); + va_end(argp); + lua_concat(L, 2); +} + + +/* ----------------------------------------------------------------------------- + * global swig types + * ----------------------------------------------------------------------------- */ +/* Constant table */ +#define SWIG_LUA_INT 1 +#define SWIG_LUA_FLOAT 2 +#define SWIG_LUA_STRING 3 +#define SWIG_LUA_POINTER 4 +#define SWIG_LUA_BINARY 5 +#define SWIG_LUA_CHAR 6 + +/* Structure for variable linking table */ +typedef struct { + const char *name; + lua_CFunction get; + lua_CFunction set; +} swig_lua_var_info; + +/* Constant information structure */ +typedef struct { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_lua_const_info; + +typedef struct { + const char *name; + lua_CFunction method; +} swig_lua_method; + +typedef struct { + const char *name; + lua_CFunction getmethod; + lua_CFunction setmethod; +} swig_lua_attribute; + +// Can be used to create namespaces. Currently used to +// wrap class static methods/variables/constants +typedef struct { + const char *name; + swig_lua_method *ns_methods; + swig_lua_attribute *ns_attributes; + swig_lua_const_info *ns_constants; +} swig_lua_namespace; + +typedef struct swig_lua_class { + const char *name; + swig_type_info **type; + lua_CFunction constructor; + void (*destructor)(void *); + swig_lua_method *methods; + swig_lua_attribute *attributes; + swig_lua_namespace cls_static; + struct swig_lua_class **bases; + const char **base_names; +} swig_lua_class; + +/* this is the struct for wrapping all pointers in SwigLua +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + void *ptr; +} swig_lua_userdata; + +/* this is the struct for wrapping arbitrary packed binary data +(currently it is only used for member function pointers) +the data ordering is similar to swig_lua_userdata, but it is currently not possible +to tell the two structures apart within SWIG, other than by looking at the type +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + char data[1]; /* arbitary amount of data */ +} swig_lua_rawdata; + +/* Common SWIG API */ +#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) +#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) +#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) +#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) + +/* Runtime API */ +#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) +#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) +#define SWIG_MODULE_CLIENTDATA_TYPE lua_State* + +/* Contract support */ +#define SWIG_contract_assert(expr, msg) \ + if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else + + +/* helper #defines */ +#define SWIG_fail {goto fail;} +#define SWIG_fail_arg(func_name,argnum,type) \ + {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ + func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ + goto fail;} +#define SWIG_fail_ptr(func_name,argnum,type) \ + SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") +#define SWIG_check_num_args(func_name,a,b) \ + if (lua_gettop(L)<a || lua_gettop(L)>b) \ + {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ + goto fail;} + + +#define SWIG_Lua_get_table(L,n) \ + (lua_pushstring(L, n), lua_rawget(L,-2)) + +#define SWIG_Lua_add_function(L,n,f) \ + (lua_pushstring(L, n), \ + lua_pushcfunction(L, f), \ + lua_rawset(L,-3)) + +/* special helper for allowing 'nil' for usertypes */ +#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) + +#ifdef __cplusplus +/* Special helper for member function pointers +it gets the address, casts it, then dereferences it */ +//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) +#endif + +/* storing/access of swig_module_info */ +SWIGRUNTIME swig_module_info * +SWIG_Lua_GetModule(lua_State* L) { + swig_module_info *ret = 0; + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_rawget(L,LUA_REGISTRYINDEX); + if (lua_islightuserdata(L,-1)) + ret=(swig_module_info*)lua_touserdata(L,-1); + lua_pop(L,1); /* tidy */ + return ret; +} + +SWIGRUNTIME void +SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { + /* add this all into the Lua registry: */ + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_pushlightuserdata(L,(void*)module); + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* ----------------------------------------------------------------------------- + * global variable support code: modules + * ----------------------------------------------------------------------------- */ + +/* this function is called when trying to set an immutable. +default action is to print an error. +This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ +SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) +{ +/* there should be 1 param passed in: the new value */ +#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE + lua_pop(L,1); /* remove it */ + luaL_error(L,"This variable is immutable"); +#endif + return 0; /* should not return anything */ +} + +/* the module.get method used for getting linked data */ +SWIGINTERN int SWIG_Lua_module_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute + printf("SWIG_Lua_module_get %p(%s) '%s'\n", + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2)); +*/ + /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,1)); /* just in case */ +#else + assert(lua_istable(L,1)); /* default Lua action */ +#endif + lua_getmetatable(L,1); /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,-1)); /* just in case */ +#else + assert(lua_istable(L,-1)); +#endif + SWIG_Lua_get_table(L,".get"); /* get the .get table */ + lua_remove(L,3); /* remove metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + if (lua_isrotable(L,-1)) +#else + if (lua_istable(L,-1)) +#endif + { + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,3); /* remove .get */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); + return 1; + } + lua_pop(L,1); /* remove the top */ + } + lua_pop(L,1); /* remove the .get */ + lua_pushnil(L); /* return a nil */ + return 1; +} + +/* the module.set method used for setting linked data */ +SWIGINTERN int SWIG_Lua_module_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +*/ + /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,1)); /* just in case */ +#else + assert(lua_istable(L,1)); /* default Lua action */ +#endif + lua_getmetatable(L,1); /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,-1)); /* just in case */ +#else + assert(lua_istable(L,-1)); +#endif + SWIG_Lua_get_table(L,".set"); /* get the .set table */ + lua_remove(L,4); /* remove metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + if (lua_isrotable(L,-1)) +#else + if (lua_istable(L,-1)) +#endif + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,4); /* remove .set */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) + else { + return 0; // Exits stoically if an invalid key is initialized. + } +#endif + } + lua_settop(L,3); /* reset back to start */ + /* we now have the table, key & new value, so just set directly */ + lua_rawset(L,1); /* add direct */ + return 0; +} + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +/* registering a module in lua. Pushes the module table on the stack. */ +SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name) +{ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushstring(L,name); + lua_newtable(L); /* the table */ + /* add meta table */ + lua_newtable(L); /* the meta table */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); + lua_pushstring(L,".get"); + lua_newtable(L); /* the .get table */ + lua_rawset(L,-3); /* add .get into metatable */ + lua_pushstring(L,".set"); + lua_newtable(L); /* the .set table */ + lua_rawset(L,-3); /* add .set into metatable */ + lua_setmetatable(L,-2); /* sets meta table in module */ +#ifdef SWIG_LUA_MODULE_GLOBAL + /* If requested, install the module directly into the global namespace. */ + lua_rawset(L,-3); /* add module into parent */ + SWIG_Lua_get_table(L,name); /* get the table back out */ +#else + /* Do not install the module table as global name. The stack top has + the module table with the name below. We pop the top and replace + the name with it. */ + lua_replace(L,-2); +#endif +} + +/* ending the register */ +SWIGINTERN void SWIG_Lua_module_end(lua_State* L) +{ + lua_pop(L,1); /* tidy stack (remove module) */ +} + +/* adding a linked variable to the module */ +SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +{ + assert(lua_istable(L,-1)); /* just in case */ + lua_getmetatable(L,-1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) /* if there is a set fn */ + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } + lua_pop(L,1); /* tidy stack (remove meta) */ +} +#endif + +/* adding a function module */ +SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn) +{ + SWIG_Lua_add_function(L,name,fn); +} + +/* ----------------------------------------------------------------------------- + * global variable support code: namespaces + * ----------------------------------------------------------------------------- */ + +SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute +*/ + assert(lua_istable(L,-2)); /* just in case */ + lua_getmetatable(L,-2); + assert(lua_istable(L,-1)); + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + return 0; +} + +SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +*/ + + assert(lua_istable(L,1)); + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + return 0; +} + +SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration +SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration + +/* helper function - register namespace methods and attributes into namespace */ +SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns) +{ + int i = 0; + assert(lua_istable(L,-1)); + /* There must be table at the top of the stack */ + SWIG_Lua_InstallConstants(L, ns->ns_constants); + + lua_getmetatable(L,-1); + + /* add fns */ + for(i=0;ns->ns_attributes[i].name;i++){ + SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); + } + + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;ns->ns_methods[i].name;i++){ + SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method); + } + lua_pop(L,1); + + /* clear stack - remove metatble */ + lua_pop(L,1); + +} + +/* helper function. creates namespace table and add it to module table */ +SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns) +{ + assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */ + lua_checkstack(L,5); + lua_pushstring(L, ns->name); + lua_newtable(L); /* namespace itself */ + lua_newtable(L); /* metatable for namespace */ + + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + lua_rawset(L,-3); + + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); + + lua_setmetatable(L,-2); /* set metatable */ + lua_rawset(L,-3); /* add namespace to module table */ +} +/* ----------------------------------------------------------------------------- + * global variable support code: classes + * ----------------------------------------------------------------------------- */ + +/* the class.get method, performs the lookup of class attributes */ +SWIGINTERN int SWIG_Lua_class_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) userdata (not the meta table) + (2) string name of the attribute +*/ + assert(lua_isuserdata(L,-2)); /* just in case */ + lua_getmetatable(L,-2); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* NEW: looks for the __getitem() fn + this is a user provided get fn */ + SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; /* sorry not known */ +} + +/* the class.set method, performs the lookup of class attributes */ +SWIGINTERN int SWIG_Lua_class_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n", + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2), + lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ + + assert(lua_isuserdata(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* userdata */ + lua_pushvalue(L,3); /* value */ + lua_call(L,2,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + /* NEW: looks for the __setitem() fn + this is a user provided set fn */ + SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_pushvalue(L,3); /* the value */ + lua_call(L,3,0); /* 3 values in ,0 out */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; +} + +/* the class.destruct method called by the interpreter */ +SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata* usr; + swig_lua_class* clss; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + /* if must be destroyed & has a destructor */ + if (usr->own) /* if must be destroyed */ + { + clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ + if (clss && clss->destructor) /* there is a destroy fn */ + { + clss->destructor(usr->ptr); /* bye bye */ + } + } + return 0; +} + +/* the class.__tostring method called by the interpreter and print */ +SWIGINTERN int SWIG_Lua_class_tostring(lua_State* L) +{ +/* there should be 1 param passed in + (1) userdata (not the metatable) */ + assert(lua_isuserdata(L,1)); /* just in case */ + unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + + lua_getfield(L, -1, ".type"); + const char* className = lua_tostring(L, -1); + + char output[256]; + sprintf(output, "<%s userdata: %lX>", className, userData); + + lua_pushstring(L, (const char*)output); + return 1; +} + +/* to manually disown some userdata */ +SWIGINTERN int SWIG_Lua_class_disown(lua_State* L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata* usr; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + + usr->own = 0; /* clear our ownership */ + return 0; +} + +/* Constructor proxy. Used when class name entry in module is not class constructor, +but special table instead. */ +SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L) +{ + /* unlimited number of parameters + First one is our proxy table and we should remove it + Other we should pass to real constructor + */ + assert(lua_istable(L,1)); + lua_pushstring(L,".constructor"); + lua_rawget(L,1); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} + +/* gets the swig class registry (or creates it) */ +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) +{ + /* add this all into the swig registry: */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ + if (!lua_istable(L,-1)) /* not there */ + { /* must be first time, so add it */ + lua_pop(L,1); /* remove the result */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + lua_rawset(L,LUA_REGISTRYINDEX); + /* then get it */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); + } +} + +/* helper fn to get the classes metatable from the register */ +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) +{ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,cname); /* get the name */ + lua_rawget(L,-2); /* get it */ + lua_remove(L,-2); /* tidy up (remove registry) */ +} + +/* helper add a variable to a registered class */ +SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +{ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } +} + +/* helper to recursively add class static details (static attributes, operations and constants) */ +SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss) +{ + int i = 0; + /* The class namespace table must be on the top of the stack */ + assert(lua_istable(L,-1)); + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_static_details(L,clss->bases[i]); + } + + SWIG_Lua_add_namespace_details(L, &clss->cls_static); +} + +/* helper to recursively add class details (attributes & operations) */ +SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss) +{ + int i; + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_details(L,clss->bases[i]); + } + /* add fns */ + for(i=0;clss->attributes[i].name;i++){ + SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + } + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->methods[i].name;i++){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + lua_pop(L,1); /* tidy stack (remove table) */ + /* add operator overloads + these look ANY method which start with "__" and assume they + are operator overloads & add them to the metatable + (this might mess up is someone defines a method __gc (the destructor)*/ + for(i=0;clss->methods[i].name;i++){ + if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + } +} + +/* set up the base classes pointers. +Each class structure has a list of pointers to the base class structures. +This function fills them. +It cannot be done at compile time, as this will not work with hireachies +spread over more than one swig file. +Therefore it must be done at runtime, querying the SWIG type system. +*/ +SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss) +{ + int i=0; + swig_module_info* module=SWIG_GetModule(L); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* not found yet */ + { + /* lookup and cache the base class */ + swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); + if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + } + } +} + +/* Register class static methods,attributes etc as well as constructor proxy */ +SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss) +{ + lua_checkstack(L,5); /* just in case */ + assert(lua_istable(L,-1)); /* just in case */ + assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */ + + SWIG_Lua_namespace_register(L,&clss->cls_static); + + SWIG_Lua_get_table(L,clss->name); // Get namespace table back + assert(lua_istable(L,-1)); /* just in case */ + + /* add its constructor to module with the name of the class + so you can do MyClass(...) as well as new_MyClass(...) + BUT only if a constructor is defined + (this overcomes the problem of pure virtual classes without constructors)*/ + if (clss->constructor) + { + SWIG_Lua_add_function(L,".constructor", clss->constructor); + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy); + lua_pop(L,1); + } + + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_class_static_details(L, clss); + + /* clear stack */ + lua_pop(L,1); +} + +/* performs the entire class registration process */ +SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) +{ + SWIG_Lua_class_register_static(L,clss); + + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->name); /* get the name */ + lua_newtable(L); /* create the metatable */ + /* add string of class name called ".type" */ + lua_pushstring(L,".type"); + lua_pushstring(L,clss->name); + lua_rawset(L,-3); + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + /* add manual disown method */ + SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown); + lua_rawset(L,-3); + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); + SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); + /* add tostring method for better output */ + SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring); + /* add it */ + lua_rawset(L,-3); /* metatable into registry */ + lua_pop(L,1); /* tidy stack (remove registry) */ + + SWIG_Lua_get_class_metatable(L,clss->name); + SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ + lua_pop(L,1); /* tidy stack (remove class metatable) */ +} + +/* ----------------------------------------------------------------------------- + * Class/structure conversion fns + * ----------------------------------------------------------------------------- */ + +/* helper to add metatable to new lua object */ +SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) +{ + if (type->clientdata) /* there is clientdata: so add the metatable */ + { + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); + if (lua_istable(L,-1)) + { + lua_setmetatable(L,-2); + } + else + { + lua_pop(L,1); + } + } +} + +/* pushes a new object into the lua stack */ +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own) +{ + swig_lua_userdata* usr; + if (!ptr){ + lua_pushnil(L); + return; + } + usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ + usr->ptr=ptr; /* set the ptr */ + usr->type=type; + usr->own=own; +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + _SWIG_Lua_AddMetatable(L,type); /* add metatable */ +#endif +} + +/* takes a object from the lua stack & converts it into an object of the correct type + (if possible) */ +SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags) +{ + swig_lua_userdata* usr; + swig_cast_info *cast; + if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ + usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ + if (usr) + { + if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ + { + usr->own=0; + } + if (!type) /* special cast void*, no casting fn */ + { + *ptr=usr->ptr; + return SWIG_OK; /* ok */ + } + cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */ + if (cast) + { + int newmemory = 0; + *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + return SWIG_OK; /* ok */ + } + } + return SWIG_ERROR; /* error */ +} + +SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags, + int argnum,const char* func_name){ + void* result; + if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ + luaL_error (L,"Error in %s, expected a %s at argument number %d\n", + func_name,(type && type->str)?type->str:"void*",argnum); + } + return result; +} + +/* pushes a packed userdata. user for member fn pointers only */ +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata* raw; + assert(ptr); /* not acceptable to pass in a NULL value */ + raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ + raw->type=type; + raw->own=0; + memcpy(raw->data,ptr,size); /* copy the data */ + _SWIG_Lua_AddMetatable(L,type); /* add metatable */ +} + +/* converts a packed userdata. user for member fn pointers only */ +SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata* raw; + raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ + if (!raw) return SWIG_ERROR; /* error */ + if (type==0 || type==raw->type) /* void* or identical type */ + { + memcpy(ptr,raw->data,size); /* copy it */ + return SWIG_OK; /* ok */ + } + return SWIG_ERROR; /* error */ +} + +/* a function to get the typestring of a piece of data */ +SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) +{ + swig_lua_userdata* usr; + if (lua_isuserdata(L,tp)) + { + usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ + if (usr && usr->type && usr->type->str) + return usr->type->str; + return "userdata (unknown type)"; + } + return lua_typename(L,lua_type(L,tp)); +} + +/* lua callable function to get the userdata's type */ +SWIGRUNTIME int SWIG_Lua_type(lua_State* L) +{ + lua_pushstring(L,SWIG_Lua_typename(L,1)); + return 1; +} + +/* lua callable function to compare userdata's value +the issue is that two userdata may point to the same thing +but to lua, they are different objects */ +SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) +{ + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; +} + +/* ----------------------------------------------------------------------------- + * global variable support code: class/struct typemap functions + * ----------------------------------------------------------------------------- */ + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +/* Install Constants */ +SWIGINTERN void +SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { + int i; + for (i = 0; constants[i].type; i++) { + switch(constants[i].type) { + case SWIG_LUA_INT: + lua_pushstring(L,constants[i].name); + lua_pushnumber(L,(lua_Number)constants[i].lvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_FLOAT: + lua_pushstring(L,constants[i].name); + lua_pushnumber(L,(lua_Number)constants[i].dvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_CHAR: + lua_pushstring(L,constants[i].name); + lua_pushfstring(L,"%c",(char)constants[i].lvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_STRING: + lua_pushstring(L,constants[i].name); + lua_pushstring(L,(char *) constants[i].pvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_POINTER: + lua_pushstring(L,constants[i].name); + SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); + lua_rawset(L,-3); + break; + case SWIG_LUA_BINARY: + lua_pushstring(L,constants[i].name); + SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); + lua_rawset(L,-3); + break; + default: + break; + } + } +} +#endif + +/* ----------------------------------------------------------------------------- + * executing lua code from within the wrapper + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ +#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) +#endif +/* Executes a C string in Lua which is a really simple way of calling lua from C +Unfortunately lua keeps changing its APIs, so we need a conditional compile +In lua 5.0.X its lua_dostring() +In lua 5.1.X its luaL_dostring() +*/ +SWIGINTERN int +SWIG_Lua_dostring(lua_State *L, const char* str) { + int ok,top; + if (str==0 || str[0]==0) return 0; /* nothing to do */ + top=lua_gettop(L); /* save stack */ +#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) + ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ +#else + ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ +#endif + if (ok!=0) { + SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); + } + lua_settop(L,top); /* restore the stack */ + return ok; +} + +#ifdef __cplusplus +} +#endif + +/* ------------------------------ end luarun.swg ------------------------------ */ + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_Accelerometer swig_types[0] +#define SWIGTYPE_p_Actor swig_types[1] +#define SWIGTYPE_p_AngelSampleHandle swig_types[2] +#define SWIGTYPE_p_AngelSoundHandle swig_types[3] +#define SWIGTYPE_p_Camera swig_types[4] +#define SWIGTYPE_p_Color swig_types[5] +#define SWIGTYPE_p_CompoundLog swig_types[6] +#define SWIGTYPE_p_Console swig_types[7] +#define SWIGTYPE_p_ConsoleLog swig_types[8] +#define SWIGTYPE_p_Controller swig_types[9] +#define SWIGTYPE_p_ControllerInput swig_types[10] +#define SWIGTYPE_p_ControllerManager swig_types[11] +#define SWIGTYPE_p_DeveloperLog swig_types[12] +#define SWIGTYPE_p_FileLog swig_types[13] +#define SWIGTYPE_p_FullScreenActor swig_types[14] +#define SWIGTYPE_p_GLint swig_types[15] +#define SWIGTYPE_p_GestureData swig_types[16] +#define SWIGTYPE_p_GridActor swig_types[17] +#define SWIGTYPE_p_HUDActor swig_types[18] +#define SWIGTYPE_p_MathUtil swig_types[19] +#define SWIGTYPE_p_Message swig_types[20] +#define SWIGTYPE_p_MessageListener swig_types[21] +#define SWIGTYPE_p_MouseListener swig_types[22] +#define SWIGTYPE_p_ParticleActor swig_types[23] +#define SWIGTYPE_p_PhysicsActor swig_types[24] +#define SWIGTYPE_p_Preferences swig_types[25] +#define SWIGTYPE_p_Renderable swig_types[26] +#define SWIGTYPE_p_SoundDevice swig_types[27] +#define SWIGTYPE_p_Switchboard swig_types[28] +#define SWIGTYPE_p_SystemLog swig_types[29] +#define SWIGTYPE_p_TagCollection swig_types[30] +#define SWIGTYPE_p_TextActor swig_types[31] +#define SWIGTYPE_p_Touch swig_types[32] +#define SWIGTYPE_p_TouchListener swig_types[33] +#define SWIGTYPE_p_Tuning swig_types[34] +#define SWIGTYPE_p_TypedMessageT_Vec2i_t swig_types[35] +#define SWIGTYPE_p_TypedMessageT_Vec2ui_t swig_types[36] +#define SWIGTYPE_p_TypedMessageT_Vec3i_t swig_types[37] +#define SWIGTYPE_p_TypedMessageT_Vec3ui_t swig_types[38] +#define SWIGTYPE_p_TypedMessageT_Vector2_t swig_types[39] +#define SWIGTYPE_p_TypedMessageT_Vector3_t swig_types[40] +#define SWIGTYPE_p_TypedMessageT_float_t swig_types[41] +#define SWIGTYPE_p_TypedMessageT_int_t swig_types[42] +#define SWIGTYPE_p_TypedMessageT_std__string_t swig_types[43] +#define SWIGTYPE_p_Vec2i swig_types[44] +#define SWIGTYPE_p_Vec2ui swig_types[45] +#define SWIGTYPE_p_Vec3i swig_types[46] +#define SWIGTYPE_p_Vec3ui swig_types[47] +#define SWIGTYPE_p_Vector2 swig_types[48] +#define SWIGTYPE_p_Vector2List swig_types[49] +#define SWIGTYPE_p_Vector3 swig_types[50] +#define SWIGTYPE_p_World swig_types[51] +#define SWIGTYPE_p_std__setT_Actor_p_t swig_types[52] +#define SWIGTYPE_p_std__setT_MessageListener_p_t swig_types[53] +#define SWIGTYPE_p_std__setT_std__string_t swig_types[54] +#define SWIGTYPE_p_std__string swig_types[55] +#define SWIGTYPE_p_std__vectorT_Actor_p_t swig_types[56] +#define SWIGTYPE_p_std__vectorT_Touch_p_t swig_types[57] +#define SWIGTYPE_p_std__vectorT_Vec3ui_t swig_types[58] +#define SWIGTYPE_p_std__vectorT_std__string_t swig_types[59] +#define SWIGTYPE_p_void swig_types[60] +static swig_type_info *swig_types[62]; +static swig_module_info swig_module = {swig_types, 61, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_name "angel" +#define SWIG_init luaopen_angel +#define SWIG_init_user luaopen_angel_user + +#define SWIG_LUACODE luaopen_angel_luacode + +namespace swig { +typedef struct{} LANGUAGE_OBJ; +} + + +#define SWIGVERSION 0x020011 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#include <string> + + +SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { + int ret = lua_isstring(L, idx); + if (!ret) + ret = lua_isnil(L, idx); + return ret; +} + + +#include "../../Infrastructure/Vector2.h" +#include "../../Infrastructure/Vector3.h" +#include "../../Infrastructure/VecStructs.h" + + +#include "../../Infrastructure/Color.h" + + +#include "../../Messaging/Switchboard.h" +#include "../../Messaging/Message.h" + + +#include "../../Infrastructure/Renderable.h" + + +#include "../../Infrastructure/World.h" + + +#include "../../Infrastructure/Log.h" + + +#include "../../Infrastructure/TuningVariable.h" + + +#include "../../Infrastructure/Preferences.h" + + +#include "../../Infrastructure/SoundDevice.h" + + +#include "../../Scripting/LuaConsole.h" + + +#include "../../Input/Controller.h" + + +#include "../../Input/MouseInput.h" + + +#include "../../Input/MultiTouch.h" + + +#include "../../Actors/Actor.h" +#include "../../Infrastructure/TagCollection.h" + + +#include "../../Infrastructure/Camera.h" + + +#include "../../Actors/PhysicsActor.h" + + +#include "../../Actors/ParticleActor.h" + + +#include "../../Actors/TextActor.h" + + +#include "../../Actors/GridActor.h" +#include "../../Actors/FullScreenActor.h" +#include "../../Actors/HUDActor.h" + + +#include "../../Infrastructure/Textures.h" + + +//#include "../../../ClientGame/<INCLUDE_HEADER.H>" + +#ifdef __cplusplus +extern "C" { +#endif +static int _wrap_new_string__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + std::string *result = 0 ; + + SWIG_check_num_args("std::string::string",0,0) + result = (std::string *)new std::string(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_string__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + char *arg1 = (char *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("std::string::string",1,1) + if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("std::string::string",1,"char const *"); + arg1 = (char *)lua_tostring(L, 1); + result = (std::string *)new std::string((char const *)arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_string(lua_State* L) { + int argc; + int argv[2]={ + 1,2 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_string__SWIG_0(L); + } + if (argc == 1) { + int _v; + { + _v = SWIG_lua_isnilstring(L,argv[0]); + } + if (_v) { + return _wrap_new_string__SWIG_1(L); + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_string'\n" + " Possible C/C++ prototypes are:\n" + " std::string::string()\n" + " std::string::string(char const *)\n"); + lua_error(L);return 0; +} + + +static int _wrap_string_size(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + unsigned int result; + + SWIG_check_num_args("std::string::size",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::size",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_size",1,SWIGTYPE_p_std__string); + } + + result = (unsigned int)((std::string const *)arg1)->size(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_length(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + unsigned int result; + + SWIG_check_num_args("std::string::length",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::length",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_length",1,SWIGTYPE_p_std__string); + } + + result = (unsigned int)((std::string const *)arg1)->length(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_empty(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + bool result; + + SWIG_check_num_args("std::string::empty",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::empty",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_empty",1,SWIGTYPE_p_std__string); + } + + result = (bool)((std::string const *)arg1)->empty(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_c_str(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("std::string::c_str",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::c_str",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_c_str",1,SWIGTYPE_p_std__string); + } + + result = (char *)((std::string const *)arg1)->c_str(); + lua_pushstring(L,(const char *)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_data(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("std::string::data",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::data",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_data",1,SWIGTYPE_p_std__string); + } + + result = (char *)((std::string const *)arg1)->data(); + lua_pushstring(L,(const char *)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_assign(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *arg2 = (char *) 0 ; + + SWIG_check_num_args("std::string::assign",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::assign",1,"std::string *"); + if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("std::string::assign",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_assign",1,SWIGTYPE_p_std__string); + } + + arg2 = (char *)lua_tostring(L, 2); + (arg1)->assign((char const *)arg2); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_string(void *obj) { +std::string *arg1 = (std::string *) obj; +delete arg1; +} +static swig_lua_method swig_std_string_methods[] = { + {"size", _wrap_string_size}, + {"length", _wrap_string_length}, + {"empty", _wrap_string_empty}, + {"c_str", _wrap_string_c_str}, + {"data", _wrap_string_data}, + {"assign", _wrap_string_assign}, + {0,0} +}; +static swig_lua_attribute swig_std_string_attributes[] = { + {0,0,0} +}; +static swig_lua_attribute swig_std_string_cls_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_std_string_cls_methods[] = { + {0,0} +}; +static swig_lua_const_info swig_std_string_cls_constants[] = { + {0,0,0,0,0,0} +}; +static swig_lua_class *swig_std_string_bases[] = {0}; +static const char *swig_std_string_base_names[] = {0}; +static swig_lua_class _wrap_class_std_string = { "string", &SWIGTYPE_p_std__string,_wrap_new_string, swig_delete_string, swig_std_string_methods, swig_std_string_attributes, { "string", swig_std_string_cls_methods, swig_std_string_cls_attributes, swig_std_string_cls_constants }, swig_std_string_bases, swig_std_string_base_names }; + +static int _wrap_Vec2i_X_set(lua_State* L) { + int SWIG_arg = 0; + Vec2i *arg1 = (Vec2i *) 0 ; + int arg2 ; + + SWIG_check_num_args("Vec2i::X",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2i::X",1,"Vec2i *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec2i::X",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2i,0))){ + SWIG_fail_ptr("Vec2i_X_set",1,SWIGTYPE_p_Vec2i); + } + + arg2 = (int)lua_tonumber(L, 2); + if (arg1) (arg1)->X = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec2i_X_get(lua_State* L) { + int SWIG_arg = 0; + Vec2i *arg1 = (Vec2i *) 0 ; + int result; + + SWIG_check_num_args("Vec2i::X",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2i::X",1,"Vec2i *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2i,0))){ + SWIG_fail_ptr("Vec2i_X_get",1,SWIGTYPE_p_Vec2i); + } + + result = (int) ((arg1)->X); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec2i_Y_set(lua_State* L) { + int SWIG_arg = 0; + Vec2i *arg1 = (Vec2i *) 0 ; + int arg2 ; + + SWIG_check_num_args("Vec2i::Y",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2i::Y",1,"Vec2i *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec2i::Y",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2i,0))){ + SWIG_fail_ptr("Vec2i_Y_set",1,SWIGTYPE_p_Vec2i); + } + + arg2 = (int)lua_tonumber(L, 2); + if (arg1) (arg1)->Y = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec2i_Y_get(lua_State* L) { + int SWIG_arg = 0; + Vec2i *arg1 = (Vec2i *) 0 ; + int result; + + SWIG_check_num_args("Vec2i::Y",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2i::Y",1,"Vec2i *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2i,0))){ + SWIG_fail_ptr("Vec2i_Y_get",1,SWIGTYPE_p_Vec2i); + } + + result = (int) ((arg1)->Y); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec2i__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + int arg1 ; + int arg2 ; + Vec2i *result = 0 ; + + SWIG_check_num_args("Vec2i::Vec2i",2,2) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Vec2i::Vec2i",1,"int"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec2i::Vec2i",2,"int"); + arg1 = (int)lua_tonumber(L, 1); + arg2 = (int)lua_tonumber(L, 2); + result = (Vec2i *)new Vec2i(arg1,arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vec2i,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec2i__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + Vec2i *result = 0 ; + + SWIG_check_num_args("Vec2i::Vec2i",0,0) + result = (Vec2i *)new Vec2i(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vec2i,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec2i(lua_State* L) { + int argc; + int argv[3]={ + 1,2,3 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Vec2i__SWIG_1(L); + } + if (argc == 2) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + return _wrap_new_Vec2i__SWIG_0(L); + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Vec2i'\n" + " Possible C/C++ prototypes are:\n" + " Vec2i::Vec2i(int,int)\n" + " Vec2i::Vec2i()\n"); + lua_error(L);return 0; +} + + +static int _wrap_Vec2i___eq(lua_State* L) { + int SWIG_arg = 0; + Vec2i *arg1 = (Vec2i *) 0 ; + Vec2i *arg2 = 0 ; + bool result; + + SWIG_check_num_args("Vec2i::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2i::operator ==",1,"Vec2i const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2i,0))){ + SWIG_fail_ptr("Vec2i___eq",1,SWIGTYPE_p_Vec2i); + } + + { + // const Vec2i& conversion + Vec2i *vecPtr; + Vec2i vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vec2i,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to ints + lua_pushinteger(L, 1); + lua_gettable(L, 2); + int x = lua_tointeger(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + int y = lua_tointeger(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = (bool)((Vec2i const *)arg1)->operator ==((Vec2i const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_Vec2i(void *obj) { +Vec2i *arg1 = (Vec2i *) obj; +delete arg1; +} +static swig_lua_method swig_Vec2i_methods[] = { + {"__eq", _wrap_Vec2i___eq}, + {0,0} +}; +static swig_lua_attribute swig_Vec2i_attributes[] = { + { "X", _wrap_Vec2i_X_get, _wrap_Vec2i_X_set}, + { "Y", _wrap_Vec2i_Y_get, _wrap_Vec2i_Y_set}, + {0,0,0} +}; +static swig_lua_attribute swig_Vec2i_cls_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_Vec2i_cls_methods[] = { + {0,0} +}; +static swig_lua_const_info swig_Vec2i_cls_constants[] = { + {0,0,0,0,0,0} +}; +static swig_lua_class *swig_Vec2i_bases[] = {0}; +static const char *swig_Vec2i_base_names[] = {0}; +static swig_lua_class _wrap_class_Vec2i = { "Vec2i", &SWIGTYPE_p_Vec2i,_wrap_new_Vec2i, swig_delete_Vec2i, swig_Vec2i_methods, swig_Vec2i_attributes, { "Vec2i", swig_Vec2i_cls_methods, swig_Vec2i_cls_attributes, swig_Vec2i_cls_constants }, swig_Vec2i_bases, swig_Vec2i_base_names }; + +static int _wrap_Vec2ui_X_set(lua_State* L) { + int SWIG_arg = 0; + Vec2ui *arg1 = (Vec2ui *) 0 ; + unsigned int arg2 ; + + SWIG_check_num_args("Vec2ui::X",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2ui::X",1,"Vec2ui *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec2ui::X",2,"unsigned int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2ui,0))){ + SWIG_fail_ptr("Vec2ui_X_set",1,SWIGTYPE_p_Vec2ui); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (unsigned int)lua_tonumber(L, 2); + if (arg1) (arg1)->X = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec2ui_X_get(lua_State* L) { + int SWIG_arg = 0; + Vec2ui *arg1 = (Vec2ui *) 0 ; + unsigned int result; + + SWIG_check_num_args("Vec2ui::X",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2ui::X",1,"Vec2ui *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2ui,0))){ + SWIG_fail_ptr("Vec2ui_X_get",1,SWIGTYPE_p_Vec2ui); + } + + result = (unsigned int) ((arg1)->X); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec2ui_Y_set(lua_State* L) { + int SWIG_arg = 0; + Vec2ui *arg1 = (Vec2ui *) 0 ; + unsigned int arg2 ; + + SWIG_check_num_args("Vec2ui::Y",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2ui::Y",1,"Vec2ui *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec2ui::Y",2,"unsigned int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2ui,0))){ + SWIG_fail_ptr("Vec2ui_Y_set",1,SWIGTYPE_p_Vec2ui); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (unsigned int)lua_tonumber(L, 2); + if (arg1) (arg1)->Y = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec2ui_Y_get(lua_State* L) { + int SWIG_arg = 0; + Vec2ui *arg1 = (Vec2ui *) 0 ; + unsigned int result; + + SWIG_check_num_args("Vec2ui::Y",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2ui::Y",1,"Vec2ui *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2ui,0))){ + SWIG_fail_ptr("Vec2ui_Y_get",1,SWIGTYPE_p_Vec2ui); + } + + result = (unsigned int) ((arg1)->Y); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec2ui__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + unsigned int arg1 ; + unsigned int arg2 ; + Vec2ui *result = 0 ; + + SWIG_check_num_args("Vec2ui::Vec2ui",2,2) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Vec2ui::Vec2ui",1,"unsigned int"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec2ui::Vec2ui",2,"unsigned int"); + SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative") + arg1 = (unsigned int)lua_tonumber(L, 1); + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (unsigned int)lua_tonumber(L, 2); + result = (Vec2ui *)new Vec2ui(arg1,arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vec2ui,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec2ui__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + Vec2ui *result = 0 ; + + SWIG_check_num_args("Vec2ui::Vec2ui",0,0) + result = (Vec2ui *)new Vec2ui(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vec2ui,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec2ui(lua_State* L) { + int argc; + int argv[3]={ + 1,2,3 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Vec2ui__SWIG_1(L); + } + if (argc == 2) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + return _wrap_new_Vec2ui__SWIG_0(L); + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Vec2ui'\n" + " Possible C/C++ prototypes are:\n" + " Vec2ui::Vec2ui(unsigned int,unsigned int)\n" + " Vec2ui::Vec2ui()\n"); + lua_error(L);return 0; +} + + +static int _wrap_Vec2ui___eq(lua_State* L) { + int SWIG_arg = 0; + Vec2ui *arg1 = (Vec2ui *) 0 ; + Vec2ui *arg2 = 0 ; + bool result; + + SWIG_check_num_args("Vec2ui::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec2ui::operator ==",1,"Vec2ui const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec2ui,0))){ + SWIG_fail_ptr("Vec2ui___eq",1,SWIGTYPE_p_Vec2ui); + } + + { + // cosnt Vec2ui& conversion + Vec2ui *vecPtr; + Vec2ui vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vec2ui,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to ints + lua_pushinteger(L, 1); + lua_gettable(L, 2); + unsigned int x = lua_tointeger(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + unsigned int y = lua_tointeger(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = (bool)((Vec2ui const *)arg1)->operator ==((Vec2ui const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_Vec2ui(void *obj) { +Vec2ui *arg1 = (Vec2ui *) obj; +delete arg1; +} +static swig_lua_method swig_Vec2ui_methods[] = { + {"__eq", _wrap_Vec2ui___eq}, + {0,0} +}; +static swig_lua_attribute swig_Vec2ui_attributes[] = { + { "X", _wrap_Vec2ui_X_get, _wrap_Vec2ui_X_set}, + { "Y", _wrap_Vec2ui_Y_get, _wrap_Vec2ui_Y_set}, + {0,0,0} +}; +static swig_lua_attribute swig_Vec2ui_cls_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_Vec2ui_cls_methods[] = { + {0,0} +}; +static swig_lua_const_info swig_Vec2ui_cls_constants[] = { + {0,0,0,0,0,0} +}; +static swig_lua_class *swig_Vec2ui_bases[] = {0}; +static const char *swig_Vec2ui_base_names[] = {0}; +static swig_lua_class _wrap_class_Vec2ui = { "Vec2ui", &SWIGTYPE_p_Vec2ui,_wrap_new_Vec2ui, swig_delete_Vec2ui, swig_Vec2ui_methods, swig_Vec2ui_attributes, { "Vec2ui", swig_Vec2ui_cls_methods, swig_Vec2ui_cls_attributes, swig_Vec2ui_cls_constants }, swig_Vec2ui_bases, swig_Vec2ui_base_names }; + +static int _wrap_Vec3i_X_set(lua_State* L) { + int SWIG_arg = 0; + Vec3i *arg1 = (Vec3i *) 0 ; + int arg2 ; + + SWIG_check_num_args("Vec3i::X",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3i::X",1,"Vec3i *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec3i::X",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3i,0))){ + SWIG_fail_ptr("Vec3i_X_set",1,SWIGTYPE_p_Vec3i); + } + + arg2 = (int)lua_tonumber(L, 2); + if (arg1) (arg1)->X = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3i_X_get(lua_State* L) { + int SWIG_arg = 0; + Vec3i *arg1 = (Vec3i *) 0 ; + int result; + + SWIG_check_num_args("Vec3i::X",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3i::X",1,"Vec3i *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3i,0))){ + SWIG_fail_ptr("Vec3i_X_get",1,SWIGTYPE_p_Vec3i); + } + + result = (int) ((arg1)->X); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3i_Y_set(lua_State* L) { + int SWIG_arg = 0; + Vec3i *arg1 = (Vec3i *) 0 ; + int arg2 ; + + SWIG_check_num_args("Vec3i::Y",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3i::Y",1,"Vec3i *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec3i::Y",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3i,0))){ + SWIG_fail_ptr("Vec3i_Y_set",1,SWIGTYPE_p_Vec3i); + } + + arg2 = (int)lua_tonumber(L, 2); + if (arg1) (arg1)->Y = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3i_Y_get(lua_State* L) { + int SWIG_arg = 0; + Vec3i *arg1 = (Vec3i *) 0 ; + int result; + + SWIG_check_num_args("Vec3i::Y",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3i::Y",1,"Vec3i *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3i,0))){ + SWIG_fail_ptr("Vec3i_Y_get",1,SWIGTYPE_p_Vec3i); + } + + result = (int) ((arg1)->Y); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3i_Z_set(lua_State* L) { + int SWIG_arg = 0; + Vec3i *arg1 = (Vec3i *) 0 ; + int arg2 ; + + SWIG_check_num_args("Vec3i::Z",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3i::Z",1,"Vec3i *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec3i::Z",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3i,0))){ + SWIG_fail_ptr("Vec3i_Z_set",1,SWIGTYPE_p_Vec3i); + } + + arg2 = (int)lua_tonumber(L, 2); + if (arg1) (arg1)->Z = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3i_Z_get(lua_State* L) { + int SWIG_arg = 0; + Vec3i *arg1 = (Vec3i *) 0 ; + int result; + + SWIG_check_num_args("Vec3i::Z",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3i::Z",1,"Vec3i *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3i,0))){ + SWIG_fail_ptr("Vec3i_Z_get",1,SWIGTYPE_p_Vec3i); + } + + result = (int) ((arg1)->Z); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec3i__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + int arg1 ; + int arg2 ; + int arg3 ; + Vec3i *result = 0 ; + + SWIG_check_num_args("Vec3i::Vec3i",3,3) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Vec3i::Vec3i",1,"int"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec3i::Vec3i",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Vec3i::Vec3i",3,"int"); + arg1 = (int)lua_tonumber(L, 1); + arg2 = (int)lua_tonumber(L, 2); + arg3 = (int)lua_tonumber(L, 3); + result = (Vec3i *)new Vec3i(arg1,arg2,arg3); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vec3i,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec3i__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + Vec3i *result = 0 ; + + SWIG_check_num_args("Vec3i::Vec3i",0,0) + result = (Vec3i *)new Vec3i(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vec3i,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec3i(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Vec3i__SWIG_1(L); + } + if (argc == 3) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + return _wrap_new_Vec3i__SWIG_0(L); + } + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Vec3i'\n" + " Possible C/C++ prototypes are:\n" + " Vec3i::Vec3i(int,int,int)\n" + " Vec3i::Vec3i()\n"); + lua_error(L);return 0; +} + + +static int _wrap_Vec3i___eq(lua_State* L) { + int SWIG_arg = 0; + Vec3i *arg1 = (Vec3i *) 0 ; + Vec3i *arg2 = 0 ; + bool result; + + SWIG_check_num_args("Vec3i::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3i::operator ==",1,"Vec3i const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3i,0))){ + SWIG_fail_ptr("Vec3i___eq",1,SWIGTYPE_p_Vec3i); + } + + { + // const Vec3i& conversion + Vec3i *vecPtr; + Vec3i vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vec3i,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to ints + lua_pushinteger(L, 1); + lua_gettable(L, 2); + int x = lua_tointeger(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + int y = lua_tointeger(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 3); + lua_gettable(L, 2); + int z = lua_tointeger(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = (bool)((Vec3i const *)arg1)->operator ==((Vec3i const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_Vec3i(void *obj) { +Vec3i *arg1 = (Vec3i *) obj; +delete arg1; +} +static swig_lua_method swig_Vec3i_methods[] = { + {"__eq", _wrap_Vec3i___eq}, + {0,0} +}; +static swig_lua_attribute swig_Vec3i_attributes[] = { + { "X", _wrap_Vec3i_X_get, _wrap_Vec3i_X_set}, + { "Y", _wrap_Vec3i_Y_get, _wrap_Vec3i_Y_set}, + { "Z", _wrap_Vec3i_Z_get, _wrap_Vec3i_Z_set}, + {0,0,0} +}; +static swig_lua_attribute swig_Vec3i_cls_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_Vec3i_cls_methods[] = { + {0,0} +}; +static swig_lua_const_info swig_Vec3i_cls_constants[] = { + {0,0,0,0,0,0} +}; +static swig_lua_class *swig_Vec3i_bases[] = {0}; +static const char *swig_Vec3i_base_names[] = {0}; +static swig_lua_class _wrap_class_Vec3i = { "Vec3i", &SWIGTYPE_p_Vec3i,_wrap_new_Vec3i, swig_delete_Vec3i, swig_Vec3i_methods, swig_Vec3i_attributes, { "Vec3i", swig_Vec3i_cls_methods, swig_Vec3i_cls_attributes, swig_Vec3i_cls_constants }, swig_Vec3i_bases, swig_Vec3i_base_names }; + +static int _wrap_Vec3ui_X_set(lua_State* L) { + int SWIG_arg = 0; + Vec3ui *arg1 = (Vec3ui *) 0 ; + unsigned int arg2 ; + + SWIG_check_num_args("Vec3ui::X",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3ui::X",1,"Vec3ui *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec3ui::X",2,"unsigned int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3ui,0))){ + SWIG_fail_ptr("Vec3ui_X_set",1,SWIGTYPE_p_Vec3ui); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (unsigned int)lua_tonumber(L, 2); + if (arg1) (arg1)->X = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3ui_X_get(lua_State* L) { + int SWIG_arg = 0; + Vec3ui *arg1 = (Vec3ui *) 0 ; + unsigned int result; + + SWIG_check_num_args("Vec3ui::X",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3ui::X",1,"Vec3ui *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3ui,0))){ + SWIG_fail_ptr("Vec3ui_X_get",1,SWIGTYPE_p_Vec3ui); + } + + result = (unsigned int) ((arg1)->X); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3ui_Y_set(lua_State* L) { + int SWIG_arg = 0; + Vec3ui *arg1 = (Vec3ui *) 0 ; + unsigned int arg2 ; + + SWIG_check_num_args("Vec3ui::Y",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3ui::Y",1,"Vec3ui *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec3ui::Y",2,"unsigned int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3ui,0))){ + SWIG_fail_ptr("Vec3ui_Y_set",1,SWIGTYPE_p_Vec3ui); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (unsigned int)lua_tonumber(L, 2); + if (arg1) (arg1)->Y = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3ui_Y_get(lua_State* L) { + int SWIG_arg = 0; + Vec3ui *arg1 = (Vec3ui *) 0 ; + unsigned int result; + + SWIG_check_num_args("Vec3ui::Y",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3ui::Y",1,"Vec3ui *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3ui,0))){ + SWIG_fail_ptr("Vec3ui_Y_get",1,SWIGTYPE_p_Vec3ui); + } + + result = (unsigned int) ((arg1)->Y); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3ui_Z_set(lua_State* L) { + int SWIG_arg = 0; + Vec3ui *arg1 = (Vec3ui *) 0 ; + unsigned int arg2 ; + + SWIG_check_num_args("Vec3ui::Z",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3ui::Z",1,"Vec3ui *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec3ui::Z",2,"unsigned int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3ui,0))){ + SWIG_fail_ptr("Vec3ui_Z_set",1,SWIGTYPE_p_Vec3ui); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (unsigned int)lua_tonumber(L, 2); + if (arg1) (arg1)->Z = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vec3ui_Z_get(lua_State* L) { + int SWIG_arg = 0; + Vec3ui *arg1 = (Vec3ui *) 0 ; + unsigned int result; + + SWIG_check_num_args("Vec3ui::Z",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3ui::Z",1,"Vec3ui *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3ui,0))){ + SWIG_fail_ptr("Vec3ui_Z_get",1,SWIGTYPE_p_Vec3ui); + } + + result = (unsigned int) ((arg1)->Z); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec3ui__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + unsigned int arg1 ; + unsigned int arg2 ; + unsigned int arg3 ; + Vec3ui *result = 0 ; + + SWIG_check_num_args("Vec3ui::Vec3ui",3,3) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Vec3ui::Vec3ui",1,"unsigned int"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vec3ui::Vec3ui",2,"unsigned int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Vec3ui::Vec3ui",3,"unsigned int"); + SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative") + arg1 = (unsigned int)lua_tonumber(L, 1); + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (unsigned int)lua_tonumber(L, 2); + SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative") + arg3 = (unsigned int)lua_tonumber(L, 3); + result = (Vec3ui *)new Vec3ui(arg1,arg2,arg3); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vec3ui,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec3ui__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + Vec3ui *result = 0 ; + + SWIG_check_num_args("Vec3ui::Vec3ui",0,0) + result = (Vec3ui *)new Vec3ui(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vec3ui,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vec3ui(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Vec3ui__SWIG_1(L); + } + if (argc == 3) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + return _wrap_new_Vec3ui__SWIG_0(L); + } + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Vec3ui'\n" + " Possible C/C++ prototypes are:\n" + " Vec3ui::Vec3ui(unsigned int,unsigned int,unsigned int)\n" + " Vec3ui::Vec3ui()\n"); + lua_error(L);return 0; +} + + +static int _wrap_Vec3ui___eq(lua_State* L) { + int SWIG_arg = 0; + Vec3ui *arg1 = (Vec3ui *) 0 ; + Vec3ui *arg2 = 0 ; + bool result; + + SWIG_check_num_args("Vec3ui::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vec3ui::operator ==",1,"Vec3ui const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vec3ui,0))){ + SWIG_fail_ptr("Vec3ui___eq",1,SWIGTYPE_p_Vec3ui); + } + + { + // const Vec3ui& conversion + Vec3ui *vecPtr; + Vec3ui vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vec3ui,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to ints + lua_pushinteger(L, 1); + lua_gettable(L, 2); + unsigned int x = lua_tointeger(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + unsigned int y = lua_tointeger(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 3); + lua_gettable(L, 2); + unsigned int z = lua_tointeger(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = (bool)((Vec3ui const *)arg1)->operator ==((Vec3ui const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_Vec3ui(void *obj) { +Vec3ui *arg1 = (Vec3ui *) obj; +delete arg1; +} +static swig_lua_method swig_Vec3ui_methods[] = { + {"__eq", _wrap_Vec3ui___eq}, + {0,0} +}; +static swig_lua_attribute swig_Vec3ui_attributes[] = { + { "X", _wrap_Vec3ui_X_get, _wrap_Vec3ui_X_set}, + { "Y", _wrap_Vec3ui_Y_get, _wrap_Vec3ui_Y_set}, + { "Z", _wrap_Vec3ui_Z_get, _wrap_Vec3ui_Z_set}, + {0,0,0} +}; +static swig_lua_attribute swig_Vec3ui_cls_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_Vec3ui_cls_methods[] = { + {0,0} +}; +static swig_lua_const_info swig_Vec3ui_cls_constants[] = { + {0,0,0,0,0,0} +}; +static swig_lua_class *swig_Vec3ui_bases[] = {0}; +static const char *swig_Vec3ui_base_names[] = {0}; +static swig_lua_class _wrap_class_Vec3ui = { "Vec3ui", &SWIGTYPE_p_Vec3ui,_wrap_new_Vec3ui, swig_delete_Vec3ui, swig_Vec3ui_methods, swig_Vec3ui_attributes, { "Vec3ui", swig_Vec3ui_cls_methods, swig_Vec3ui_cls_attributes, swig_Vec3ui_cls_constants }, swig_Vec3ui_bases, swig_Vec3ui_base_names }; + +static int _wrap_Vector2_X_set(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + float arg2 ; + + SWIG_check_num_args("Vector2::X",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::X",1,"Vector2 *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector2::X",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_X_set",1,SWIGTYPE_p_Vector2); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->X = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_X_get(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + float result; + + SWIG_check_num_args("Vector2::X",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::X",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_X_get",1,SWIGTYPE_p_Vector2); + } + + result = (float) ((arg1)->X); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Y_set(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + float arg2 ; + + SWIG_check_num_args("Vector2::Y",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::Y",1,"Vector2 *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector2::Y",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_Y_set",1,SWIGTYPE_p_Vector2); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->Y = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Y_get(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + float result; + + SWIG_check_num_args("Vector2::Y",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::Y",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_Y_get",1,SWIGTYPE_p_Vector2); + } + + result = (float) ((arg1)->Y); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Zero_set(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + + SWIG_check_num_args("Vector2::Zero",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::Zero",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_Zero_set",1,SWIGTYPE_p_Vector2); + } + + Vector2::Zero = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Zero_get(lua_State* L) { + int SWIG_arg = 0; + Vector2 *result = 0 ; + + SWIG_check_num_args("Vector2::Zero",0,0) + result = (Vector2 *)&Vector2::Zero; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector2,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_One_set(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + + SWIG_check_num_args("Vector2::One",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::One",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_One_set",1,SWIGTYPE_p_Vector2); + } + + Vector2::One = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_One_get(lua_State* L) { + int SWIG_arg = 0; + Vector2 *result = 0 ; + + SWIG_check_num_args("Vector2::One",0,0) + result = (Vector2 *)&Vector2::One; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector2,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_UnitX_set(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + + SWIG_check_num_args("Vector2::UnitX",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::UnitX",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_UnitX_set",1,SWIGTYPE_p_Vector2); + } + + Vector2::UnitX = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_UnitX_get(lua_State* L) { + int SWIG_arg = 0; + Vector2 *result = 0 ; + + SWIG_check_num_args("Vector2::UnitX",0,0) + result = (Vector2 *)&Vector2::UnitX; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector2,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_UnitY_set(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + + SWIG_check_num_args("Vector2::UnitY",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::UnitY",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_UnitY_set",1,SWIGTYPE_p_Vector2); + } + + Vector2::UnitY = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_UnitY_get(lua_State* L) { + int SWIG_arg = 0; + Vector2 *result = 0 ; + + SWIG_check_num_args("Vector2::UnitY",0,0) + result = (Vector2 *)&Vector2::UnitY; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector2,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vector2__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + float arg1 ; + float arg2 ; + Vector2 *result = 0 ; + + SWIG_check_num_args("Vector2::Vector2",2,2) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Vector2::Vector2",1,"float"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector2::Vector2",2,"float"); + arg1 = (float)lua_tonumber(L, 1); + arg2 = (float)lua_tonumber(L, 2); + result = (Vector2 *)new Vector2(arg1,arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector2,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vector2__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + float arg1 ; + Vector2 *result = 0 ; + + SWIG_check_num_args("Vector2::Vector2",1,1) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Vector2::Vector2",1,"float"); + arg1 = (float)lua_tonumber(L, 1); + result = (Vector2 *)new Vector2(arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector2,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vector2__SWIG_2(lua_State* L) { + int SWIG_arg = 0; + Vector2 *result = 0 ; + + SWIG_check_num_args("Vector2::Vector2",0,0) + result = (Vector2 *)new Vector2(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector2,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vector2(lua_State* L) { + int argc; + int argv[3]={ + 1,2,3 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Vector2__SWIG_2(L); + } + if (argc == 1) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + return _wrap_new_Vector2__SWIG_1(L); + } + } + if (argc == 2) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + return _wrap_new_Vector2__SWIG_0(L); + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Vector2'\n" + " Possible C/C++ prototypes are:\n" + " Vector2::Vector2(float,float)\n" + " Vector2::Vector2(float)\n" + " Vector2::Vector2()\n"); + lua_error(L);return 0; +} + + +static int _wrap_Vector2_Length(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + float result; + + SWIG_check_num_args("Vector2::Length",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::Length",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_Length",1,SWIGTYPE_p_Vector2); + } + + result = (float)(arg1)->Length(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_LengthSquared(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + float result; + + SWIG_check_num_args("Vector2::LengthSquared",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::LengthSquared",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_LengthSquared",1,SWIGTYPE_p_Vector2); + } + + result = (float)(arg1)->LengthSquared(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Distance(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 *arg2 = 0 ; + float result; + + SWIG_check_num_args("Vector2::Distance",2,2) + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = (float)Vector2::Distance((Vector2 const &)*arg1,(Vector2 const &)*arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_DistanceSquared(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 *arg2 = 0 ; + float result; + + SWIG_check_num_args("Vector2::DistanceSquared",2,2) + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = (float)Vector2::DistanceSquared((Vector2 const &)*arg1,(Vector2 const &)*arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Dot(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 *arg2 = 0 ; + float result; + + SWIG_check_num_args("Vector2::Dot",2,2) + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = (float)Vector2::Dot((Vector2 const &)*arg1,(Vector2 const &)*arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Normalize(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + + SWIG_check_num_args("Vector2::Normalize",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::Normalize",1,"Vector2 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2_Normalize",1,SWIGTYPE_p_Vector2); + } + + (arg1)->Normalize(); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Reflect(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 *arg2 = 0 ; + Vector2 result; + + SWIG_check_num_args("Vector2::Reflect",2,2) + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = Vector2::Reflect((Vector2 const &)*arg1,(Vector2 const &)*arg2); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Min(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 *arg2 = 0 ; + Vector2 result; + + SWIG_check_num_args("Vector2::Min",2,2) + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = Vector2::Min((Vector2 const &)*arg1,(Vector2 const &)*arg2); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Max(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 *arg2 = 0 ; + Vector2 result; + + SWIG_check_num_args("Vector2::Max",2,2) + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = Vector2::Max((Vector2 const &)*arg1,(Vector2 const &)*arg2); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Clamp(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 *arg2 = 0 ; + Vector2 *arg3 = 0 ; + Vector2 result; + + SWIG_check_num_args("Vector2::Clamp",3,3) + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg3 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 3); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 3); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg3 = &vec; + } + } + result = Vector2::Clamp((Vector2 const &)*arg1,(Vector2 const &)*arg2,(Vector2 const &)*arg3); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Lerp(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 *arg2 = 0 ; + float arg3 ; + Vector2 result; + + SWIG_check_num_args("Vector2::Lerp",3,3) + if(!lua_isnumber(L,3)) SWIG_fail_arg("Vector2::Lerp",3,"float"); + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + arg3 = (float)lua_tonumber(L, 3); + result = Vector2::Lerp((Vector2 const &)*arg1,(Vector2 const &)*arg2,arg3); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Negate(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + Vector2 result; + + SWIG_check_num_args("Vector2::Negate",1,1) + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + result = Vector2::Negate((Vector2 const &)*arg1); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2_Rotate(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = 0 ; + float arg2 ; + Vector2 result; + + SWIG_check_num_args("Vector2::Rotate",2,2) + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector2::Rotate",2,"float"); + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg1 = &vec; + } + } + arg2 = (float)lua_tonumber(L, 2); + result = Vector2::Rotate((Vector2 const &)*arg1,arg2); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2___eq(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + Vector2 *arg2 = 0 ; + bool result; + + SWIG_check_num_args("Vector2::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::operator ==",1,"Vector2 const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2___eq",1,SWIGTYPE_p_Vector2); + } + + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = (bool)((Vector2 const *)arg1)->operator ==((Vector2 const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2___unm(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + Vector2 result; + + SWIG_check_num_args("Vector2::operator -",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::operator -",1,"Vector2 const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2___unm",1,SWIGTYPE_p_Vector2); + } + + result = ((Vector2 const *)arg1)->operator -(); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2___sub(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + Vector2 *arg2 = 0 ; + Vector2 result; + + SWIG_check_num_args("Vector2::operator -",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::operator -",1,"Vector2 const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2___sub",1,SWIGTYPE_p_Vector2); + } + + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = ((Vector2 const *)arg1)->operator -((Vector2 const &)*arg2); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2___add(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + Vector2 *arg2 = 0 ; + Vector2 result; + + SWIG_check_num_args("Vector2::operator +",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::operator +",1,"Vector2 const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2___add",1,SWIGTYPE_p_Vector2); + } + + { + // const Vector2& conversion + Vector2 *vecPtr; + Vector2 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector2,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + arg2 = &vec; + } + } + result = ((Vector2 const *)arg1)->operator +((Vector2 const &)*arg2); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2___div(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + float arg2 ; + Vector2 result; + + SWIG_check_num_args("Vector2::operator /",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::operator /",1,"Vector2 const *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector2::operator /",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2___div",1,SWIGTYPE_p_Vector2); + } + + arg2 = (float)lua_tonumber(L, 2); + result = ((Vector2 const *)arg1)->operator /(arg2); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector2___mul(lua_State* L) { + int SWIG_arg = 0; + Vector2 *arg1 = (Vector2 *) 0 ; + float arg2 ; + Vector2 result; + + SWIG_check_num_args("Vector2::operator *",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector2::operator *",1,"Vector2 const *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector2::operator *",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector2,0))){ + SWIG_fail_ptr("Vector2___mul",1,SWIGTYPE_p_Vector2); + } + + arg2 = (float)lua_tonumber(L, 2); + result = ((Vector2 const *)arg1)->operator *(arg2); + { + Vector2 * resultptr = new Vector2((const Vector2 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_Vector2(void *obj) { +Vector2 *arg1 = (Vector2 *) obj; +delete arg1; +} +static swig_lua_method swig_Vector2_methods[] = { + {"Length", _wrap_Vector2_Length}, + {"LengthSquared", _wrap_Vector2_LengthSquared}, + {"Normalize", _wrap_Vector2_Normalize}, + {"__eq", _wrap_Vector2___eq}, + {"__unm", _wrap_Vector2___unm}, + {"__sub", _wrap_Vector2___sub}, + {"__add", _wrap_Vector2___add}, + {"__div", _wrap_Vector2___div}, + {"__mul", _wrap_Vector2___mul}, + {0,0} +}; +static swig_lua_attribute swig_Vector2_attributes[] = { + { "X", _wrap_Vector2_X_get, _wrap_Vector2_X_set}, + { "Y", _wrap_Vector2_Y_get, _wrap_Vector2_Y_set}, + {0,0,0} +}; +static swig_lua_attribute swig_Vector2_cls_attributes[] = { + { "Zero", _wrap_Vector2_Zero_get, _wrap_Vector2_Zero_set}, + { "One", _wrap_Vector2_One_get, _wrap_Vector2_One_set}, + { "UnitX", _wrap_Vector2_UnitX_get, _wrap_Vector2_UnitX_set}, + { "UnitY", _wrap_Vector2_UnitY_get, _wrap_Vector2_UnitY_set}, + {0,0,0} +}; +static swig_lua_method swig_Vector2_cls_methods[] = { + {"Distance", _wrap_Vector2_Distance}, + {"DistanceSquared", _wrap_Vector2_DistanceSquared}, + {"Dot", _wrap_Vector2_Dot}, + {"Reflect", _wrap_Vector2_Reflect}, + {"Min", _wrap_Vector2_Min}, + {"Max", _wrap_Vector2_Max}, + {"Clamp", _wrap_Vector2_Clamp}, + {"Lerp", _wrap_Vector2_Lerp}, + {"Negate", _wrap_Vector2_Negate}, + {"Rotate", _wrap_Vector2_Rotate}, + {0,0} +}; +static swig_lua_const_info swig_Vector2_cls_constants[] = { + {0,0,0,0,0,0} +}; +static swig_lua_class *swig_Vector2_bases[] = {0}; +static const char *swig_Vector2_base_names[] = {0}; +static swig_lua_class _wrap_class_Vector2 = { "Vector2", &SWIGTYPE_p_Vector2,_wrap_new_Vector2, swig_delete_Vector2, swig_Vector2_methods, swig_Vector2_attributes, { "Vector2", swig_Vector2_cls_methods, swig_Vector2_cls_attributes, swig_Vector2_cls_constants }, swig_Vector2_bases, swig_Vector2_base_names }; + +static int _wrap_Vector3_X_set(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float arg2 ; + + SWIG_check_num_args("Vector3::X",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::X",1,"Vector3 *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector3::X",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_X_set",1,SWIGTYPE_p_Vector3); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->X = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_X_get(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float result; + + SWIG_check_num_args("Vector3::X",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::X",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_X_get",1,SWIGTYPE_p_Vector3); + } + + result = (float) ((arg1)->X); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Y_set(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float arg2 ; + + SWIG_check_num_args("Vector3::Y",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::Y",1,"Vector3 *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector3::Y",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_Y_set",1,SWIGTYPE_p_Vector3); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->Y = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Y_get(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float result; + + SWIG_check_num_args("Vector3::Y",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::Y",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_Y_get",1,SWIGTYPE_p_Vector3); + } + + result = (float) ((arg1)->Y); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Z_set(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float arg2 ; + + SWIG_check_num_args("Vector3::Z",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::Z",1,"Vector3 *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector3::Z",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_Z_set",1,SWIGTYPE_p_Vector3); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->Z = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Z_get(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float result; + + SWIG_check_num_args("Vector3::Z",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::Z",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_Z_get",1,SWIGTYPE_p_Vector3); + } + + result = (float) ((arg1)->Z); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Zero_set(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + + SWIG_check_num_args("Vector3::Zero",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::Zero",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_Zero_set",1,SWIGTYPE_p_Vector3); + } + + Vector3::Zero = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Zero_get(lua_State* L) { + int SWIG_arg = 0; + Vector3 *result = 0 ; + + SWIG_check_num_args("Vector3::Zero",0,0) + result = (Vector3 *)&Vector3::Zero; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector3,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_One_set(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + + SWIG_check_num_args("Vector3::One",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::One",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_One_set",1,SWIGTYPE_p_Vector3); + } + + Vector3::One = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_One_get(lua_State* L) { + int SWIG_arg = 0; + Vector3 *result = 0 ; + + SWIG_check_num_args("Vector3::One",0,0) + result = (Vector3 *)&Vector3::One; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector3,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_UnitX_set(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + + SWIG_check_num_args("Vector3::UnitX",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::UnitX",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_UnitX_set",1,SWIGTYPE_p_Vector3); + } + + Vector3::UnitX = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_UnitX_get(lua_State* L) { + int SWIG_arg = 0; + Vector3 *result = 0 ; + + SWIG_check_num_args("Vector3::UnitX",0,0) + result = (Vector3 *)&Vector3::UnitX; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector3,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_UnitY_set(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + + SWIG_check_num_args("Vector3::UnitY",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::UnitY",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_UnitY_set",1,SWIGTYPE_p_Vector3); + } + + Vector3::UnitY = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_UnitY_get(lua_State* L) { + int SWIG_arg = 0; + Vector3 *result = 0 ; + + SWIG_check_num_args("Vector3::UnitY",0,0) + result = (Vector3 *)&Vector3::UnitY; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector3,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_UnitZ_set(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + + SWIG_check_num_args("Vector3::UnitZ",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::UnitZ",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_UnitZ_set",1,SWIGTYPE_p_Vector3); + } + + Vector3::UnitZ = *arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_UnitZ_get(lua_State* L) { + int SWIG_arg = 0; + Vector3 *result = 0 ; + + SWIG_check_num_args("Vector3::UnitZ",0,0) + result = (Vector3 *)&Vector3::UnitZ; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector3,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vector3__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + float arg1 ; + float arg2 ; + float arg3 ; + Vector3 *result = 0 ; + + SWIG_check_num_args("Vector3::Vector3",3,3) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Vector3::Vector3",1,"float"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector3::Vector3",2,"float"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Vector3::Vector3",3,"float"); + arg1 = (float)lua_tonumber(L, 1); + arg2 = (float)lua_tonumber(L, 2); + arg3 = (float)lua_tonumber(L, 3); + result = (Vector3 *)new Vector3(arg1,arg2,arg3); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector3,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vector3__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + float arg1 ; + Vector3 *result = 0 ; + + SWIG_check_num_args("Vector3::Vector3",1,1) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Vector3::Vector3",1,"float"); + arg1 = (float)lua_tonumber(L, 1); + result = (Vector3 *)new Vector3(arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector3,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vector3__SWIG_2(lua_State* L) { + int SWIG_arg = 0; + Vector3 *result = 0 ; + + SWIG_check_num_args("Vector3::Vector3",0,0) + result = (Vector3 *)new Vector3(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vector3,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Vector3(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Vector3__SWIG_2(L); + } + if (argc == 1) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + return _wrap_new_Vector3__SWIG_1(L); + } + } + if (argc == 3) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + return _wrap_new_Vector3__SWIG_0(L); + } + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Vector3'\n" + " Possible C/C++ prototypes are:\n" + " Vector3::Vector3(float,float,float)\n" + " Vector3::Vector3(float)\n" + " Vector3::Vector3()\n"); + lua_error(L);return 0; +} + + +static int _wrap_Vector3_Length(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float result; + + SWIG_check_num_args("Vector3::Length",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::Length",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_Length",1,SWIGTYPE_p_Vector3); + } + + result = (float)(arg1)->Length(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_LengthSquared(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float result; + + SWIG_check_num_args("Vector3::LengthSquared",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::LengthSquared",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_LengthSquared",1,SWIGTYPE_p_Vector3); + } + + result = (float)(arg1)->LengthSquared(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Distance(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 *arg2 = 0 ; + float result; + + SWIG_check_num_args("Vector3::Distance",2,2) + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = (float)Vector3::Distance((Vector3 const &)*arg1,(Vector3 const &)*arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_DistanceSquared(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 *arg2 = 0 ; + float result; + + SWIG_check_num_args("Vector3::DistanceSquared",2,2) + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = (float)Vector3::DistanceSquared((Vector3 const &)*arg1,(Vector3 const &)*arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Dot(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 *arg2 = 0 ; + float result; + + SWIG_check_num_args("Vector3::Dot",2,2) + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = (float)Vector3::Dot((Vector3 const &)*arg1,(Vector3 const &)*arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Normalize(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + + SWIG_check_num_args("Vector3::Normalize",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::Normalize",1,"Vector3 *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3_Normalize",1,SWIGTYPE_p_Vector3); + } + + (arg1)->Normalize(); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Reflect(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 *arg2 = 0 ; + Vector3 result; + + SWIG_check_num_args("Vector3::Reflect",2,2) + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = Vector3::Reflect((Vector3 const &)*arg1,(Vector3 const &)*arg2); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Min(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 *arg2 = 0 ; + Vector3 result; + + SWIG_check_num_args("Vector3::Min",2,2) + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = Vector3::Min((Vector3 const &)*arg1,(Vector3 const &)*arg2); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Max(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 *arg2 = 0 ; + Vector3 result; + + SWIG_check_num_args("Vector3::Max",2,2) + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = Vector3::Max((Vector3 const &)*arg1,(Vector3 const &)*arg2); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Clamp(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 *arg2 = 0 ; + Vector3 *arg3 = 0 ; + Vector3 result; + + SWIG_check_num_args("Vector3::Clamp",3,3) + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg3 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 3); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 3); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 3); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg3 = &vec; + } + } + result = Vector3::Clamp((Vector3 const &)*arg1,(Vector3 const &)*arg2,(Vector3 const &)*arg3); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Lerp(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 *arg2 = 0 ; + float arg3 ; + Vector3 result; + + SWIG_check_num_args("Vector3::Lerp",3,3) + if(!lua_isnumber(L,3)) SWIG_fail_arg("Vector3::Lerp",3,"float"); + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + arg3 = (float)lua_tonumber(L, 3); + result = Vector3::Lerp((Vector3 const &)*arg1,(Vector3 const &)*arg2,arg3); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3_Negate(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = 0 ; + Vector3 result; + + SWIG_check_num_args("Vector3::Negate",1,1) + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg1 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 1); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 1); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 1); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg1 = &vec; + } + } + result = Vector3::Negate((Vector3 const &)*arg1); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3___eq(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + Vector3 *arg2 = 0 ; + bool result; + + SWIG_check_num_args("Vector3::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::operator ==",1,"Vector3 const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3___eq",1,SWIGTYPE_p_Vector3); + } + + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = (bool)((Vector3 const *)arg1)->operator ==((Vector3 const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3___unm(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + Vector3 result; + + SWIG_check_num_args("Vector3::operator -",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::operator -",1,"Vector3 const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3___unm",1,SWIGTYPE_p_Vector3); + } + + result = ((Vector3 const *)arg1)->operator -(); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3___sub(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + Vector3 *arg2 = 0 ; + Vector3 result; + + SWIG_check_num_args("Vector3::operator -",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::operator -",1,"Vector3 const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3___sub",1,SWIGTYPE_p_Vector3); + } + + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = ((Vector3 const *)arg1)->operator -((Vector3 const &)*arg2); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3___add(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + Vector3 *arg2 = 0 ; + Vector3 result; + + SWIG_check_num_args("Vector3::operator +",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::operator +",1,"Vector3 const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3___add",1,SWIGTYPE_p_Vector3); + } + + { + // const Vector3& conversion + Vector3 *vecPtr; + Vector3 vec; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&vecPtr,SWIGTYPE_p_Vector3,0))) + { + arg2 = vecPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float x = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float y = lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float z = lua_tonumber(L, -1); + lua_pop(L, 1); + + // build the vector + vec.X = x; + vec.Y = y; + vec.Z = z; + arg2 = &vec; + } + } + result = ((Vector3 const *)arg1)->operator +((Vector3 const &)*arg2); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3___div(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float arg2 ; + Vector3 result; + + SWIG_check_num_args("Vector3::operator /",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::operator /",1,"Vector3 const *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector3::operator /",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3___div",1,SWIGTYPE_p_Vector3); + } + + arg2 = (float)lua_tonumber(L, 2); + result = ((Vector3 const *)arg1)->operator /(arg2); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Vector3___mul(lua_State* L) { + int SWIG_arg = 0; + Vector3 *arg1 = (Vector3 *) 0 ; + float arg2 ; + Vector3 result; + + SWIG_check_num_args("Vector3::operator *",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vector3::operator *",1,"Vector3 const *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Vector3::operator *",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vector3,0))){ + SWIG_fail_ptr("Vector3___mul",1,SWIGTYPE_p_Vector3); + } + + arg2 = (float)lua_tonumber(L, 2); + result = ((Vector3 const *)arg1)->operator *(arg2); + { + Vector3 * resultptr = new Vector3((const Vector3 &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_Vector3(void *obj) { +Vector3 *arg1 = (Vector3 *) obj; +delete arg1; +} +static swig_lua_method swig_Vector3_methods[] = { + {"Length", _wrap_Vector3_Length}, + {"LengthSquared", _wrap_Vector3_LengthSquared}, + {"Normalize", _wrap_Vector3_Normalize}, + {"__eq", _wrap_Vector3___eq}, + {"__unm", _wrap_Vector3___unm}, + {"__sub", _wrap_Vector3___sub}, + {"__add", _wrap_Vector3___add}, + {"__div", _wrap_Vector3___div}, + {"__mul", _wrap_Vector3___mul}, + {0,0} +}; +static swig_lua_attribute swig_Vector3_attributes[] = { + { "X", _wrap_Vector3_X_get, _wrap_Vector3_X_set}, + { "Y", _wrap_Vector3_Y_get, _wrap_Vector3_Y_set}, + { "Z", _wrap_Vector3_Z_get, _wrap_Vector3_Z_set}, + {0,0,0} +}; +static swig_lua_attribute swig_Vector3_cls_attributes[] = { + { "Zero", _wrap_Vector3_Zero_get, _wrap_Vector3_Zero_set}, + { "One", _wrap_Vector3_One_get, _wrap_Vector3_One_set}, + { "UnitX", _wrap_Vector3_UnitX_get, _wrap_Vector3_UnitX_set}, + { "UnitY", _wrap_Vector3_UnitY_get, _wrap_Vector3_UnitY_set}, + { "UnitZ", _wrap_Vector3_UnitZ_get, _wrap_Vector3_UnitZ_set}, + {0,0,0} +}; +static swig_lua_method swig_Vector3_cls_methods[] = { + {"Distance", _wrap_Vector3_Distance}, + {"DistanceSquared", _wrap_Vector3_DistanceSquared}, + {"Dot", _wrap_Vector3_Dot}, + {"Reflect", _wrap_Vector3_Reflect}, + {"Min", _wrap_Vector3_Min}, + {"Max", _wrap_Vector3_Max}, + {"Clamp", _wrap_Vector3_Clamp}, + {"Lerp", _wrap_Vector3_Lerp}, + {"Negate", _wrap_Vector3_Negate}, + {0,0} +}; +static swig_lua_const_info swig_Vector3_cls_constants[] = { + {0,0,0,0,0,0} +}; +static swig_lua_class *swig_Vector3_bases[] = {0}; +static const char *swig_Vector3_base_names[] = {0}; +static swig_lua_class _wrap_class_Vector3 = { "Vector3", &SWIGTYPE_p_Vector3,_wrap_new_Vector3, swig_delete_Vector3, swig_Vector3_methods, swig_Vector3_attributes, { "Vector3", swig_Vector3_cls_methods, swig_Vector3_cls_attributes, swig_Vector3_cls_constants }, swig_Vector3_bases, swig_Vector3_base_names }; + +static int _wrap_Color_R_set(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + float arg2 ; + + SWIG_check_num_args("Color::R",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::R",1,"Color *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::R",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color_R_set",1,SWIGTYPE_p_Color); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->R = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_R_get(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + float result; + + SWIG_check_num_args("Color::R",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::R",1,"Color *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color_R_get",1,SWIGTYPE_p_Color); + } + + result = (float) ((arg1)->R); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_G_set(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + float arg2 ; + + SWIG_check_num_args("Color::G",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::G",1,"Color *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::G",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color_G_set",1,SWIGTYPE_p_Color); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->G = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_G_get(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + float result; + + SWIG_check_num_args("Color::G",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::G",1,"Color *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color_G_get",1,SWIGTYPE_p_Color); + } + + result = (float) ((arg1)->G); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_B_set(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + float arg2 ; + + SWIG_check_num_args("Color::B",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::B",1,"Color *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::B",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color_B_set",1,SWIGTYPE_p_Color); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->B = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_B_get(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + float result; + + SWIG_check_num_args("Color::B",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::B",1,"Color *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color_B_get",1,SWIGTYPE_p_Color); + } + + result = (float) ((arg1)->B); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_A_set(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + float arg2 ; + + SWIG_check_num_args("Color::A",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::A",1,"Color *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::A",2,"float"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color_A_set",1,SWIGTYPE_p_Color); + } + + arg2 = (float)lua_tonumber(L, 2); + if (arg1) (arg1)->A = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_A_get(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + float result; + + SWIG_check_num_args("Color::A",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::A",1,"Color *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color_A_get",1,SWIGTYPE_p_Color); + } + + result = (float) ((arg1)->A); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Color__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + Color *result = 0 ; + + SWIG_check_num_args("Color::Color",0,0) + result = (Color *)new Color(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Color,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Color__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + float arg1 ; + float arg2 ; + float arg3 ; + float arg4 ; + bool arg5 ; + Color *result = 0 ; + + SWIG_check_num_args("Color::Color",5,5) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Color::Color",1,"float"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::Color",2,"float"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Color::Color",3,"float"); + if(!lua_isnumber(L,4)) SWIG_fail_arg("Color::Color",4,"float"); + if(!lua_isboolean(L,5)) SWIG_fail_arg("Color::Color",5,"bool"); + arg1 = (float)lua_tonumber(L, 1); + arg2 = (float)lua_tonumber(L, 2); + arg3 = (float)lua_tonumber(L, 3); + arg4 = (float)lua_tonumber(L, 4); + arg5 = (lua_toboolean(L, 5)!=0); + result = (Color *)new Color(arg1,arg2,arg3,arg4,arg5); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Color,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Color__SWIG_2(lua_State* L) { + int SWIG_arg = 0; + float arg1 ; + float arg2 ; + float arg3 ; + float arg4 ; + Color *result = 0 ; + + SWIG_check_num_args("Color::Color",4,4) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Color::Color",1,"float"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::Color",2,"float"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Color::Color",3,"float"); + if(!lua_isnumber(L,4)) SWIG_fail_arg("Color::Color",4,"float"); + arg1 = (float)lua_tonumber(L, 1); + arg2 = (float)lua_tonumber(L, 2); + arg3 = (float)lua_tonumber(L, 3); + arg4 = (float)lua_tonumber(L, 4); + result = (Color *)new Color(arg1,arg2,arg3,arg4); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Color,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Color__SWIG_3(lua_State* L) { + int SWIG_arg = 0; + float arg1 ; + float arg2 ; + float arg3 ; + Color *result = 0 ; + + SWIG_check_num_args("Color::Color",3,3) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Color::Color",1,"float"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::Color",2,"float"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Color::Color",3,"float"); + arg1 = (float)lua_tonumber(L, 1); + arg2 = (float)lua_tonumber(L, 2); + arg3 = (float)lua_tonumber(L, 3); + result = (Color *)new Color(arg1,arg2,arg3); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_Color,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Color(lua_State* L) { + int argc; + int argv[6]={ + 1,2,3,4,5,6 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Color__SWIG_0(L); + } + if (argc == 3) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + return _wrap_new_Color__SWIG_3(L); + } + } + } + } + if (argc == 4) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[3]); + } + if (_v) { + return _wrap_new_Color__SWIG_2(L); + } + } + } + } + } + if (argc == 5) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[3]); + } + if (_v) { + { + _v = lua_isboolean(L,argv[4]); + } + if (_v) { + return _wrap_new_Color__SWIG_1(L); + } + } + } + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Color'\n" + " Possible C/C++ prototypes are:\n" + " Color::Color()\n" + " Color::Color(float,float,float,float,bool)\n" + " Color::Color(float,float,float,float)\n" + " Color::Color(float,float,float)\n"); + lua_error(L);return 0; +} + + +static int _wrap_Color_FromInts__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + bool arg5 ; + Color result; + + SWIG_check_num_args("Color::FromInts",5,5) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Color::FromInts",1,"int"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::FromInts",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Color::FromInts",3,"int"); + if(!lua_isnumber(L,4)) SWIG_fail_arg("Color::FromInts",4,"int"); + if(!lua_isboolean(L,5)) SWIG_fail_arg("Color::FromInts",5,"bool"); + arg1 = (int)lua_tonumber(L, 1); + arg2 = (int)lua_tonumber(L, 2); + arg3 = (int)lua_tonumber(L, 3); + arg4 = (int)lua_tonumber(L, 4); + arg5 = (lua_toboolean(L, 5)!=0); + result = Color::FromInts(arg1,arg2,arg3,arg4,arg5); + { + Color * resultptr = new Color((const Color &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Color,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_FromInts__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + Color result; + + SWIG_check_num_args("Color::FromInts",4,4) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Color::FromInts",1,"int"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::FromInts",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Color::FromInts",3,"int"); + if(!lua_isnumber(L,4)) SWIG_fail_arg("Color::FromInts",4,"int"); + arg1 = (int)lua_tonumber(L, 1); + arg2 = (int)lua_tonumber(L, 2); + arg3 = (int)lua_tonumber(L, 3); + arg4 = (int)lua_tonumber(L, 4); + result = Color::FromInts(arg1,arg2,arg3,arg4); + { + Color * resultptr = new Color((const Color &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Color,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_FromInts__SWIG_2(lua_State* L) { + int SWIG_arg = 0; + int arg1 ; + int arg2 ; + int arg3 ; + Color result; + + SWIG_check_num_args("Color::FromInts",3,3) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Color::FromInts",1,"int"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("Color::FromInts",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("Color::FromInts",3,"int"); + arg1 = (int)lua_tonumber(L, 1); + arg2 = (int)lua_tonumber(L, 2); + arg3 = (int)lua_tonumber(L, 3); + result = Color::FromInts(arg1,arg2,arg3); + { + Color * resultptr = new Color((const Color &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Color,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color_FromInts(lua_State* L) { + int argc; + int argv[6]={ + 1,2,3,4,5,6 + }; + + argc = lua_gettop(L); + if (argc == 3) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + return _wrap_Color_FromInts__SWIG_2(L); + } + } + } + } + if (argc == 4) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[3]); + } + if (_v) { + return _wrap_Color_FromInts__SWIG_1(L); + } + } + } + } + } + if (argc == 5) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[3]); + } + if (_v) { + { + _v = lua_isboolean(L,argv[4]); + } + if (_v) { + return _wrap_Color_FromInts__SWIG_0(L); + } + } + } + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Color_FromInts'\n" + " Possible C/C++ prototypes are:\n" + " Color::FromInts(int,int,int,int,bool)\n" + " Color::FromInts(int,int,int,int)\n" + " Color::FromInts(int,int,int)\n"); + lua_error(L);return 0; +} + + +static int _wrap_Color_FromHexString(lua_State* L) { + int SWIG_arg = 0; + String arg1 ; + Color result; + + SWIG_check_num_args("Color::FromHexString",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("Color::FromHexString",1,"String"); + (&arg1)->assign(lua_tostring(L,1),lua_rawlen(L,1)); + result = Color::FromHexString(arg1); + { + Color * resultptr = new Color((const Color &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Color,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color___eq(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + Color *arg2 = 0 ; + bool result; + + SWIG_check_num_args("Color::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::operator ==",1,"Color const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color___eq",1,SWIGTYPE_p_Color); + } + + { + // const Color& conversion + Color *colPtr; + Color col; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&colPtr,SWIGTYPE_p_Color,0))) + { + arg2 = colPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float r = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float g = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float b = lua_tonumber(L, -1); + lua_pop(L, 1); + + float a = 1.0f; + if (lua_rawlen(L, 2) >= 4) + { + lua_pushinteger(L, 4); + lua_gettable(L, 2); + if (lua_isnumber(L, -1)) + { + a = lua_tonumber(L, -1); + } + lua_pop(L, 1); + } + + // build the color + col.R = r; + col.G = g; + col.B = b; + col.A = a; + arg2 = &col; + } + } + result = (bool)((Color const *)arg1)->operator ==((Color const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Color___sub(lua_State* L) { + int SWIG_arg = 0; + Color *arg1 = (Color *) 0 ; + Color *arg2 = 0 ; + Color result; + + SWIG_check_num_args("Color::operator -",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Color::operator -",1,"Color const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Color,0))){ + SWIG_fail_ptr("Color___sub",1,SWIGTYPE_p_Color); + } + + { + // const Color& conversion + Color *colPtr; + Color col; + if (SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&colPtr,SWIGTYPE_p_Color,0))) + { + arg2 = colPtr; + } + else + { + // convert table parameters to floats + lua_pushinteger(L, 1); + lua_gettable(L, 2); + float r = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 2); + lua_gettable(L, 2); + float g = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_pushinteger(L, 3); + lua_gettable(L, 2); + float b = lua_tonumber(L, -1); + lua_pop(L, 1); + + float a = 1.0f; + if (lua_rawlen(L, 2) >= 4) + { + lua_pushinteger(L, 4); + lua_gettable(L, 2); + if (lua_isnumber(L, -1)) + { + a = lua_tonumber(L, -1); + } + lua_pop(L, 1); + } + + // build the color + col.R = r; + col.G = g; + col.B = b; + col.A = a; + arg2 = &col; + } + } + result = ((Color const *)arg1)->operator -((Color const &)*arg2);