Guest User

Untitled

a guest
Jan 13th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 16.28 KB | None | 0 0
  1. comparing with https://code.google.com/p/bitfighter/
  2. searching for changes
  3. diff -r da40340a2909 -r 70cdfe0ad762 zap/CoreGame.cpp
  4. --- a/zap/CoreGame.cpp  Sun Jan 13 12:05:03 2013 +0100
  5. +++ b/zap/CoreGame.cpp  Sun Jan 13 11:57:17 2013 +0100
  6. @@ -279,33 +279,15 @@
  7.     setStartingHealth(F32(CoreDefaultStartingHealth) / DamageReductionRatio);      // Hits to kill
  8.  
  9.     mHasExploded = false;
  10. +
  11.     mHeartbeatTimer.reset(CoreHeartbeatStartInterval);
  12.     mCurrentExplosionNumber = 0;
  13. +
  14.     mPanelGeom.isValid = false;
  15.  
  16.     mKillString = "crashed into a core";    // TODO: Really needed?
  17.  
  18.     LUAW_CONSTRUCTOR_INITIALIZATIONS;
  19. -  
  20. -   if(L)
  21. -   {
  22. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, TEAM_INDX, END }, { GEOM, TEAM_INDX, INT, END }}, 3 };
  23. -      S32 profile = checkArgList(L, constructorArgList, "CoreItem", "constructor");
  24. -      if(profile == 1)
  25. -      {
  26. -         setPos(getPointOrXY(L, 1));
  27. -         setTeam(getInt(L, 2));
  28. -      }
  29. -      else if(profile == 2)
  30. -      {
  31. -         setPos(getPointOrXY(L, 1));
  32. -         setTeam(getInt(L, 2));
  33. -         setStartingHealth(getInt(L, 3));
  34. -         // I've got no idea why this works and getInt(L, 2) doesn't.
  35. -         //mSpawnTime = S32(getInt(L, 3) * 1000);
  36. -         //mTimer.reset(mSpawnTime);
  37. -      }
  38. -   }
  39.  }
  40.  
  41.  
  42. diff -r da40340a2909 -r 70cdfe0ad762 zap/EngineeredItem.cpp
  43. --- a/zap/EngineeredItem.cpp    Sun Jan 13 12:05:03 2013 +0100
  44. +++ b/zap/EngineeredItem.cpp    Sun Jan 13 11:57:17 2013 +0100
  45. @@ -1689,20 +1689,10 @@
  46.  // Combined Lua / C++ default constructor
  47.  Turret::Turret(lua_State *L) : Parent(TEAM_NEUTRAL, Point(0,0), Point(1,0))
  48.  {
  49. -   // TODO: This does not work; we need to snap the turret to a nearby wall and compute the normal angle.
  50. -   // It is likely that setPos is similarly broken.  And maybe more.
  51. +   initialize();
  52. +
  53.     if(L)
  54. -   {
  55. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, TEAM_INDX, END }}, 2 };
  56. -      S32 profile = checkArgList(L, constructorArgList, "Turret", "constructor");
  57.        findMountPoint(Game::getAddTarget(), getPos());
  58. -      if(profile == 1)
  59. -      {
  60. -         findMountPoint(gServerGame, getPointOrXY(L, 1));
  61. -         setTeam(getInt(L, 2));
  62. -      }
  63. -   }
  64. -   initialize();
  65.  }
  66.  
  67.  
  68. @@ -2049,8 +2039,6 @@
  69.  /////
  70.  // Lua interface
  71.  /**
  72. -  *  @luafunc Turret::Turret()
  73. -  *  @luafunc Turret::Turret(geom, team)
  74.    *  @luaclass Turret
  75.    *  @brief Mounted gun that shoots at enemy ships and other objects.
  76.    */
  77. diff -r da40340a2909 -r 70cdfe0ad762 zap/Spawn.cpp
  78. --- a/zap/Spawn.cpp Sun Jan 13 12:05:03 2013 +0100
  79. +++ b/zap/Spawn.cpp Sun Jan 13 11:57:17 2013 +0100
  80. @@ -206,16 +206,7 @@
  81.  // Lua constructor
  82.  Spawn::Spawn(lua_State *L) : AbstractSpawn(Point(0,0))
  83.  {
  84. -   static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, TEAM_INDX, END }}, 3 };
  85. -   S32 profile = checkArgList(L, constructorArgList, "Spawn", "constructor");
  86.     initialize();
  87. -   if(L && profile == 1)
  88. -      setPos(getPointOrXY(L, 1));
  89. -   else if(L && profile == 2)
  90. -   {
  91. -      setPos(getPointOrXY(L, 1));
  92. -      setTeam(getInt(L, 2));
  93. -   }
  94.  }
  95.  
  96.  
  97. @@ -298,9 +289,6 @@
  98.  /////
  99.  // Lua interface
  100.  /**
  101. -  *  @luafunc Spawn::Spawn()
  102. -  *  @luafunc Spawn::Spawn(geom)
  103. -  *  @luafunc Spawn::Spawn(geom, team)
  104.    *  @luaclass Spawn
  105.    *  @brief Marks locations where ships and robots should spawn.
  106.    *  @geom  The geometry of Spawns is a single point.
  107. @@ -447,22 +435,6 @@
  108.  AsteroidSpawn::AsteroidSpawn(lua_State *L) : Parent(Point(0,0), DEFAULT_RESPAWN_TIME)
  109.  {
  110.     initialize();
  111. -  
  112. -   if(L)
  113. -   {
  114. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, INT, END }}, 3 };
  115. -      S32 profile = checkArgList(L, constructorArgList, "AsteroidSpawn", "constructor");
  116. -      initialize();
  117. -      if(profile == 1)
  118. -         setPos(getPointOrXY(L, 1));
  119. -      else if(profile == 2)
  120. -      {
  121. -         setPos(getPointOrXY(L, 1));
  122. -         // I've got no idea why this works and getInt(L, 2) doesn't.
  123. -         mSpawnTime = S32(getInt(L, 3) * 1000);
  124. -         mTimer.reset(mSpawnTime);
  125. -      }
  126. -   }
  127.  }
  128.  
  129.  
  130. @@ -557,9 +529,6 @@
  131.  /////
  132.  // Lua interface
  133.  /**
  134. -  *  @luafunc AsteroidSpawn::AsteroidSpawn()
  135. -  *  @luafunc AsteroidSpawn::AsteroidSpawn(geom)
  136. -  *  @luafunc AsteroidSpawn::AsteroidSpawn(geom, time)
  137.    *  @luaclass AsteroidSpawn
  138.    *  @brief Spawns \link Asteroid Asteroids \endlink at regular intervals.
  139.    *  @geom  The geometry of AsteroidSpawns is a single point.
  140. @@ -593,21 +562,6 @@
  141.  CircleSpawn::CircleSpawn(lua_State *L) : Parent(Point(0,0), DEFAULT_RESPAWN_TIME)
  142.  {
  143.     initialize();
  144. -  
  145. -   if(L)
  146. -   {
  147. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, INT, END }}, 3 };
  148. -      S32 profile = checkArgList(L, constructorArgList, "CircleSpawn", "constructor");
  149. -      if(profile == 1)
  150. -         setPos(getPointOrXY(L, 1));
  151. -      else if(profile == 2)
  152. -      {
  153. -         setPos(getPointOrXY(L, 1));
  154. -         // I've got no idea why this works and getInt(L, 2) doesn't.
  155. -         mSpawnTime = S32(getInt(L, 3) * 1000);
  156. -         mTimer.reset(mSpawnTime);
  157. -      }
  158. -   }
  159.  }
  160.  
  161.  
  162. @@ -704,9 +658,6 @@
  163.  /////
  164.  // Lua interface
  165.  /**
  166. -  *  @luafunc CircleSpawn::CircleSpawn()
  167. -  *  @luafunc CircleSpawn::CircleSpawn(geom)
  168. -  *  @luafunc CircleSpawn::CircleSpawn(geom, time)
  169.    *  @luaclass CircleSpawn
  170.    *  @brief Spawns \link Circle Circles \endlink at regular intervals.
  171.    *  @geom  The geometry of CircleSpawns is a single point.
  172. diff -r da40340a2909 -r 70cdfe0ad762 zap/UIGame.cpp
  173. --- a/zap/UIGame.cpp    Sun Jan 13 12:05:03 2013 +0100
  174. +++ b/zap/UIGame.cpp    Sun Jan 13 11:57:17 2013 +0100
  175. @@ -2290,7 +2290,7 @@
  176.     { "addbots",     &GameUserInterface::addBotsHandler,         { xINT, STR, TEAM, STR }, 4, LEVEL_COMMANDS,  1,  2,  {"[count]","[file]","[team name or num]","[args]"}, "Add [count] bots from [file] to [team num], pass [args] to bot" },
  177.     { "kickbot",     &GameUserInterface::kickBotHandler,         {  },                     0, LEVEL_COMMANDS,  1,  1,  {  },                                       "Kick most recently added bot" },
  178.     { "kickbots",    &GameUserInterface::kickBotsHandler,        {  },                     0, LEVEL_COMMANDS,  1,  1,  {  },                                       "Kick all bots" },
  179. -   {"announce",        &GameUserInterface::announceHandler,        { STR },                  1, ADMIN_COMMANDS,  0,  1,  {"<ANNOUNCEMENT>"},      "The admin announces an important message"   },
  180. +   {"announce",      &GameUserInterface::announceHandler,          { STR },                  1, ADMIN_COMMANDS,  0,  1,  {"<ANNOUNCEMENT>"},      "The admin announces an important message"   },
  181.  
  182.     { "kick",               &GameUserInterface::kickPlayerHandler,         { NAME },       1, ADMIN_COMMANDS,  0,  1,  {"<name>"},              "Kick a player from the game" },
  183.     { "ban",                &GameUserInterface::banPlayerHandler,          { NAME, xINT }, 2, ADMIN_COMMANDS,  0,  1,  {"<name>","[duration]"}, "Ban a player from the server (IP-based, def. = 60 mins)" },
  184. diff -r da40340a2909 -r 70cdfe0ad762 zap/Zone.cpp
  185. --- a/zap/Zone.cpp  Sun Jan 13 12:05:03 2013 +0100
  186. +++ b/zap/Zone.cpp  Sun Jan 13 11:57:17 2013 +0100
  187. @@ -26,7 +26,6 @@
  188.  #include "Zone.h"
  189.  #include "game.h"
  190.  #include "stringUtils.h"
  191. -#include "Geometry.h"
  192.  
  193.  namespace Zap
  194.  {
  195. @@ -37,17 +36,6 @@
  196.  // Combined Lua / C++ constructor)
  197.  Zone::Zone(lua_State *L)  
  198.  {
  199. -   if(L)
  200. -   {
  201. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }}, 2 };
  202. -      S32 profile = checkArgList(L, constructorArgList, "Zone", "constructor");
  203. -        
  204. -      if(profile == 1)
  205. -      {
  206. -         setGeom(L, 1);
  207. -      }
  208. -   }
  209. -  
  210.     setTeam(TEAM_NEUTRAL);
  211.     mObjectTypeNumber = ZoneTypeNumber;
  212.  
  213. @@ -160,9 +148,7 @@
  214.  /////
  215.  // Lua interface
  216.  
  217. -/**
  218. -  *  @luafunc Zone::Zone()
  219. -  *  @luafunc Zone::Zone(geom)
  220. +/**
  221.    *  @luaclass Zone
  222.    *  @brief Invisible objects, used mainly for generating events.
  223.    */
  224. diff -r da40340a2909 -r 70cdfe0ad762 zap/barrier.cpp
  225. --- a/zap/barrier.cpp   Sun Jan 13 12:05:03 2013 +0100
  226. +++ b/zap/barrier.cpp   Sun Jan 13 11:57:17 2013 +0100
  227. @@ -31,7 +31,6 @@
  228.  #include "game.h"
  229.  #include "config.h"
  230.  #include "stringUtils.h"
  231. -#include "LuaWrapper.h"
  232.  
  233.  #ifndef ZAP_DEDICATED
  234.  #  include "OpenglUtils.h"
  235. @@ -350,18 +349,6 @@
  236.     mAlreadyAdded = false;
  237.  
  238.     setNewGeometry(geomPolyLine);
  239. -  
  240. -   if(L)
  241. -   {
  242. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, INT, END }}, 2 };
  243. -      S32 profile = checkArgList(L, constructorArgList, "WallItem", "constructor");
  244. -      if(profile == 1)
  245. -      {
  246. -         setWidth(lua_tointeger(L, -1));
  247. -         lua_pop(L, 1);
  248. -         setGeom(L);
  249. -      }
  250. -   }
  251.  
  252.     LUAW_CONSTRUCTOR_INITIALIZATIONS;
  253.  }
  254. @@ -584,8 +571,6 @@
  255.  /////
  256.  // Lua interface
  257.  /**
  258. -  *  @luafunc WallItem::WallItem()
  259. -  *  @luafunc WallItem::WallItem(geom, thickness)
  260.    *  @luaclass WallItem
  261.    *  @brief Traditional wall item.
  262.    *  @descr A %WallItem is a traditional wall consisting of a series of straight-line segments.  WallItems have a width setting that
  263. diff -r da40340a2909 -r 70cdfe0ad762 zap/flagItem.cpp
  264. --- a/zap/flagItem.cpp  Sun Jan 13 12:05:03 2013 +0100
  265. +++ b/zap/flagItem.cpp  Sun Jan 13 11:57:17 2013 +0100
  266. @@ -45,21 +45,6 @@
  267.  FlagItem::FlagItem(lua_State *L) : Parent(Point(0,0), true, (F32)Ship::CollisionRadius) // radius was 20
  268.  {
  269.     initialize();
  270. -  
  271. -   if(L)
  272. -   {
  273. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, TEAM_INDX, END }}, 3 };
  274. -      S32 profile = checkArgList(L, constructorArgList, "FlagItem", "constructor");
  275. -      if(profile == 1)
  276. -      {
  277. -         setPos(getPointOrXY(L, 1));
  278. -      }
  279. -      else if(profile == 2)
  280. -      {
  281. -         setPos(getPointOrXY(L, 1));
  282. -         setTeam(getInt(L, 2));
  283. -      }
  284. -   }
  285.  }
  286.  
  287.  
  288. @@ -411,9 +396,6 @@
  289.  // Lua interface
  290.  
  291.  /**
  292. -  *  @luafunc  FlagItem::FlagItem()
  293. -  *  @luafunc  FlagItem::FlagItem(geom)
  294. -  *  @luafunc  FlagItem::FlagItem(geom, team)
  295.    *  @luaclass FlagItem
  296.    *  @brief    Flags are used in many games, such as Nexus and Capture The Flag (CTF).
  297.    *  @geom     The geometry of a %FlagItem is a point.
  298. diff -r da40340a2909 -r 70cdfe0ad762 zap/moveObject.cpp
  299. --- a/zap/moveObject.cpp    Sun Jan 13 12:05:03 2013 +0100
  300. +++ b/zap/moveObject.cpp    Sun Jan 13 11:57:17 2013 +0100
  301. @@ -1310,16 +1310,6 @@
  302.     mDesign = TNL::Random::readI(0, ASTEROID_DESIGNS - 1);
  303.  
  304.     mKillString = "crashed into an asteroid";
  305. -  
  306. -   if(L)
  307. -   {
  308. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }}, 2 };
  309. -      S32 profile = checkArgList(L, constructorArgList, "Asteroid", "constructor");
  310. -      if(profile == 1)
  311. -      {
  312. -         setPos(getPointOrXY(L, 1));
  313. -      }
  314. -   }
  315.  
  316.     LUAW_CONSTRUCTOR_INITIALIZATIONS;
  317.  }
  318. @@ -1611,8 +1601,6 @@
  319.  // Lua interface
  320.  
  321.  /**
  322. - *   @luafunc Asteroid::Asteroid()
  323. - *   @luafunc Asteroid::Asteroid(geom)
  324.   *   @luaclass Asteroid
  325.   *   @brief    Just like the arcade game!  Yo!
  326.   */
  327. diff -r da40340a2909 -r 70cdfe0ad762 zap/projectile.cpp
  328. --- a/zap/projectile.cpp    Sun Jan 13 12:05:03 2013 +0100
  329. +++ b/zap/projectile.cpp    Sun Jan 13 11:57:17 2013 +0100
  330. @@ -1017,20 +1017,7 @@
  331.  // Combined Lua / C++ default constructor -- used in Lua and editor
  332.  SpyBug::SpyBug(lua_State *L) : Burst(Point(0,0), Point(0,0), NULL)
  333.  {
  334. -   if(L)
  335. -   {
  336. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, TEAM_INDX, END }}, 2 };
  337. -      S32 profile = checkArgList(L, constructorArgList, "SpyBug", "constructor");
  338. -      
  339. -      if(profile == 0)
  340. -         initialize(Point(0,0), NULL);
  341. -      else if(profile == 1)
  342. -      {
  343. -         initialize(Point(0,0), NULL);
  344. -         setPos(getPointOrXY(L, 1));
  345. -         setTeam(getInt(L, 2));
  346. -      }
  347. -   }
  348. +   initialize(Point(0,0), NULL);
  349.  }
  350.  
  351.  
  352. @@ -1253,14 +1240,6 @@
  353.  
  354.  /////
  355.  // Lua interface
  356. -/**
  357. -  *  @luafunc SpyBug::SpyBug()
  358. -  *  @luafunc SpyBug::SpyBug(geom, team)
  359. -  *  @luaclass SpyBug
  360. -  *  @brief Monitors a section of the map and will show enemy ships there.
  361. -  *  @descr Can only be used/created if the Sensor module is selected.
  362. -  *         Makes surrounding areas of the commander's map visible to player and teammates.
  363. -  */
  364.  //                Fn name                  Param profiles            Profile count                          
  365.  #define LUA_METHODS(CLASS, METHOD) \
  366.  
  367. diff -r da40340a2909 -r 70cdfe0ad762 zap/speedZone.cpp
  368. --- a/zap/speedZone.cpp Sun Jan 13 12:05:03 2013 +0100
  369. +++ b/zap/speedZone.cpp Sun Jan 13 11:57:17 2013 +0100
  370. @@ -63,9 +63,6 @@
  371.  // Combined C++/Lua constructor
  372.  SpeedZone::SpeedZone(lua_State *L)
  373.  {
  374. -   static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, NUM, END }}, 3 };
  375. -   S32 profile = checkArgList(L, constructorArgList, "SpeedZone", "constructor");
  376. -  
  377.     mNetFlags.set(Ghostable);
  378.     mObjectTypeNumber = SpeedZoneTypeNumber;
  379.  
  380. @@ -75,14 +72,6 @@
  381.     mUnpackInit = 0;           // Some form of counter, to know that it is a rotating speed zone
  382.  
  383.     preparePoints();           // If this is constructed by Lua, we need to have some default geometry in place
  384. -  
  385. -   if(L && profile == 1)
  386. -      setPos(getPointOrXY(L, 1));
  387. -   else if(L && profile == 2)
  388. -   {
  389. -      setPos(getPointOrXY(L, 1));
  390. -      setSpeed(getInt(L, 2));
  391. -   }
  392.  
  393.     LUAW_CONSTRUCTOR_INITIALIZATIONS;
  394.  }
  395. @@ -541,9 +530,6 @@
  396.  //// Lua methods
  397.  
  398.  /**
  399. -  *  @luafunc SpeedZone::SpeedZone()
  400. -  *  @luafunc SpeedZone::SpeedZone(geom)
  401. -  *  @luafunc SpeedZone::SpeedZone(geom, speed)
  402.    *  @luaclass SpeedZone
  403.    *  @brief Propels ships at high speed.
  404.    *  @descr SpeedZones are game objects that propel ships around a level.  Each %SpeedZone has a direction point
  405. diff -r da40340a2909 -r 70cdfe0ad762 zap/teleporter.cpp
  406. --- a/zap/teleporter.cpp    Sun Jan 13 12:05:03 2013 +0100
  407. +++ b/zap/teleporter.cpp    Sun Jan 13 11:57:17 2013 +0100
  408. @@ -86,11 +86,13 @@
  409.  {
  410.     TNLAssert(mOwner, "We need an owner here!");
  411.     mDests.push_back(dest);
  412. +
  413.     if(mDests.size() == 1)      // Just added the first dest
  414.     {
  415.        mOwner->setVert(dest, 1);
  416.        mOwner->updateExtentInDatabase();
  417.     }
  418. +  
  419.     // If we're the server, update the clients
  420.     if(mOwner->getGame() && mOwner->getGame()->isServer())
  421.        mOwner->s2cAddDestination(dest);
  422. @@ -175,16 +177,7 @@
  423.  // Combined default C++/Lua constructor
  424.  Teleporter::Teleporter(lua_State *L)
  425.  {
  426. -   initialize(Point(0,0),Point(0,0),NULL);
  427. -   // TODO: Fix this one too -- intiailze needs to be refactored because who knows
  428. -   // how many points the teleporter is getting?  could be 1, could be 2, could be many
  429. -   if(L)
  430. -   {
  431. -      static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }}, 2 };
  432. -      S32 profile = checkArgList(L, constructorArgList, "Teleporter", "constructor");
  433. -      if(profile == 1)
  434. -         setPos(getPointOrXY(L, 1));
  435. -   }
  436. +   initialize(Point(0,0), Point(0,0), NULL);
  437.  }
  438.  
  439.  
  440. @@ -865,8 +858,6 @@
  441.  //// Lua methods
  442.  
  443.  /**
  444. -  *  @luafunc Teleporter::Teleporter()
  445. -  *  @luafunc Teleporter::Teleporter(geom)
  446.    *  @luaclass Teleporter
  447.    *  @brief Instantly transports ships from here to there.
  448.    *  @descr A %Teleporter represents the basic teleporter object.  Every teleporter has an intake location
  449. diff -r da40340a2909 -r 70cdfe0ad762 zap/textItem.cpp
  450. --- a/zap/textItem.cpp  Sun Jan 13 12:05:03 2013 +0100
  451. +++ b/zap/textItem.cpp  Sun Jan 13 11:57:17 2013 +0100
  452. @@ -53,9 +53,6 @@
  453.  // Combined Lua / C++ constructor
  454.  TextItem::TextItem(lua_State *L)
  455.  {
  456. -   static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, STR, END }}, 2 };
  457. -   S32 profile = checkArgList(L, constructorArgList, "Spawn", "constructor");
  458. -  
  459.     mNetFlags.set(Ghostable);
  460.     mObjectTypeNumber = TextItemTypeNumber;
  461.  
  462. @@ -63,12 +60,6 @@
  463.     mSize = 20;
  464.  
  465.     LUAW_CONSTRUCTOR_INITIALIZATIONS;
  466. -  
  467. -   if(L && profile == 1)
  468. -   {
  469. -      setPos(getPointOrXY(L, 1));
  470. -      setText(getString(L, 2));
  471. -   }
  472.  }
  473.  
  474.  
  475. @@ -435,8 +426,6 @@
  476.  //// Lua methods
  477.  
  478.  /**
  479. -  *  @luafunc TextItem::TextItem()
  480. -  *  @luafunc TextItem::TextItem(geom, text)
  481.    *  @luaclass TextItem
  482.    *  @brief Display text message in level.
  483.    *  @descr A %TextItem displays text in a level.  If the %TextItem belongs to a team, it is only visible to players on that team.
Advertisement
Add Comment
Please, Sign In to add comment