remove some warnings

This commit is contained in:
darkrose 2015-04-23 02:34:43 +10:00
parent 9e81b583e6
commit 9a7eac64d7
11 changed files with 19 additions and 50 deletions

View File

@ -2301,13 +2301,6 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
if (content_features(n_plus_z_plus_y).draw_type == CDT_ROOFLIKE)
is_roof_z_plus_y[1] = true;
bool is_roof_x_all[] = {false, false};
bool is_roof_z_all[] = {false, false};
is_roof_x_all[0] = is_roof_x[0] || is_roof_x_minus_y[0] || is_roof_x_plus_y[0];
is_roof_x_all[1] = is_roof_x[1] || is_roof_x_minus_y[1] || is_roof_x_plus_y[1];
is_roof_z_all[0] = is_roof_z[0] || is_roof_z_minus_y[0] || is_roof_z_plus_y[0];
is_roof_z_all[1] = is_roof_z[1] || is_roof_z_minus_y[1] || is_roof_z_plus_y[1];
u8 adjacencies = is_roof_x[0] + is_roof_x[1] + is_roof_z[0] + is_roof_z[1];
// get the tile, with crack if being dug

View File

@ -1685,12 +1685,7 @@ bool CookBookNodeMetadata::receiveFields(std::string formname, std::map<std::str
}
std::string CookBookNodeMetadata::getDrawSpecString()
{
InventoryList *l = m_inventory->getList("result");
InventoryItem *q = l->getItem(0);
int tr = 0;
std::vector<content_t> &list = lists::get("cooking");
if (q && q->getContent() != CONTENT_IGNORE)
tr = crafting::getResultCount(q);
char buff[256];
snprintf(buff,256,gettext("Page %d of %d"),(int)(m_page+1),(int)((list.size()/40)+1));

View File

@ -153,7 +153,6 @@ void ItemSAO::step(float dtime, bool send_recommended)
if (m_speed_f.getLength()*dtime > pos_max_d)
m_speed_f *= pos_max_d / (m_speed_f.getLength()*dtime);
v3f pos_f = getBasePosition();
v3f pos_f_old = pos_f;
v3f accel_f = v3f(0,0,0);
moveresult = collisionMoveSimple(&m_env->getMap(), pos_max_d,
box, 0.0, dtime, pos_f, m_speed_f, accel_f);

View File

@ -1954,7 +1954,7 @@ void ServerEnvironment::step(float dtime)
}else{
bool found = false;
/* moss also grows */
for (s16 i=0;!false && i<6; i++) {
for (s16 i=0; !found && i<6; i++) {
a = m_map->getNodeNoEx(p+g_6dirs[i]);
if (a.getContent() == CONTENT_MOSSYCOBBLE) {
n.setContent(CONTENT_MOSSYCOBBLE);

View File

@ -246,8 +246,6 @@ void FarMesh::render()
v2f p1 = p0 + v2f(1,1)*grid_size;
bool ground_is_sand = false;
bool ground_is_rock = false;
bool ground_is_mud = false;
video::SColor c;
// Detect water
@ -261,7 +259,6 @@ void FarMesh::render()
else if(steepness > 2.0)
{
c = video::SColor(255,128,128,128);
ground_is_rock = true;
}
// Basic ground
else
@ -269,14 +266,12 @@ void FarMesh::render()
if(ma_avg < 2.0*BS)
{
c = video::SColor(255,128,128,128);
ground_is_rock = true;
}
else
{
if(h_avg <= 2.5*BS && have_sand_count >= 2)
{
c = video::SColor(255,210,194,156);
ground_is_sand = true;
}
else
{

View File

@ -1316,9 +1316,6 @@ void the_game(
Some statistics are collected in these
*/
u32 drawtime = 0;
u32 beginscenetime = 0;
u32 scenetime = 0;
u32 endscenetime = 0;
core::list<float> frametime_log;
@ -1516,8 +1513,6 @@ void the_game(
busytime_avg1 = busytime_avg1 * 0.98 + busytime * 0.02;
f32 busytime_jitter1 = busytime - busytime_avg1;
static f32 busytime_jitter1_max_sample = 0.0;
static f32 busytime_jitter1_min_sample = 0.0;
{
static f32 jitter1_max = 0.0;
static f32 jitter1_min = 0.0;
@ -1529,8 +1524,6 @@ void the_game(
counter += dtime;
if (counter > 0.0) {
counter -= 3.0;
busytime_jitter1_max_sample = jitter1_max;
busytime_jitter1_min_sample = jitter1_min;
jitter1_max = 0.0;
jitter1_min = 0.0;
}
@ -2548,13 +2541,13 @@ void the_game(
{
TimeTaker timer("beginScene");
driver->beginScene(false, true, bgcolor);
beginscenetime = timer.stop(true);
timer.stop(true);
}
{
TimeTaker timer("smgr");
smgr->drawAll();
scenetime = timer.stop(true);
timer.stop(true);
}
{
@ -2679,7 +2672,7 @@ void the_game(
{
TimeTaker timer("endScene");
endSceneX(driver);
endscenetime = timer.stop(true);
timer.stop(true);
}
drawtime = drawtimer.stop(true);

View File

@ -497,11 +497,10 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 230, 30);
rect += topleft_content + v2s32(135, 90);
gui::IGUIEditBox *e;
#if USE_FREETYPE
e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(text_name.c_str(), true, Environment, this, GUI_ID_NAME_INPUT, rect);
new gui::intlGUIEditBox(text_name.c_str(), true, Environment, this, GUI_ID_NAME_INPUT, rect);
#else
e = Environment->addEditBox(text_name.c_str(), rect, false, this, GUI_ID_NAME_INPUT);
Environment->addEditBox(text_name.c_str(), rect, false, this, GUI_ID_NAME_INPUT);
#endif
}
{
@ -528,21 +527,19 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
text_address = L"servers.voxelands.com";
core::rect<s32> rect(0, 0, 230, 30);
rect += topleft_content + v2s32(135, 200);
gui::IGUIEditBox *e;
#if USE_FREETYPE
e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(text_address.c_str(), true, Environment, this, GUI_ID_ADDRESS_INPUT, rect);
new gui::intlGUIEditBox(text_address.c_str(), true, Environment, this, GUI_ID_ADDRESS_INPUT, rect);
#else
e = Environment->addEditBox(text_address.c_str(), rect, false, this, GUI_ID_ADDRESS_INPUT);
Environment->addEditBox(text_address.c_str(), rect, false, this, GUI_ID_ADDRESS_INPUT);
#endif
}
{
core::rect<s32> rect(0, 0, 120, 30);
rect += topleft_content + v2s32(245, 240);
gui::IGUIEditBox *e;
#if USE_FREETYPE
e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(text_port.c_str(), true, Environment, this, GUI_ID_PORT_INPUT, rect);
new gui::intlGUIEditBox(text_port.c_str(), true, Environment, this, GUI_ID_PORT_INPUT, rect);
#else
e = Environment->addEditBox(text_port.c_str(), rect, false, this, GUI_ID_PORT_INPUT);
Environment->addEditBox(text_port.c_str(), rect, false, this, GUI_ID_PORT_INPUT);
#endif
}
// Start game button
@ -624,7 +621,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
gui::IGUIScrollBar *sb = Environment->addScrollBar(true, rect, this, GUI_ID_VOLUME_SB);
sb->setMin(0);
sb->setMax(100);
sb->setPos(m_data->volume);
sb->setPos(volume);
}
// Key change button
@ -872,11 +869,10 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 190, 30);
rect += topleft_content + v2s32(190, 260);
gui::IGUIEditBox *e;
#if USE_FREETYPE
e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(fixed_seed.c_str(), true, Environment, this, GUI_ID_MAP_SEED_INPUT, rect);
new gui::intlGUIEditBox(fixed_seed.c_str(), true, Environment, this, GUI_ID_MAP_SEED_INPUT, rect);
#else
e = Environment->addEditBox(fixed_seed.c_str(), rect, false, this, GUI_ID_MAP_SEED_INPUT);
Environment->addEditBox(fixed_seed.c_str(), rect, false, this, GUI_ID_MAP_SEED_INPUT);
#endif
}
}

View File

@ -807,12 +807,11 @@ std::string http_url_encode(std::string &str)
std::string http_url_decode(std::string &str)
{
int32_t i;
int32_t o;
int32_t k;
char buff[10];
char* in = (char*)str.c_str();
std::string out("");
for (i=0,o=0; in[i] != 0; i++) {
for (i=0; in[i] != 0; i++) {
if (in[i] == '%') {
i++;
if (in[i] == 0 || in[i+1] == 0)

View File

@ -1958,7 +1958,7 @@ void ServerMap::initBlockMake(mapgen::BlockMakeData *data, v3s16 blockpos)
MapBlock* ServerMap::finishBlockMake(mapgen::BlockMakeData *data,
core::map<v3s16, MapBlock*> &changed_blocks)
{
v3s16 blockpos = data->blockpos;
//v3s16 blockpos = data->blockpos;
/*infostream<<"finishBlockMake(): ("<<blockpos.X<<","<<blockpos.Y<<","
<<blockpos.Z<<")"<<std::endl;*/
@ -3496,7 +3496,6 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
v3f camera_position = m_camera_position;
v3f camera_direction = m_camera_direction;
f32 camera_fov = m_camera_fov;
v3s16 camera_offset = m_camera_offset;
m_camera_mutex.Unlock();
/*

View File

@ -223,7 +223,7 @@ bool MapBlock::propagateSunlight(core::map<v3s16, bool> & light_sources,
{
#if 1
bool no_sunlight = false;
bool no_top_block = false;
//bool no_top_block = false;
// Check if node above block has sunlight
bool is_valid_position;
MapNode n = getNodeParent(v3s16(x, MAP_BLOCKSIZE, z), &is_valid_position);
@ -235,7 +235,7 @@ bool MapBlock::propagateSunlight(core::map<v3s16, bool> & light_sources,
no_sunlight = true;
}
}else{
no_top_block = true;
//no_top_block = true;
// NOTE: This makes over-ground roofed places sunlighted
// Assume sunlight, unless is_underground==true

View File

@ -481,7 +481,7 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
s32 nearest_emerged_d = -1;
s32 nearest_emergefull_d = -1;
s32 nearest_sent_d = -1;
bool queue_is_full = false;
//bool queue_is_full = false;
s16 d;
for(d = d_start; d <= d_max; d++)
@ -532,7 +532,7 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
// Don't select too many blocks for sending
if(num_blocks_selected >= max_simul_dynamic)
{
queue_is_full = true;
//queue_is_full = true;
goto queue_full_break;
}