mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Clang format: fix LINT on old PR which doesn't have LINT enabled
This commit is contained in:
parent
0a8834608d
commit
0419552c92
@ -17,19 +17,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script/common/c_converter.h"
|
|
||||||
#include "l_localplayer.h"
|
#include "l_localplayer.h"
|
||||||
#include "l_internal.h"
|
#include "l_internal.h"
|
||||||
|
#include "script/common/c_converter.h"
|
||||||
|
|
||||||
LuaLocalPlayer::LuaLocalPlayer(LocalPlayer *m)
|
LuaLocalPlayer::LuaLocalPlayer(LocalPlayer *m) { m_localplayer = m; }
|
||||||
{
|
|
||||||
m_localplayer = m;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LuaLocalPlayer::create(lua_State *L, LocalPlayer *m)
|
void LuaLocalPlayer::create(lua_State *L, LocalPlayer *m)
|
||||||
{
|
{
|
||||||
LuaLocalPlayer *o = new LuaLocalPlayer(m);
|
LuaLocalPlayer *o = new LuaLocalPlayer(m);
|
||||||
*(void **) (lua_newuserdata(L, sizeof(void *))) = o;
|
*(void **)(lua_newuserdata(L, sizeof(void *))) = o;
|
||||||
luaL_getmetatable(L, className);
|
luaL_getmetatable(L, className);
|
||||||
lua_setmetatable(L, -2);
|
lua_setmetatable(L, -2);
|
||||||
|
|
||||||
@ -332,13 +329,10 @@ LuaLocalPlayer *LuaLocalPlayer::checkobject(lua_State *L, int narg)
|
|||||||
if (!ud)
|
if (!ud)
|
||||||
luaL_typerror(L, narg, className);
|
luaL_typerror(L, narg, className);
|
||||||
|
|
||||||
return *(LuaLocalPlayer **) ud;
|
return *(LuaLocalPlayer **)ud;
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalPlayer *LuaLocalPlayer::getobject(LuaLocalPlayer *ref)
|
LocalPlayer *LuaLocalPlayer::getobject(LuaLocalPlayer *ref) { return ref->m_localplayer; }
|
||||||
{
|
|
||||||
return ref->m_localplayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalPlayer *LuaLocalPlayer::getobject(lua_State *L, int narg)
|
LocalPlayer *LuaLocalPlayer::getobject(lua_State *L, int narg)
|
||||||
{
|
{
|
||||||
@ -351,7 +345,7 @@ LocalPlayer *LuaLocalPlayer::getobject(lua_State *L, int narg)
|
|||||||
|
|
||||||
int LuaLocalPlayer::gc_object(lua_State *L)
|
int LuaLocalPlayer::gc_object(lua_State *L)
|
||||||
{
|
{
|
||||||
LuaLocalPlayer *o = *(LuaLocalPlayer **) (lua_touserdata(L, 1));
|
LuaLocalPlayer *o = *(LuaLocalPlayer **)(lua_touserdata(L, 1));
|
||||||
delete o;
|
delete o;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -378,14 +372,12 @@ void LuaLocalPlayer::Register(lua_State *L)
|
|||||||
lua_pop(L, 1); // Drop metatable
|
lua_pop(L, 1); // Drop metatable
|
||||||
|
|
||||||
luaL_openlib(L, 0, methods, 0); // fill methodtable
|
luaL_openlib(L, 0, methods, 0); // fill methodtable
|
||||||
lua_pop(L, 1); // Drop methodtable
|
lua_pop(L, 1); // Drop methodtable
|
||||||
}
|
}
|
||||||
|
|
||||||
const char LuaLocalPlayer::className[] = "LocalPlayer";
|
const char LuaLocalPlayer::className[] = "LocalPlayer";
|
||||||
const luaL_reg LuaLocalPlayer::methods[] = {
|
const luaL_reg LuaLocalPlayer::methods[] = {luamethod(LuaLocalPlayer, get_velocity),
|
||||||
luamethod(LuaLocalPlayer, get_velocity),
|
luamethod(LuaLocalPlayer, get_hp), luamethod(LuaLocalPlayer, get_name),
|
||||||
luamethod(LuaLocalPlayer, get_hp),
|
|
||||||
luamethod(LuaLocalPlayer, get_name),
|
|
||||||
luamethod(LuaLocalPlayer, is_teleported),
|
luamethod(LuaLocalPlayer, is_teleported),
|
||||||
luamethod(LuaLocalPlayer, is_attached),
|
luamethod(LuaLocalPlayer, is_attached),
|
||||||
luamethod(LuaLocalPlayer, is_touching_ground),
|
luamethod(LuaLocalPlayer, is_touching_ground),
|
||||||
@ -412,5 +404,4 @@ const luaL_reg LuaLocalPlayer::methods[] = {
|
|||||||
luamethod(LuaLocalPlayer, get_movement_speed),
|
luamethod(LuaLocalPlayer, get_movement_speed),
|
||||||
luamethod(LuaLocalPlayer, get_movement),
|
luamethod(LuaLocalPlayer, get_movement),
|
||||||
|
|
||||||
{0, 0}
|
{0, 0}};
|
||||||
};
|
|
||||||
|
@ -22,12 +22,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
|
|
||||||
#include "l_base.h"
|
#include "l_base.h"
|
||||||
|
|
||||||
|
|
||||||
class LocalPlayer;
|
class LocalPlayer;
|
||||||
|
|
||||||
class LuaLocalPlayer : public ModApiBase {
|
class LuaLocalPlayer : public ModApiBase
|
||||||
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static const char className[];
|
static const char className[];
|
||||||
static const luaL_Reg methods[];
|
static const luaL_Reg methods[];
|
||||||
|
|
||||||
@ -91,5 +90,4 @@ public:
|
|||||||
static void Register(lua_State *L);
|
static void Register(lua_State *L);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // MINETEST_L_LOCALPLAYER_H
|
||||||
#endif //MINETEST_L_LOCALPLAYER_H
|
|
||||||
|
@ -30,18 +30,15 @@ struct TileSpec;
|
|||||||
|
|
||||||
struct ItemMesh
|
struct ItemMesh
|
||||||
{
|
{
|
||||||
scene::IMesh* mesh;
|
scene::IMesh *mesh;
|
||||||
/*!
|
/*!
|
||||||
* Stores the color of each mesh buffer.
|
* Stores the color of each mesh buffer.
|
||||||
* If the boolean is true, the color is fixed, else
|
* If the boolean is true, the color is fixed, else
|
||||||
* palettes can modify it.
|
* palettes can modify it.
|
||||||
*/
|
*/
|
||||||
std::vector<std::pair<bool, video::SColor> > buffer_colors;
|
std::vector<std::pair<bool, video::SColor>> buffer_colors;
|
||||||
|
|
||||||
ItemMesh():
|
ItemMesh() : mesh(NULL), buffer_colors() {}
|
||||||
mesh(NULL),
|
|
||||||
buffer_colors()
|
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user