small changes
* show protocol version on background * make 860 the default protocol * avoid more crashes on mapview * activa crash handler by default
This commit is contained in:
parent
a4cef0d390
commit
58d9426be8
|
@ -11,6 +11,7 @@ function Background.init()
|
||||||
local clientVersionLabel = background:getChildById('clientVersionLabel')
|
local clientVersionLabel = background:getChildById('clientVersionLabel')
|
||||||
clientVersionLabel:setText('OTClient ' .. g_app.getVersion() .. '\n' ..
|
clientVersionLabel:setText('OTClient ' .. g_app.getVersion() .. '\n' ..
|
||||||
'Rev ' .. g_app.getBuildRevision() .. '\n' ..
|
'Rev ' .. g_app.getBuildRevision() .. '\n' ..
|
||||||
|
'Protocol ' .. g_game.getProtocolVersion() .. '\n' ..
|
||||||
'Built on ' .. g_app.getBuildDate())
|
'Built on ' .. g_app.getBuildDate())
|
||||||
|
|
||||||
if not g_game.isOnline() then
|
if not g_game.isOnline() then
|
||||||
|
|
|
@ -16,7 +16,7 @@ Panel
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
text-align: center
|
text-align: center
|
||||||
height: 48
|
text-auto-resize: true
|
||||||
width: 120
|
width: 120
|
||||||
color: #ffffff
|
color: #ffffff
|
||||||
font: verdana-11px-monochrome
|
font: verdana-11px-monochrome
|
||||||
|
|
|
@ -8,7 +8,6 @@ SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake;${CMAKE_MODULE_PATH}")
|
||||||
|
|
||||||
# framework options
|
# framework options
|
||||||
OPTION(WINDOWS_CONSOLE "Enables console window on Windows platform" OFF)
|
OPTION(WINDOWS_CONSOLE "Enables console window on Windows platform" OFF)
|
||||||
OPTION(CRASH_HANDLER "Generate crash reports" OFF)
|
|
||||||
OPTION(USE_OPENGL_ES2 "Use OpenGL ES 2.0 (for mobiles devices)" OFF)
|
OPTION(USE_OPENGL_ES2 "Use OpenGL ES 2.0 (for mobiles devices)" OFF)
|
||||||
SET(BUILD_REVISION "custom" CACHE "Git revision string (intended for releases)" STRING)
|
SET(BUILD_REVISION "custom" CACHE "Git revision string (intended for releases)" STRING)
|
||||||
|
|
||||||
|
@ -63,6 +62,7 @@ ENDIF()
|
||||||
IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||||
ADD_DEFINITIONS(-DDEBUG)
|
ADD_DEFINITIONS(-DDEBUG)
|
||||||
MESSAGE(STATUS "Debug information: ON")
|
MESSAGE(STATUS "Debug information: ON")
|
||||||
|
OPTION(CRASH_HANDLER "Generate crash reports" ON)
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS "Debug information: OFF")
|
MESSAGE(STATUS "Debug information: OFF")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
|
@ -5,7 +5,7 @@ ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6)
|
||||||
|
|
||||||
# otclient options
|
# otclient options
|
||||||
OPTION(BOT_PROTECTION "Enable bot protection" ON)
|
OPTION(BOT_PROTECTION "Enable bot protection" ON)
|
||||||
SET(PROTOCOL 861 CACHE "Protocol version" STRING)
|
SET(PROTOCOL 860 CACHE "Protocol version" STRING)
|
||||||
ADD_DEFINITIONS(-DPROTOCOL=${PROTOCOL})
|
ADD_DEFINITIONS(-DPROTOCOL=${PROTOCOL})
|
||||||
MESSAGE(STATUS "Protocol: " ${PROTOCOL})
|
MESSAGE(STATUS "Protocol: " ${PROTOCOL})
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ MapView::MapView()
|
||||||
m_lockedFirstVisibleFloor = -1;
|
m_lockedFirstVisibleFloor = -1;
|
||||||
m_cachedFirstVisibleFloor = 0;
|
m_cachedFirstVisibleFloor = 0;
|
||||||
m_cachedLastVisibleFloor = 7;
|
m_cachedLastVisibleFloor = 7;
|
||||||
m_customCameraPosition.z = 7;
|
|
||||||
|
|
||||||
Size frameBufferSize(std::min(g_graphics.getMaxTextureSize(), (int)DEFAULT_FRAMBUFFER_WIDTH),
|
Size frameBufferSize(std::min(g_graphics.getMaxTextureSize(), (int)DEFAULT_FRAMBUFFER_WIDTH),
|
||||||
std::min(g_graphics.getMaxTextureSize(), (int)DEFAULT_FRAMBUFFER_HEIGHT));
|
std::min(g_graphics.getMaxTextureSize(), (int)DEFAULT_FRAMBUFFER_HEIGHT));
|
||||||
|
@ -472,6 +471,8 @@ int MapView::calcFirstVisibleFloor()
|
||||||
} else {
|
} else {
|
||||||
Position cameraPosition = getCameraPosition();
|
Position cameraPosition = getCameraPosition();
|
||||||
|
|
||||||
|
// this could happens if the player is not known yet
|
||||||
|
if(cameraPosition.isValid()) {
|
||||||
// avoid rendering multifloors in far views
|
// avoid rendering multifloors in far views
|
||||||
if(m_viewRange >= FAR_VIEW) {
|
if(m_viewRange >= FAR_VIEW) {
|
||||||
z = cameraPosition.z;
|
z = cameraPosition.z;
|
||||||
|
@ -511,11 +512,12 @@ int MapView::calcFirstVisibleFloor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
z = firstFloor;
|
z = firstFloor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// just ensure the that the floor is in the valid range
|
||||||
z = std::min(std::max(z, 0), (int)Otc::MAX_Z);
|
z = std::min(std::max(z, 0), (int)Otc::MAX_Z);
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
@ -525,6 +527,8 @@ int MapView::calcLastVisibleFloor()
|
||||||
int z = 7;
|
int z = 7;
|
||||||
|
|
||||||
Position cameraPosition = getCameraPosition();
|
Position cameraPosition = getCameraPosition();
|
||||||
|
// this could happens if the player is not known yet
|
||||||
|
if(cameraPosition.isValid()) {
|
||||||
// avoid rendering multifloors in far views
|
// avoid rendering multifloors in far views
|
||||||
if(m_viewRange >= FAR_VIEW) {
|
if(m_viewRange >= FAR_VIEW) {
|
||||||
z = cameraPosition.z;
|
z = cameraPosition.z;
|
||||||
|
@ -535,7 +539,9 @@ int MapView::calcLastVisibleFloor()
|
||||||
else
|
else
|
||||||
z = Otc::SEA_FLOOR;
|
z = Otc::SEA_FLOOR;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// just ensure the that the floor is in the valid range
|
||||||
z = std::min(std::max(z, 0), (int)Otc::MAX_Z);
|
z = std::min(std::max(z, 0), (int)Otc::MAX_Z);
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
@ -553,6 +559,10 @@ TilePtr MapView::getTile(const Point& mousePos, const Rect& mapRect)
|
||||||
Size visibleSize = getVisibleSize();
|
Size visibleSize = getVisibleSize();
|
||||||
Position cameraPosition = getCameraPosition();
|
Position cameraPosition = getCameraPosition();
|
||||||
|
|
||||||
|
// if we have no camera, its impossible to get the tile
|
||||||
|
if(!cameraPosition.isValid())
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
float scaleFactor = m_tileSize / (float)Otc::TILE_PIXELS;
|
float scaleFactor = m_tileSize / (float)Otc::TILE_PIXELS;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue