Skip to content

Commit

Permalink
[luadefs-server] Clean up Water
Browse files Browse the repository at this point in the history
  • Loading branch information
qaisjp committed Sep 9, 2015
1 parent d5f1c97 commit 3f4f3b8
Show file tree
Hide file tree
Showing 10 changed files with 314 additions and 299 deletions.
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ LOGIC = \
./logic/lua/CLuaFunctionDefs.Timer.cpp \
./logic/lua/CLuaFunctionDefs.UTF.cpp \
./logic/lua/CLuaFunctionDefs.Utility.cpp \
./logic/lua/CLuaFunctionDefs.Water.cpp \
./logic/lua/CLuaFunctionDefs.Weapon.cpp \
./logic/lua/CLuaFunctionParseHelpers.cpp \
./logic/lua/CLuaFunctionRef.cpp \
Expand Down Expand Up @@ -245,6 +244,7 @@ LOGIC = \
./logic/luadefs/CLuaVector4Defs.cpp \
./logic/luadefs/CLuaVehicleDefs.cpp \
./logic/luadefs/CLuaVoiceDefs.cpp \
./logic/luadefs/CLuaWaterDefs.cpp \
./logic/luadefs/CLuaWorldDefs.cpp \
./logic/luadefs/CLuaXMLDefs.cpp \
./logic/packets/CCameraSyncPacket.cpp \
Expand Down
1 change: 1 addition & 0 deletions MTA10_Server/mods/deathmatch/StdInc.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ struct SAclRequest;
#include "luadefs/CLuaResourceDefs.h"
#include "luadefs/CLuaTeamDefs.h"
#include "luadefs/CLuaTextDefs.h"
#include "luadefs/CLuaWaterDefs.h"
#include "luadefs/CLuaWorldDefs.h"
#include "luadefs/CLuaVehicleDefs.h"
#include "luadefs/CLuaVoiceDefs.h"
Expand Down
3 changes: 2 additions & 1 deletion MTA10_Server/mods/deathmatch/_ServerDeathmatch 2008.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@
<ClCompile Include="logic\luadefs\CLuaVector3Defs.cpp" />
<ClCompile Include="logic\luadefs\CLuaVector4Defs.cpp" />
<ClCompile Include="logic\luadefs\CLuaVehicleDefs.cpp" />
<ClCompile Include="logic\luadefs\CLuaWaterDefs.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Account.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Ban.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Clothing.cpp" />
Expand All @@ -475,7 +476,6 @@
<ClCompile Include="logic\lua\CLuaFunctionDefs.Timer.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.UTF.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Utility.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Water.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Weapon.cpp" />
<ClCompile Include="logic\lua\CLuaMatrix.cpp" />
<ClCompile Include="logic\lua\CLuaVector2.cpp" />
Expand Down Expand Up @@ -890,6 +890,7 @@
<ClInclude Include="logic\luadefs\CLuaVector3Defs.h" />
<ClInclude Include="logic\luadefs\CLuaVector4Defs.h" />
<ClInclude Include="logic\luadefs\CLuaVehicleDefs.h" />
<ClInclude Include="logic\luadefs\CLuaWaterDefs.h" />
<ClInclude Include="logic\lua\CLuaVector2.h" />
<ClInclude Include="logic\lua\CLuaVector3.h" />
<ClInclude Include="logic\lua\CLuaVector4.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,6 @@
<ClCompile Include="logic\lua\CLuaFunctionDefs.RadarArea.cpp">
<Filter>Source Files\logic\lua</Filter>
</ClCompile>
<ClCompile Include="logic\lua\CLuaFunctionDefs.Water.cpp">
<Filter>Source Files\logic\lua</Filter>
</ClCompile>
<ClCompile Include="logic\lua\CLuaFunctionDefs.ColShape.cpp">
<Filter>Source Files\logic\lua</Filter>
</ClCompile>
Expand Down Expand Up @@ -993,6 +990,9 @@
<ClCompile Include="logic\luadefs\CLuaTeamDefs.cpp">
<Filter>Source Files\logic\luadefs</Filter>
</ClCompile>
<ClCompile Include="logic\luadefs\CLuaWaterDefs.cpp">
<Filter>Source Files\logic\luadefs</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="logic\CLightsyncManager.h">
Expand Down Expand Up @@ -1874,6 +1874,9 @@
<ClInclude Include="logic\luadefs\CLuaTeamDefs.h">
<Filter>Header Files\logic\luadefs</Filter>
</ClInclude>
<ClInclude Include="logic\luadefs\CLuaWaterDefs.h">
<Filter>Header Files\logic\luadefs</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Xml Include="acl.xml">
Expand Down
10 changes: 0 additions & 10 deletions MTA10_Server/mods/deathmatch/logic/lua/CLuaFunctionDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,6 @@ class CLuaFunctionDefs
LUA_DECLARE ( CreateColPolygon );
LUA_DECLARE ( CreateColTube );

// Water funcs
LUA_DECLARE ( CreateWater );
LUA_DECLARE ( SetWaterLevel );
LUA_DECLARE ( ResetWaterLevel );
LUA_DECLARE ( GetWaterVertexPosition );
LUA_DECLARE ( SetWaterVertexPosition );
LUA_DECLARE ( GetWaterColor );
LUA_DECLARE ( SetWaterColor );
LUA_DECLARE ( ResetWaterColor );

