LUAS3DLib.cpp File Reference

#include <lua/LUAS3DLib.h>
#include <lua/LUAScript.h>
#include <lua/LUAUtil.h>
#include <common/OptionEntry.h>
#include <common/OptionsScorched.h>
#include <common/Logger.h>
#include <tank/TankContainer.h>
#include <tank/TankState.h>
#include <target/TargetLife.h>
#include <landscapemap/LandscapeMaps.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"

Go to the source code of this file.

Defines

#define LUA_LIB

Functions

static LUAScriptgetScript (lua_State *L)
static void addTank (lua_State *L, Tank *tank)
static int s3d_get_option (lua_State *L)
static int s3d_get_tank (lua_State *L)
static int s3d_get_tanks (lua_State *L)
static int s3d_get_height (lua_State *L)
static int s3d_get_arenawidth (lua_State *L)
static int s3d_get_arenaheight (lua_State *L)
static int s3d_get_landscapewidth (lua_State *L)
static int s3d_get_landscapeheight (lua_State *L)
LUALIB_API int luaopen_s3d (lua_State *L)

Variables

static const luaL_Reg s3dlib []


Define Documentation

#define LUA_LIB

Definition at line 32 of file LUAS3DLib.cpp.


Function Documentation

static void addTank ( lua_State L,
Tank tank 
) [static]

Definition at line 47 of file LUAS3DLib.cpp.

References LUAUtil::addVectorToStack(), FIXED_RESOLUTION, Tank::getAlive(), TargetLife::getCenterPosition(), Target::getCStrName(), Target::getLife(), Target::getPlayerId(), Tank::getTeam(), lua_newtable, lua_pushboolean(), lua_pushnumber(), lua_pushstring(), and lua_settable().

Referenced by s3d_get_tank(), and s3d_get_tanks().

static LUAScript* getScript ( lua_State L  )  [static]

Definition at line 39 of file LUAS3DLib.cpp.

References lua_getglobal, lua_pop, and lua_touserdata().

Referenced by s3d_explosion(), s3d_fire_weapon(), s3d_get_arenaheight(), s3d_get_arenawidth(), s3d_get_height(), s3d_get_landscapeheight(), s3d_get_landscapewidth(), s3d_get_option(), s3d_get_tank(), s3d_get_tanks(), s3d_laser(), s3d_napalm(), and s3d_random().

LUALIB_API int luaopen_s3d ( lua_State L  ) 

Definition at line 196 of file LUAS3DLib.cpp.

Referenced by LUAScript::LUAScript().

static int s3d_get_arenaheight ( lua_State L  )  [static]

Definition at line 154 of file LUAS3DLib.cpp.

References GroundMaps::getArenaHeight(), LUAScript::getContext(), LandscapeMaps::getGroundMaps(), ScorchedContext::getLandscapeMaps(), getScript(), and lua_pushnumber().

static int s3d_get_arenawidth ( lua_State L  )  [static]

Definition at line 144 of file LUAS3DLib.cpp.

References GroundMaps::getArenaWidth(), LUAScript::getContext(), LandscapeMaps::getGroundMaps(), ScorchedContext::getLandscapeMaps(), getScript(), and lua_pushnumber().

static int s3d_get_height ( lua_State L  )  [static]

Definition at line 130 of file LUAS3DLib.cpp.

References fixed::asInt(), LUAScript::getContext(), LandscapeMaps::getGroundMaps(), GroundMaps::getHeight(), fixed::getInternal(), ScorchedContext::getLandscapeMaps(), getScript(), lua_pushnumber(), and luaL_checknumber().

static int s3d_get_landscapeheight ( lua_State L  )  [static]

Definition at line 174 of file LUAS3DLib.cpp.

References LUAScript::getContext(), LandscapeMaps::getGroundMaps(), GroundMaps::getLandscapeHeight(), ScorchedContext::getLandscapeMaps(), getScript(), and lua_pushnumber().

static int s3d_get_landscapewidth ( lua_State L  )  [static]

Definition at line 164 of file LUAS3DLib.cpp.

References LUAScript::getContext(), LandscapeMaps::getGroundMaps(), ScorchedContext::getLandscapeMaps(), GroundMaps::getLandscapeWidth(), getScript(), and lua_pushnumber().

static int s3d_get_option ( lua_State L  )  [static]

Definition at line 72 of file LUAS3DLib.cpp.

References S3D::formatStringBuffer(), LUAScript::getContext(), OptionEntryHelper::getEntry(), OptionsScorched::getMainOptions(), OptionsGame::getOptions(), ScorchedContext::getOptionsGame(), getScript(), OptionEntry::getValueAsString(), Logger::log(), lua_pushstring(), and luaL_checkstring.

static int s3d_get_tank ( lua_State L  )  [static]

Definition at line 90 of file LUAS3DLib.cpp.

References addTank(), S3D::formatStringBuffer(), LUAScript::getContext(), getScript(), TankContainer::getTankById(), ScorchedContext::getTankContainer(), Logger::log(), lua_pushstring(), and luaL_checknumber().

static int s3d_get_tanks ( lua_State L  )  [static]

Definition at line 108 of file LUAS3DLib.cpp.

References addTank(), TankContainer::getAllTanks(), LUAScript::getContext(), Target::getPlayerId(), getScript(), ScorchedContext::getTankContainer(), lua_newtable, lua_pushnumber(), and lua_settable().


Variable Documentation

const luaL_Reg s3dlib[] [static]

Initial value:

 {
        {"get_option", s3d_get_option},
        {"get_tank", s3d_get_tank},
        {"get_tanks", s3d_get_tanks},
        {"get_height", s3d_get_height},
        {"get_arenawidth", s3d_get_arenawidth},
        {"get_arenaheight", s3d_get_arenaheight},
        {"get_landscapewidth", s3d_get_landscapewidth},
        {"get_landscapeheight", s3d_get_landscapeheight},
        {NULL, NULL}
}

Definition at line 184 of file LUAS3DLib.cpp.


Generated on Mon Feb 16 15:14:58 2009 for Scorched3D by  doxygen 1.5.3