Skip to content

Commit

Permalink
[luadefs-server] Delete unused Camera oopdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
qaisjp committed Sep 9, 2015
1 parent 1b14adb commit ea44011
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 187 deletions.
1 change: 0 additions & 1 deletion MTA10_Server/mods/deathmatch/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ LOGIC = \
./logic/lua/CLuaVector4.cpp \
./logic/lua/LuaCommon.cpp \
./logic/lua/LuaUtils.cpp \
./logic/lua/oopdefs/CLuaOOPFunctionDefs.Camera.cpp \
./logic/lua/oopdefs/CLuaOOPFunctionDefs.Connection.cpp \
./logic/lua/oopdefs/CLuaOOPFunctionDefs.Marker.cpp \
./logic/lua/oopdefs/CLuaOOPFunctionDefs.Ped.cpp \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@
<ClCompile Include="logic\lua\CLuaVector2.cpp" />
<ClCompile Include="logic\lua\CLuaVector3.cpp" />
<ClCompile Include="logic\lua\CLuaVector4.cpp" />
<ClCompile Include="logic\lua\oopdefs\CLuaOOPFunctionDefs.Camera.cpp" />
<ClCompile Include="logic\lua\oopdefs\CLuaOOPFunctionDefs.Marker.cpp" />
<ClCompile Include="logic\lua\oopdefs\CLuaOOPFunctionDefs.Ped.cpp" />
<ClCompile Include="logic\lua\oopdefs\CLuaOOPFunctionDefs.Player.cpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,9 +885,6 @@
<ClCompile Include="logic\lua\CLuaMatrix.cpp">
<Filter>Source Files\logic\lua</Filter>
</ClCompile>
<ClCompile Include="logic\lua\oopdefs\CLuaOOPFunctionDefs.Camera.cpp">
<Filter>Source Files\logic\oopdefs</Filter>
</ClCompile>
<ClCompile Include="logic\lua\oopdefs\CLuaOOPFunctionDefs.Ped.cpp">
<Filter>Source Files\logic\oopdefs</Filter>
</ClCompile>
Expand Down
7 changes: 0 additions & 7 deletions MTA10_Server/mods/deathmatch/logic/lua/oopdefs/CLuaOOPDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ class CLuaOOPDefs : public CLuaDefs
// Player
LUA_DECLARE ( OutputChat );

// Camera
LUA_DECLARE ( GetCameraMatrix );
LUA_DECLARE ( GetCameraPosition );
LUA_DECLARE ( SetCameraPosition );
LUA_DECLARE ( GetCameraRotation );
LUA_DECLARE ( SetCameraRotation );

// Marker
LUA_DECLARE ( GetMarkerTarget );

Expand Down

This file was deleted.

38 changes: 31 additions & 7 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaCameraDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
void CLuaCameraDefs::LoadFunctions ( void )
{
// Get functions
CLuaCFunctions::AddFunction ( "getCameraMatrix", CLuaCameraDefs::getCameraMatrix );
CLuaCFunctions::AddFunction ( "getCameraTarget", CLuaCameraDefs::getCameraTarget );
CLuaCFunctions::AddFunction ( "getCameraInterior", CLuaCameraDefs::getCameraInterior );
CLuaCFunctions::AddFunction ( "getCameraMatrix", getCameraMatrix );
CLuaCFunctions::AddFunction ( "getCameraTarget", getCameraTarget );
CLuaCFunctions::AddFunction ( "getCameraInterior", getCameraInterior );

// Set functions
CLuaCFunctions::AddFunction ( "setCameraMatrix", CLuaCameraDefs::setCameraMatrix );
CLuaCFunctions::AddFunction ( "setCameraTarget", CLuaCameraDefs::setCameraTarget );
CLuaCFunctions::AddFunction ( "setCameraInterior", CLuaCameraDefs::setCameraInterior );
CLuaCFunctions::AddFunction ( "fadeCamera", CLuaCameraDefs::fadeCamera );
CLuaCFunctions::AddFunction ( "setCameraMatrix", setCameraMatrix );
CLuaCFunctions::AddFunction ( "setCameraTarget", setCameraTarget );
CLuaCFunctions::AddFunction ( "setCameraInterior", setCameraInterior );
CLuaCFunctions::AddFunction ( "fadeCamera", fadeCamera );
}


Expand Down Expand Up @@ -60,6 +60,30 @@ int CLuaCameraDefs::getCameraMatrix ( lua_State* luaVM )
return 1;
}

int CLuaCameraDefs::OOP_getCameraMatrix ( lua_State* luaVM )
{
// Needs further attention before adding
CPlayer* pPlayer;

CScriptArgReader argStream ( luaVM );

argStream.ReadUserData ( pPlayer );

if ( !argStream.HasErrors () )
{
CMatrix matrix;
//pPlayer->GetCamera ()->GetMatrix ( matrix );

lua_pushmatrix ( luaVM, matrix );
return 1;
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );

lua_pushboolean ( luaVM, false );
return 1;
}


int CLuaCameraDefs::getCameraTarget ( lua_State* luaVM )
{
Expand Down
28 changes: 12 additions & 16 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaCameraDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,22 @@
*
*****************************************************************************/

#ifndef __CLUACAMERADEFS_H
#define __CLUACAMERADEFS_H

#pragma once
#include "CLuaDefs.h"

class CLuaCameraDefs: public CLuaDefs
{
public:
static void LoadFunctions ( void );
static void LoadFunctions ( void );

// Get functions
static int getCameraMatrix ( lua_State* luaVM );
static int getCameraTarget ( lua_State* luaVM );
static int getCameraInterior ( lua_State* luaVM );

// Set functions
static int setCameraMatrix ( lua_State* luaVM );
static int setCameraTarget ( lua_State* luaVM );
static int setCameraInterior ( lua_State* luaVM );
static int fadeCamera ( lua_State* luaVM );
};

#endif
LUA_DECLARE_OOP ( getCameraMatrix );
LUA_DECLARE ( getCameraTarget );
LUA_DECLARE ( getCameraInterior );

// Set functions
LUA_DECLARE ( setCameraMatrix );
LUA_DECLARE ( setCameraTarget );
LUA_DECLARE ( setCameraInterior );
LUA_DECLARE ( fadeCamera );
};

0 comments on commit ea44011

Please sign in to comment.