Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
IGameDef *gamedef):
- m_smgr(smgr),
m_playernode(NULL),
m_headnode(NULL),
m_cameranode(NULL),
void drawWieldedTool();
private:
- // Scene manager and nodes
- scene::ISceneManager* m_smgr;
+ // Nodes
scene::ISceneNode* m_playernode;
scene::ISceneNode* m_headnode;
scene::ICameraSceneNode* m_cameranode;
template <typename TAlloc>
inline ustring16<TAlloc> operator+(const short left, const ustring16<TAlloc>& right)
{
- ustring16<TAlloc> ret(core::stringc(left));
+ ustring16<TAlloc> ret((core::stringc(left)));
ret += right;
return ret;
}
template <typename TAlloc>
inline ustring16<TAlloc> operator+(const unsigned short left, const ustring16<TAlloc>& right)
{
- ustring16<TAlloc> ret(core::stringc(left));
+ ustring16<TAlloc> ret((core::stringc(left)));
ret += right;
return ret;
}
template <typename TAlloc>
inline ustring16<TAlloc> operator+(const int left, const ustring16<TAlloc>& right)
{
- ustring16<TAlloc> ret(core::stringc(left));
+ ustring16<TAlloc> ret((core::stringc(left)));
ret += right;
return ret;
}
template <typename TAlloc>
inline ustring16<TAlloc> operator+(const unsigned int left, const ustring16<TAlloc>& right)
{
- ustring16<TAlloc> ret(core::stringc(left));
+ ustring16<TAlloc> ret((core::stringc(left)));
ret += right;
return ret;
}
template <typename TAlloc>
inline ustring16<TAlloc> operator+(const long left, const ustring16<TAlloc>& right)
{
- ustring16<TAlloc> ret(core::stringc(left));
+ ustring16<TAlloc> ret((core::stringc(left)));
ret += right;
return ret;
}
template <typename TAlloc>
inline ustring16<TAlloc> operator+(const unsigned long left, const ustring16<TAlloc>& right)
{
- ustring16<TAlloc> ret(core::stringc(left));
+ ustring16<TAlloc> ret((core::stringc(left)));
ret += right;
return ret;
}
template <typename TAlloc>
inline ustring16<TAlloc> operator+(const float left, const ustring16<TAlloc>& right)
{
- ustring16<TAlloc> ret(core::stringc(left));
+ ustring16<TAlloc> ret((core::stringc(left)));
ret += right;
return ret;
}
template <typename TAlloc>
inline ustring16<TAlloc> operator+(const double left, const ustring16<TAlloc>& right)
{
- ustring16<TAlloc> ret(core::stringc(left));
+ ustring16<TAlloc> ret((core::stringc(left)));
ret += right;
return ret;
}
class Connection;
}
+#define ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))
+
enum ClientState
{
Invalid,
m_nearest_unsent_d(0),
m_nearest_unsent_reset_timer(0.0),
m_excess_gotblocks(0),
- m_nothing_to_send_counter(0),
m_nothing_to_send_pause_timer(0.0),
m_name(""),
m_version_major(0),
u32 m_excess_gotblocks;
// CPU usage optimization
- u32 m_nothing_to_send_counter;
float m_nothing_to_send_pause_timer;
/*
{ assert(m_env == 0); m_env = env; }
static std::string state2Name(ClientState state) {
- assert(state < sizeof(statenames));
+ assert((int) state < ARRAYSIZE(statenames));
return statenames[state];
}
virtual void updateLight(u8 light_at_pos){}
virtual v3s16 getLightPosition(){return v3s16(0,0,0);}
virtual core::aabbox3d<f32>* getSelectionBox(){return NULL;}
- virtual core::aabbox3d<f32>* getCollisionBox(){return NULL;}
+ virtual bool getCollisionBox(aabb3f *toset){return false;}
virtual bool collideWithObjects(){return false;}
virtual v3f getPosition(){return v3f(0,0,0);}
virtual scene::IMeshSceneNode *getMeshSceneNode(){return NULL;}
video::SMaterial m_material;
core::aabbox3d<f32> m_box;
float m_cloud_y;
- float m_brightness;
video::SColorf m_color;
u32 m_seed;
v2f m_camera_pos;
ReliablePacketBuffer
*/
-ReliablePacketBuffer::ReliablePacketBuffer(): m_list_size(0),writeptr(0) {}
+ReliablePacketBuffer::ReliablePacketBuffer(): m_list_size(0) {}
void ReliablePacketBuffer::print()
{
ConnectionReceiveThread::ConnectionReceiveThread(Connection* parent,
unsigned int max_packet_size) :
- m_connection(parent),
- m_max_packet_size(max_packet_size)
+ m_connection(parent)
{
}
RPBSearchResult findPacket(u16 seqnum);
std::list<BufferedPacket> m_list;
- u16 m_list_size;
+ u32 m_list_size;
u16 m_oldest_non_answered_ack;
JMutex m_list_mutex;
-
- unsigned int writeptr;
};
/*
Connection* m_connection;
- unsigned int m_max_packet_size;
};
class Connection
void addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
IrrlichtDevice *irr);
- void removeFromScene();
+ void removeFromScene(bool permanent);
void updateLight(u8 light_at_pos);
v3s16 getLightPosition();
void updateNodePos();
updateNodePos();
}
-void TestCAO::removeFromScene()
+void TestCAO::removeFromScene(bool permanent)
{
if(m_node == NULL)
return;
void addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
IrrlichtDevice *irr);
- void removeFromScene();
+ void removeFromScene(bool permanent);
void updateLight(u8 light_at_pos);
v3s16 getLightPosition();
void updateNodePos();
updateTexture();
}
-void ItemCAO::removeFromScene()
+void ItemCAO::removeFromScene(bool permanent)
{
if(m_node == NULL)
return;
bool getCollisionBox(aabb3f *toset) {
if (m_prop.physical) {
- aabb3f retval;
//update collision box
toset->MinEdge = m_prop.collisionbox.MinEdge * BS;
toset->MaxEdge = m_prop.collisionbox.MaxEdge * BS;
v3s16 last_tried_pos(-32768,-32768,-32768); // For error output
v3s16 p;
- u8 flags;
+ u8 flags = 0;
map = (ServerMap *)&(m_server->m_env->getMap());
emerge = m_server->m_emerge;
m_map(map),
m_script(scriptIface),
m_gamedef(gamedef),
- m_random_spawn_timer(3),
m_send_recommended_timer(0),
m_active_block_interval_overload_skip(0),
m_game_time(0),
continue;
// Move
- player->move(dtime, *m_map, 100*BS);
+ player->move(dtime, this, 100*BS);
}
}
if(player->isLocal() == false)
{
// Move
- player->move(dtime, *m_map, 100*BS);
+ player->move(dtime, this, 100*BS);
}
// Outgoing network message buffer for active objects
std::list<ActiveObjectMessage> m_active_object_messages;
// Some timers
- float m_random_spawn_timer; // used for experimental code
float m_send_recommended_timer;
IntervalLimiter m_object_management_interval;
// List of active blocks
m_client = client;
}
- void gotText(std::string message) {
+ void gotText(std::wstring message) {
errorstream << "LocalFormspecHandler::gotText old style message received" << std::endl;
}
IMenuManager *menumgr,
Client* client
):
- GUIModalMenu(env, parent, id, menumgr),
- m_client(client)
+ GUIModalMenu(env, parent, id, menumgr)
{
}
bool OnEvent(const SEvent& event);
- bool pausesGame(){ return true; }
-
-private:
- Client* m_client;
-
+ bool pausesGame() { return true; }
};
#endif
{
}
-void LocalPlayer::move(f32 dtime, ClientEnvironment *env, f32 pos_max_d,
+void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
std::list<CollisionInfo> *collision_info)
{
Map *map = &env->getMap();
m_can_jump = false;
}
-void LocalPlayer::move(f32 dtime, ClientEnvironment *env, f32 pos_max_d)
+void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d)
{
move(dtime, env, pos_max_d, NULL);
}
#include "player.h"
#include <list>
-class ClientEnvironment;
+class Environment;
class ClientActiveObject;
v3f overridePosition;
- void move(f32 dtime, ClientEnvironment *env, f32 pos_max_d,
+ void move(f32 dtime, Environment *env, f32 pos_max_d);
+ void move(f32 dtime, Environment *env, f32 pos_max_d,
std::list<CollisionInfo> *collision_info);
- void move(f32 dtime, ClientEnvironment *env, f32 pos_max_d);
void applyControl(float dtime);
s32 mouse_wheel;
private:
- IrrlichtDevice *m_device;
// The current state of keys
KeyList keyIsDown;
// Sector metadata is loaded from disk if not already loaded.
ServerMapSector *sector = createSector(sectorpos);
assert(sector);
+ (void) sector;
for(s16 y=blockpos_min.Y-extra_borders.Y;
y<=blockpos_max.Y+extra_borders.Y; y++)
return m_savedir + DIR_DELIM + "sectors2" + DIR_DELIM + cc;
default:
assert(false);
+ return "";
}
}
v2s16 ServerMap::getSectorPos(std::string dirname)
{
- unsigned int x, y;
+ unsigned int x = 0, y = 0;
int r;
std::string component;
fs::RemoveLastPathComponent(dirname, &component, 1);
enum DecorationType {
- DECO_SIMPLE,
+ DECO_SIMPLE = 1,
DECO_SCHEMATIC,
DECO_LSYSTEM
};
///////////////////////////////////////////////////////////////////////////////
-void NoiseIndev::init(NoiseIndevParams *np, int seed, int sx, int sy, int sz) {
- Noise::init((NoiseParams*)np, seed, sx, sy, sz);
- this->npindev = np;
+void NoiseIndev::init(NoiseParams *np, int seed, int sx, int sy, int sz) {
+ Noise::init(np, seed, sx, sy, sz);
+ this->npindev = (NoiseIndevParams*) np;
}
NoiseIndev::NoiseIndev(NoiseIndevParams *np, int seed, int sx, int sy) : Noise(np, seed, sx, sy) {
virtual ~NoiseIndev() {};
NoiseIndev(NoiseIndevParams *np, int seed, int sx, int sy);
NoiseIndev(NoiseIndevParams *np, int seed, int sx, int sy, int sz);
- void init(NoiseIndevParams *np, int seed, int sx, int sy, int sz);
+ void init(NoiseParams *np, int seed, int sx, int sy, int sz);
void transformNoiseMapFarScale(float xx = 0, float yy = 0, float zz = 0);
};
#include "irrlichttypes_bloated.h"
#include "inventory.h"
#include "constants.h" // BS
+#include <list>
#define PLAYERNAME_SIZE 20
struct CollisionInfo;
class PlayerSAO;
struct HudElement;
+class Environment;
class Player
{
Player(IGameDef *gamedef);
virtual ~Player() = 0;
- virtual void move(f32 dtime, Map &map, f32 pos_max_d)
+ virtual void move(f32 dtime, Environment *env, f32 pos_max_d)
+ {}
+ virtual void move(f32 dtime, Environment *env, f32 pos_max_d,
+ std::list<CollisionInfo> *collision_info)
{}
v3f getSpeed()
class LuaItemStack;
class ModApiItemMod;
class InventoryList;
-class InventoryLocation;
+struct InventoryLocation;
class ScriptApiItem
: virtual public ScriptApiBase
BiomeDefManager *bdef = emerge->biomedef;
enum DecorationType decotype = (DecorationType)getenumfield(L, index,
- "deco_type", es_DecorationType, -1);
- if (decotype == -1) {
+ "deco_type", es_DecorationType, 0);
+ if (decotype == 0) {
errorstream << "register_decoration: unrecognized "
"decoration placement type";
return 0;
class MainShaderConstantSetter : public IShaderConstantSetter
{
public:
- MainShaderConstantSetter(IrrlichtDevice *device):
- m_device(device)
+ MainShaderConstantSetter(IrrlichtDevice *device)
{}
~MainShaderConstantSetter() {}
services->setVertexShaderConstant(world.pointer(), 8, 4);
}
-
-private:
- IrrlichtDevice *m_device;
};
/*
video::SColor m_skycolor;
video::SColorf m_cloudcolor_f;
v3f m_stars[SKY_STAR_COUNT];
- u16 m_star_indices[SKY_STAR_COUNT*4];
video::S3DVertex m_star_vertices[SKY_STAR_COUNT*4];
LocalPlayer* m_player;
};