scene::ISceneManager *smgr;
SubgameSpec gamespec;
WorldSpec worldspec;
- bool simple_singleplayer_mode = false;
+ bool simple_singleplayer_mode;
// These are set up based on the menu and other things
// TODO: Are these required since there's already playername, password, etc
this->key = key;
}
+ virtual ~JoystickAxisCmb() {}
+
virtual bool isTriggered(const irr::SEvent::SJoystickEvent &ev) const;
u16 axis_to_compare;
// Append to the correct layer
std::vector<MeshBufList> &list = lists[layer];
const video::SMaterial &m = buf->getMaterial();
- for (MeshBufList &l : list) {
+ for (std::vector<MeshBufList>::iterator it = list.begin(); it != list.end();
+ ++it) {
// comparing a full material is quite expensive so we don't do it if
// not even first texture is equal
- if (l.m.TextureLayer[0].Texture != m.TextureLayer[0].Texture)
+ if ((*it).m.TextureLayer[0].Texture != m.TextureLayer[0].Texture)
continue;
- if (l.m == m) {
- l.bufs.push_back(buf);
+ if ((*it).m == m) {
+ (*it).bufs.push_back(buf);
return;
}
}
Measuring time is very useful for long delays when the
machine is swapping a lot.
*/
- std::time_t time1 = time(0);
+ time_t time1 = time(0);
/*
Get animation parameters
std::vector<MeshBufList> &lists = drawbufs.lists[layer];
int timecheck_counter = 0;
- for (MeshBufList &list : lists) {
+ for (std::vector<MeshBufList>::iterator it = lists.begin(); it != lists.end();
+ ++it) {
timecheck_counter++;
if (timecheck_counter > 50) {
timecheck_counter = 0;
- std::time_t time2 = time(0);
+ time_t time2 = time(0);
if (time2 > time1 + 4) {
infostream << "ClientMap::renderMap(): "
"Rendering takes ages, returning."
}
}
- driver->setMaterial(list.m);
+ driver->setMaterial((*it).m);
- for (scene::IMeshBuffer *buf : list.bufs) {
- driver->drawMeshBuffer(buf);
- vertex_count += buf->getVertexCount();
+ for (std::vector<scene::IMeshBuffer*>::iterator it2 = (*it).bufs.begin();
+ it2 != (*it).bufs.end(); ++it2) {
+ driver->drawMeshBuffer(*it2);
+ vertex_count += (*it2)->getVertexCount();
meshbuffer_count++;
}
}
{
std::ostringstream os2;
os2 << DESERIALIZE_START;
- for (const auto &stringvar : m_stringvars) {
- if (!stringvar.first.empty() || !stringvar.second.empty())
- os2 << stringvar.first << DESERIALIZE_KV_DELIM
- << stringvar.second << DESERIALIZE_PAIR_DELIM;
+ for (StringMap::const_iterator it = m_stringvars.begin(); it != m_stringvars.end();
+ ++it) {
+ if (!(*it).first.empty() || !(*it).second.empty())
+ os2 << (*it).first << DESERIALIZE_KV_DELIM
+ << (*it).second << DESERIALIZE_PAIR_DELIM;
}
os << serializeJsonStringIfNeeded(os2.str());
}
ReflowScan::ReflowScan(Map *map, INodeDefManager *ndef) :
m_map(map),
m_ndef(ndef),
- m_liquid_queue(nullptr)
+ m_liquid_queue(NULL)
{
}
// scanned block. Blocks are only added to the lookup if they are really
// needed. The lookup is indexed manually to use the same index in a
// bit-array (of uint32 type) which stores for unloaded blocks that they
- // were already fetched from Map but were actually nullptr.
+ // were already fetched from Map but were actually NULL.
memset(m_lookup, 0, sizeof(m_lookup));
int block_idx = 1 + (1 * 9) + (1 * 3);
m_lookup[block_idx] = block;
m_last_chat_message_sent(time(NULL)),
m_chat_message_allowance(5.0f),
m_message_rate_overhead(0),
+ m_day_night_ratio_do_override(false),
hud_hotbar_image(""),
hud_hotbar_selected_image("")
{
float m_chat_message_allowance;
u16 m_message_rate_overhead;
- bool m_day_night_ratio_do_override = false;
+ bool m_day_night_ratio_do_override;
float m_day_night_ratio;
std::string hud_hotbar_image;
std::string hud_hotbar_selected_image;
friend class LuaItemStack;
friend class ModApiItemMod;
- bool getItemCallback(const char *name, const char *callbackname, const v3s16 *p = nullptr);
+ bool getItemCallback(const char *name, const char *callbackname, const v3s16 *p = NULL);
void pushPointedThing(const PointedThing& pointed);
};
pointed.node_abovesurface = pos;
pointed.node_undersurface = pos + v3s16(0,-1,0);
// Place it with a NULL placer (appears in Lua as nil)
- bool success = scriptIfaceItem->item_OnPlace(item, nullptr, pointed);
+ bool success = scriptIfaceItem->item_OnPlace(item, NULL, pointed);
lua_pushboolean(L, success);
return 1;
}
ndef->getIds(lua_tostring(L, 3), filter);
}
- std::unordered_map<content_t, u32> individual_count;
+ UNORDERED_MAP<content_t, u32> individual_count;
lua_newtable(L);
u64 i = 0;
#include "lua_api/l_item.h"
#include "common/c_converter.h"
#include "common/c_content.h"
+#include "util/cpp11_container.h"
#include "log.h"
#include "tool.h"
#include "serverobject.h"
if (co->getType() == ACTIVEOBJECT_TYPE_PLAYER)
return 0;
- const std::unordered_set<int> &child_ids = co->getAttachmentChildIds();
- for (int child_id : child_ids) {
+ const UNORDERED_SET<int> &child_ids = co->getAttachmentChildIds();
+ for (UNORDERED_SET<int>::const_iterator it = child_ids.begin(); it != child_ids.end();
+ ++it) {
// Child can be NULL if it was deleted earlier
- if (ServerActiveObject *child = env->getActiveObject(child_id))
+ if (ServerActiveObject *child = env->getActiveObject(*it))
child->setAttachment(0, "", v3f(0, 0, 0), v3f(0, 0, 0));
}
// Cache previous version to speedup lookup which has a very high performance
// penalty on each call
content_t previous_c{};
- std::vector<LoadingBlockModifierDef *> *lbm_list = nullptr;
+ std::vector<LoadingBlockModifierDef *> *lbm_list = NULL;
for (pos.X = 0; pos.X < MAP_BLOCKSIZE; pos.X++)
for (pos.Y = 0; pos.Y < MAP_BLOCKSIZE; pos.Y++)
- This is usually set to true by the step() method when the object wants
to be deleted but can be set by anything else too.
*/
- bool m_pending_removal = false;
+ bool m_pending_removal;
/*
Same purpose as m_pending_removal but for deactivation.
If this is set alongside with m_pending_removal, removal takes
priority.
*/
- bool m_pending_deactivation = false;
+ bool m_pending_deactivation;
/*
A getter that unifies the above to answer the question: