Changeset - r18760:babf79514cd5
[Not reviewed]
master
0 10 4
truebrain - 13 years ago 2011-12-19 20:58:59
truebrain@openttd.org
(svn r23618) -Add: ScriptGame::Pause, ScriptGame::Unpause, and ScriptGame::GetLandscape (GameScript only)
14 files changed with 211 insertions and 0 deletions:
0 comments (0 inline, 0 general)
projects/openttd_vs100.vcxproj
Show inline comments
 
@@ -940,12 +940,13 @@
 
    <ClInclude Include="..\src\script\api\script_engine.hpp" />
 
    <ClInclude Include="..\src\script\api\script_enginelist.hpp" />
 
    <ClInclude Include="..\src\script\api\script_error.hpp" />
 
    <ClInclude Include="..\src\script\api\script_event.hpp" />
 
    <ClInclude Include="..\src\script\api\script_event_types.hpp" />
 
    <ClInclude Include="..\src\script\api\script_execmode.hpp" />
 
    <ClInclude Include="..\src\script\api\script_game.hpp" />
 
    <ClInclude Include="..\src\script\api\script_gamesettings.hpp" />
 
    <ClInclude Include="..\src\script\api\script_group.hpp" />
 
    <ClInclude Include="..\src\script\api\script_grouplist.hpp" />
 
    <ClInclude Include="..\src\script\api\script_industry.hpp" />
 
    <ClInclude Include="..\src\script\api\script_industrylist.hpp" />
 
    <ClInclude Include="..\src\script\api\script_industrytype.hpp" />
 
@@ -993,12 +994,13 @@
 
    <ClCompile Include="..\src\script\api\script_engine.cpp" />
 
    <ClCompile Include="..\src\script\api\script_enginelist.cpp" />
 
    <ClCompile Include="..\src\script\api\script_error.cpp" />
 
    <ClCompile Include="..\src\script\api\script_event.cpp" />
 
    <ClCompile Include="..\src\script\api\script_event_types.cpp" />
 
    <ClCompile Include="..\src\script\api\script_execmode.cpp" />
 
    <ClCompile Include="..\src\script\api\script_game.cpp" />
 
    <ClCompile Include="..\src\script\api\script_gamesettings.cpp" />
 
    <ClCompile Include="..\src\script\api\script_group.cpp" />
 
    <ClCompile Include="..\src\script\api\script_grouplist.cpp" />
 
    <ClCompile Include="..\src\script\api\script_industry.cpp" />
 
    <ClCompile Include="..\src\script\api\script_industrylist.cpp" />
 
    <ClCompile Include="..\src\script\api\script_industrytype.cpp" />
projects/openttd_vs100.vcxproj.filters
Show inline comments
 
@@ -2055,12 +2055,15 @@
 
    <ClInclude Include="..\src\script\api\script_event_types.hpp">
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_execmode.hpp">
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_game.hpp">
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_gamesettings.hpp">
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_group.hpp">
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
@@ -2214,12 +2217,15 @@
 
    <ClCompile Include="..\src\script\api\script_event_types.cpp">
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_execmode.cpp">
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_game.cpp">
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_gamesettings.cpp">
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_group.cpp">
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
projects/openttd_vs80.vcproj
Show inline comments
 
@@ -3104,12 +3104,16 @@
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_execmode.hpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_game.hpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_gamesettings.hpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_group.hpp"
 
				>
 
@@ -3320,12 +3324,16 @@
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_execmode.cpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_game.cpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_gamesettings.cpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_group.cpp"
 
				>
projects/openttd_vs90.vcproj
Show inline comments
 
@@ -3101,12 +3101,16 @@
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_execmode.hpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_game.hpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_gamesettings.hpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_group.hpp"
 
				>
 
@@ -3317,12 +3321,16 @@
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_execmode.cpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_game.cpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_gamesettings.cpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_group.cpp"
 
				>
source.list
Show inline comments
 
@@ -718,12 +718,13 @@ script/api/script_depotlist.hpp
 
