Small fix, upgrade to irrlicht 1.7.2 on windows
parent
05a6ea0996
commit
54d47d2799
|
@ -305,8 +305,8 @@ if(MSVC)
|
|||
|
||||
# EHa enables SEH exceptions (used for catching segfaults)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/EHa /O2 /Ob2 /Oi /Ot /Oy /GL /FD /MT /GS- /arch:SSE /fp:fast /D NDEBUG /D _HAS_ITERATOR_DEBUGGING=0 /TP")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /NODEFAULTLIB:\"libcmtd.lib\" /NODEFAULTLIB:\"libcmt.lib\"")
|
||||
#set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG")
|
||||
#set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /NODEFAULTLIB:\"libcmtd.lib\" /NODEFAULTLIB:\"libcmt.lib\"")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG")
|
||||
|
||||
# Debug build doesn't catch exceptions by itself
|
||||
# Add some optimizations because otherwise it's VERY slow
|
||||
|
|
29
src/game.cpp
29
src/game.cpp
|
@ -307,6 +307,10 @@ void getPointedNode(Client *client, v3f player_position,
|
|||
f32 maxdistance = -BS * 1001;
|
||||
|
||||
v3s16 pos_i = floatToInt(player_position, BS);
|
||||
//j@@@
|
||||
v3s16 cam_i(camera_direction.X>=0?1:-1,
|
||||
camera_direction.Y>=0?1:-1,
|
||||
camera_direction.Z>=0?1:-1);
|
||||
|
||||
/*infostream<<"pos_i=("<<pos_i.X<<","<<pos_i.Y<<","<<pos_i.Z<<")"
|
||||
<<std::endl;*/
|
||||
|
@ -643,27 +647,36 @@ void getPointedNode(Client *client, v3f player_position,
|
|||
nodebox.MinEdge += nodepos_f;
|
||||
nodebox.MaxEdge += nodepos_f;
|
||||
nodehilightbox = nodebox;
|
||||
}else if(nodefound==false && np != pos_i && np != v3s16(pos_i.X,pos_i.Y+1,pos_i.Z) ){
|
||||
//check if we can build here
|
||||
//this can't be checked (not such material property)...
|
||||
//but is it important here anyway?
|
||||
}else if( nodefound==false
|
||||
&& distance < (BS*6)
|
||||
&& np != pos_i
|
||||
&& np != v3s16(pos_i.X,pos_i.Y+1,pos_i.Z)
|
||||
&& content_features(n).buildable_to){
|
||||
|
||||
bool can_build = false;
|
||||
v3s16 ap;
|
||||
static const v3s16 neigh_pos[] = { v3s16(0,0,1), v3s16(0,0,-1), v3s16(0,1,0), v3s16(0,-1,0), v3s16(1,0,0), v3s16(-1,0,0) };
|
||||
for(int i=0; i<6; i++)
|
||||
{
|
||||
ap = np + neigh_pos[i];
|
||||
//j@@@
|
||||
const v3s16& npos = dirs[i];
|
||||
ap = np + npos;
|
||||
try{
|
||||
MapNode an = client->getNode(ap);
|
||||
//check if we can `stick' to this node
|
||||
if(!content_features(an).walkable) //FIXME: is this OK?
|
||||
continue;
|
||||
if( npos.X==cam_i.X
|
||||
|| npos.Y==cam_i.Y
|
||||
|| npos.Z==cam_i.Z
|
||||
){
|
||||
can_build = false;
|
||||
break;
|
||||
}
|
||||
can_build = true;
|
||||
goto after_check_neighbor;
|
||||
//goto after_check_neighbor;
|
||||
}catch(InvalidPositionException&){}
|
||||
}
|
||||
after_check_neighbor:
|
||||
//after_check_neighbor:
|
||||
if(can_build && distance > maxdistance){
|
||||
|
||||
maxdistance = distance;
|
||||
|
|
|
@ -75,9 +75,11 @@ void ContentFeatures::setInventoryTextureCube(std::string top,
|
|||
if(g_texturesource == NULL)
|
||||
return;
|
||||
|
||||
//jFIXME: usunac to
|
||||
//workaround for windows irrlicht bug (texture cubes drawn wrong)
|
||||
#ifdef _WINDOWS
|
||||
inventory_texture = g_texturesource->getTextureRaw("[noalpha:"+top+"^[forcesingle");
|
||||
return;
|
||||
#else
|
||||
|
||||
str_replace_char(top, '^', '&');
|
||||
str_replace_char(left, '^', '&');
|
||||
|
@ -91,6 +93,7 @@ void ContentFeatures::setInventoryTextureCube(std::string top,
|
|||
imgname_full += "{";
|
||||
imgname_full += right;
|
||||
inventory_texture = g_texturesource->getTextureRaw(imgname_full);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue