mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-26 16:56:19 +00:00
Merge with develop
This commit is contained in:
parent
c95e136ef7
commit
afaaa36777
14 changed files with 159 additions and 68 deletions
|
@ -158,9 +158,9 @@ IF(WITH_NEL)
|
|||
|
||||
IF((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL)
|
||||
SET(CURL_STATIC ON)
|
||||
ELSE((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL)
|
||||
ELSE()
|
||||
SET(CURL_STATIC OFF)
|
||||
ENDIF((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL)
|
||||
ENDIF()
|
||||
|
||||
IF(CURL_STATIC)
|
||||
SET(CURL_DEFINITIONS -DCURL_STATICLIB)
|
||||
|
@ -172,15 +172,23 @@ IF(WITH_NEL)
|
|||
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
|
||||
ENDIF(OPENSSL_FOUND)
|
||||
|
||||
# CURL Macports version depends on libidn, libintl and libiconv too
|
||||
IF(APPLE)
|
||||
IF(UNIX)
|
||||
# CURL depends on libidn
|
||||
FIND_LIBRARY(IDN_LIBRARY idn)
|
||||
FIND_LIBRARY(INTL_LIBRARY intl)
|
||||
|
||||
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY} ${INTL_LIBRARY})
|
||||
ENDIF(APPLE)
|
||||
ENDIF(CURL_STATIC)
|
||||
ENDIF(WITH_GUI)
|
||||
IF(IDN_LIBRARY)
|
||||
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
# CURL Macports version depends on libidn, libintl and libiconv too
|
||||
IF(APPLE)
|
||||
FIND_LIBRARY(INTL_LIBRARY intl)
|
||||
IF(INTL_LIBRARY)
|
||||
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include ${LIBXML2_INCLUDE_DIR})
|
||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
||||
|
|
|
@ -1738,7 +1738,9 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle)
|
|||
}
|
||||
else if (windowStyle == EWSFullscreen)
|
||||
{
|
||||
#ifndef _DEBUG
|
||||
dwNewStyle |= WS_POPUP;
|
||||
#endif
|
||||
isVisible = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,9 +49,6 @@
|
|||
#define FINAL_VERSION 1
|
||||
#endif // TEST_CRASH_COUNTER
|
||||
|
||||
// game share
|
||||
#include "game_share/ryzom_version.h"
|
||||
|
||||
// Client
|
||||
#include "resource.h"
|
||||
#include "init.h"
|
||||
|
|
|
@ -48,8 +48,6 @@
|
|||
// Std.
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
// Game Share
|
||||
#include "game_share/ryzom_version.h"
|
||||
// Client
|
||||
#include "init.h"
|
||||
#include "input.h"
|
||||
|
@ -89,6 +87,7 @@
|
|||
#include "interface_v3/add_on_manager.h"
|
||||
|
||||
#include "bg_downloader_access.h"
|
||||
#include "user_agent.h"
|
||||
|
||||
#include "nel/misc/check_fpu.h"
|
||||
|
||||
|
@ -837,11 +836,7 @@ void prelogInit()
|
|||
displayCPUInfo();
|
||||
|
||||
// Display the client version.
|
||||
#if FINAL_VERSION
|
||||
nlinfo("RYZOM VERSION : FV %s ("__DATE__" "__TIME__")", RYZOM_VERSION);
|
||||
#else
|
||||
nlinfo("RYZOM VERSION : DEV %s ("__DATE__" "__TIME__")", RYZOM_VERSION);
|
||||
#endif
|
||||
nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str());
|
||||
|
||||
FPU_CHECKER_ONCE
|
||||
|
||||
|
@ -953,14 +948,28 @@ void prelogInit()
|
|||
return;
|
||||
}
|
||||
|
||||
// used to determine screen default resolution
|
||||
if (ClientCfg.Width < 800 || ClientCfg.Height < 600)
|
||||
{
|
||||
UDriver::CMode mode;
|
||||
|
||||
CConfigFile::CVar *varPtr = NULL;
|
||||
|
||||
if (!ClientCfg.Windowed && Driver->getCurrentScreenMode(mode))
|
||||
{
|
||||
ClientCfg.Width = mode.Width;
|
||||
ClientCfg.Height = mode.Height;
|
||||
ClientCfg.Depth = mode.Depth;
|
||||
ClientCfg.Frequency = mode.Frequency;
|
||||
|
||||
// update client.cfg with detected depth and frequency
|
||||
varPtr = ClientCfg.ConfigFile.getVarPtr("Depth");
|
||||
if(varPtr)
|
||||
varPtr->forceAsInt(ClientCfg.Depth);
|
||||
|
||||
varPtr = ClientCfg.ConfigFile.getVarPtr("Frequency");
|
||||
if(varPtr)
|
||||
varPtr->forceAsInt(ClientCfg.Frequency);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -969,7 +978,7 @@ void prelogInit()
|
|||
}
|
||||
|
||||
// update client.cfg with detected resolution
|
||||
CConfigFile::CVar *varPtr = ClientCfg.ConfigFile.getVarPtr("Width");
|
||||
varPtr = ClientCfg.ConfigFile.getVarPtr("Width");
|
||||
if(varPtr)
|
||||
varPtr->forceAsInt(ClientCfg.Width);
|
||||
|
||||
|
|
|
@ -97,7 +97,6 @@
|
|||
// Sound
|
||||
#include "nel/sound/sound_anim_manager.h"
|
||||
// Game share
|
||||
#include "game_share/ryzom_version.h"
|
||||
#include "game_share/light_cycle.h"
|
||||
#include "sound_manager.h"
|
||||
#include "precipitation_clip_grid.h"
|
||||
|
|
|
@ -2990,12 +2990,15 @@ public:
|
|||
if (Driver == NULL) return;
|
||||
|
||||
VideoModes.clear();
|
||||
vector<string> stringModeList;
|
||||
vector<string> stringModeList, stringFreqList;
|
||||
sint nFoundMode, nFoundFreq;
|
||||
|
||||
sint nFoundMode = getRyzomModes(VideoModes, stringModeList);
|
||||
getRyzomModes(VideoModes, stringModeList, stringFreqList, nFoundMode, nFoundFreq);
|
||||
|
||||
// Initialize interface combo box
|
||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||
|
||||
// resolutions
|
||||
CDBGroupComboBox *pCB= dynamic_cast<CDBGroupComboBox*>(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO ));
|
||||
if( pCB )
|
||||
{
|
||||
|
@ -3003,11 +3006,23 @@ public:
|
|||
for (sint j = 0; j < (sint)stringModeList.size(); j++)
|
||||
pCB->addText(ucstring(stringModeList[j]));
|
||||
}
|
||||
|
||||
// frequencies
|
||||
pCB= dynamic_cast<CDBGroupComboBox*>(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO ));
|
||||
if( pCB )
|
||||
{
|
||||
pCB->resetTexts();
|
||||
for (sint j = 0; j < (sint)stringFreqList.size(); j++)
|
||||
pCB->addText(ucstring(stringFreqList[j]));
|
||||
}
|
||||
|
||||
// -1 is important to indicate we set this value in edit mode
|
||||
NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_VIDEO_MODE_DB )->setValue32(-1);
|
||||
NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_VIDEO_FREQ_DB )->setValue32(-1);
|
||||
NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_VIDEO_MODE_DB )->setValue32(nFoundMode);
|
||||
|
||||
NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_VIDEO_FREQ_DB )->setValue32(-1);
|
||||
NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_VIDEO_FREQ_DB )->setValue32(nFoundFreq);
|
||||
|
||||
CCtrlBaseButton *pBut = dynamic_cast<CCtrlBaseButton*>(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON ));
|
||||
if (pBut)
|
||||
{
|
||||
|
|
|
@ -1945,7 +1945,10 @@ class CAHInitResLod : public IActionHandler
|
|||
VideoModes.clear();
|
||||
StringModeList.clear();
|
||||
|
||||
CurrentMode = getRyzomModes(VideoModes, StringModeList);
|
||||
std::vector<std::string> stringFreqList;
|
||||
sint currentFreq;
|
||||
|
||||
getRyzomModes(VideoModes, StringModeList, stringFreqList, CurrentMode, currentFreq);
|
||||
|
||||
// getRyzomModes() expects empty list, so we need to insert 'Windowed' after mode list is filled
|
||||
StringModeList.insert(StringModeList.begin(), "uiConfigWindowed");
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "game_share/brick_types.h"
|
||||
#include "game_share/light_cycle.h"
|
||||
#include "game_share/time_weather_season/time_and_season.h"
|
||||
#include "game_share/ryzom_version.h"
|
||||
#include "game_share/bot_chat_types.h"
|
||||
// PACS
|
||||
#include "nel/pacs/u_global_position.h"
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
#include <nel/3d/u_text_context.h>
|
||||
#include <nel/gui/lua_ihm.h>
|
||||
|
||||
#include "game_share/ryzom_version.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "client_cfg.h"
|
||||
#include "user_entity.h"
|
||||
|
@ -44,7 +42,7 @@
|
|||
#include "misc.h"
|
||||
#include "interface_v3/interface_manager.h"
|
||||
#include "actions_client.h"
|
||||
|
||||
#include "user_agent.h"
|
||||
|
||||
|
||||
using namespace NLMISC;
|
||||
|
@ -244,15 +242,7 @@ void displayDebug()
|
|||
//-----------//
|
||||
TextContext->setHotSpot(UTextContext::TopLeft);
|
||||
line = 1.f;
|
||||
string str;
|
||||
#if FINAL_VERSION
|
||||
str = "FV";
|
||||
#else
|
||||
str = "DEV";
|
||||
#endif
|
||||
if(ClientCfg.ExtendedCommands)
|
||||
str += "_E";
|
||||
str += " "RYZOM_VERSION;
|
||||
string str = getDisplayVersion();
|
||||
TextContext->printfAt(0.f, line, "Version %s", str.c_str());
|
||||
|
||||
// TOP MIDDLE //
|
||||
|
|
|
@ -1392,12 +1392,19 @@ bool isWindowMaximized()
|
|||
screenMode.Width == width && screenMode.Height == height);
|
||||
}
|
||||
|
||||
sint getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<std::string> &stringModeList)
|
||||
bool getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<std::string> &stringModeList, std::vector<std::string> &stringFreqList, sint &nFoundStringMode, sint &nFoundStringFreq)
|
||||
{
|
||||
// default values
|
||||
nFoundStringMode = -1;
|
||||
nFoundStringFreq = -1;
|
||||
|
||||
// mode index in original video modes
|
||||
sint nFoundMode = -1;
|
||||
|
||||
// **** Init Video Modes
|
||||
Driver->getModes(videoModes);
|
||||
// Remove modes under 800x600 and get the unique strings
|
||||
sint i, j, nFoundMode = -1;
|
||||
sint i, j;
|
||||
for (i=0; i < (sint)videoModes.size(); ++i)
|
||||
{
|
||||
if ((videoModes[i].Width < 800) || (videoModes[i].Height < 600))
|
||||
|
@ -1408,10 +1415,10 @@ sint getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<st
|
|||
else
|
||||
{
|
||||
bool bFound = false;
|
||||
string tmp = toString(videoModes[i].Width)+" x "+toString(videoModes[i].Height);
|
||||
string res = toString(videoModes[i].Width)+" x "+toString(videoModes[i].Height);
|
||||
for (j = 0; j < (sint)stringModeList.size(); ++j)
|
||||
{
|
||||
if (stringModeList[j] == tmp)
|
||||
if (stringModeList[j] == res)
|
||||
{
|
||||
bFound = true;
|
||||
break;
|
||||
|
@ -1419,31 +1426,54 @@ sint getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<st
|
|||
}
|
||||
if (!bFound)
|
||||
{
|
||||
stringModeList.push_back(tmp);
|
||||
stringModeList.push_back(res);
|
||||
|
||||
if ((videoModes[i].Width <= ClientCfg.Width) && (videoModes[i].Height <= ClientCfg.Height))
|
||||
{
|
||||
if (nFoundMode == -1)
|
||||
if (nFoundStringMode == -1)
|
||||
{
|
||||
nFoundMode = j;
|
||||
nFoundStringMode = j;
|
||||
nFoundMode = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((videoModes[i].Width >= videoModes[nFoundMode].Width) &&
|
||||
(videoModes[i].Height >= videoModes[nFoundMode].Height))
|
||||
nFoundMode = j;
|
||||
{
|
||||
nFoundStringMode = j;
|
||||
nFoundMode = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If no modes are available, fallback to windowed mode
|
||||
if (nFoundMode == -1)
|
||||
if (nFoundStringMode == -1)
|
||||
{
|
||||
nlwarning("Mode %ux%u not found, fall back to windowed", (uint)ClientCfg.Width, (uint)ClientCfg.Height);
|
||||
ClientCfg.Windowed = true;
|
||||
ClientCfg.writeInt("FullScreen", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// add frequencies to frequencies list
|
||||
for (i=0; i < (sint)videoModes.size(); ++i)
|
||||
{
|
||||
if (videoModes[i].Width == videoModes[nFoundMode].Width && videoModes[i].Height == videoModes[nFoundMode].Height)
|
||||
{
|
||||
uint freq = videoModes[i].Frequency;
|
||||
|
||||
return nFoundMode;
|
||||
if (ClientCfg.Frequency > 0 && freq == ClientCfg.Frequency)
|
||||
{
|
||||
nFoundStringFreq = stringFreqList.size();
|
||||
}
|
||||
|
||||
stringFreqList.push_back(toString(freq));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nFoundStringMode > -1;
|
||||
}
|
||||
|
|
|
@ -228,7 +228,7 @@ uint getCurrentColorDepth();
|
|||
bool isWindowMaximized();
|
||||
|
||||
// get all supported video modes
|
||||
sint getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<std::string> &stringModeList);
|
||||
bool getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<std::string> &stringModeList, std::vector<std::string> &stringFreqList, sint &nFoundMode, sint &nFoundFreq);
|
||||
|
||||
#endif // CL_MISC_H
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "global.h"
|
||||
#include "nel/misc/events.h"
|
||||
#include "nel/3d/u_texture.h"
|
||||
#include "game_share/ryzom_version.h"
|
||||
#include "nel/misc/i18n.h"
|
||||
#include "continent.h"
|
||||
#include "weather.h"
|
||||
|
@ -31,6 +30,7 @@
|
|||
#include "release.h"
|
||||
#include "net_manager.h"
|
||||
#include "client_cfg.h"
|
||||
#include "user_agent.h"
|
||||
#include "bg_downloader_access.h"
|
||||
#include "nel/misc/system_utils.h"
|
||||
#include "nel/3d/stereo_hmd.h"
|
||||
|
@ -277,13 +277,7 @@ void CProgress::internalProgress (float value)
|
|||
// Display the build version.
|
||||
TextContext->setFontSize((uint)(12.f * fontFactor));
|
||||
TextContext->setHotSpot(UTextContext::TopRight);
|
||||
string str;
|
||||
#if FINAL_VERSION
|
||||
str = "FV ";
|
||||
#else
|
||||
str = "DEV ";
|
||||
#endif
|
||||
str += RYZOM_VERSION;
|
||||
string str = getDisplayVersion();
|
||||
TextContext->printfAt(1.0f,1.0f, str.c_str());
|
||||
|
||||
// Display the tips of the day.
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
|
||||
#include "stdpch.h"
|
||||
#include "user_agent.h"
|
||||
#include "client_cfg.h"
|
||||
|
||||
#include "game_share/ryzom_version.h"
|
||||
|
||||
#if defined(RYZOM_COMPATIBILITY_VERSION) && defined(HAVE_REVISION_H)
|
||||
#ifdef HAVE_REVISION_H
|
||||
#include "revision.h"
|
||||
#endif
|
||||
|
||||
|
@ -60,17 +61,57 @@ std::string getUserAgentVersion()
|
|||
|
||||
if (s_userAgent.empty())
|
||||
{
|
||||
char buffer[256];
|
||||
|
||||
#if defined(REVISION) && defined(RYZOM_COMPATIBILITY_VERSION)
|
||||
// we don't need RYZOM_VERSION if we already have a numeric form a.b.c, we just need to append revision to it
|
||||
sprintf(buffer, "%s.%s-%s-%s", RYZOM_COMPATIBILITY_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH);
|
||||
#ifdef REVISION
|
||||
s_userAgent = NLMISC::toString("%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH);
|
||||
#else
|
||||
sprintf(buffer, "%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH);
|
||||
s_userAgent = NLMISC::toString("%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH);
|
||||
#endif
|
||||
|
||||
s_userAgent = buffer;
|
||||
}
|
||||
|
||||
return s_userAgent;
|
||||
}
|
||||
|
||||
std::string getVersion()
|
||||
{
|
||||
return RYZOM_VERSION;
|
||||
}
|
||||
|
||||
std::string getDisplayVersion()
|
||||
{
|
||||
static std::string s_version;
|
||||
|
||||
if (s_version.empty())
|
||||
{
|
||||
#if FINAL_VERSION
|
||||
s_version = "FV ";
|
||||
#else
|
||||
s_version = "DEV ";
|
||||
#endif
|
||||
if (ClientCfg.ExtendedCommands) s_version += "_E";
|
||||
|
||||
s_version += getVersion();
|
||||
|
||||
#ifdef REVISION
|
||||
s_version += NLMISC::toString(".%s", REVISION);
|
||||
#endif
|
||||
}
|
||||
|
||||
return s_version;
|
||||
}
|
||||
|
||||
std::string getDebugVersion()
|
||||
{
|
||||
static std::string s_version;
|
||||
|
||||
if (s_version.empty())
|
||||
{
|
||||
s_version = getDisplayVersion();
|
||||
#ifdef BUILD_DATE
|
||||
s_version += NLMISC::toString(" (%s)", BUILD_DATE);
|
||||
#else
|
||||
s_version += NLMISC::toString(" (%s %s)", __DATE__, __TIME__);
|
||||
#endif
|
||||
}
|
||||
|
||||
return s_version;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,10 @@ std::string getUserAgent();
|
|||
std::string getUserAgentName();
|
||||
std::string getUserAgentVersion();
|
||||
|
||||
std::string getVersion();
|
||||
std::string getDisplayVersion();
|
||||
std::string getDebugVersion();
|
||||
|
||||
#endif // CL_USER_AGENT_H
|
||||
|
||||
/* End of user_agent.h */
|
||||
|
|
Loading…
Reference in a new issue