script/api/script_engine.hpp
 
script/api/script_enginelist.hpp
 
script/api/script_error.hpp
 
script/api/script_event.hpp
 
script/api/script_event_types.hpp
 
script/api/script_execmode.hpp
 
script/api/script_game.hpp
 
script/api/script_gamesettings.hpp
 
script/api/script_group.hpp
 
script/api/script_grouplist.hpp
 
script/api/script_industry.hpp
 
script/api/script_industrylist.hpp
 
script/api/script_industrytype.hpp
 
@@ -773,12 +774,13 @@ script/api/script_depotlist.cpp
 
script/api/script_engine.cpp
 
script/api/script_enginelist.cpp
 
script/api/script_error.cpp
 
script/api/script_event.cpp
 
script/api/script_event_types.cpp
 
script/api/script_execmode.cpp
 
script/api/script_game.cpp
 
script/api/script_gamesettings.cpp
 
script/api/script_group.cpp
 
script/api/script_grouplist.cpp
 
script/api/script_industry.cpp
 
script/api/script_industrylist.cpp
 
script/api/script_industrytype.cpp
src/game/game_instance.cpp
Show inline comments
 
@@ -37,12 +37,13 @@
 
#include "../script/api/game/game_depotlist.hpp.sq"
 
#include "../script/api/game/game_engine.hpp.sq"
 
#include "../script/api/game/game_enginelist.hpp.sq"
 
#include "../script/api/game/game_error.hpp.sq"
 
#include "../script/api/game/game_event.hpp.sq"
 
#include "../script/api/game/game_execmode.hpp.sq"
 
#include "../script/api/game/game_game.hpp.sq"
 
#include "../script/api/game/game_gamesettings.hpp.sq"
 
#include "../script/api/game/game_industry.hpp.sq"
 
#include "../script/api/game/game_industrylist.hpp.sq"
 
#include "../script/api/game/game_industrytype.hpp.sq"
 
#include "../script/api/game/game_industrytypelist.hpp.sq"
 
#include "../script/api/game/game_infrastructure.hpp.sq"
 
@@ -106,12 +107,13 @@ void GameInstance::RegisterAPI()
 
	SQGSEngine_Register(this->engine);
 
	SQGSEngineList_Register(this->engine);
 
	SQGSError_Register(this->engine);
 
	SQGSEvent_Register(this->engine);
 
	SQGSEventController_Register(this->engine);
 
	SQGSExecMode_Register(this->engine);
 
	SQGSGame_Register(this->engine);
 
	SQGSGameSettings_Register(this->engine);
 
	SQGSIndustry_Register(this->engine);
 
	SQGSIndustryList_Register(this->engine);
 
	SQGSIndustryList_CargoAccepting_Register(this->engine);
 
	SQGSIndustryList_CargoProducing_Register(this->engine);
 
	SQGSIndustryType_Register(this->engine);
src/lang/english.txt
Show inline comments
 
@@ -1823,16 +1823,18 @@ STR_NETWORK_ERROR_CLIENT_GUI_LOST_CONNEC
 
STR_NETWORK_SERVER_MESSAGE                                      :*** {1:RAW_STRING}
 
############ Leave those lines in this order!!
 
STR_NETWORK_SERVER_MESSAGE_GAME_PAUSED                          :Game paused ({STRING})
 
STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_1                  :Game still paused ({STRING})
 
STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_2                  :Game still paused ({STRING}, {STRING})
 
STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_3                  :Game still paused ({STRING}, {STRING}, {STRING})
 
STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_4                  :Game still paused ({STRING}, {STRING}, {STRING}, {STRING})
 
STR_NETWORK_SERVER_MESSAGE_GAME_UNPAUSED                        :Game unpaused ({STRING})
 
STR_NETWORK_SERVER_MESSAGE_GAME_REASON_NOT_ENOUGH_PLAYERS       :number of players
 
STR_NETWORK_SERVER_MESSAGE_GAME_REASON_CONNECTING_CLIENTS       :connecting clients
 