// Weapon funcs
LUA_DECLARE ( GetWeaponProperty );
LUA_DECLARE ( GetOriginalWeaponProperty );
Expand Down
28 changes: 1 addition & 27 deletions MTA10_Server/mods/deathmatch/logic/lua/CLuaMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,32 +311,6 @@ void CLuaMain::AddQueryHandleClass ( lua_State* luaVM )
}


void CLuaMain::AddWaterClass ( lua_State* luaVM )
{
lua_newclass ( luaVM );

lua_classfunction ( luaVM, "create", "createWater" );

lua_classfunction ( luaVM, "getVertexPosition", "getWaterVertexPosition" );
lua_classfunction ( luaVM, "getWaveHeight", "getWaveHeight" );
lua_classfunction ( luaVM, "getColor", "getWaterColor" );

lua_classfunction ( luaVM, "setWaveHeight", "setWaveHeight" );
lua_classfunction ( luaVM, "setColor", "setWaterColor" );
lua_classfunction ( luaVM, "setVertexPosition", "setWaterVertexPosition" );
lua_classfunction ( luaVM, "setLevel", "setWaterLevel" );

lua_classfunction ( luaVM, "resetColor", "resetWaterColor" );
lua_classfunction ( luaVM, "resetLevel", "resetWaterLevel" );

lua_classvariable ( luaVM, "level", "setWaterLevel", NULL );
lua_classvariable ( luaVM, "height", "setWaveHeight", "getWaveHeight" );
//lua_classvariable ( luaVM, "color", "setWaterColor", "getWaterColor" );

lua_registerclass ( luaVM, "Water", "Element" );
}


void CLuaMain::AddTimerClass ( lua_State* luaVM )
{
lua_newclass ( luaVM );
Expand Down Expand Up @@ -387,14 +361,14 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
CLuaResourceDefs ::AddClass ( luaVM );
CLuaBlipDefs ::AddClass ( luaVM );
CLuaTeamDefs ::AddClass ( luaVM );
CLuaWaterDefs ::AddClass ( luaVM );
AddAccountClass ( luaVM );
AddBanClass ( luaVM );
AddColShapeClass ( luaVM );
AddObjectClass ( luaVM );
AddRadarAreaClass ( luaVM );
AddConnectionClass ( luaVM );
AddQueryHandleClass ( luaVM );
AddWaterClass ( luaVM );
AddTimerClass ( luaVM );
}

Expand Down
1 change: 0 additions & 1 deletion MTA10_Server/mods/deathmatch/logic/lua/CLuaMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class CLuaMain //: public CClient
void AddRadarAreaClass ( lua_State* luaVM );
void AddConnectionClass ( lua_State* luaVM );
void AddQueryHandleClass ( lua_State* luaVM );
void AddWaterClass ( lua_State* luaVM );
void AddTimerClass ( lua_State* luaVM );

bool IsOOPEnabled ( void ) { return m_bEnableOOP; }
Expand Down
11 changes: 1 addition & 10 deletions MTA10_Server/mods/deathmatch/logic/lua/CLuaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,6 @@ void CLuaManager::LoadCFunctions ( void )
CLuaCFunctions::AddFunction ( "createColPolygon", CLuaFunctionDefs::CreateColPolygon );
CLuaCFunctions::AddFunction ( "createColTube", CLuaFunctionDefs::CreateColTube );

// Water functions
CLuaCFunctions::AddFunction ( "createWater", CLuaFunctionDefs::CreateWater );
CLuaCFunctions::AddFunction ( "setWaterLevel", CLuaFunctionDefs::SetWaterLevel );
CLuaCFunctions::AddFunction ( "resetWaterLevel", CLuaFunctionDefs::ResetWaterLevel );
CLuaCFunctions::AddFunction ( "getWaterVertexPosition", CLuaFunctionDefs::GetWaterVertexPosition );
CLuaCFunctions::AddFunction ( "setWaterVertexPosition", CLuaFunctionDefs::SetWaterVertexPosition );
CLuaCFunctions::AddFunction ( "getWaterColor", CLuaFunctionDefs::GetWaterColor );
CLuaCFunctions::AddFunction ( "setWaterColor", CLuaFunctionDefs::SetWaterColor );
CLuaCFunctions::AddFunction ( "resetWaterColor", CLuaFunctionDefs::ResetWaterColor );

// Weapon funcs
CLuaCFunctions::AddFunction ( "getWeaponNameFromID", CLuaFunctionDefs::GetWeaponNameFromID );
CLuaCFunctions::AddFunction ( "getWeaponIDFromName", CLuaFunctionDefs::GetWeaponIDFromName );
Expand Down Expand Up @@ -356,6 +346,7 @@ void CLuaManager::LoadCFunctions ( void )
CLuaPlayerDefs::LoadFunctions ();
CLuaBlipDefs::LoadFunctions ();
CLuaTeamDefs::LoadFunctions ();
CLuaWaterDefs::LoadFunctions ();

// All-Seeing Eye Functions
CLuaCFunctions::AddFunction ( "getGameType", CLuaFunctionDefs::GetGameType );
Expand Down

0 comments on commit 3f4f3b8

Please sign in to comment.