STR_NETWORK_SERVER_MESSAGE_GAME_REASON_MANUAL                   :manual
 
STR_NETWORK_SERVER_MESSAGE_GAME_REASON_GAME_SCRIPT              :game script
 
############ End of leave-in-this-order
 
STR_NETWORK_MESSAGE_CLIENT_LEAVING                              :leaving
 
STR_NETWORK_MESSAGE_CLIENT_JOINED                               :*** {RAW_STRING} has joined the game
 
STR_NETWORK_MESSAGE_CLIENT_JOINED_ID                            :*** {RAW_STRING} has joined the game (Client #{2:NUM})
 
STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN                         :*** {RAW_STRING} has joined company #{2:NUM}
 
STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE                     :*** {RAW_STRING} has joined spectators
src/misc_cmd.cpp
Show inline comments
 
@@ -145,12 +145,13 @@ static void AskUnsafeUnpauseCallback(Win
 
CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 
{
 
	switch (p1) {
 
		case PM_PAUSED_SAVELOAD:
 
		case PM_PAUSED_ERROR:
 
		case PM_PAUSED_NORMAL:
 
		case PM_PAUSED_GAME_SCRIPT:
 
			break;
 

	
 
#ifdef ENABLE_NETWORK
 
		case PM_PAUSED_JOIN:
 
		case PM_PAUSED_ACTIVE_CLIENTS:
 
			if (!_networking) return CMD_ERROR;
src/network/network.cpp
Show inline comments
 
@@ -333,28 +333,32 @@ void NetworkHandlePauseChange(PauseMode 
 
{
 
	if (!_networking) return;
 

	
 
	switch (changed_mode) {
 
		case PM_PAUSED_NORMAL:
 
		case PM_PAUSED_JOIN:
 
		case PM_PAUSED_GAME_SCRIPT:
 
		case PM_PAUSED_ACTIVE_CLIENTS: {
 
			bool changed = ((_pause_mode == PM_UNPAUSED) != (prev_mode == PM_UNPAUSED));
 
			bool paused = (_pause_mode != PM_UNPAUSED);
 
			if (!paused && !changed) return;
 

	
 
			StringID str;
 
			if (!changed) {
 
				int i = -1;
 

	
 
				if ((_pause_mode & PM_PAUSED_NORMAL) != PM_UNPAUSED)         SetDParam(++i, STR_NETWORK_SERVER_MESSAGE_GAME_REASON_MANUAL);
 
				if ((_pause_mode & PM_PAUSED_JOIN) != PM_UNPAUSED)           SetDParam(++i, STR_NETWORK_SERVER_MESSAGE_GAME_REASON_CONNECTING_CLIENTS);
 
				if ((_pause_mode & PM_PAUSED_GAME_SCRIPT) != PM_UNPAUSED)    SetDParam(++i, STR_NETWORK_SERVER_MESSAGE_GAME_REASON_GAME_SCRIPT);
 
				if ((_pause_mode & PM_PAUSED_ACTIVE_CLIENTS) != PM_UNPAUSED) SetDParam(++i, STR_NETWORK_SERVER_MESSAGE_GAME_REASON_NOT_ENOUGH_PLAYERS);
 
				str = STR_NETWORK_SERVER_MESSAGE_GAME_STILL_PAUSED_1 + i;
 
			} else {
 
				switch (changed_mode) {
 
					case PM_PAUSED_NORMAL:         SetDParam(0, STR_NETWORK_SERVER_MESSAGE_GAME_REASON_MANUAL); break;
 
					case PM_PAUSED_JOIN:           SetDParam(0, STR_NETWORK_SERVER_MESSAGE_GAME_REASON_CONNECTING_CLIENTS); break;
 
					case PM_PAUSED_GAME_SCRIPT:    SetDParam(0, STR_NETWORK_SERVER_MESSAGE_GAME_REASON_GAME_SCRIPT); break;
 
					case PM_PAUSED_ACTIVE_CLIENTS: SetDParam(0, STR_NETWORK_SERVER_MESSAGE_GAME_REASON_NOT_ENOUGH_PLAYERS); break;
 
					default: NOT_REACHED();
 
				}
 
				str = paused ? STR_NETWORK_SERVER_MESSAGE_GAME_PAUSED : STR_NETWORK_SERVER_MESSAGE_GAME_UNPAUSED;
 
			}
 

	
src/openttd.h
Show inline comments
 
@@ -58,12 +58,13 @@ enum PauseMode {
 
	PM_UNPAUSED              = 0,      ///< A normal unpaused game
 
	PM_PAUSED_NORMAL         = 1 << 0, ///< A game normally paused
 
	PM_PAUSED_SAVELOAD       = 1 << 1, ///< A game paused for saving/loading
 
	PM_PAUSED_JOIN           = 1 << 2, ///< A game paused for 'pause_on_join'
 
	PM_PAUSED_ERROR          = 1 << 3, ///< A game paused because a (critical) error
 
	PM_PAUSED_ACTIVE_CLIENTS = 1 << 4, ///< A game paused for 'min_active_clients'
 
	PM_PAUSED_GAME_SCRIPT    = 1 << 5, ///< A game paused by a game script
 

	
 
	/** Pause mode bits when paused for network reasons. */
 
	PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
 
};
 
DECLARE_ENUM_AS_BIT_SET(PauseMode)
 
typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
src/script/api/game/game_game.hpp.sq
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD 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 General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
 

	
 
#include "../script_game.hpp"
 
#include "../template/template_game.hpp.sq"
 

	
 

	
 
template <> const char *GetClassName<ScriptGame, ST_GS>() { return "GSGame"; }
 

	
 
void SQGSGame_Register(Squirrel *engine)
 
{
 
	DefSQClass<ScriptGame, ST_GS> SQGSGame("GSGame");
 
	SQGSGame.PreRegister(engine);
 
	SQGSGame.AddConstructor<void (ScriptGame::*)(), 1>(engine, "x");
 

	
 
	SQGSGame.DefSQConst(engine, ScriptGame::LT_TEMPERATE, "LT_TEMPERATE");
 
	SQGSGame.DefSQConst(engine, ScriptGame::LT_ARCTIC,    "LT_ARCTIC");
 
	SQGSGame.DefSQConst(engine, ScriptGame::LT_TROPIC,    "LT_TROPIC");
 
	SQGSGame.DefSQConst(engine, ScriptGame::LT_TOYLAND,   "LT_TOYLAND");
 

	
 
	SQGSGame.DefSQStaticMethod(engine, &ScriptGame::Pause,         "Pause",         1, ".");
 
	SQGSGame.DefSQStaticMethod(engine, &ScriptGame::Unpause,       "Unpause",       1, ".");
 
	SQGSGame.DefSQStaticMethod(engine, &ScriptGame::IsPaused,      "IsPaused",      1, ".");
 
	SQGSGame.DefSQStaticMethod(engine, &ScriptGame::GetLandscape,  "GetLandscape",  1, ".");
 
	SQGSGame.DefSQStaticMethod(engine, &ScriptGame::IsMultiplayer, "IsMultiplayer", 1, ".");
 

	
 
	SQGSGame.PostRegister(engine);
 
}
src/script/api/script_game.cpp
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD 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 General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_game.cpp Implementation of ScriptGame. */
 

	
 
#include "../../stdafx.h"
 
#include "script_game.hpp"
 
#include "../../command_type.h"
 
#include "../../settings_type.h"
 
#include "../../openttd.h"
 
#include "../../network/network.h"
 

	
 
/* static */ bool ScriptGame::Pause()
 
{
 
	return ScriptObject::DoCommand(0, PM_PAUSED_GAME_SCRIPT, 1, CMD_PAUSE);
 
}
 

	
 
/* static */ bool ScriptGame::Unpause()
 
{
 
	return ScriptObject::DoCommand(0, PM_PAUSED_GAME_SCRIPT, 0, CMD_PAUSE);
 
}
 

	
 
/* static */ bool ScriptGame::IsPaused()
 
{
 
	return !!_pause_mode;
 
}
 

	
 
/* static */ ScriptGame::LandscapeType ScriptGame::GetLandscape()
 
{
 
	return (ScriptGame::LandscapeType)_settings_game.game_creation.landscape;
 
}
 

	
 
/* static */ bool ScriptGame::IsMultiplayer()
 
{
 
#ifdef ENABLE_NETWORK
 
	return _network_server;
 
#else
 
	return false;
 
#endif
 
}
src/script/api/script_game.hpp
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD 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 General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_game.hpp Everything to manipulate the current running game. */
 

	
 
#ifndef SCRIPT_GAME_HPP
 
#define SCRIPT_GAME_HPP
 

	
 
#include "script_object.hpp"
 
#include "../../landscape_type.h"
 

	
 
/**
 
 * Class that handles some game related functions.
 
 * @api game
 
 */
 
class ScriptGame : public ScriptObject {
 
public:
 
	/**
 
	 * Type of landscapes known in the game.
 
	 */
 
	enum LandscapeType {
 
		/* Note: these values represent part of the in-game LandscapeType enum */
 
		LT_TEMPERATE  = ::LT_TEMPERATE, ///< Temperate climiate.
 
		LT_ARCTIC     = ::LT_ARCTIC,    ///< Arctic climate.
 
		LT_TROPIC     = ::LT_TROPIC,    ///< Tropic climate.
 
		LT_TOYLAND    = ::LT_TOYLAND,   ///< Toyland climate.
 
	};
 

	
 
	/**
 
	 * Pause the server.
 
	 * @return True if the action succeeded.
 
	 */
 
	static bool Pause();
 

	
 
	/**
 
	 * Unpause the server.
 
	 * @return True if the action succeeded.
 
	 */
 
	static bool Unpause();
 

	
 
	/**
 
	 * Check if the game is paused.
 
	 * @return True if and only if the game is paused (by which-ever means).
 
	 * @note That a game is paused, doesn't always means you can unpause it. If
 
	 *  the game has been manually paused, or because of the pause_on_join in
 
	 *  Multiplayer for example, you cannot unpause the game.
 
	 */
 
	static bool IsPaused();
 

	
 
	/**
 
	 * Get the current landscape.
 
	 */
 
	static LandscapeType GetLandscape();
 

	
 
	/**
 
	 * Is this a multiplayer game?
 
	 * @return True if this is a server in a multiplayer game.
 
	 */
 
	static bool IsMultiplayer();
 
};
 

	
 
#endif /* SCRIPT_GAME_HPP */
src/script/api/template/template_game.hpp.sq
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD 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 General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
 

	
 
#include "../script_game.hpp"
 

	
 
namespace SQConvert {
 
	/* Allow enums to be used as Squirrel parameters */
 
	template <> inline ScriptGame::LandscapeType GetParam(ForceType<ScriptGame::LandscapeType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptGame::LandscapeType)tmp; }
 
	template <> inline int Return<ScriptGame::LandscapeType>(HSQUIRRELVM vm, ScriptGame::LandscapeType res) { sq_pushinteger(vm, (int32)res); return 1; }
 

	
 
	/* Allow ScriptGame to be used as Squirrel parameter */
 
	template <> inline ScriptGame *GetParam(ForceType<ScriptGame *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptGame *)instance; }
 
	template <> inline ScriptGame &GetParam(ForceType<ScriptGame &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptGame *)instance; }
 
	template <> inline const ScriptGame *GetParam(ForceType<const ScriptGame *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (ScriptGame *)instance; }
 
	template <> inline const ScriptGame &GetParam(ForceType<const ScriptGame &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptGame *)instance; }
 
	template <> inline int Return<ScriptGame *>(HSQUIRRELVM vm, ScriptGame *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Game", res, NULL, DefSQDestructorCallback<ScriptGame>, true); return 1; }
 
} // namespace SQConvert
0 comments (0 inline, 0 general)