This commit is contained in:
Matt Raykowski 2010-06-02 12:19:41 -05:00
commit 999d7e22ef
76 changed files with 12490 additions and 1597 deletions

View file

@ -45,6 +45,9 @@ default_c
*_debug
core
# Mac OS X compile
*.dylib
# Log dump files
report_refused
report_failed
@ -58,14 +61,16 @@ log.txt
*.dlm
*.dlu
#makeall build
# makeall build
.mode_static
#cmake build files & directories
# cmake build files & directories
CMakeFiles
*.cmake
CMakeCache.txt
cmake_install.cmake
CTestTestfile.cmake
CPackConfig.cmake
CPackSourceConfig.cmake
.libs
# Linux garbage
@ -100,6 +105,9 @@ ipch
*.idb
*.sdf
# Mac OS X garbage
.DS_Store
# Ryzom server garbage
aes_alias_name.cfg
aes_nagios_report.txt

View file

@ -92,7 +92,16 @@ IF(WITH_3D)
IF(WITH_DRIVER_OPENGL)
FIND_PACKAGE(OpenGL)
IF(NOT WIN32)
IF(APPLE)
FIND_LIBRARY(CARBON NAMES Carbon)
IF(WITH_COCOA)
FIND_LIBRARY(COCOA NAMES Cocoa)
ENDIF(WITH_COCOA)
ENDIF(APPLE)
IF(NOT WITH_COCOA)
FIND_PACKAGE(X11)
FIND_PACKAGE(XF86VidMode)
ENDIF(NOT WITH_COCOA)
ENDIF(NOT WIN32)
ENDIF(WITH_DRIVER_OPENGL)

View file

@ -79,6 +79,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_TESTS "Build NeL Unit Tests" ON )
OPTION(WITH_GTK "With GTK Support" OFF)
OPTION(WITH_QT "With QT Support" OFF)
OPTION(WITH_COCOA "Build with native Mac OS X Cocoa support" OFF)
OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF)
ENDMACRO(NL_SETUP_DEFAULT_OPTIONS)
@ -120,11 +121,17 @@ MACRO(NL_SETUP_BUILD)
IF(WITH_COVERAGE)
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
ENDIF(WITH_COVERAGE)
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++ -lrt")
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++")
IF(NOT APPLE)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lrt")
ENDIF(NOT APPLE)
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -g")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -O6")
SET(NL_RELEASEDEBUG_CFLAGS "-DNL_RELEASE_DEBUG -g -finline-functions -O3 ")
SET(NL_NONE_CFLAGS "-DNL_RELEASE -g -finline-functions -O2 ")
IF(WITH_COCOA)
SET(PLATFORM_CFLAGS "-DNL_MAC_NATIVE")
ENDIF(WITH_COCOA)
ENDIF(WIN32)
# Determine host CPU

View file

@ -201,7 +201,7 @@ public:
// Return is the associated window information. (Implementation dependent)
// Must be a HWND for Windows (WIN32).
virtual void *getDisplay() =0;
virtual nlWindow getDisplay() =0;
/**
* Setup monitor color properties.

View file

@ -162,7 +162,7 @@ public:
/// Return true if driver is still active. Return false else. If he user close the window, must return false.
virtual bool isActive();
/// Return an OS dependent window handle. Under Win32, it is a HWND.
virtual void *getDisplay ();
virtual nlWindow getDisplay ();
// @}

View file

@ -221,7 +221,7 @@ public:
virtual bool isActive()=0;
/// Return an OS dependent window handle. Under Win32, it is a HWND.
virtual void *getDisplay () = 0;
virtual nlWindow getDisplay () = 0;
// @}

View file

@ -30,7 +30,7 @@ namespace NLMISC
*/
class CSystemUtils
{
static void *s_window;
static nlWindow s_window;
public:
/// Initialize data which needs it before using them.
@ -40,7 +40,7 @@ public:
static bool uninit();
/// Set the window which will be used by some functions.
static void setWindow(void *window);
static void setWindow(nlWindow window);
/// Create/update a progress bar with an appearance depending on system.
static bool updateProgressBar(uint value, uint total);

View file

@ -34,7 +34,7 @@ namespace NL3D
{
// ***************************************************************************
const uint32 IDriver::InterfaceVersion = 0x64; // Added nlWindow patch.
const uint32 IDriver::InterfaceVersion = 0x65; // Added nlWindow patch.
// ***************************************************************************
IDriver::IDriver() : _SyncTexDrvInfos( "IDriver::_SyncTexDrvInfos" )

View file

@ -1323,7 +1323,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
}
// Create a window
_HWnd = (HWND)wnd;
_HWnd = wnd;
// Reset window state
_Maximized = false;
@ -1440,19 +1440,19 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
}
// Create the D3D device
HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, (HWND)_HWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE, &parameters, &_DeviceInterface);
HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE, &parameters, &_DeviceInterface);
if (result != D3D_OK)
{
nlwarning ("Can't create device hr:0x%x adap:0x%x rast:0x%x", result, adapter, _Rasterizer);
// Create the D3D device without puredevice
HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, (HWND)_HWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &parameters, &_DeviceInterface);
HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &parameters, &_DeviceInterface);
if (result != D3D_OK)
{
nlwarning ("Can't create device without puredevice hr:0x%x adap:0x%x rast:0x%x", result, adapter, _Rasterizer);
// Create the D3D device without puredevice and hardware
HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, (HWND)_HWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &parameters, &_DeviceInterface);
HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &parameters, &_DeviceInterface);
if (result != D3D_OK)
{
nlwarning ("Can't create device without puredevice and hardware hr:0x%x adap:0x%x rast:0x%x", result, adapter, _Rasterizer);
@ -1462,7 +1462,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
}
}
// _D3D->CreateDevice (adapter, _Rasterizer, (HWND)_HWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &parameters, &_DeviceInterface);
// _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &parameters, &_DeviceInterface);
// Check some caps
D3DCAPS9 caps;
@ -1794,9 +1794,9 @@ bool CDriverD3D::isActive ()
// ***************************************************************************
void* CDriverD3D::getDisplay()
nlWindow CDriverD3D::getDisplay()
{
return (void*)_HWnd;
return _HWnd;
}
// ***************************************************************************

View file

@ -749,7 +749,7 @@ public:
virtual bool initVertexBufferHard(uint agpMem, uint vramMem);
// Windows interface
virtual void* getDisplay();
virtual nlWindow getDisplay();
virtual emptyProc getWindowProc();
virtual NLMISC::IEventEmitter *getEventEmitter();
virtual void getWindowSize (uint32 &width, uint32 &height);

View file

@ -1,4 +1,8 @@
FILE(GLOB SRC *.cpp *.h *.def)
IF(WITH_COCOA)
FILE(GLOB MAC_SRC mac/*.h mac/*.m mac/*.mm mac/*.cpp)
SET(SRC ${SRC} ${MAC_SRC})
ENDIF(WITH_COCOA)
IF(WIN32)
SET(NLDRV_OGL_LIB "nel_drv_opengl_win")
@ -25,11 +29,25 @@ IF(WIN32)
LINK_FLAGS "/NODEFAULTLIB:libcmt")
ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS)
ELSE(WIN32)
IF(APPLE)
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON})
IF(WITH_COCOA)
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA})
ELSE(WITH_COCOA)
# NOTE: I know, those hardcoded things are evil. But FindOpenGL on Mac
# simply does not look for X11's OpenGL, just for the native one.
INCLUDE_DIRECTORIES("/usr/X11/include")
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB}
"-L/usr/X11/lib" "-lGL" ${X11_LIBRARIES})
ENDIF(WITH_COCOA)
ELSE(APPLE)
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIBRARIES})
IF(XF86VidMode_FOUND)
INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR})
ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS})
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XF86VidMode_LIBRARY})
ENDIF(XF86VidMode_FOUND)
ENDIF(APPLE)
ENDIF(WIN32)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})

View file

@ -27,12 +27,18 @@
# include <windows.h>
# include <windowsx.h>
# include <string>
#else // NL_OS_UNIX
# include <GL/gl.h>
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# define GL_GLEXT_LEGACY
# include <OpenGL/gl.h>
# include "mac/glext.h"
# include "mac/cocoa_adapter.h"
#elif defined (NL_OS_UNIX)
# include <GL/gl.h>
# include <GL/glx.h>
#endif // NL_OS_UNIX
#include <vector>
#include <GL/gl.h>
#include "nel/3d/viewport.h"
#include "nel/3d/scissor.h"
@ -282,15 +288,18 @@ CDriverGL::CDriverGL()
_hDC = NULL;
_NeedToRestaureGammaRamp = false;
_Interval = 1;
#elif defined (NL_OS_UNIX) // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::ctor();
#elif defined (NL_OS_UNIX)
cursor = None;
#ifdef XF86VIDMODE
# ifdef XF86VIDMODE
// zero the old screen mode
memset(&_OldScreenMode, 0, sizeof(_OldScreenMode));
#endif //XF86VIDMODE
# endif //XF86VIDMODE
#endif // NL_OS_UNIX
_FullScreen= false;
@ -315,8 +324,6 @@ CDriverGL::CDriverGL()
for(i=0;i<MaxLight;i++)
_LightDirty[i]= false;
_CurrentGlNormalize= false;
_ForceNormalize= false;
@ -414,6 +421,10 @@ CDriverGL::~CDriverGL()
{
H_AUTO_OGL(CDriverGL_CDriverGLDtor)
release();
#if defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::dtor();
#endif
}
// ***************************************************************************
@ -462,7 +473,11 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc)
// ati specific : try to retrieve driver version
retrieveATIDriverVersion();
#else
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
return NL3D::MAC::init(windowIcon, exitFunc);
#elif defined (NL_OS_UNIX)
dpy = XOpenDisplay(NULL);
if (dpy == NULL)
@ -747,7 +762,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
return false;
}
/* After determining a compatible pixel format, the next step is to create a pbuffer of the
chosen format. Fortunately this step is fairly easy, as you merely select one of the formats
returned in the list in step #2 and call the function: */
@ -873,7 +887,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
_FullScreen= false;
if (wnd)
{
_hWnd=(HWND)wnd;
_hWnd=wnd;
_DestroyWindow=false;
}
else
@ -1027,7 +1041,11 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
nlinfo(e.what());
}
#elif defined(NL_OS_UNIX) // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::setDisplay(wnd, mode, show, resizeable);
#elif defined (NL_OS_UNIX)
static int sAttribList16bpp[] =
{
@ -1093,22 +1111,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
XSetWindowAttributes attr;
attr.background_pixel = BlackPixel(dpy, DefaultScreen(dpy));
#ifdef XF86VIDMODE
// If we're going to attempt fullscreen, we need to set redirect to True,
// This basically places the window with no borders in the top left
// corner of the screen.
if (mode.Windowed)
{
attr.override_redirect = False;
}
else
{
attr.override_redirect = True;
}
#else
attr.override_redirect = False;
#endif
int attr_flags = CWOverrideRedirect | CWBackPixel;
@ -1136,6 +1139,8 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
XChangeWindowAttributes(dpy, win, attr_flags, &attr);
}
const char *title="NeL window";
XSizeHints size_hints;
size_hints.x = 0;
size_hints.y = 0;
@ -1147,13 +1152,14 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
size_hints.max_width = width;
size_hints.max_height = height;
#ifdef X_HAVE_UTF8_STRING
Xutf8SetWMProperties (dpy, win, (char*)title, (char*)title, NULL, 0, &size_hints, NULL, NULL);
#else
XTextProperty text_property;
// FIXME char*s are created as const char*, but that doesn't work
// with XStringListToTextProperty()'s char** ...
const char *title="NeL window";
XStringListToTextProperty((char**)&title, 1, &text_property);
XSetWMProperties (dpy, win, &text_property, &text_property, 0, 0, &size_hints, 0, 0);
#endif
glXMakeCurrent (dpy, win, ctx);
XMapRaised (dpy, win);
@ -1166,66 +1172,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
// XEvent event;
// XIfEvent(dpy, &event, WaitForNotify, (char *)this);
#ifdef XF86VIDMODE
if (!mode.Windowed)
{
// Set window to the right size, map it to the display, and raise it to the front
XResizeWindow(dpy, win, width, height);
XMapRaised(dpy, win);
XRaiseWindow(dpy, win);
// grab the mouse and keyboard on the fullscreen window
if ((XGrabPointer(dpy, win, True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime) != GrabSuccess) ||
(XGrabKeyboard(dpy, win, True, GrabModeAsync, GrabModeAsync, CurrentTime) != 0) )
{
// Until I work out how to deal with this nicely, it just gives
// an error and exits the prorgam.
nlerror("Unable to grab keyboard and mouse");
}
else
{
// Save the old screen mode and dotclock and viewport
memset(&_OldScreenMode, 0, sizeof(_OldScreenMode));
XF86VidModeGetModeLine(dpy, DefaultScreen(dpy), &_OldDotClock, &_OldScreenMode);
XF86VidModeGetViewPort(dpy, DefaultScreen(dpy), &_OldX, &_OldY);
// Get a list of modes, search for an appropriate one.
XF86VidModeModeInfo **modes;
int nmodes;
if (XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &nmodes, &modes))
{
int mode_index = -1; // Gah, magic numbers all bad.
for (int i = 0; i < nmodes; i++)
{
nldebug("3D: Available mode - %dx%d", modes[i]->hdisplay, modes[i]->vdisplay);
if(modes[i]->hdisplay == width && modes[i]->vdisplay == height)
{
mode_index = i;
break;
}
}
// Switch to the mode
if (mode_index != -1)
{
if(XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), modes[mode_index]))
{
nlinfo("3D: Switching to mode %dx%d", modes[mode_index]->hdisplay, modes[mode_index]->vdisplay);
XF86VidModeSetViewPort(dpy, DefaultScreen(dpy), 0, 0);
_FullScreen = true;
}
}
else
{
// This is a problem, since we've nuked the border from
// window in the setup stage, until I work out how
// to get it back (recreate window? seems excessive)
nlerror("Couldn't find an appropriate mode %dx%d", width, height);
}
}
}
}
#endif // XF86VIDMODE
setMode(mode);
#endif // NL_OS_UNIX
@ -1270,7 +1217,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
_UserLightEnable[i]= false;
// init _DriverGLStates
_DriverGLStates.init(_Extensions.ARBTextureCubeMap, _Extensions.NVTextureRectangle, _MaxDriverLight);
_DriverGLStates.init(_Extensions.ARBTextureCubeMap, (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle), _MaxDriverLight);
// Init OpenGL/Driver defaults.
@ -1291,7 +1238,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
glDisable(GL_NORMALIZE);
glDisable(GL_COLOR_SUM_EXT);
_CurrViewport.init(0.f, 0.f, 1.f, 1.f);
_CurrScissor.initFullScreen();
_CurrentGlNormalize= false;
@ -1310,8 +1256,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if(_Extensions.EXTSeparateSpecularColor)
{
glLightModeli((GLenum)GL_LIGHT_MODEL_COLOR_CONTROL_EXT, GL_SEPARATE_SPECULAR_COLOR_EXT);
}
_VertexProgramEnabled= false;
@ -1433,8 +1377,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
params[0]=0; params[1]=0; params[2]=0; params[3]=1;
glTexGenfv(GL_Q, GL_OBJECT_PLANE, params);
glTexGenfv(GL_Q, GL_EYE_PLANE, params);
}
resetTextureShaders();
@ -1448,7 +1390,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
// use enableLighting(0....), to get normal behaviour
_DriverGLStates.enableLight(0, true);
_Initialized = true;
_ForceDXTCCompression= false;
@ -1472,7 +1413,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
_EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL);
_EVSColorHandle = nglBindParameterEXT(GL_CURRENT_COLOR);
if (!_EVSPositionHandle || !_EVSNormalHandle || !_EVSColorHandle)
{
nlwarning("Unable to bind input parameters for use with EXT_vertex_shader, vertex program support is disabled");
@ -1484,8 +1424,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
for(uint k = 0; k < 8; ++k)
{
_EVSTexHandle[k] = nglBindTextureUnitParameterEXT(GL_TEXTURE0_ARB + k, GL_CURRENT_TEXTURE_COORDS);
}
// Other attributes are managed using variant pointers :
// Secondary color
@ -1497,8 +1435,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
// Allocate invariants. One assitionnal variant is needed for fog coordinate if fog bug is not fixed in driver version
_EVSConstantHandle = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_INVARIANT_EXT, GL_FULL_RANGE_EXT, _EVSNumConstant + (_ATIFogRangeFixed ? 0 : 1));
if (_EVSConstantHandle == 0)
{
nlwarning("Unable to allocate constants for EXT_vertex_shader, vertex program support is disabled");
@ -1530,6 +1466,37 @@ static void modifyStyle (HWND hWnd, int nStyleOffset, LONG_PTR dwRemove, LONG_PT
}
#endif
// --------------------------------------------------
void CDriverGL::switchBackToOldMode()
{
#ifdef NL_OS_WINDOWS
ChangeDisplaySettings(&_OldScreenMode, 0);
#elif defined(XF86VIDMODE)
XF86VidModeModeInfo info;
nlinfo("3D: Switching back to original mode");
// This is UGLY
info.dotclock = _OldDotClock;
info.hdisplay = _OldScreenMode.hdisplay;
info.hsyncstart = _OldScreenMode.hsyncstart;
info.hsyncend = _OldScreenMode.hsyncend;
info.htotal = _OldScreenMode.htotal;
info.vdisplay = _OldScreenMode.vdisplay;
info.vsyncstart = _OldScreenMode.vsyncstart;
info.vsyncend = _OldScreenMode.vsyncend;
info.vtotal = _OldScreenMode.vtotal;
info.flags = _OldScreenMode.flags;
info.privsize = _OldScreenMode.privsize;
info.c_private = _OldScreenMode.c_private;
nlinfo("3D: Switching back mode to %dx%d", info.hdisplay, info.vdisplay);
XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), &info);
nlinfo("3D: Switching back viewport to %d,%d",_OldX, _OldY);
XF86VidModeSetViewPort(dpy, DefaultScreen(dpy), _OldX, _OldY);
#endif // XF86VIDMODE
}
// --------------------------------------------------
bool CDriverGL::setMode(const GfxMode& mode)
{
@ -1539,7 +1506,7 @@ bool CDriverGL::setMode(const GfxMode& mode)
{
if (_FullScreen)
{
ChangeDisplaySettings (NULL,0);
switchBackToOldMode();
modifyStyle(_hWnd, GWL_STYLE, WS_POPUP, WS_OVERLAPPEDWINDOW+WS_CLIPCHILDREN+WS_CLIPSIBLINGS);
}
_WindowWidth = mode.Width;
@ -1622,9 +1589,86 @@ bool CDriverGL::setMode(const GfxMode& mode)
_WindowX = clientRect.left;
_WindowY = clientRect.top;
_FullScreen = !mode.Windowed;
#else
// TODO linux version !!!
#endif
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined(NL_OS_UNIX)
#ifdef XF86VIDMODE
if (!mode.Windowed)
{
// Store old mdoe in order to restore it when leaving fullscreen
if (mode.Windowed == _FullScreen)
{
memset(&_OldScreenMode, 0, sizeof(_OldScreenMode));
XF86VidModeGetModeLine(dpy, DefaultScreen(dpy), &_OldDotClock, &_OldScreenMode);
XF86VidModeGetViewPort(dpy, DefaultScreen(dpy), &_OldX, &_OldY);
}
// Find the requested mode and use it
XF86VidModeModeInfo **modes;
int nmodes;
if (XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &nmodes, &modes))
{
for (int i = 0; i < nmodes; i++)
{
nldebug("3D: Available mode - %dx%d", modes[i]->hdisplay, modes[i]->vdisplay);
if(modes[i]->hdisplay == mode.Width && modes[i]->vdisplay == mode.Height)
{
if(XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), modes[i]))
{
nlinfo("3D: Switching to mode %dx%d", modes[i]->hdisplay, modes[i]->vdisplay);
XF86VidModeSetViewPort(dpy, DefaultScreen(dpy), 0, 0);
}
break;
}
}
}
}
else if (mode.Windowed == _FullScreen)
switchBackToOldMode();
#endif // XF86VIDMODE
// Update WM hints (update size and disallow resizing)
XSizeHints size_hints;
size_hints.x = 0;
size_hints.y = 0;
size_hints.width = mode.Width;
size_hints.height = mode.Height;
size_hints.flags = PSize;
if (!mode.Windowed)
{
size_hints.flags = PSize | PMinSize | PMaxSize;
size_hints.min_width = mode.Width;
size_hints.min_height = mode.Height;
size_hints.max_width = mode.Width;
size_hints.max_height = mode.Height;
}
XSetWMNormalHints(dpy, win, &size_hints);
// Toggle fullscreen
if (mode.Windowed == _FullScreen)
{
XEvent xev;
memset(&xev, 0, sizeof(xev));
xev.type = ClientMessage;
xev.xclient.window = win;
xev.xclient.message_type = XInternAtom(dpy, "_NET_WM_STATE", false);
xev.xclient.format = 32;
xev.xclient.data.l[0] = !mode.Windowed;
xev.xclient.data.l[1] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", false);
xev.xclient.data.l[2] = 0;
XSendEvent(dpy, DefaultRootWindow(dpy), false, SubstructureNotifyMask, &xev);
}
_FullScreen = !mode.Windowed;
// Resize and update the window
XResizeWindow(dpy, win, mode.Width, mode.Height);
XMapWindow(dpy, win);
#endif // NL_OS_UNIX
return true;
}
@ -1654,7 +1698,11 @@ bool CDriverGL::getModes(std::vector<GfxMode> &modes)
}
#elif defined(NL_OS_MAC)
getMacModes(modes);
#else
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
# ifdef XF86VIDMODE
int nmodes;
@ -1702,7 +1750,24 @@ bool CDriverGL::getCurrentScreenMode(GfxMode &mode)
mode.Frequency= devmode.dmDisplayFrequency,
mode.Width= (uint16)devmode.dmPelsWidth;
mode.Height= (uint16)devmode.dmPelsHeight;
#else
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Temporary Mac Implementation"
nlwarning("OpenGL Driver: Temporary Mac Implementation");
mode.Depth = 24;
#elif defined(NL_OS_MAC)
/*
TODO this is just a hack to get the ryzom client running on mac os x x11.
the implementation below relies on the vidmode extension which is not
availeble on mac os x's x11. for that reason the color depth value is
hard coded here.
FIXME replace this hack by native cocoa color depth retrieval
*/
nlwarning("FIXME: returning hardcoded color depth of 24bit");
mode.Depth= 24;
#elif defined(NL_OS_UNIX)
# ifdef XF86VIDMODE
sint pixelClock;
@ -1733,7 +1798,11 @@ void CDriverGL::setWindowTitle(const ucstring &title)
{
#ifdef NL_OS_WINDOWS
SetWindowTextW(_hWnd,(WCHAR*)title.c_str());
#elif defined(NL_OS_UNIX) // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::setWindowTitle(title);
#elif defined (NL_OS_UNIX)
XTextProperty text_property;
char *t = (char*)title.toUtf8().c_str();
XStringListToTextProperty(&t, 1, &text_property);
@ -1748,8 +1817,13 @@ void CDriverGL::setWindowPos(uint32 x, uint32 y)
_WindowY = (sint32)y;
#ifdef NL_OS_WINDOWS
SetWindowPos(_hWnd, NULL, _WindowX, _WindowY, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);
#elif defined(NL_OS_UNIX) // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::setWindowPos(x, y);
#elif defined (NL_OS_UNIX)
XMoveWindow(dpy, win, _WindowX, _WindowY);
#endif // NL_OS_WINDOWS
}
@ -1758,7 +1832,11 @@ void CDriverGL::showWindow(bool show)
{
#ifdef NL_OS_WINDOWS
ShowWindow (_hWnd, show ? SW_SHOW:SW_HIDE);
#elif defined(NL_OS_UNIX) // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
if (show)
XMapWindow(dpy, win);
else
@ -1821,13 +1899,17 @@ bool CDriverGL::activate()
{
wglMakeCurrent(_hDC,_hRC);
}
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Temporary Mac Implementation"
nlwarning("OpenGL Driver: Temporary Mac Implementation");
// already done in setDisplay, not needed here - unclean! FIXME
#elif defined (NL_OS_UNIX)
GLXContext nctx=glXGetCurrentContext();
if (nctx != NULL && nctx!=ctx)
{
glXMakeCurrent(dpy, win,ctx);
}
#endif // NL_OS_WINDOWS
return true;
@ -1859,11 +1941,8 @@ bool CDriverGL::clear2D(CRGBA rgba)
H_AUTO_OGL(CDriverGL_clear2D)
glClearColor((float)rgba.R/255.0f,(float)rgba.G/255.0f,(float)rgba.B/255.0f,(float)rgba.A/255.0f);
glClear(GL_COLOR_BUFFER_BIT);
return true;
}
@ -1874,12 +1953,9 @@ bool CDriverGL::clearZBuffer(float zval)
H_AUTO_OGL(CDriverGL_clearZBuffer)
glClearDepth(zval);
_DriverGLStates.enableZWrite(true);
glClear(GL_DEPTH_BUFFER_BIT);
return true;
}
@ -1890,10 +1966,8 @@ bool CDriverGL::clearStencilBuffer(float stencilval)
H_AUTO_OGL(CDriverGL_clearStencilBuffer)
glClearStencil((int)stencilval);
glClear(GL_STENCIL_BUFFER_BIT);
return true;
}
@ -1903,8 +1977,6 @@ void CDriverGL::setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha)
{
H_AUTO_OGL(CDriverGL_setColorMask )
glColorMask (bRed, bGreen, bBlue, bAlpha);
}
// --------------------------------------------------
@ -1994,17 +2066,17 @@ bool CDriverGL::swapBuffers()
if (_VRAMVertexArrayRange) _VRAMVertexArrayRange->updateLostBuffers();
}
#ifdef NL_OS_WINDOWS
SwapBuffers(_hDC);
#else // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::swapBuffers();
#elif defined (NL_OS_UNIX)
glXSwapBuffers(dpy, win);
#endif // NL_OS_WINDOWS
// Activate the default texture environnments for all stages.
//===========================================================
// This is not a requirement, but it ensure a more stable state each frame.
@ -2023,7 +2095,6 @@ bool CDriverGL::swapBuffers()
forceActivateTexEnvColor(stage, env);
}
// Activate the default material.
//===========================================================
// Same reasoning as textures :)
@ -2031,8 +2102,6 @@ bool CDriverGL::swapBuffers()
if (_NVTextureShaderEnabled)
{
glDisable(GL_TEXTURE_SHADER_NV);
_NVTextureShaderEnabled = false;
}
_CurrentMaterial= NULL;
@ -2085,8 +2154,6 @@ bool CDriverGL::release()
// Reset VertexArrayRange.
resetVertexArrayRange();
// delete containers
delete _AGPVertexArrayRange;
delete _VRAMVertexArrayRange;
@ -2121,7 +2188,7 @@ bool CDriverGL::release()
if(_FullScreen)
{
ChangeDisplaySettings(&_OldScreenMode, 0);
switchBackToOldMode();
_FullScreen= false;
}
}
@ -2149,29 +2216,20 @@ bool CDriverGL::release()
}
}
#elif defined (NL_OS_UNIX)// NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#ifdef XF86VIDMODE
#elif defined (NL_OS_UNIX)
if(_FullScreen)
{
XF86VidModeModeInfo info;
nlinfo("3D: Switching back to original mode");
switchBackToOldMode();
// This is a bit ugly - a quick hack to copy the ModeLine structure
// into the modeInfo structure.
memcpy((XF86VidModeModeLine *)((char *)&info + sizeof(info.dotclock)),&_OldScreenMode, sizeof(XF86VidModeModeLine));
info.dotclock = _OldDotClock;
nlinfo("3D: Switching back mode to %dx%d", info.hdisplay, info.vdisplay);
XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), &info);
nlinfo("3D: Switching back viewport to %d,%d",_OldX, _OldY);
XF86VidModeSetViewPort(dpy, DefaultScreen(dpy), _OldX, _OldY);
// Ungrab the keyboard (probably not necessary);
XUnmapWindow(dpy, win);
XSync(dpy, True);
XUngrabKeyboard(dpy, CurrentTime);
}
#endif // XF86VIDMODE
if (ctx)
{
@ -2246,7 +2304,12 @@ void CDriverGL::setupViewport (const class CViewport& viewport)
int clientWidth = _WindowWidth;
int clientHeight = _WindowHeight;
#else // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
uint32 clientWidth, clientHeight;
NL3D::MAC::getWindowSize(clientWidth, clientHeight);
#elif defined (NL_OS_UNIX)
XWindowAttributes win_attributes;
if (!XGetWindowAttributes(dpy, win, &win_attributes))
@ -2318,7 +2381,14 @@ void CDriverGL::setupScissor (const class CScissor& scissor)
int clientWidth = _WindowWidth;
int clientHeight = _WindowHeight;
#else // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
// nlwarning("OpenGL Driver: Temporary Mac Implementation");
int clientWidth = 1024;
int clientHeight = 768;
#elif defined (NL_OS_UNIX)
XWindowAttributes win_attributes;
if (!XGetWindowAttributes(dpy, win, &win_attributes))
@ -2404,6 +2474,10 @@ void CDriverGL::showCursor(bool b)
while (ShowCursor(b) >= 0)
;
}
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
if (b)
@ -2448,6 +2522,10 @@ void CDriverGL::setMousePos(float x, float y)
ClientToScreen (_hWnd, &pt);
SetCursorPos(pt.x, pt.y);
}
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
XWindowAttributes xwa;
XGetWindowAttributes (dpy, win, &xwa);
@ -2479,6 +2557,10 @@ void CDriverGL::getWindowSize(uint32 &width, uint32 &height)
height = (uint32)(_WindowHeight);
}
}
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::getWindowSize(width, height);
#elif defined (NL_OS_UNIX)
XWindowAttributes xwa;
XGetWindowAttributes (dpy, win, &xwa);
@ -2507,6 +2589,10 @@ void CDriverGL::getWindowPos(uint32 &x, uint32 &y)
y = (uint32)(_WindowY);
}
}
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::getWindowPos(x, y);
#elif defined (NL_OS_UNIX)
x = y = 0;
#endif // NL_OS_UNIX
@ -2521,9 +2607,14 @@ bool CDriverGL::isActive()
H_AUTO_OGL(CDriverGL_isActive)
#ifdef NL_OS_WINDOWS
return (IsWindow(_hWnd) != 0);
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
// nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
return true;
#endif // NL_OS_UNIX
return true;
}
uint8 CDriverGL::getBitPerPixel ()
@ -2583,8 +2674,16 @@ void CDriverGL::setCapture (bool b)
ReleaseCapture ();
*/
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
/*
TODO x11 funtion: setCapture
*/
if(b) // capture the cursor.
{
XGrabPointer(dpy, win, True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime);
@ -2673,8 +2772,6 @@ bool CDriverGL::fillBuffer (CBitmap &bitmap)
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glDrawPixels (rect.Width, rect.Height, GL_RGBA, GL_UNSIGNED_BYTE, &(bitmap.getPixels()[0]) );
return true;
}
@ -2746,8 +2843,6 @@ void CDriverGL::setPolygonMode (TPolygonMode mode)
glPolygonMode (GL_FRONT_AND_BACK, GL_POINT);
break;
}
}
@ -2797,8 +2892,6 @@ void CDriverGL::setupFog(float start, float end, CRGBA color)
}
_FogStart = start;
_FogEnd = end;
}
@ -2949,8 +3042,6 @@ void CDriverGL::setMatrix2DForTextureOffsetAddrMode(const uint stage, const floa
nlassert(stage < inlGetNumTextStages() );
_DriverGLStates.activeTextureARB(stage);
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, mat);
}
@ -2971,8 +3062,6 @@ void CDriverGL::enableNVTextureShader(bool enabled)
glDisable(GL_TEXTURE_SHADER_NV);
}
_NVTextureShaderEnabled = enabled;
}
}
@ -3039,9 +3128,14 @@ NLMISC::IMouseDevice *CDriverGL::enableLowLevelMouse(bool enable, bool exclusive
diee->releaseMouse();
return NULL;
}
#else
return NULL;
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
#endif
return NULL;
}
// ***************************************************************************
@ -3068,9 +3162,14 @@ NLMISC::IKeyboardDevice *CDriverGL::enableLowLevelKeyboard(bool enable)
diee->releaseKeyboard();
return NULL;
}
#else
return NULL;
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
#endif
return NULL;
}
// ***************************************************************************
@ -3081,9 +3180,14 @@ NLMISC::IInputDeviceManager *CDriverGL::getLowLevelInputDeviceManager()
if (_EventEmitter.getNumEmitters() < 2) return NULL;
NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
return diee;
#else
return NULL;
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
#endif
return NULL;
}
// ***************************************************************************
@ -3114,7 +3218,11 @@ uint CDriverGL::getDoubleClickDelay(bool hardwareMouse)
}
// try to read the good value from windows
return ::GetDoubleClickTime();
#else
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
// TODO for Linux FIXME: FAKE FIX
return 250;
#endif
@ -3126,6 +3234,7 @@ bool CDriverGL::supportBlendConstantColor() const
H_AUTO_OGL(CDriverGL_supportBlendConstantColor)
return _Extensions.EXTBlendColor;
}
// ***************************************************************************
void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col)
{
@ -3139,9 +3248,8 @@ void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col)
return;
static const float OO255= 1.0f/255;
nglBlendColorEXT(col.R*OO255, col.G*OO255, col.B*OO255, col.A*OO255);
}
// ***************************************************************************
NLMISC::CRGBA CDriverGL::getBlendConstantColor() const
{
@ -3168,11 +3276,8 @@ void CDriverGL::refreshProjMatrixFromGL()
glGetFloatv(GL_PROJECTION_MATRIX, mat);
_GLProjMat.set(mat);
_ProjMatDirty = false;
}
// ***************************************************************************
bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties)
{
@ -3224,7 +3329,11 @@ bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &prop
return false;
}
#else
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
// TODO for Linux: implement CDriverGL::setMonitorColorProperties
nlwarning ("CDriverGL::setMonitorColorProperties not implemented");
@ -3272,7 +3381,6 @@ void CDriverGL::initEMBM()
{
H_AUTO_OGL(CDriverGL_initEMBM)
if (supportEMBM())
{
std::fill(_StageSupportEMBM, _StageSupportEMBM + IDRV_MAT_MAXTEXTURES, false);
@ -3740,7 +3848,6 @@ void CDriverGL::enablePolygonSmoothing(bool smooth)
else
glDisable(GL_POLYGON_SMOOTH);
_PolygonSmooth= smooth;
}
@ -3755,7 +3862,6 @@ bool CDriverGL::isPolygonSmoothingEnabled() const
// ***************************************************************************
void CDriverGL::startProfileVBHardLock()
{
if(_VBHardProfiling)
return;
@ -3770,7 +3876,6 @@ void CDriverGL::startProfileVBHardLock()
// ***************************************************************************
void CDriverGL::endProfileVBHardLock(vector<std::string> &result)
{
if(!_VBHardProfiling)
return;
@ -3809,7 +3914,6 @@ void CDriverGL::endProfileVBHardLock(vector<std::string> &result)
// ***************************************************************************
void CDriverGL::appendVBHardLockProfile(NLMISC::TTicks time, CVertexBuffer *vb)
{
// must allocate a new place?
if(_CurVBHardLockCount>=_VBHardProfiles.size())
{
@ -3853,7 +3957,6 @@ void CDriverGL::profileIBAllocation(std::vector<std::string> &/* result */)
// ***************************************************************************
void CDriverGL::profileVBHardAllocation(std::vector<std::string> &result)
{
result.clear();
result.reserve(1000);
result.push_back(toString("Memory Allocated: %4d Ko in AGP / %4d Ko in VRAM",
@ -3996,9 +4099,13 @@ void CDriverGL::retrieveATIDriverVersion()
}
RegCloseKey(parentKey);
}
#else
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
// TODO for Linux: implement retrieveATIDriverVersion... assuming versions under linux are probably different
#endif
#endif
}
@ -4073,7 +4180,6 @@ bool CDriverGL::activeShader(CShader * /* shd */)
void CDriverGL::startBench (bool wantStandardDeviation, bool quick, bool reset)
{
CHTimer::startBench (wantStandardDeviation, quick, reset);
}
@ -4081,7 +4187,6 @@ void CDriverGL::startBench (bool wantStandardDeviation, bool quick, bool reset)
void CDriverGL::endBench ()
{
CHTimer::endBench ();
}
@ -4089,7 +4194,6 @@ void CDriverGL::endBench ()
void CDriverGL::displayBench (class NLMISC::CLog *log)
{
// diplay
CHTimer::displayHierarchicalByExecutionPathSorted(log, CHTimer::TotalTime, true, 48, 2);
CHTimer::displayHierarchical(log, true, 48, 2);
@ -4112,7 +4216,7 @@ void CDriverGL::checkTextureOn() const
// tmp for debug
CDriverGLStates &dgs = const_cast<CDriverGLStates &>(_DriverGLStates);
uint currTexStage = dgs.getActiveTextureARB();
for(uint k = 0; k < getNbTextureStages(); ++k)
for(uint k = 0; k < this->getNbTextureStages(); ++k)
{
dgs.activeTextureARB(k);
GLboolean flag2D;
@ -4157,7 +4261,7 @@ bool CDriverGL::supportOcclusionQuery() const
bool CDriverGL::supportTextureRectangle() const
{
H_AUTO_OGL(CDriverGL_supportTextureRectangle)
return _Extensions.NVTextureRectangle;
return (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle);
}
// ***************************************************************************

View file

@ -17,7 +17,6 @@
#ifndef NL_DRIVER_OPENGL_H
#define NL_DRIVER_OPENGL_H
#include "nel/misc/types_nl.h"
//#define NL_PROFILE_DRIVER_OGL
@ -31,16 +30,19 @@
# define WIN32_LEAN_AND_MEAN
# define NOMINMAX
# include <windows.h>
#else // NL_OS_UNIX
# include <GL/gl.h>
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# define GL_GLEXT_LEGACY
# include <OpenGL/gl.h>
#elif defined (NL_OS_UNIX)
# define GLX_GLXEXT_PROTOTYPES
# include <GL/gl.h>
# include <GL/glx.h>
# ifdef XF86VIDMODE
# include <X11/extensions/xf86vmode.h>
# endif //XF86VIDMODE
#endif // NL_OS_UNIX
#include <GL/gl.h>
#include "driver_opengl_extension.h"
#include "nel/3d/driver.h"
@ -68,6 +70,8 @@
#ifdef NL_OS_WINDOWS
#include "nel/misc/win_event_emitter.h"
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
#include "mac/cocoa_event_emitter.h"
#elif defined (NL_OS_UNIX)
#include "unix_event_emitter.h"
#endif // NL_OS_UNIX
@ -299,12 +303,14 @@ public:
/// Show or hide the NeL window
virtual void showWindow(bool show);
virtual void* getDisplay()
virtual nlWindow getDisplay()
{
#ifdef NL_OS_WINDOWS
return (void*)_hWnd;
#else // NL_OS_WINDOWS
return _hWnd;
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
return NULL;
#elif defined(NL_OS_UNIX)
return win;
#endif // NL_OS_WINDOWS
}
@ -673,6 +679,9 @@ private:
// Off-screen rendering in Dib section
HPBUFFERARB _PBuffer;
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NLMISC::CCocoaEventEmitter _EventEmitter;
#elif defined (NL_OS_UNIX)
Display *dpy;
@ -832,6 +841,8 @@ private:
bool _CurrentGlNormalize;
private:
void switchBackToOldMode();
// Get the proj matrix setupped in GL
void refreshProjMatrixFromGL();

View file

@ -44,7 +44,7 @@ void *nglGetProcAddress(const char *name)
free (symbolName);
return symbol ? NSAddressOfSymbol (symbol) : NULL;
}
#else // NL_OS_WINDOWS
#elif defined (NL_OS_UNIX)
void (*nglGetProcAddress(const char *procName))()
{
return glXGetProcAddressARB((const GLubyte *)procName);
@ -1143,6 +1143,22 @@ static bool setupNVTextureRectangle(const char *glext)
return true;
}
// ***************************************************************************
static bool setupEXTTextureRectangle(const char *glext)
{
H_AUTO_OGL(setupEXTTextureRectangle);
CHECK_EXT("GL_EXT_texture_rectangle");
return true;
}
// ***************************************************************************
static bool setupARBTextureRectangle(const char *glext)
{
H_AUTO_OGL(setupARBTextureRectangle);
CHECK_EXT("GL_ARB_texture_rectangle");
return true;
}
// ***************************************************************************
static bool setupFrameBufferObject(const char *glext)
{
@ -1311,6 +1327,12 @@ void registerGlExtensions(CGlExtensions &ext)
// Check GL_NV_texture_rectangle
ext.NVTextureRectangle = setupNVTextureRectangle(glext);
// Check GL_EXT_texture_rectangle
ext.EXTTextureRectangle = setupEXTTextureRectangle(glext);
// Check GL_ARB_texture_rectangle
ext.ARBTextureRectangle = setupARBTextureRectangle(glext);
// Check GL_EXT_framebuffer_object
ext.FrameBufferObject = setupFrameBufferObject(glext);

View file

@ -24,13 +24,18 @@
# define WIN32_LEAN_AND_MEAN
# define NOMINMAX
# include <windows.h>
#else // NL_OS_UNIX
# include <GL/gl.h>
# include <GL/glext.h> // Please download it from http://www.opengl.org/registry/
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# define GL_GLEXT_LEGACY
# include <OpenGL/gl.h>
# include "mac/glext.h"
#elif defined (NL_OS_UNIX)
# include <GL/gl.h>
# include <GL/glext.h> // Please download it from http://www.opengl.org/registry/
# include <GL/glx.h>
#endif // NL_OS_UNIX
#include <GL/gl.h>
#include <GL/glext.h> // Please download it from http://www.opengl.org/registry/
#ifndef GL_GLEXT_VERSION
# error "I need a newer <GL/glext.h>. Please download it from http://www.opengl.org/registry/"
#endif // GL_nGLEXT_VERSION
@ -70,6 +75,8 @@ struct CGlExtensions
bool NVTextureShader;
bool NVOcclusionQuery;
bool NVTextureRectangle;
bool EXTTextureRectangle;
bool ARBTextureRectangle;
bool FrameBufferObject;
bool PackedDepthStencil;
// true if NVVertexProgram and if we know that VP is emulated
@ -181,6 +188,8 @@ public:
result += ARBTextureCubeMap ? "ARBTextureCubeMap " : "";
result += ATIEnvMapBumpMap ? "ATIEnvMapBumpMap " : "";
result += NVTextureRectangle ? "NVTextureRectangle " : "";
result += EXTTextureRectangle ? "EXTTextureRectangle " : "";
result += ARBTextureRectangle ? "ARBTextureRectangle " : "";
result += ARBTextureNonPowerOfTwo ? "ARBTextureNonPowerOfTwo " : "";
result += "texture stages(*) = ";
result += NLMISC::toString(NbTextureStages);

View file

@ -20,8 +20,14 @@
#include "nel/misc/types_nl.h"
#include <GL/gl.h>
#include <GL/glext.h> // Please download it from http://www.opengl.org/registry/
#ifdef NL_MAC_NATIVE
# define GL_GLEXT_LEGACY
# include <OpenGL/gl.h>
# include "mac/glext.h"
#else
# include <GL/gl.h>
# include <GL/glext.h> // Please download it from http://www.opengl.org/registry/
#endif
#ifdef __cplusplus
extern "C" {

View file

@ -97,7 +97,6 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode
GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, GL_DOT_PRODUCT_DEPTH_REPLACE_NV
};
if (!tex || !tex->isTextureCube())
{
glenum = glTex2dAddrModesNV[(uint) mode];
@ -165,7 +164,6 @@ void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
{
glMatrixMode(GL_TEXTURE);
// for each stage, setup the texture matrix if needed
uint newMask = (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) >> IDRV_MAT_USER_TEX_FIRST_BIT;
uint shiftMask = 1;
@ -176,7 +174,6 @@ void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
_DriverGLStates.activeTextureARB(k);
glLoadMatrixf(mat.getUserTexMat(k).get());
_UserTexMatEnabled |= shiftMask;
}
else
@ -189,15 +186,12 @@ void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
_DriverGLStates.activeTextureARB(k);
glLoadIdentity();
_UserTexMatEnabled &= ~shiftMask;
}
}
shiftMask <<= 1;
}
glMatrixMode(GL_MODELVIEW);
}
}
@ -208,7 +202,6 @@ void CDriverGL::disableUserTextureMatrix()
{
glMatrixMode(GL_TEXTURE);
uint k = 0;
do
{
@ -217,16 +210,12 @@ void CDriverGL::disableUserTextureMatrix()
_DriverGLStates.activeTextureARB(k);
glLoadIdentity();
_UserTexMatEnabled &= ~ (1 << k);
}
++k;
}
while (_UserTexMatEnabled != 0);
glMatrixMode(GL_MODELVIEW);
}
}
@ -259,7 +248,6 @@ void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr<
convTexAddr(textures[stage], (CMaterial::TTexAddressingMode) addressingModes[stage], glAddrMode);
if (glAddrMode != _CurrentTexAddrMode[stage]) // addressing mode different from the one in the device?
{
_DriverGLStates.activeTextureARB(stage);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, glAddrMode);
@ -404,7 +392,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
if (mat.getTexture(stage))
}*/
// Activate the textures.
// Do not do it for Lightmap and per pixel lighting , because done in multipass in a very special fashion.
// This avoid the useless multiple change of texture states per lightmapped object.
@ -490,16 +477,13 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
}
else
{
// Color unlit part.
CRGBA col= mat.getColor();
glColor4ub(col.R, col.G, col.B, col.A);
_DriverGLStates.setVertexColorLighted(false);
}
// Fog Part.
//=================
@ -745,7 +729,6 @@ void CDriverGL::setupLightMapPass(uint pass)
static uint32 packedColorGrey= CRGBA(128,128,128,128).getPacked();
static GLfloat glcolGrey[4]= {0.5f,0.5f,0.5f,1.f};
// No lightmap or all blacks??, just setup "black texture" for stage 0.
if(_NLightMaps==0)
{
@ -760,7 +743,6 @@ void CDriverGL::setupLightMapPass(uint pass)
// setup color to 0 => blackness. in emissive cause texture can still be lighted by dynamic light
_DriverGLStates.setEmissive(packedColorBlack, glcolBlack);
// Setup gen tex off
_DriverGLStates.activeTextureARB(0);
_DriverGLStates.setTexGenMode(0, 0);
@ -900,8 +882,6 @@ void CDriverGL::setupLightMapPass(uint pass)
// Arg3.
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR);
}
else
{
@ -920,8 +900,6 @@ void CDriverGL::setupLightMapPass(uint pass)
// Arg2.
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT );
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);
}
}
}
@ -965,8 +943,6 @@ void CDriverGL::setupLightMapPass(uint pass)
{
// Multiply x 2
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2);
}
}
}
@ -988,8 +964,6 @@ void CDriverGL::setupLightMapPass(uint pass)
{
static GLfloat blackFog[4]= {0,0,0,0};
glFogfv(GL_FOG_COLOR, blackFog);
}
// Blend is different if the material is blended or not
@ -1051,8 +1025,6 @@ void CDriverGL::setupLightMapPass(uint pass)
// no need to reset for pass after 1, since same than prec pass (black)!
else if(pass==1)
_DriverGLStates.setDiffuse(packedColorBlack, glcolBlack);
}
// ***************************************************************************
void CDriverGL::endLightMapMultiPass()
@ -1081,8 +1053,6 @@ void CDriverGL::endLightMapMultiPass()
{
_DriverGLStates.activeTextureARB(i);
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1);
}
}
}
@ -1180,8 +1150,6 @@ void CDriverGL::setupSpecularEnd()
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
}
// ***************************************************************************
@ -1286,8 +1254,6 @@ void CDriverGL::setupSpecularPass(uint pass)
// Arg3.
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO );
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA);
}
}
else if (_Extensions.ATITextureEnvCombine3)
@ -1340,8 +1306,6 @@ void CDriverGL::setupSpecularPass(uint pass)
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO );
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_ALPHA);
}
}
else
{ // We have to do it in 2 passes
@ -1390,8 +1354,6 @@ void CDriverGL::setupSpecularPass(uint pass)
activateTexEnvMode(1, env);
}
}
}
// ***************************************************************************
void CDriverGL::endSpecularMultiPass()
@ -1470,14 +1432,12 @@ CTextureCube *CDriverGL::getSpecularCubeMap(uint exp)
_SpecularTextureCubes.resize(MaxExponent);
}
NLMISC::clamp(exp, 1u, (MaxExponent - 1));
uint cubeMapIndex = expToCubeMap[exp];
nlassert(cubeMapIndex < numCubeMap);
if (_SpecularTextureCubes[cubeMapIndex] != NULL) // has the cube map already been cted ?
{
return _SpecularTextureCubes[cubeMapIndex];
@ -1607,8 +1567,6 @@ void CDriverGL::setupPPLPass(uint pass)
// Arg3 = White (= ~ Black)
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR);
}
else // use ATI extension
{
@ -1624,8 +1582,6 @@ void CDriverGL::setupPPLPass(uint pass)
// Arg2 = Primary color (other light diffuse and
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);
}
}
activateTexEnvColor(0, _PPLightDiffuseColor);
@ -1678,8 +1634,6 @@ void CDriverGL::setupPPLPass(uint pass)
// Arg3 = 0
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_COLOR);
}
else // ATI EnvCombine3
{
@ -1707,8 +1661,6 @@ void CDriverGL::setupPPLPass(uint pass)
// Arg1 = 0
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_COLOR);
}
}
activateTexEnvColor(2, _PPLightSpecularColor);
@ -1785,8 +1737,6 @@ void CDriverGL::setupPPLNoSpecPass(uint pass)
// Arg3 = White (= ~ Black)
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR);
}
else
{
@ -1802,8 +1752,6 @@ void CDriverGL::setupPPLNoSpecPass(uint pass)
// Arg1 = Primary color (other light diffuse and
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);
}
}
activateTexEnvColor(0, _PPLightDiffuseColor);
@ -1860,7 +1808,6 @@ inline void CDriverGL::setupCausticsSecondTex(uint stage)
// ***************************************************************************
void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass)
{
nlassert(mat.getShader() == CMaterial::Caustics);
if (inlGetNumTextStages() == 1 || !_Extensions.ARBTextureCubeMap)
@ -1873,8 +1820,6 @@ void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass)
nlassert(pass == 0);
setupCausticsFirstTex(mat);
}
else if (inlGetNumTextStages() == 2) /// do in in 2 pass
{
@ -1888,8 +1833,6 @@ void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass)
/// setup additif blending
_DriverGLStates.enableBlend();
_DriverGLStates.blendFunc(pShader->SrcBlend, pShader->DstBlend);
}
}
}
@ -2002,8 +1945,6 @@ void CDriverGL::setupCloudPass (uint /* pass */)
glEnable(GL_FRAGMENT_SHADER_ATI);
float cst[4] = { 0.f, 0.f, 0.f, mat.getColor().A / 255.f };
nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst);
/*
_DriverGLStates.activeTextureARB(0);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
@ -2188,7 +2129,6 @@ void CDriverGL::setupWaterPassARB(const CMaterial &mat)
nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ARBWaterShader[(_FogEnabled ? 1 : 0) | (mat.getTexture(3) != NULL ? 2 : 0)]);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
// setup the constant
if (mat.getTexture(0) && mat.getTexture(0)->isBumpMap())
{
@ -2233,7 +2173,6 @@ void CDriverGL::setupWaterPassARB(const CMaterial &mat)
}
}
}
}
@ -2291,14 +2230,10 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat)
float factor = tb->getNormalizationFactor();
float tsMatrix[4] = { 0.25f * factor, 0.f, 0.f, 0.25f * factor };
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, tsMatrix);
}
else
{
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, IdentityTexMat);
}
}
tex = mat.getTexture(1);
@ -2314,14 +2249,10 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat)
float factor = tb->getNormalizationFactor();
float tsMatrix[4] = { factor, 0.f, 0.f, factor };
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, tsMatrix);
}
else
{
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, IdentityTexMat);
}
}
tex = mat.getTexture(2);

View file

@ -19,7 +19,13 @@
#include "nel/misc/types_nl.h"
#include "nel/3d/vertex_buffer.h"
#include <GL/gl.h>
#ifdef NL_MAC_NATIVE
# define GL_GLEXT_LEGACY
# include <OpenGL/gl.h>
#else
# include <GL/gl.h>
#endif
namespace NL3D

View file

@ -1966,7 +1966,11 @@ bool CDriverGL::getRenderTargetSize (uint32 &width, uint32 &height)
#ifdef NL_OS_WINDOWS
width = _WindowWidth;
height = _WindowHeight;
#else // NL_OS_WINDOWS
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
# warning "OpenGL Driver: Missing Mac Implementation"
nlwarning("OpenGL Driver: Missing Mac Implementation");
#elif defined (NL_OS_UNIX)
XWindowAttributes win_attributes;
if (!XGetWindowAttributes(dpy, win, &win_attributes))
throw EBadDisplay("Can't get window attributes.");

View file

@ -0,0 +1,79 @@
/*
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NL_DRIVER_OPENGL_MAC_COCOA_ADAPTER_H
#define NL_DRIVER_OPENGL_MAC_COCOA_ADAPTER_H
#include "nel/misc/types_nl.h"
#include "nel/misc/event_server.h"
#include "nel/3d/driver.h"
#include "cocoa_event_emitter.h"
/*
* this cocoa adapter is a helper to call functions executing obj-c code
* from driver_opengl.cpp
*
* please see this as a temporary solution... there is some stuff concerning
* driver refactoring going on anyway as far as i know
*
* this can as well be seen as a preparation to pull platform specific code
* out of driver_opengl.cpp ;)
*
* btw: we cannot simply use a c++ class here, because then NSWindow* and friends
* would be members, but then we would need to add obj-c code here using an
* include or a forward declaration. this again would break compiling cpp files
* including this one (eg. driver_opengl.cpp)
*/
namespace NL3D { namespace MAC {
/// mac specific stuff while calling CDriverGL::CDriverGL()
void ctor();
/// mac specific stuff while calling CDriverGL::~CDriverGL()
void dtor();
/// mac specific stuff while calling CDriverGL::init()
bool init(uint windowIcon = 0, emptyProc exitFunc = 0);
/// mac specific stuff while calling CDriverGL::setDisplay()
bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
/// mac specific stuff while calling CDriverGL::getWindowSize()
void getWindowSize(uint32 &width, uint32 &height);
/// mac specific stuff while calling CDriverGL::getWindowPos()
void getWindowPos(uint32 &x, uint32 &y);
/// mac specific stuff while calling CDriverGL::setWindowPos()
void setWindowPos(uint32 x, uint32 y);
/// mac specific stuff while calling CDriverGL::setWindowTitle()
void setWindowTitle(const ucstring &title);
/// mac specific stuff while calling CDriverGL::swapBuffers()
void swapBuffers();
/// mac specific stuff while calling CCocoaEventEmitter::submitEvents()
void submitEvents(NLMISC::CEventServer& server,
bool allWindows, NLMISC::CCocoaEventEmitter* eventEmitter);
}}
#endif

View file

@ -0,0 +1,474 @@
/*
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cocoa_adapter.h"
#include "nel/misc/events.h"
#include "nel/3d/driver.h"
#include "cocoa_event_emitter.h"
#include "cocoa_opengl_view.h"
#include "cocoa_window.h"
// virtual key codes are only defined here. we still do not need to link carbon
// see: http://lists.apple.com/archives/Cocoa-dev/2009/May/msg01180.html
#include <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
namespace NL3D { namespace MAC {
static NSApplication* g_app = 0;
static NSAutoreleasePool* g_pool = 0;
static CocoaWindow* g_window = 0;
static CocoaOpenGLView* g_glview = 0;
static NSOpenGLContext* g_glctx = 0;
void ctor()
{
nldebug("mac cpp bridge called");
// create a pool, cocoa code would leak memory otherwise
g_pool = [[NSAutoreleasePool alloc] init];
// init the application object
g_app = [NSApplication sharedApplication];
}
void dtor()
{
nldebug("mac cpp bridge called");
// release the pool
[g_pool release];
}
bool init(uint windowIcon, emptyProc exitFunc)
{
nldebug("mac cpp bridge called with %u %u", windowIcon, exitFunc);
return true;
}
bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable)
{
nldebug("mac cpp bridge called with %u %u %u %u", wnd, &mode, show, resizeable);
// create a window
/* TODO: NSBackingStoreBuffered ??? */
g_window = [[CocoaWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1024, 768)
styleMask:NSTitledWindowMask | NSResizableWindowMask |
NSClosableWindowMask | NSMiniaturizableWindowMask
backing:NSBackingStoreBuffered
defer:NO];
// setup opengl settings
NSOpenGLPixelFormatAttribute att[] =
{
NSOpenGLPFAWindow,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAColorSize, 24,
NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFADepthSize, 24,
NSOpenGLPFANoRecovery,
NSOpenGLPFAAccelerated,
0
};
// put the settings into a format object
NSOpenGLPixelFormat* format =
[[NSOpenGLPixelFormat alloc] initWithAttributes:att];
// create a opengl view with the created format
g_glview = [[CocoaOpenGLView alloc]
initWithFrame:NSMakeRect(0, 0, 1024, 768) pixelFormat: format];
// create a opengl context for the view
g_glctx = [g_glview openGLContext];
// setup some stuff in the window
[g_window setContentView:g_glview];
[g_window makeKeyAndOrderFront:nil];
[g_window setAcceptsMouseMovedEvents:YES];
// make the views opengl context the currrent one
[g_glctx makeCurrentContext];
// tell the application that we are running now
[g_app finishLaunching];
// free the pixel format object
[format release];
return true;
}
void getWindowSize(uint32 &width, uint32 &height)
{
NSRect rect = [g_glview bounds];
width = rect.size.width;
height = rect.size.height;
}
void getWindowPos(uint32 &x, uint32 &y)
{
NSRect screenRect = [[g_window screen] frame];
NSRect windowRect = [g_window frame];
x = windowRect.origin.x;
y = screenRect.size.height - windowRect.size.height - windowRect.origin.y;
}
void setWindowPos(uint32 x, uint32 y)
{
NSRect screenRect = [[g_window screen] frame];
NSRect windowRect = [g_window frame];
y = screenRect.size.height - y;
[g_window setFrameTopLeftPoint:NSMakePoint(x, y)];
}
void setWindowTitle(const ucstring &title)
{
[g_window setTitle:[NSString stringWithUTF8String:title.toUtf8().c_str()]];
}
void swapBuffers()
{
[g_glctx flushBuffer];
}
/*
TODO: this function has to be moved to a more central place to handle key
mapping on mac x11 as well
*/
NLMISC::TKey virtualKeycodeToNelKey(unsigned short keycode)
{
switch(keycode)
{
case kVK_ANSI_0: return NLMISC::Key0;
case kVK_ANSI_1: return NLMISC::Key1;
case kVK_ANSI_2: return NLMISC::Key2;
case kVK_ANSI_3: return NLMISC::Key3;
case kVK_ANSI_4: return NLMISC::Key4;
case kVK_ANSI_5: return NLMISC::Key6;
case kVK_ANSI_6: return NLMISC::Key5;
case kVK_ANSI_7: return NLMISC::Key7;
case kVK_ANSI_8: return NLMISC::Key8;
case kVK_ANSI_9: return NLMISC::Key9;
case kVK_ANSI_A: return NLMISC::KeyA;
case kVK_ANSI_B: return NLMISC::KeyB;
case kVK_ANSI_C: return NLMISC::KeyC;
case kVK_ANSI_D: return NLMISC::KeyD;
case kVK_ANSI_E: return NLMISC::KeyE;
case kVK_ANSI_F: return NLMISC::KeyF;
case kVK_ANSI_G: return NLMISC::KeyG;
case kVK_ANSI_H: return NLMISC::KeyH;
case kVK_ANSI_I: return NLMISC::KeyI;
case kVK_ANSI_J: return NLMISC::KeyJ;
case kVK_ANSI_K: return NLMISC::KeyK;
case kVK_ANSI_L: return NLMISC::KeyL;
case kVK_ANSI_M: return NLMISC::KeyM;
case kVK_ANSI_N: return NLMISC::KeyN;
case kVK_ANSI_O: return NLMISC::KeyO;
case kVK_ANSI_P: return NLMISC::KeyP;
case kVK_ANSI_Q: return NLMISC::KeyQ;
case kVK_ANSI_R: return NLMISC::KeyR;
case kVK_ANSI_S: return NLMISC::KeyS;
case kVK_ANSI_T: return NLMISC::KeyT;
case kVK_ANSI_U: return NLMISC::KeyU;
case kVK_ANSI_V: return NLMISC::KeyV;
case kVK_ANSI_W: return NLMISC::KeyW;
case kVK_ANSI_X: return NLMISC::KeyX;
case kVK_ANSI_Y: return NLMISC::KeyY;
case kVK_ANSI_Z: return NLMISC::KeyZ;
case kVK_ANSI_Equal: return NLMISC::KeyEQUALS;
case kVK_ANSI_Minus: return NLMISC::KeySUBTRACT;
case kVK_ANSI_RightBracket: return NLMISC::KeyRBRACKET;
case kVK_ANSI_LeftBracket: return NLMISC::KeyLBRACKET;
case kVK_ANSI_Quote: return NLMISC::KeyAPOSTROPHE;
case kVK_ANSI_Grave: return NLMISC::KeyPARAGRAPH;
case kVK_ANSI_Slash: return NLMISC::KeySLASH;
case kVK_ANSI_Backslash: return NLMISC::KeyBACKSLASH;
case kVK_ANSI_Comma: return NLMISC::KeyCOMMA;
case kVK_ANSI_Period: return NLMISC::KeyPERIOD;
case kVK_ANSI_Semicolon: return NLMISC::KeySEMICOLON;
case kVK_ANSI_KeypadDecimal: return NLMISC::KeyDECIMAL;
case kVK_ANSI_KeypadMultiply: return NLMISC::KeyMULTIPLY;
case kVK_ANSI_KeypadPlus: return NLMISC::KeyADD;
case kVK_ANSI_KeypadClear: return NLMISC::KeyDELETE;
case kVK_ANSI_KeypadDivide: return NLMISC::KeyDIVIDE;
case kVK_ANSI_KeypadEnter: return NLMISC::KeyRETURN;
case kVK_ANSI_KeypadMinus: return NLMISC::KeySUBTRACT;
case kVK_ANSI_KeypadEquals: return NLMISC::KeySEPARATOR;
case kVK_ANSI_Keypad0: return NLMISC::KeyNUMPAD0;
case kVK_ANSI_Keypad1: return NLMISC::KeyNUMPAD1;
case kVK_ANSI_Keypad2: return NLMISC::KeyNUMPAD2;
case kVK_ANSI_Keypad3: return NLMISC::KeyNUMPAD3;
case kVK_ANSI_Keypad4: return NLMISC::KeyNUMPAD4;
case kVK_ANSI_Keypad5: return NLMISC::KeyNUMPAD5;
case kVK_ANSI_Keypad6: return NLMISC::KeyNUMPAD6;
case kVK_ANSI_Keypad7: return NLMISC::KeyNUMPAD7;
case kVK_ANSI_Keypad8: return NLMISC::KeyNUMPAD8;
case kVK_ANSI_Keypad9: return NLMISC::KeyNUMPAD9;
case kVK_Return: return NLMISC::KeyRETURN;
case kVK_Tab: return NLMISC::KeyTAB;
case kVK_Space: return NLMISC::KeySPACE;
case kVK_Delete: return NLMISC::KeyBACK;
case kVK_ForwardDelete: return NLMISC::KeyDELETE;
case kVK_Escape: return NLMISC::KeyESCAPE;
case kVK_Shift: return NLMISC::KeySHIFT;
case kVK_RightShift: return NLMISC::KeyRSHIFT;
case kVK_CapsLock: return NLMISC::KeyCAPITAL;
case kVK_Control: return NLMISC::KeyCONTROL;
case kVK_RightControl: return NLMISC::KeyRCONTROL;
case kVK_F1: return NLMISC::KeyF1;
case kVK_F2: return NLMISC::KeyF2;
case kVK_F3: return NLMISC::KeyF3;
case kVK_F4: return NLMISC::KeyF4;
case kVK_F5: return NLMISC::KeyF5;
case kVK_F6: return NLMISC::KeyF6;
case kVK_F7: return NLMISC::KeyF7;
case kVK_F8: return NLMISC::KeyF8;
case kVK_F9: return NLMISC::KeyF9;
case kVK_F11: return NLMISC::KeyF11;
case kVK_F13: return NLMISC::KeyF13;
case kVK_F16: return NLMISC::KeyF16;
case kVK_F14: return NLMISC::KeyF14;
case kVK_F10: return NLMISC::KeyF10;
case kVK_F12: return NLMISC::KeyF12;
case kVK_F15: return NLMISC::KeyF15;
case kVK_F17: return NLMISC::KeyF17;
case kVK_F18: return NLMISC::KeyF18;
case kVK_F19: return NLMISC::KeyF19;
case kVK_F20: return NLMISC::KeyF20;
case kVK_Home: return NLMISC::KeyHOME;
case kVK_End: return NLMISC::KeyEND;
case kVK_PageUp: return NLMISC::KeyPRIOR;
case kVK_PageDown: return NLMISC::KeyNEXT;
case kVK_LeftArrow: return NLMISC::KeyLEFT;
case kVK_RightArrow: return NLMISC::KeyRIGHT;
case kVK_DownArrow: return NLMISC::KeyDOWN;
case kVK_UpArrow: return NLMISC::KeyUP;
case kVK_Command:break;
case kVK_Option:break;
case kVK_RightOption:break;
case kVK_Function:break;
case kVK_VolumeUp:break;
case kVK_VolumeDown:break;
case kVK_Mute:break;
case kVK_Help:break;
case kVK_ISO_Section:break;
case kVK_JIS_Yen:break;
case kVK_JIS_Underscore:break;
case kVK_JIS_KeypadComma:break;
case kVK_JIS_Eisu:break;
case kVK_JIS_Kana:break;
default:break;
}
return NLMISC::KeyNOKEY;
}
/*
TODO: this function has to be moved to a more central place to handle key
mapping on mac x11 as well
*/
NLMISC::TKeyButton modifierFlagsToNelKeyButton(unsigned int modifierFlags)
{
unsigned int buttons = 0;
if (modifierFlags & NSControlKeyMask) buttons |= NLMISC::ctrlKeyButton;
if (modifierFlags & NSShiftKeyMask) buttons |= NLMISC::shiftKeyButton;
if (modifierFlags & NSAlternateKeyMask) buttons |= NLMISC::altKeyButton;
return (NLMISC::TKeyButton)buttons;
}
bool isTextKeyEvent(NSEvent* event)
{
// if there are no characters provided with this event, is is not a text event
if([[event characters] length] == 0)
return false;
NLMISC::TKey nelKey = virtualKeycodeToNelKey([event keyCode]);
// ryzom ui wants to have "escape key string" to leave text box
if(nelKey == NLMISC::KeyESCAPE)
return true;
// ryzom ui wants to have "return key string" to submit text box (send chat)
if(nelKey == NLMISC::KeyRETURN)
return true;
// get the character reported by cocoa
unsigned int character = [[event characters] characterAtIndex:0];
// printable ascii characters
if(isprint(character))
return true;
/*
TODO check why iswprint(character) does not solve it.
it always returns false, even for π é ...
*/
// > 127 but not printable
if( nelKey == NLMISC::KeyF1 || nelKey == NLMISC::KeyF2 ||
nelKey == NLMISC::KeyF3 || nelKey == NLMISC::KeyF4 ||
nelKey == NLMISC::KeyF5 || nelKey == NLMISC::KeyF6 ||
nelKey == NLMISC::KeyF7 || nelKey == NLMISC::KeyF8 ||
nelKey == NLMISC::KeyF9 || nelKey == NLMISC::KeyF10 ||
nelKey == NLMISC::KeyF11 || nelKey == NLMISC::KeyF12 ||
nelKey == NLMISC::KeyF13 || nelKey == NLMISC::KeyF14 ||
nelKey == NLMISC::KeyF15 || nelKey == NLMISC::KeyF16 ||
nelKey == NLMISC::KeyF17 || nelKey == NLMISC::KeyF18 ||
nelKey == NLMISC::KeyF19 || nelKey == NLMISC::KeyF20 ||
nelKey == NLMISC::KeyUP || nelKey == NLMISC::KeyDOWN ||
nelKey == NLMISC::KeyLEFT || nelKey == NLMISC::KeyRIGHT ||
nelKey == NLMISC::KeyHOME || nelKey == NLMISC::KeyEND ||
nelKey == NLMISC::KeyPRIOR || nelKey == NLMISC::KeyNEXT ||
nelKey == NLMISC::KeyDELETE)
return false;
// all the fancy wide characters
if(character > 127)
return true;
return false;
}
void submitEvents(NLMISC::CEventServer& server,
bool allWindows, NLMISC::CCocoaEventEmitter* eventEmitter)
{
// cocoa style memory cleanup
[g_pool release];
g_pool = [[NSAutoreleasePool alloc] init];
// we break if there was no event to handle
/* TODO maximum? */
while(true)
{
// get the next event to handle
NSEvent* event = [g_app nextEventMatchingMask:NSAnyEventMask
untilDate:nil /*[NSDate distantFuture]*/
inMode:NSDefaultRunLoopMode dequeue:YES];
// stop, if there was no event
if(!event)
break;
// NSLog(@"%@", event);
uint32 width, height;
/* TODO cache? */
getWindowSize(width, height);
// get the mouse position in nel style (relative)
float mouseX = event.locationInWindow.x / (float)width;
float mouseY = event.locationInWindow.y / (float)height;
switch(event.type)
{
case NSLeftMouseDown:
server.postEvent(new NLMISC::CEventMouseDown(
mouseX, mouseY, NLMISC::leftButton /* modifiers */, eventEmitter));
break;
case NSLeftMouseUp:
server.postEvent(new NLMISC::CEventMouseUp(
mouseX, mouseY, NLMISC::leftButton /* modifiers */, eventEmitter));
break;
case NSRightMouseDown:
server.postEvent(new NLMISC::CEventMouseDown(
mouseX, mouseY, NLMISC::rightButton /* modifiers */, eventEmitter));
break;
case NSRightMouseUp:
server.postEvent(new NLMISC::CEventMouseUp(
mouseX, mouseY, NLMISC::rightButton /* modifiers */, eventEmitter));
break;
case NSMouseMoved:
server.postEvent(new NLMISC::CEventMouseMove(
mouseX, mouseY, (NLMISC::TMouseButton)0 /* modifiers */, eventEmitter));
break;
case NSLeftMouseDragged:
server.postEvent(new NLMISC::CEventMouseMove(
mouseX, mouseY, NLMISC::leftButton /* modifiers */, eventEmitter));
break;
case NSRightMouseDragged:break;
server.postEvent(new NLMISC::CEventMouseMove(
mouseX, mouseY, NLMISC::rightButton /* modifiers */, eventEmitter));
case NSMouseEntered:break;
case NSMouseExited:break;
case NSKeyDown:
/*
TODO dead keys
http://developer.apple.com/mac/library/documentation/Carbon/Reference/
Unicode_Utilities_Ref/Reference/reference.html#//apple_ref/c/func/
UCKeyTranslate
*/
// push the key press event to the new event server
server.postEvent(new NLMISC::CEventKeyDown(
virtualKeycodeToNelKey([event keyCode]),
modifierFlagsToNelKeyButton([event modifierFlags]),
[event isARepeat] == NO,
eventEmitter));
if(isTextKeyEvent(event))
{
ucstring ucstr;
// get the string associated with the key press event
ucstr.fromUtf8([[event characters] UTF8String]);
// push to event server
server.postEvent(new NLMISC::CEventChar(
ucstr[0],
NLMISC::noKeyButton,
eventEmitter));
}
break;
case NSKeyUp:
server.postEvent(new NLMISC::CEventKeyUp(
virtualKeycodeToNelKey([event keyCode]),
modifierFlagsToNelKeyButton([event modifierFlags]),
eventEmitter));
break;
case NSFlagsChanged:break;
case NSAppKitDefined:break;
case NSSystemDefined:break;
case NSApplicationDefined:break;
case NSPeriodic:break;
case NSCursorUpdate:break;
case NSScrollWheel:break;
case NSTabletPoint:break;
case NSTabletProximity:break;
case NSOtherMouseDown:break;
case NSOtherMouseUp:break;
case NSOtherMouseDragged:break;
case NSEventTypeGesture:break;
case NSEventTypeMagnify:break;
case NSEventTypeSwipe:break;
case NSEventTypeRotate:break;
case NSEventTypeBeginGesture:break;
case NSEventTypeEndGesture:break;
default:
nlwarning("Unknown event type. dropping.");
// NSLog(@"%@", event);
break;
}
[g_app sendEvent:event];
[g_app updateWindows];
}
}
}}

View file

@ -0,0 +1,30 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "cocoa_event_emitter.h"
#include "cocoa_adapter.h"
namespace NLMISC
{
void CCocoaEventEmitter::submitEvents(CEventServer & server, bool allWindows)
{
// just forwarding to our cocoa adapter
NL3D::MAC::submitEvents(server, allWindows, this);
}
}

View file

@ -0,0 +1,33 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef NL_COCOA_EVENT_EMITTER_H
#define NL_COCOA_EVENT_EMITTER_H
#include <nel/misc/event_emitter.h>
namespace NLMISC
{
class CCocoaEventEmitter : public IEventEmitter
{
public:
virtual void submitEvents(CEventServer & server, bool allWindows);
};
}
#endif

View file

@ -0,0 +1,32 @@
/*
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
/**
* derived to configure the NSOpenGLView
*/
@interface CocoaOpenGLView : NSOpenGLView
{
}
-(BOOL)acceptsFirstResponder;
-(BOOL)needsPanelToBecomeKey;
-(void)keyDown:(NSEvent*)event;
@end

View file

@ -0,0 +1,42 @@
/*
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import "cocoa_opengl_view.h"
@implementation CocoaOpenGLView
-(BOOL)acceptsFirstResponder
{
return YES;
}
-(BOOL)needsPanelToBecomeKey
{
return NO;
}
-(void)keyDown:(NSEvent*)event
{
// we handle the key here, so os x does not make a sound :)
/*
TODO do it in the event emitter? eg do not forward key down?
does command+q / command+m still work then?
*/
}
@end

View file

@ -0,0 +1,31 @@
/*
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
/**
* derived to configure the NSWindow
*/
@interface CocoaWindow : NSWindow
{
}
-(BOOL)canBecomeKeyWindow;
-(BOOL)canBecomeMainWindow;
-(BOOL)needsPanelToBecomeKey;
-(BOOL)acceptsFirstResponder;
@end

View file

@ -0,0 +1,43 @@
/*
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import "cocoa_window.h"
@implementation CocoaWindow
-(BOOL)canBecomeKeyWindow
{
return YES;
}
-(BOOL)canBecomeMainWindow
{
return YES;
}
-(BOOL)needsPanelToBecomeKey
{
return NO;
}
-(BOOL)acceptsFirstResponder
{
return YES;
}
@end

File diff suppressed because it is too large Load diff

View file

@ -18,6 +18,8 @@
#ifdef NL_OS_UNIX
#ifndef NL_MAC_NATIVE
#include <X11/keysym.h>
#include <GL/gl.h>
#include <GL/glx.h>
@ -29,12 +31,42 @@ namespace NLMISC {
CUnixEventEmitter::CUnixEventEmitter ():_dpy(NULL), _win(0), _PreviousKey(KeyNOKEY)
{
_im = 0;
_ic = 0;
}
CUnixEventEmitter::~CUnixEventEmitter()
{
if (_ic) XDestroyIC(_ic);
if (_im) XCloseIM(_im);
}
void CUnixEventEmitter::init (Display *dpy, Window win)
{
_dpy = dpy;
_win = win;
createIM();
}
void CUnixEventEmitter::createIM()
{
_im = XOpenIM(_dpy, NULL, NULL, NULL);
if (_im)
{
_ic = XCreateIC(_im, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, _win, XNFocusWindow, _win, NULL);
// XSetICFocus(_ic);
}
else
{
_ic = 0;
nlwarning("XCreateIM failed");
}
if (!_ic)
{
nlwarning("XCreateIC failed");
}
}
void CUnixEventEmitter::submitEvents(CEventServer & server, bool allWindows)
@ -82,8 +114,70 @@ TKeyButton getKeyButton (uint32 state)
return (TKeyButton)button;
}
TKey getKey (KeySym keysym)
TKey getKeyFromKeycode (uint keycode)
{
// keycodes are depending on system
switch (keycode)
{
#ifdef NL_OS_MAC
case 0x12: return Key1;
case 0x13: return Key2;
case 0x14: return Key3;
case 0x15: return Key4;
case 0x16: return Key6;
case 0x17: return Key5;
case 0x18: return KeyEQUALS;
case 0x19: return Key9;
case 0x1a: return Key7;
case 0x1c: return Key8;
case 0x1d: return Key0;
case 0x1e: return KeyRBRACKET;
case 0x21: return KeyLBRACKET;
case 0x27: return KeyAPOSTROPHE;
case 0x29: return KeySEMICOLON;
case 0x2a: return KeyBACKSLASH;
case 0x2b: return KeyCOMMA;
case 0x2c: return KeySLASH;
case 0x2f: return KeyPERIOD;
// case 0x5e: return KeyOEM_102;
// case 0x30: return KeyTILDE;
// case 0x3d: return KeyPARAGRAPH;
#else
case 0x0a: return Key1;
case 0x0b: return Key2;
case 0x0c: return Key3;
case 0x0d: return Key4;
case 0x0e: return Key5;
case 0x0f: return Key6;
case 0x10: return Key7;
case 0x11: return Key8;
case 0x12: return Key9;
case 0x13: return Key0;
case 0x14: return KeyLBRACKET;
case 0x15: return KeyEQUALS;
case 0x22: return KeyRBRACKET;
case 0x23: return KeySEMICOLON;
case 0x2f: return KeyCOMMA;
case 0x30: return KeyTILDE;
case 0x31: return KeyAPOSTROPHE;
case 0x33: return KeyBACKSLASH;
case 0x5e: return KeyOEM_102;
case 0x3a: return KeyCOMMA;
case 0x3b: return KeyPERIOD;
case 0x3c: return KeySLASH;
case 0x3d: return KeyPARAGRAPH;
#endif
default:
// nlwarning("missing keycode 0x%x %d '%c'", keycode, keycode, keycode);
break;
}
return KeyNOKEY;
}
TKey getKeyFromKeySym (KeySym keysym)
{
// nlwarning("0x%x %d '%c'", keysym, keysym, keysym);
switch (keysym)
{
case XK_BackSpace: return KeyBACK;
@ -131,6 +225,7 @@ TKey getKey (KeySym keysym)
case XK_KP_Add: return KeyADD;
case XK_KP_Subtract: return KeySUBTRACT;
case XK_KP_Decimal: return KeyDECIMAL;
// case XK_period: return KeyDECIMAL;
case XK_KP_Divide: return KeyDIVIDE;
case XK_F1: return KeyF1;
case XK_F2: return KeyF2;
@ -157,16 +252,6 @@ TKey getKey (KeySym keysym)
case XK_Alt_L: return KeyMENU;
case XK_Alt_R: return KeyMENU;
case XK_space: return KeySPACE;
case XK_0: return Key0;
case XK_1: return Key1;
case XK_2: return Key2;
case XK_3: return Key3;
case XK_4: return Key4;
case XK_5: return Key5;
case XK_6: return Key6;
case XK_7: return Key7;
case XK_8: return Key8;
case XK_9: return Key9;
case XK_A:
case XK_a: return KeyA;
case XK_B:
@ -220,7 +305,7 @@ TKey getKey (KeySym keysym)
case XK_Z:
case XK_z: return KeyZ;
default:
//nldebug ("0x%x %d '%c'", keysym, keysym, keysym);
// other keys don't need to be processed here
break;
}
return KeyNOKEY;
@ -299,14 +384,39 @@ void CUnixEventEmitter::processMessage (XEvent &event, CEventServer &server)
}
Case(KeyPress)
{
char Text[1024];
// save keycode because XFilterEvent could set it to 0
uint keyCode = event.xkey.keycode;
KeySym k;
int c;
c = XLookupString(&event.xkey, Text, 1024-1, &k, NULL);
static char Text[256];
int c = 0;
TKey key = getKey(XKeycodeToKeysym(_dpy, event.xkey.keycode, 0));
// check if event is filtered
bool filtered = XFilterEvent(&event, _win);
// if key event is filtered, we shouldn't use XLookupString to retrieve KeySym
if (!filtered)
{
Status status = XLookupNone;
#ifdef X_HAVE_UTF8_STRING
if (_ic)
c = Xutf8LookupString(_ic, &event.xkey, Text, sizeof(Text), &k, &status);
#endif
if (status == XLookupNone)
c = XLookupString(&event.xkey, Text, sizeof(Text), &k, NULL);
}
else
{
k = XKeycodeToKeysym(_dpy, keyCode, 0);
}
// send CEventKeyDown event only if keyCode is defined
if (keyCode)
{
TKey key = getKeyFromKeySym(k);
if(key == KeyNOKEY)
key = getKey(XKeycodeToKeysym(_dpy, event.xkey.keycode, 1));
key = getKeyFromKeycode(keyCode);
server.postEvent (new CEventKeyDown (key, getKeyButton(event.xbutton.state), _PreviousKey != key, this));
_PreviousKey = key;
@ -314,35 +424,37 @@ void CUnixEventEmitter::processMessage (XEvent &event, CEventServer &server)
// don't send a control character when deleting
if (key == KeyDELETE)
c = 0;
}
Text[c] = '\0';
if(c>0)
{
#ifdef X_HAVE_UTF8_STRING
ucstring ucstr;
ucstr.fromUtf8(Text);
server.postEvent (new CEventChar (ucstr[0], noKeyButton, this));
#else
for (int i = 0; i < c; i++)
{
server.postEvent (new CEventChar ((ucchar)(unsigned char)Text[i], noKeyButton, this));
}
#endif
}
break;
}
Case (KeyRelease)
{
char Text[1024];
KeySym k;
int c;
c = XLookupString(&event.xkey, Text, 1024-1, &k, NULL);
TKey key = getKey(XKeycodeToKeysym(_dpy, event.xkey.keycode, 0));
TKey key = getKeyFromKeySym(XKeycodeToKeysym(_dpy, event.xkey.keycode, 0));
if(key == KeyNOKEY)
key = getKey(XKeycodeToKeysym(_dpy, event.xkey.keycode, 1));
key = getKeyFromKeycode(event.xkey.keycode);
server.postEvent (new CEventKeyUp (key, getKeyButton(event.xbutton.state), this));
_PreviousKey = KeyNOKEY;
break;
}
Case(FocusIn)
if (_ic) XSetICFocus(_ic);
return;
Case(FocusOut)
if (_ic) XUnsetICFocus(_ic);
return;
Case(Expose)
break;
@ -350,6 +462,8 @@ void CUnixEventEmitter::processMessage (XEvent &event, CEventServer &server)
XRefreshKeyboardMapping((XMappingEvent *)&event);
break;
Case(DestroyNotify)
// XIM server has crashed
createIM();
break;
Case(ConfigureNotify)
/* if (event.xconfigure.width==gmaxx && event.xconfigure.height==gmaxy) {
@ -367,4 +481,6 @@ void CUnixEventEmitter::processMessage (XEvent &event, CEventServer &server)
} // NLMISC
#endif // NL_MAC_NATIVE
#endif // NL_OS_UNIX

View file

@ -17,6 +17,8 @@
#ifndef NL_UNIX_EVENT_EMITTER_H
#define NL_UNIX_EVENT_EMITTER_H
#ifndef NL_MAC_NATIVE
#include "nel/misc/types_nl.h"
#include "nel/misc/event_emitter.h"
#include "nel/misc/events.h"
@ -41,6 +43,7 @@ public:
/// Constructor
CUnixEventEmitter();
virtual ~CUnixEventEmitter();
void init (Display *dpy, Window win);
@ -55,9 +58,13 @@ public:
void processMessage (XEvent &event, CEventServer &server);
private:
void createIM();
Display *_dpy;
Window _win;
TKey _PreviousKey;
XIM _im;
XIC _ic;
};
@ -65,6 +72,8 @@ private:
#endif // NL_OS_UNIX
#endif // NL_MAC_NATIVE
#endif // NL_UNIX_EVENT_EMITTER_H
/* End of unix_event_emitter.h */

View file

@ -386,7 +386,7 @@ bool CDriverUser::isActive()
// ***************************************************************************
void *CDriverUser::getDisplay ()
nlWindow CDriverUser::getDisplay ()
{
NL3D_HAUTO_UI_DRIVER;

View file

@ -287,7 +287,7 @@ int Height = 100;
CFontGenerator::CFontGenerator (const std::string &fontFileName, const std::string &fontExFileName)
{
// HWND win=(HWND)winHack;
// HWND win=winHack;
// WindowHandle = win;
// Format = format;
// RECT rect;

View file

@ -389,6 +389,8 @@ void CTileBank::makeAllExtensionDDS ()
// Diffuse
tmp= _TileVector[nTile].getRelativeFileName (CTile::diffuse);
pos= tmp.rfind(".tga");
if (pos == string::npos)
pos = tmp.rfind(".png");
if(pos!= string::npos)
{
tmp.replace(pos, 4, ".dds");
@ -398,6 +400,8 @@ void CTileBank::makeAllExtensionDDS ()
// Additive.
tmp= _TileVector[nTile].getRelativeFileName (CTile::additive);
pos= tmp.rfind(".tga");
if (pos == string::npos)
pos = tmp.rfind(".png");
if(pos!= string::npos)
{
tmp.replace(pos, 4, ".dds");
@ -407,6 +411,8 @@ void CTileBank::makeAllExtensionDDS ()
// Alpha.
tmp= _TileVector[nTile].getRelativeFileName (CTile::alpha);
pos= tmp.rfind(".tga");
if (pos == string::npos)
pos = tmp.rfind(".png");
if(pos!= string::npos)
{
tmp.replace(pos, 4, ".dds");

View file

@ -99,6 +99,7 @@ libnelmisc_la_SOURCES = \
string_id_array.cpp \
string_mapper.cpp \
system_info.cpp \
system_utils.cpp \
task_manager.cpp \
tds.cpp \
time_nl.cpp \

View file

@ -158,7 +158,7 @@ uint8 CBitmap::readJPG( NLMISC::IStream &f )
{
dstChannels = 1;
srcChannels = 1;
resize (cinfo.image_width, cinfo.image_height, Luminance);
resize (cinfo.image_width, cinfo.image_height, _LoadGrayscaleAsAlpha ? Alpha : Luminance);
}
else
{

View file

@ -163,7 +163,7 @@ uint8 CBitmap::readPNG( NLMISC::IStream &f )
dstChannels = 1;
firstChannel = 0;
lastChannel = 0;
resize (width, height, Luminance);
resize (width, height, _LoadGrayscaleAsAlpha ? Alpha : Luminance);
}
else if (iColorType == PNG_COLOR_TYPE_GRAY_ALPHA)
{

View file

@ -36,7 +36,7 @@ static const uint32 KeyMaxLength = 1024;
namespace NLMISC {
void *CSystemUtils::s_window = NULL;
nlWindow CSystemUtils::s_window = EmptyWindow;
bool CSystemUtils::init()
{
@ -59,7 +59,7 @@ bool CSystemUtils::uninit()
return true;
}
void CSystemUtils::setWindow(void *window)
void CSystemUtils::setWindow(nlWindow window)
{
s_window = window;
}
@ -83,12 +83,12 @@ bool CSystemUtils::updateProgressBar(uint value, uint total)
if (total)
{
// update the taskbar progress
hr = pTaskbarList->SetProgressValue((HWND)s_window, (ULONGLONG)value, (ULONGLONG)total);
hr = pTaskbarList->SetProgressValue(s_window, (ULONGLONG)value, (ULONGLONG)total);
}
else
{
// don't update anymore the progress
hr = pTaskbarList->SetProgressState((HWND)s_window, value == 0 ? TBPF_INDETERMINATE:TBPF_NOPROGRESS);
hr = pTaskbarList->SetProgressState(s_window, value == 0 ? TBPF_INDETERMINATE:TBPF_NOPROGRESS);
}
// release the interface
@ -368,13 +368,13 @@ bool CSystemUtils::isSystemCursorInClientArea()
return false;
}
HWND wnd = WindowFromPoint(cursPos);
if (wnd != (HWND)s_window)
if (wnd != s_window)
{
return false; // not the same window
}
// want that the mouse be in the client area
RECT clientRect;
if (!GetClientRect((HWND)s_window, &clientRect))
if (!GetClientRect(s_window, &clientRect))
{
return false;
}
@ -383,11 +383,11 @@ bool CSystemUtils::isSystemCursorInClientArea()
tl.y = clientRect.top;
br.x = clientRect.right;
br.y = clientRect.bottom;
if (!ClientToScreen((HWND)s_window, &tl))
if (!ClientToScreen(s_window, &tl))
{
return false;
}
if (!ClientToScreen((HWND)s_window, &br))
if (!ClientToScreen(s_window, &br))
{
return false;
}

View file

@ -1,5 +1,11 @@
FILE(GLOB SRC *.cpp *.h)
# TODO: fixes a linking problem for libnelsound.dylib, but does not look like
# the cleanest way to solve the issue. FIXME!
IF(APPLE)
SET(SRC ${SRC} driver/sound_driver.cpp driver/buffer.cpp)
ENDIF(APPLE)
IF(NOT WIN32)
ADD_LIBRARY(nelsound SHARED ${SRC})
ELSE(NOT WIN32)

View file

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="nel_patch_edit"
Version="9.00"
Name="nel_patch_edit_adv"
ProjectGUID="{F8D52EA9-5C60-4C40-912B-F049B85B9DC0}"
RootNamespace="nel_patch_edit"
RootNamespace="nel_patch_edit_adv"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@ -86,6 +87,8 @@
ProgramDatabaseFile=".\DebugFast/neleditpatch.pdb"
SubSystem="2"
BaseAddress="0x05830000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\DebugFast/neleditpatch.lib"
TargetMachine="1"
/>
@ -107,9 +110,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy &quot;C:\3dsmax3_1 debug\exe\plugins\neleditpatch.dlm&quot; &quot;c:\3dsmax3_1\plugins&quot;&#x0D;&#x0A;echo copie dans max&#x0D;&#x0A;"
@ -187,6 +187,8 @@
ProgramDatabaseFile=".\Debug/neleditpatch.pdb"
SubSystem="2"
BaseAddress="0x05830000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\Debug/neleditpatch.lib"
TargetMachine="1"
/>
@ -208,9 +210,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -289,6 +288,8 @@
SubSystem="2"
SetChecksum="true"
BaseAddress="0x05830000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\Release/neleditpatch.lib"
TargetMachine="1"
/>
@ -310,9 +311,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -391,6 +389,8 @@
SubSystem="2"
SetChecksum="true"
BaseAddress="0x05830000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\ReleaseDebug/neleditpatch.lib"
TargetMachine="1"
/>
@ -412,9 +412,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -492,6 +489,8 @@
ProgramDatabaseFile=".\Hybrid/neleditpatch.pdb"
SubSystem="2"
BaseAddress="0x05830000"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\Hybrid/neleditpatch.lib"
TargetMachine="1"
/>
@ -513,9 +512,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>

View file

@ -1,707 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="nel_vertex_tree_paint"
ProjectGUID="{2D2D6DAE-D4DB-41CC-A732-E913EE21F228}"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Hybrid|Win32"
OutputDirectory=".\Hybrid"
IntermediateDirectory=".\Hybrid"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Hybrid/nel_vertex_tree_paint.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__STL_DEBUG"
RuntimeLibrary="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Hybrid/nel_vertex_tree_paint.pch"
AssemblerListingLocation=".\Hybrid/"
ObjectFile=".\Hybrid/"
ProgramDataBaseFileName="nel_vertex_tree_paint.pdb"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="core.lib geom.lib maxutil.lib mesh.lib COMCTL32.LIB KERNEL32.LIB USER32.LIB GDI32.LIB WINSPOOL.LIB COMDLG32.LIB ADVAPI32.LIB SHELL32.LIB OLE32.LIB OLEAUT32.LIB UUID.LIB odbc32.lib odbccp32.lib freetype231.lib"
OutputFile=".\Hybrid\nel_vertex_tree_paint.dlm"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\vertex_tree_paint.def"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Hybrid/nel_vertex_tree_paint.pdb"
SubSystem="2"
BaseAddress="0x05D10000"
ImportLibrary=".\Hybrid/nel_vertex_tree_paint.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/nel_vertex_tree_paint.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__STL_DEBUG"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/nel_vertex_tree_paint.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName="nel_vertex_tree_paint.pdb"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="core.lib geom.lib maxutil.lib mesh.lib COMCTL32.LIB KERNEL32.LIB USER32.LIB GDI32.LIB WINSPOOL.LIB COMDLG32.LIB ADVAPI32.LIB SHELL32.LIB OLE32.LIB OLEAUT32.LIB UUID.LIB odbc32.lib odbccp32.lib freetype231.lib"
OutputFile=".\Debug\nel_vertex_tree_paint.dlm"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\vertex_tree_paint.def"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/nel_vertex_tree_paint.pdb"
SubSystem="2"
BaseAddress="0x05D10000"
ImportLibrary=".\Debug/nel_vertex_tree_paint.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/nel_vertex_tree_paint.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/nel_vertex_tree_paint.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName="nel_vertex_tree_paint.pdb"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="core.lib geom.lib maxutil.lib mesh.lib COMCTL32.LIB KERNEL32.LIB USER32.LIB GDI32.LIB WINSPOOL.LIB COMDLG32.LIB ADVAPI32.LIB SHELL32.LIB OLE32.LIB OLEAUT32.LIB UUID.LIB odbc32.lib odbccp32.lib freetype231.lib"
OutputFile=".\Release\nel_vertex_tree_paint.dlm"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\vertex_tree_paint.def"
ProgramDatabaseFile=".\Release/nel_vertex_tree_paint.pdb"
SubSystem="2"
SetChecksum="true"
BaseAddress="0x05D10000"
ImportLibrary=".\Release/nel_vertex_tree_paint.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="DebugFast|Win32"
OutputDirectory=".\DebugFast"
IntermediateDirectory=".\DebugFast"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\DebugFast/nel_vertex_tree_paint.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\DebugFast/nel_vertex_tree_paint.pch"
AssemblerListingLocation=".\DebugFast/"
ObjectFile=".\DebugFast/"
ProgramDataBaseFileName="nel_vertex_tree_paint.pdb"
BrowseInformation="1"
BrowseInformationFile=".\DebugFast/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="core.lib geom.lib maxutil.lib mesh.lib COMCTL32.LIB KERNEL32.LIB USER32.LIB GDI32.LIB WINSPOOL.LIB COMDLG32.LIB ADVAPI32.LIB SHELL32.LIB OLE32.LIB OLEAUT32.LIB UUID.LIB odbc32.lib odbccp32.lib freetype231.lib"
OutputFile=".\DebugFast\nel_vertex_tree_paint.dlm"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\vertex_tree_paint.def"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\DebugFast/nel_vertex_tree_paint.pdb"
SubSystem="2"
BaseAddress="0x05D10000"
ImportLibrary=".\DebugFast/nel_vertex_tree_paint.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseDebug|Win32"
OutputDirectory=".\ReleaseDebug"
IntermediateDirectory=".\ReleaseDebug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\ReleaseDebug/nel_vertex_tree_paint.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="_WINDOWS;NL_RELEASE_DEBUG;WIN32;NDEBUG"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\ReleaseDebug/nel_vertex_tree_paint.pch"
AssemblerListingLocation=".\ReleaseDebug/"
ObjectFile=".\ReleaseDebug/"
ProgramDataBaseFileName="nel_vertex_tree_paint.pdb"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="core.lib geom.lib maxutil.lib mesh.lib COMCTL32.LIB KERNEL32.LIB USER32.LIB GDI32.LIB WINSPOOL.LIB COMDLG32.LIB ADVAPI32.LIB SHELL32.LIB OLE32.LIB OLEAUT32.LIB UUID.LIB odbc32.lib odbccp32.lib freetype219.lib"
OutputFile=".\ReleaseDebug\nel_vertex_tree_paint.dlm"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\vertex_tree_paint.def"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\ReleaseDebug/nel_vertex_tree_paint.pdb"
SubSystem="2"
SetChecksum="true"
BaseAddress="0x05D10000"
ImportLibrary=".\ReleaseDebug/nel_vertex_tree_paint.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="dllmain.cpp"
>
<FileConfiguration
Name="Hybrid|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__STL_DEBUG;$(NoInherit)"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__STL_DEBUG;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="_WINDOWS;NL_RELEASE_DEBUG;WIN32;NDEBUG;$(NoInherit)"
/>
</FileConfiguration>
</File>
<File
RelativePath="Paint.cpp"
>
<FileConfiguration
Name="Hybrid|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__STL_DEBUG;$(NoInherit)"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__STL_DEBUG;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="_WINDOWS;NL_RELEASE_DEBUG;WIN32;NDEBUG;$(NoInherit)"
/>
</FileConfiguration>
</File>
<File
RelativePath="vertex_tree_paint.cpp"
>
<FileConfiguration
Name="Hybrid|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__STL_DEBUG;$(NoInherit)"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__STL_DEBUG;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="_WINDOWS;NL_RELEASE_DEBUG;WIN32;NDEBUG;$(NoInherit)"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="resource.h"
>
</File>
<File
RelativePath="vertex_tree_paint.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
>
<File
RelativePath="buttonmask.bmp"
>
</File>
<File
RelativePath="Buttons.bmp"
>
</File>
<File
RelativePath="dropcurs.cur"
>
</File>
<File
RelativePath="paintcur.cur"
>
</File>
<File
RelativePath="vertex_tree_paint.def"
>
</File>
<File
RelativePath="vertex_tree_paint.rc"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -19,7 +19,7 @@
#include "nel/misc/file.h"
#include "nel/misc/bitmap.h"
#include "nel/misc/file.h"
#include "nel/misc/path.h"
#include "nel/misc/debug.h"
#include <math.h>
@ -352,6 +352,8 @@ void dividSize (CBitmap &bitmap)
// ***************************************************************************
int main(int argc, char **argv)
{
CApplicationContext applicationContext;
uint8 algo;
// Parse Command Line.
@ -495,9 +497,9 @@ int main(int argc, char **argv)
}
// Reading second Tga for user color
// Reading second Tga for user color, don't complain if _usercolor is missing
NLMISC::CIFile input2;
if (input2.open(userColorFileName))
if (CPath::exists(userColorFileName) && input2.open(userColorFileName))
{
picTga2.load(input2);
uint32 height2 = picTga2.getHeight();

View file

@ -84,9 +84,11 @@ ELSE(WITH_LUA51)
ENDIF(WITH_LUA51)
FIND_PACKAGE(CURL REQUIRED)
FIND_PACKAGE(Libwww)
FIND_PACKAGE(ZLIB)
IF(NOT WIN32)
IF(NOT WITH_COCOA)
FIND_PACKAGE(X11)
ENDIF(NOT WITH_COCOA)
ENDIF(NOT WIN32)
NL_SETUP_BUILD()

View file

@ -24,8 +24,26 @@ FIND_PATH(LIBWWW_INCLUDE_DIR
PATH_SUFFIXES libwww w3c-libwww
)
FIND_LIBRARY(LIBWWW_LIBRARY
wwwapp
# when installing libwww on mac os x using macports the file wwwconf.h resides
# in /opt/local/include and not in the real libwww include dir :/
FIND_PATH(LIBWWW_ADDITIONAL_INCLUDE_DIR
wwwconf.h
PATHS
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include
)
# combine both include directories into one variable
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_ADDITIONAL_INCLUDE_DIR})
# helper to find all the libwww sub libraries
MACRO(FIND_WWW_LIBRARY MYLIBRARY)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${ARGN}
PATHS
/usr/local/lib
/usr/lib
@ -36,7 +54,47 @@ FIND_LIBRARY(LIBWWW_LIBRARY
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
)
ENDMACRO(FIND_WWW_LIBRARY MYLIBRARY)
# on mac os x, libwww sub libraries are not "inter-linked"
# we need to link them all manually
IF(APPLE)
# find all the libwww libraries
FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY wwwapp)
FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY wwwcache)
FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY wwwcore)
FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY wwwdir)
FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY wwwfile)
FIND_WWW_LIBRARY(LIBWWWFTP_LIBRARY wwwftp)
FIND_WWW_LIBRARY(LIBWWWGOPHER_LIBRARY wwwgopher)
FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY wwwhtml)
FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY wwwhttp)
FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY wwwinit)
FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY wwwmime)
FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY wwwmux)
FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY wwwnews)
FIND_WWW_LIBRARY(LIBWWWSSL_LIBRARY wwwssl)
FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY wwwstream)
FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY wwwtelnet)
FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY wwwtrans)
FIND_WWW_LIBRARY(LIBWWWUTILS_LIBRARY wwwutils)
FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY wwwxml)
FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY wwwzip)
# combine all the libraries into one variable
SET(LIBWWW_LIBRARY
${LIBWWWAPP_LIBRARY} ${LIBWWWCACHE_LIBRARY} ${LIBWWWCORE_LIBRARY}
${LIBWWWDIR_LIBRARY} ${LIBWWWFILE_LIBRARY} ${LIBWWWFTP_LIBRARY}
${LIBWWWGOPHER_LIBRARY} ${LIBWWWHTML_LIBRARY} ${LIBWWWHTTP_LIBRARY}
${LIBWWWINIT_LIBRARY} ${LIBWWWMIME_LIBRARY} ${LIBWWWMUX_LIBRARY}
${LIBWWWNEWS_LIBRARY} ${LIBWWWSSL_LIBRARY} ${LIBWWWSTREAM_LIBRARY}
${LIBWWWTELNET_LIBRARY} ${LIBWWWTRANS_LIBRARY} ${LIBWWWUTILS_LIBRARY}
${LIBWWWXML_LIBRARY} ${LIBWWWZIP_LIBRARY}
)
ELSE(APPLE)
FIND_WWW_LIBRARY(LIBWWW_LIBRARY wwwapp)
ENDIF(APPLE)
IF(LIBWWW_LIBRARY AND LIBWWW_INCLUDE_DIR)
SET(LIBWWW_FOUND "YES")
@ -48,4 +106,3 @@ ELSE(LIBWWW_LIBRARY AND LIBWWW_INCLUDE_DIR)
MESSAGE(STATUS "Warning: Unable to find LibWWW!")
ENDIF(NOT LIBWWW_FIND_QUIETLY)
ENDIF(LIBWWW_LIBRARY AND LIBWWW_INCLUDE_DIR)

View file

@ -0,0 +1,39 @@
# - Find zlib
# Find the native ZLIB includes and library
#
# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
# ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found.
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
IF (ZLIB_INCLUDE_DIR)
# Already in cache, be silent
SET(ZLIB_FIND_QUIETLY TRUE)
ENDIF (ZLIB_INCLUDE_DIR)
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
SET(ZLIB_NAMES z zlib zdll)
FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} )
MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
# Per-recommendation
SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}")
SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}")
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)

View file

@ -80,7 +80,10 @@ MACRO(NL_SETUP_BUILD)
IF(WITH_COVERAGE)
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
ENDIF(WITH_COVERAGE)
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++ -lrt")
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++")
IF(NOT APPLE)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lrt")
ENDIF(NOT APPLE)
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -g")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -O6")
SET(NL_RELEASEDEBUG_CFLAGS "-DNL_RELEASE_DEBUG -g -finline-functions -O3 ")

View file

@ -33,9 +33,37 @@ IF(UNIX)
INCLUDE(${CMAKE_BINARY_DIR})
ENDIF(UNIX)
ADD_EXECUTABLE(client ${SRC})
# on Mac, create a .App Bundle
if(APPLE)
SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client")
SET(MACOSX_BUNDLE_ICON_FILE "")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "0.8.0")
SET(MACOSX_BUNDLE_BUNDLE_NAME "Ryzom Core Client")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "0.8")
SET(MACOSX_BUNDLE_BUNDLE_VERSION "1.0")
SET(MACOSX_BUNDLE_COPYRIGHT "Winchgate and The Ryzom Core Community")
INCLUDE_DIRECTORIES( ${LIBXML2_INCLUDE_DIR}
ADD_EXECUTABLE(client MACOSX_BUNDLE ${SRC})
# TODO: in release mode, cmake could copy all the dylibs into the .app
# bundle for redistribution... should some part of cpack handle that?
# ADD_CUSTOM_COMMAND(TARGET client POST_BUILD
# # make frameworks directory in app bundle
# COMMAND ${CMAKE_COMMAND} -E make_directory
# ${CMAKE_CURRENT_BINARY_DIR}/client.app/Contents/Frameworks
# # copy framework into app bundle
# COMMAND ${CMAKE_COMMAND} -E copy ${SOME_LIBRARY}
# ${CMAKE_CURRENT_BINARY_DIR}/client.app/Contents/Frameworks
# # ...
# # install_name_tool the lib pathes
ELSE(APPLE)
ADD_EXECUTABLE(client ${SRC})
ENDIF(APPLE)
INCLUDE_DIRECTORIES(
${LIBXML2_INCLUDE_DIR}
${NEL_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
${LIBWWW_INCLUDE_DIR}
@ -49,6 +77,7 @@ TARGET_LINK_LIBRARIES(client ${PLATFORM_LINKFLAGS}
${NELNET_LIBRARY}
${NELLIGO_LIBRARY}
${NELGEORGES_LIBRARY}
${NEL3D_LIBRARY}
${LUA_LIBRARIES}
${CURL_LIBRARIES}
${NELSOUND_LIBRARY}
@ -57,9 +86,13 @@ TARGET_LINK_LIBRARIES(client ${PLATFORM_LINKFLAGS}
${NELPACS_LIBRARY}
${LIBWWW_LIBRARY}
${Boost_LIBRARIES}
${X11_LIBRARIES}
seven_zip
luabind)
IF(NOT WITH_COCOA)
TARGET_LINK_LIBRARIES(client ${X11_LIBRARIES})
ENDIF(NOT WITH_COCOA)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
INSTALL(TARGETS client RUNTIME DESTINATION bin COMPONENT client)
INSTALL(TARGETS client RUNTIME DESTINATION bin COMPONENT client BUNDLE DESTINATION /Applications)

View file

@ -472,7 +472,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader()
}
*(uint32 *) Parent->_RyzomInstPIDPtr = (uint32) GetCurrentProcessId();
HWND hWnd = (HWND)Driver->getDisplay ();
HWND hWnd = Driver->getDisplay();
// for safety, stop any running downloader
if (isDownloaderProcessRunning())

View file

@ -283,7 +283,7 @@ static INT_PTR CALLBACK ExitClientErrorDialogProc(HWND hwndDlg, UINT uMsg, WPARA
{
if (Driver)
{
HWND wnd = (HWND) Driver->getDisplay();
HWND wnd = Driver->getDisplay();
ShowWindow(wnd, SW_MINIMIZE);
}
browseFAQ(ClientCfg.ConfigFile);
@ -461,7 +461,7 @@ static string crashCallback()
Driver->getCurrentScreenMode(mode);
if (!mode.Windowed)
{
HWND wnd = (HWND) Driver->getDisplay();
HWND wnd = Driver->getDisplay();
ShowWindow(wnd, SW_MINIMIZE);
}
}
@ -1227,7 +1227,7 @@ void postlogInit()
// tmp fix : it seems that, at this point, if the bg downloader window has focus and
// not the Ryzom one, then sound init fails
#ifdef NL_OS_WINDOWS
HWND hWnd = (HWND)Driver->getDisplay ();
HWND hWnd = Driver->getDisplay ();
nlassert (hWnd);
ShowWindow(hWnd, SW_RESTORE);
SetForegroundWindow(hWnd);

View file

@ -369,7 +369,7 @@ void CaptureSystemCursor()
{
if (IsSystemCursorCaptured()) return;
#ifdef NL_OS_WINDOWS
HWND drvWnd = (HWND) Driver->getDisplay();
HWND drvWnd = Driver->getDisplay();
if (!drvWnd) return;
SetCapture(drvWnd);
#else
@ -402,7 +402,7 @@ bool IsSystemCursorCaptured()
{
if (!Driver) return false;
#ifdef NL_OS_WINDOWS
return GetCapture() == (HWND) Driver->getDisplay();
return GetCapture() == Driver->getDisplay();
#else
return MouseCapture;
#endif
@ -445,7 +445,7 @@ bool IsSystemCursorInClientArea()
{
if (!Driver) return false;
#ifdef NL_OS_WINDOWS
HWND drvWnd = (HWND) Driver->getDisplay();
HWND drvWnd = Driver->getDisplay();
if (!drvWnd) return false;
UDriver::CMode videoMode;
Driver->getCurrentScreenMode(videoMode);

View file

@ -3725,7 +3725,7 @@ public:
#ifdef NL_OS_WINDOWS
if (Driver)
{
HWND wnd = (HWND) Driver->getDisplay();
HWND wnd = Driver->getDisplay();
ShowWindow(wnd, SW_MINIMIZE);
}
#endif

View file

@ -58,6 +58,9 @@ extern NLMISC::CLog g_log;
////////////
//static CCDBNodeLeaf *MenuColorWidgetValue = NULL; // db entry for the color menu widget (Red)
static const string ScreenshotsDirectory("screenshots/"); // don't forget the final /
void preRenderNewSky ();
// ***************************************************************************
@ -596,7 +599,9 @@ void screenShotTGA()
{
CBitmap btm;
getBuffer (btm);
string filename = CFile::findNewFile ("screenshot.tga");
if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.tga");
COFile fs(filename);
btm.writeTGA(fs, 24, false);
nlinfo("Screenshot '%s' saved in tga format (%dx%d)", filename.c_str(), (int) ClientCfg.ScreenShotWidth, (int) ClientCfg.ScreenShotHeight);
@ -607,7 +612,9 @@ void screenShotPNG()
{
CBitmap btm;
getBuffer (btm);
string filename = CFile::findNewFile ("screenshot.png");
if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.png");
COFile fs(filename);
if (!btm.writePNG(fs, 24))
{
@ -626,7 +633,9 @@ void screenShotJPG()
{
CBitmap btm;
getBuffer (btm);
string filename = CFile::findNewFile ("screenshot.jpg");
if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.jpg");
COFile fs(filename);
btm.writeJPG(fs);
nlinfo("Screenshot '%s' saved in jpg format (%dx%d)", filename.c_str(), (int) ClientCfg.ScreenShotWidth, (int) ClientCfg.ScreenShotHeight);

View file

@ -284,7 +284,7 @@ void CCustomMouse::release()
{
if (!isAlphaBlendedCursorSupported()) return;
nlassert(Driver);
HWND drvWnd = (HWND) Driver->getDisplay();
HWND drvWnd = Driver->getDisplay();
if (drvWnd)
{
SetClassLongPtr(drvWnd, GCLP_HCURSOR, 0);
@ -353,7 +353,7 @@ void CCustomMouse::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 r
if (CInputHandlerManager::getInstance()->hasFocus())
{
::SetCursor(cursorHandle);
HWND drvWnd = (HWND) Driver->getDisplay();
HWND drvWnd = Driver->getDisplay();
if (drvWnd)
{
SetClassLongPtr(drvWnd, GCLP_HCURSOR, (LONG_PTR) cursorHandle); // set default mouse icon to the last one
@ -449,7 +449,7 @@ void CCustomMouse::setSystemArrow()
{
::SetCursor(arrow);
}
HWND drvWnd = (HWND) Driver->getDisplay();
HWND drvWnd = Driver->getDisplay();
if (drvWnd)
{
SetClassLongPtr(drvWnd, GCLP_HCURSOR, (LONG_PTR) arrow); // set default mouse icon to the last one

View file

@ -331,6 +331,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
_MouseButtonsState = (TMouseButton) (_MouseButtonsState | pEvent->Button);
rIP.setButtonState(_MouseButtonsState);
updateMousePos((CEventMouse&)event, eventDesc);
// handle Event
if(pEvent->Button & leftButton)
@ -355,6 +356,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
_MouseButtonsState = (TMouseButton) (_MouseButtonsState & ~(pEvent->Button));
rIP.setButtonState(_MouseButtonsState);
updateMousePos((CEventMouse&)event, eventDesc);
// handle Event
if(pEvent->Button & leftButton)
@ -374,6 +376,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
// TODO: yoyo make it work if needed (for now, seems preferable to manage in each ActionHandler)
CEventMouseDblClk* pEvent=(CEventMouseDblClk*)&event;
updateMousePos((CEventMouse&)event, eventDesc);
// handle Event
if(pEvent->Button & leftButton)
@ -401,6 +404,8 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
else
_MouseWheel -= 1;
updateMousePos((CEventMouse&)event, eventDesc);
// handle Event now.
if (_MouseWheel != 0)
{

View file

@ -150,7 +150,7 @@ CLuaState::CLuaState()
TGetLuaIDEInterface getter = (TGetLuaIDEInterface) GetProcAddress(LuaDebuggerModule, "GetLuaIDEInterface");
nlassert(getter);
LuaDebuggerIDE = getter();
LuaDebuggerIDE->prepareDebug("save\\___external_debug.lpr", l_realloc_func, l_free_func, (HWND)Driver->getDisplay());
LuaDebuggerIDE->prepareDebug("save\\___external_debug.lpr", l_realloc_func, l_free_func, Driver->getDisplay());
_State = LuaDebuggerIDE->getLuaState();
}
}

View file

@ -109,7 +109,7 @@ void CMusicPlayer::previous ()
{
// Point the previous song
if (_CurrentSong == 0)
_CurrentSong = _Songs.size()-1;
_CurrentSong = (uint)_Songs.size()-1;
else
_CurrentSong--;
@ -228,7 +228,7 @@ public:
OPENFILENAME ofn;
memset (&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = Driver?(HWND)Driver->getDisplay ():NULL;
ofn.hwndOwner = Driver ? Driver->getDisplay():NULL;
ofn.hInstance = HInstance;
ofn.lpstrFilter = szFilter;
ofn.nFilterIndex = 0;

View file

@ -425,7 +425,7 @@ void loginMainLoop()
#ifdef NL_OS_WINDOWS
{
// Get the window
HWND hWnd = (HWND)Driver->getDisplay ();
HWND hWnd = Driver->getDisplay();
nlassert (hWnd);
// Show the window, unless it has been minimized, in
// which case we don't pop it unexpectedly

View file

@ -1498,14 +1498,7 @@ bool mainLoop()
{
beep( 680, 400 );
beep( 440, 400 );
#ifdef NL_OS_WINDOWS
// Get the window
HWND hWnd = (HWND)Driver->getDisplay ();
nlassert (hWnd);
// Show the window
ShowWindow (hWnd, SW_SHOW);
SetForegroundWindow(hWnd);
#endif // NL_OS_WINDOW
Driver->showWindow();
}
FPU_CHECKER_ONCE

View file

@ -452,20 +452,25 @@ void CUserControls::getMouseAngleMove(float &dx, float &dy)
}
}
#else
// On X11, do the thing without IMouseDevice implementation
// On X11 and Mac, do the thing without IMouseDevice implementation
if( EventsListener.getMousePosX() != _LastFrameMousePosX ||
EventsListener.getMousePosY() != _LastFrameMousePosY )
{
float dmpx, dmpy;
#ifndef NL_MAC_NATIVE
// On X11 in free look mode, the mouse is pulled back to (0.5, 0.5)
// every update to prevent reaching a border and get stuck.
if(IsMouseFreeLook())
{
/*
TODO use setCapture to not fake it
*/
dmpx = EventsListener.getMousePosX() - 0.5;
dmpy = EventsListener.getMousePosY() - 0.5;
}
else
#endif
{
dmpx = EventsListener.getMousePosX() - _LastFrameMousePosX;
dmpy = EventsListener.getMousePosY() - _LastFrameMousePosY;

View file

@ -14,7 +14,9 @@ ELSE(WIN32)
ENDIF(WIN32)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
TARGET_LINK_LIBRARIES(game_share ${NELMISC_LIBRARY})
TARGET_LINK_LIBRARIES(game_share
${NELMISC_LIBRARY} ${NELNET_LIBRARY} ${NELLIGO_LIBRARY} ${NELGEORGES_LIBRARY}
${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES})
SET_TARGET_PROPERTIES(game_share PROPERTIES VERSION ${NL_VERSION})
IF(WIN32)

View file

@ -690,7 +690,7 @@ void CBotNpc::sendVPA() // alternate VPA
visProp.Element.ColorBoot = getSheet()->ColorFeets();
visProp.Element.ColorArm = getSheet()->ColorArms();
visProp.Element.Hat = _Hat;
visProp.Element.Seed = getAlias()!=0?getAlias():(uint32)this;
visProp.Element.Seed = getAlias()!=0?getAlias():(uint32)(size_t)(void*)this;
LOG("BOT: %s L: %d R: %u H: %u CHEAD: %u CARMS: %u CHANDS: %u CBODY: %u CLEGS: %u CFEETS: %u SEED: %u",
getName().c_str(),
visProp.Element.WeaponLeftHand,

View file

@ -894,7 +894,9 @@ void COutpost::createSquad(CGroupDesc<COutpostSquadFamily> const* groupDesc, COu
COutpostSquadCreatedMsg params;
params.Outpost = this->getAlias();
params.CreateOrder = createOrder;
params.GroupId = reinterpret_cast<uint32>(grp);
// Bug #847: Just downcast the pointer to make the groupId, the collision in 64b is negligible
//params.GroupId = reinterpret_cast<uint32>(grp);
params.GroupId = (uint32)(size_t)(void*)grp;
sendOutpostMessage("OUTPOST_SQUAD_CREATED", params);
}
@ -911,7 +913,9 @@ void COutpost::spawnSquad(uint32 groupId)
{
CGroup* group = *itGroup;
CGroupNpc* groupNpc = static_cast<CGroupNpc*>(group);
uint32 thisGroupId = reinterpret_cast<uint32>(groupNpc);
// Bug #847: Just downcast the pointer to make the groupId, the collision in 64b is negligible
//uint32 thisGroupId = reinterpret_cast<uint32>(groupNpc);
uint32 thisGroupId = (uint32)(size_t)(void*)groupNpc;
if (groupId==thisGroupId)
{
group->getSpawnObj()->spawnBots();
@ -932,7 +936,9 @@ void COutpost::spawnSquad(uint32 groupId)
{
CGroup* group = *itGroup;
CGroupNpc* groupNpc = static_cast<CGroupNpc*>(group);
uint32 thisGroupId = reinterpret_cast<uint32>(groupNpc);
// Bug #847: Just downcast the pointer to make the groupId, the collision in 64b is negligible
//uint32 thisGroupId = reinterpret_cast<uint32>(groupNpc);
uint32 thisGroupId = (uint32)(size_t)(void*)groupNpc;
OUTPOST_WRN("- 0x%08x", thisGroupId);
}
}
@ -948,7 +954,9 @@ void COutpost::despawnSquad(uint32 groupId)
{
CGroup* group = *itGroup;
CGroupNpc* groupNpc = static_cast<CGroupNpc*>(group);
uint32 thisGroupId = reinterpret_cast<uint32>(groupNpc);
// Bug #847: Just downcast the pointer to make the groupId, the collision in 64b is negligible
//uint32 thisGroupId = reinterpret_cast<uint32>(groupNpc);
uint32 thisGroupId = (uint32)(size_t)(void*)groupNpc;
if (groupId==thisGroupId)
{
group->despawnBots();
@ -973,7 +981,9 @@ void COutpost::deleteSquad(uint32 groupId)
{
CGroup* group = *itGroup;
CGroupNpc* groupNpc = static_cast<CGroupNpc*>(group);
uint32 thisGroupId = reinterpret_cast<uint32>(groupNpc);
// Bug #847: Just downcast the pointer to make the groupId, the collision in 64b is negligible
//uint32 thisGroupId = reinterpret_cast<uint32>(groupNpc);
uint32 thisGroupId = (uint32)(size_t)(void*)groupNpc;
if (groupId==thisGroupId)
{
manager->groups().removeChildByIndex(group->getChildIndex());
@ -988,7 +998,9 @@ void COutpost::deleteSquad(uint32 groupId)
void COutpost::sendOutpostSquadStatus(CGroupNpc* group)
{
uint32 alias = this->getAlias();
uint32 groupId = reinterpret_cast<uint32>(group);
// Bug #847: Just downcast the pointer to make the groupId, the collision in 64b is negligible
//uint32 groupId = reinterpret_cast<uint32>(group);
uint32 groupId = (uint32)(size_t)(void*)group;
bool groupAlive = false;
bool leaderAlive = group->getSquadLeader()!=NULL;
uint32 botCount = 0;
@ -1011,7 +1023,9 @@ void COutpost::sendOutpostSquadStatus(CGroupNpc* group)
void COutpost::squadLeaderDied(CGroupNpc* group)
{
uint32 alias = this->getAlias();
uint32 groupId = reinterpret_cast<uint32>(group);
// Bug #847: Just downcast the pointer to make the groupId, the collision in 64b is negligible
//uint32 groupId = reinterpret_cast<uint32>(group);
uint32 groupId = (uint32)(size_t)(void*)group;
NLNET::CMessage msgout("OUTPOST_SQUAD_LEADER_DIED");
msgout.serial(alias);
msgout.serial(groupId);
@ -1021,7 +1035,9 @@ void COutpost::squadLeaderDied(CGroupNpc* group)
void COutpost::squadDied(CGroupNpc* group)
{
uint32 alias = this->getAlias();
uint32 groupId = reinterpret_cast<uint32>(group);
// Bug #847: Just downcast the pointer to make the groupId, the collision in 64b is negligible
//uint32 groupId = reinterpret_cast<uint32>(group);
uint32 groupId = (uint32)(size_t)(void*)group;
NLNET::CMessage msgout("OUTPOST_SQUAD_DIED");
msgout.serial(alias);
msgout.serial(groupId);

View file

@ -160,7 +160,7 @@ void CStateInstance::dumpVarsAndFunctions(CStringWriter& sw) const
sw.append("context variables:");
FOREACHC(varIt, TCtxLogicVarList, _CtxLogicVar)
sw.append(" "+CStringMapper::unmap(varIt->first)+" = "+(int)(void*)varIt->second);
sw.append(" "+CStringMapper::unmap(varIt->first)+" = "+(int)(size_t)(void*)varIt->second);
sw.append("callBacks:");
FOREACHC(varIt, TCallBackList, _CallBacks)

View file

@ -162,7 +162,7 @@ bool CFormBodyEltStruct::Empty() const
uint32 CFormBodyEltStruct::GetNbElt () const
{
return vpbodyelt.size();
return (uint32)vpbodyelt.size();
}
CFormBodyElt* CFormBodyEltStruct::GetElt( const unsigned int _index ) const

View file

@ -235,19 +235,19 @@ void CItem::SetCurrentValue( const unsigned int _index, const CStringEx s )
pitemes->SetModified( _index );
}
unsigned int CItem::GetNbElt() const
uint CItem::GetNbElt() const
{
if( pitemes )
return( pitemes->GetNbElt() );
return( 0 );
}
unsigned int CItem::GetNbParents() const
uint CItem::GetNbParents() const
{
return( vsxparents.size() );
return (uint)vsxparents.size();
}
unsigned int CItem::GetNbElt( const unsigned int _index ) const
uint CItem::GetNbElt( const unsigned int _index ) const
{
CItemElt* pie = GetElt( _index );
if( !pie )
@ -255,7 +255,7 @@ unsigned int CItem::GetNbElt( const unsigned int _index ) const
return( pie->GetNbElt() );
}
unsigned int CItem::GetInfos( const unsigned int _index ) const
uint CItem::GetInfos( const unsigned int _index ) const
{
CItemElt* pie = GetElt( _index );
if( !pie )

View file

@ -57,10 +57,10 @@ public:
void MakeItem (CForm &in);
void SetCurrentValue( const unsigned int _index, const CStringEx s );
unsigned int GetNbElt() const;
unsigned int GetNbParents() const;
unsigned int GetNbElt( const unsigned int _index ) const;
unsigned int GetInfos( const unsigned int _index ) const;
uint GetNbElt() const;
uint GetNbParents() const;
uint GetNbElt( const unsigned int _index ) const;
uint GetInfos( const unsigned int _index ) const;
CStringEx GetName( const unsigned int _index ) const;
CStringEx GetCurrentResult( const unsigned int _index ) const;
CStringEx GetCurrentValue( const unsigned int _index ) const;

View file

@ -1,15 +1,19 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="icon_search"
ProjectGUID="{D9678C2E-5137-4A48-BA0D-51B652A08624}"
RootNamespace="icon_search"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
@ -78,6 +82,8 @@
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/icon_search_d.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -100,9 +106,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -171,6 +174,8 @@
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Release/icon_search_r.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -193,17 +198,14 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="DebugFast|Win32"
OutputDirectory=".\DebugFast"
IntermediateDirectory=".\DebugFast"
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@ -224,22 +226,23 @@
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\DebugFast/icon_search.tlb"
TargetEnvironment="3"
TypeLibraryName=".\Debug/icon_search.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../../../code/nel/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
PrecompiledHeaderFile=".\DebugFast/icon_search.pch"
AssemblerListingLocation=".\DebugFast/"
ObjectFile=".\DebugFast/"
ProgramDataBaseFileName=".\DebugFast/"
PrecompiledHeaderFile=".\Debug/icon_search.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
@ -258,14 +261,15 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="jpeg.lib odbc32.lib odbccp32.lib"
OutputFile="icon_search_df.exe"
OutputFile="icon_search_d.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="libc.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\DebugFast/icon_search_df.pdb"
ProgramDatabaseFile=".\Debug/icon_search_d.pdb"
SubSystem="1"
TargetMachine="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@ -279,7 +283,7 @@
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\DebugFast/icon_search.bsc"
OutputFile=".\Debug/icon_search.bsc"
/>
<Tool
Name="VCFxCopTool"
@ -287,17 +291,14 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseDebug|Win32"
OutputDirectory=".\ReleaseDebug"
IntermediateDirectory=".\ReleaseDebug"
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@ -318,26 +319,24 @@
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\ReleaseDebug/icon_search.tlb"
TargetEnvironment="3"
TypeLibraryName=".\Release/icon_search.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../../../code/nel/include"
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
PrecompiledHeaderFile=".\ReleaseDebug/icon_search.pch"
AssemblerListingLocation=".\ReleaseDebug/"
ObjectFile=".\ReleaseDebug/"
ProgramDataBaseFileName=".\ReleaseDebug/"
BufferSecurityCheck="false"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -352,14 +351,11 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="jpeg.lib odbc32.lib odbccp32.lib"
OutputFile="icon_search_rd.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\ReleaseDebug/icon_search_rd.pdb"
OutputFile="icon_search_r.exe"
SubSystem="1"
TargetMachine="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@ -373,7 +369,7 @@
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\ReleaseDebug/icon_search.bsc"
OutputFile=".\Release/icon_search.bsc"
/>
<Tool
Name="VCFxCopTool"
@ -381,9 +377,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -418,7 +411,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -427,7 +420,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"

View file

@ -457,7 +457,7 @@ public:
/// Get full paths of files to publish
uint getFileToPublishCount() { return _FilesToPublish.size(); }
uint getFileToPublishCount() { return (uint)_FilesToPublish.size(); }
std::string getFileToPublish(uint index) { nlassert(index < _FilesToPublish.size()); return _FilesToPublish[index]; }
@ -467,7 +467,7 @@ public:
}
uint getMissionsCount()
{
return _CompiledMission.size();
return (uint)_CompiledMission.size();
}
TMissionDataPtr getMission(uint index)
{

View file

@ -1677,7 +1677,7 @@ class CContentKill : public CContentObjective
{
if (!_KillFaunas.empty())
{
numEntry = _KillFaunas.size();
numEntry = (uint32)_KillFaunas.size();
predef.resize(numEntry);
for (uint i=0; i<_KillFaunas.size(); ++i)
{
@ -1691,7 +1691,7 @@ class CContentKill : public CContentObjective
}
else if (!_KillRaces.empty())
{
numEntry = _KillRaces.size();
numEntry = (uint32)_KillRaces.size();
predef.resize(numEntry);
for (uint i=0; i<_KillRaces.size(); ++i)
{
@ -1712,7 +1712,7 @@ class CContentKill : public CContentObjective
}
else if (!_KillNpcs.empty())
{
numEntry = _KillNpcs.size();
numEntry = (uint32)_KillNpcs.size();
predef.resize(numEntry);
for (uint i=0; i<_KillNpcs.size(); ++i)
{
@ -2013,7 +2013,7 @@ class CContentCast : public CContentObjective
void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef)
{
numEntry = _Actions.size();
numEntry = (uint32)_Actions.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2083,7 +2083,7 @@ class CContentForage : public CContentObjective
virtual void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef)
{
numEntry = _Mps.size();
numEntry = (uint32)_Mps.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2166,7 +2166,7 @@ class CContentLoot : public CContentObjective
{
if (_Mode == lm_item)
{
numEntry = _Items.size();
numEntry = (uint32)_Items.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2179,7 +2179,7 @@ class CContentLoot : public CContentObjective
}
else if (_Mode == lm_mp)
{
numEntry = _Items.size();
numEntry = (uint32)_Items.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2282,7 +2282,7 @@ class CContentCraft : public CContentObjective
virtual void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef)
{
numEntry = _Items.size();
numEntry = (uint32)_Items.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2357,7 +2357,7 @@ class CContentTarget : public CContentObjective
if (!_Npcs.empty())
{
numEntry = _Npcs.size();
numEntry = (uint32)_Npcs.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2370,7 +2370,7 @@ class CContentTarget : public CContentObjective
}
else if (!_Faunas.empty())
{
numEntry = _Faunas.size();
numEntry = (uint32)_Faunas.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2383,7 +2383,7 @@ class CContentTarget : public CContentObjective
}
else if (!_Races.empty())
{
numEntry = _Races.size();
numEntry = (uint32)_Races.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2486,7 +2486,7 @@ class CContentSell : public CContentObjective
virtual void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef)
{
numEntry = _Items.size();
numEntry = (uint32)_Items.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2571,7 +2571,7 @@ class CContentBuy : public CContentObjective
virtual void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef)
{
numEntry = _Items.size();
numEntry = (uint32)_Items.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2653,7 +2653,7 @@ class CContentGive : public CContentObjective
virtual void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef)
{
numEntry = _Items.size();
numEntry = (uint32)_Items.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)
{
@ -2882,7 +2882,7 @@ class CContentSkill: public CContentObjective
virtual void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef)
{
numEntry = _Skills.size();
numEntry = (uint32)_Skills.size();
predef.resize(numEntry);
for (uint i=0; i<numEntry; ++i)

View file

@ -304,7 +304,7 @@ void GetItemColor( int color, char eco, int level, CSString& outStr )
bool endsWith( const CSString& s, const CSString& substring )
{
return (s.right( substring.size() ) == substring);
return (s.right( (uint)substring.size() ) == substring);
}

View file

@ -1,25 +1,28 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="mp_generator"
ProjectGUID="{DA23C491-DE13-4DD0-84CD-132E2905DFD6}"
RootNamespace="mp_generator"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="ReleaseDebug|Win32"
OutputDirectory=".\ReleaseDebug"
IntermediateDirectory=".\ReleaseDebug"
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@ -38,26 +41,24 @@
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\ReleaseDebug/mp_generator.tlb"
TargetEnvironment="3"
TypeLibraryName=".\Release/mp_generator.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../../../code/nel/include"
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE"
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
PrecompiledHeaderFile=".\ReleaseDebug/mp_generator.pch"
AssemblerListingLocation=".\ReleaseDebug/"
ObjectFile=".\ReleaseDebug/"
ProgramDataBaseFileName=".\ReleaseDebug/"
BufferSecurityCheck="false"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -72,14 +73,14 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libxml2.lib odbc32.lib odbccp32.lib"
OutputFile="mp_generator_rd.exe"
OutputFile="mp_generator_r.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="mp_generator.pdb"
AdditionalLibraryDirectories=""
IgnoreDefaultLibraryNames=""
SubSystem="1"
TargetMachine="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@ -93,7 +94,7 @@
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\ReleaseDebug/mp_generator.bsc"
OutputFile=".\Release/mp_generator.bsc"
/>
<Tool
Name="VCFxCopTool"
@ -101,9 +102,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -113,7 +111,6 @@
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@ -172,6 +169,8 @@
IgnoreDefaultLibraryNames="msvcrtd.lib"
ProgramDatabaseFile="mp_generator_r.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -194,19 +193,15 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="DebugFast|Win32"
OutputDirectory=".\DebugFast"
IntermediateDirectory=".\DebugFast"
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@ -225,20 +220,22 @@
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\DebugFast/mp_generator.tlb"
TargetEnvironment="3"
TypeLibraryName=".\Debug/mp_generator.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../.,../../../../../code/nel/include"
PreprocessorDefinitions="WIN32;_CONSOLE"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
PrecompiledHeaderFile=".\DebugFast/mp_generator.pch"
AssemblerListingLocation=".\DebugFast/"
ObjectFile=".\DebugFast/"
ProgramDataBaseFileName=".\DebugFast/"
AdditionalIncludeDirectories="../../../../../code/nel/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
PrecompiledHeaderFile=".\Debug/mp_generator.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
@ -248,7 +245,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
@ -256,14 +253,15 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libxml2.lib odbc32.lib odbccp32.lib "
OutputFile="mp_generator_df.exe"
LinkIncremental="1"
OutputFile="mp_generator_d.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="mp_generator.pdb"
ProgramDatabaseFile=".\Debug/mp_generator_d.pdb"
SubSystem="1"
TargetMachine="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@ -277,7 +275,7 @@
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\DebugFast/mp_generator.bsc"
OutputFile=".\Debug/mp_generator.bsc"
/>
<Tool
Name="VCFxCopTool"
@ -285,9 +283,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -297,7 +292,6 @@
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@ -354,6 +348,8 @@
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/mp_generator_d.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -376,9 +372,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -395,7 +388,7 @@
RelativePath="main.cpp"
>
<FileConfiguration
Name="ReleaseDebug|Win32"
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -413,7 +406,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"

View file

@ -143,7 +143,7 @@ public:
{
for ( std::vector<std::string>::const_iterator ik=item.Fields[c].begin(); ik!=item.Fields[c].end(); ++ik )
{
_Indices[c].insert( make_pair( *ik, _Items.size()-1 ) );
_Indices[c].insert( make_pair( *ik, (uint32)_Items.size()-1 ) );
}
}
}

View file

@ -1,257 +1,379 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Version="9.00"
Name="prim_export"
ProjectGUID="{96975416-BE2B-4458-8DF4-91870D25C46B}"
SccProjectName=""
SccLocalPath="">
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"/>
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="ReleaseDebug|Win32"
OutputDirectory=".\ReleaseDebug"
IntermediateDirectory=".\ReleaseDebug"
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
TypeLibraryName=".\Release/prim_export.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="_CONSOLE;WIN32;NDEBUG"
StringPooling="TRUE"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\ReleaseDebug/prim_export.pch"
AssemblerListingLocation=".\ReleaseDebug/"
ObjectFile=".\ReleaseDebug/"
ProgramDataBaseFileName=".\ReleaseDebug/"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/prim_export.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/>
SuppressStartupBanner="true"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="freetype.lib libxml2_a.lib odbc32.lib odbccp32.lib"
OutputFile=".\ReleaseDebug/prim_export.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\ReleaseDebug/prim_export.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\ReleaseDebug/prim_export.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
Culture="1033"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"/>
Name="VCLinkerTool"
AdditionalDependencies="freetype.lib libxml2.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/prim_export.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/prim_export.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCWebDeploymentTool"/>
Name="VCALinkTool"
/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
Name="VCManifestTool"
/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/prim_export.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/prim_export.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
SuppressStartupBanner="true"
/>
<Tool
Name="VCCustomBuildTool"/>
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="freetype.lib libxml2.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/prim_export.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/prim_export.pdb"
SubSystem="1"
TargetMachine="1"/>
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/prim_export.tlb"
HeaderFileName=""/>
Name="VCALinkTool"
/>
<Tool
Name="VCPostBuildEventTool"/>
Name="VCManifestTool"
/>
<Tool
Name="VCPreBuildEventTool"/>
Name="VCXDCMakeTool"
/>
<Tool
Name="VCPreLinkEventTool"/>
Name="VCBscMakeTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
Name="VCFxCopTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
Name="VCAppVerifierTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="DebugFast|Win32"
OutputDirectory=".\DebugFast"
IntermediateDirectory=".\DebugFast"
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
TypeLibraryName=".\Debug/prim_export.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\DebugFast/prim_export.pch"
AssemblerListingLocation=".\DebugFast/"
ObjectFile=".\DebugFast/"
ProgramDataBaseFileName=".\DebugFast/"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/prim_export.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/>
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="freetype.lib libxml2.lib odbc32.lib odbccp32.lib"
OutputFile=".\DebugFast/prim_export.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\DebugFast/prim_export.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\DebugFast/prim_export.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
Culture="1033"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"/>
Name="VCLinkerTool"
AdditionalDependencies="freetype.lib libxml2.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/prim_export.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/prim_export.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCWebDeploymentTool"/>
Name="VCALinkTool"
/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
Name="VCManifestTool"
/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/prim_export.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/prim_export.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/>
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCCustomBuildTool"/>
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="freetype.lib libxml2.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/prim_export.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/prim_export.pdb"
SubSystem="1"
TargetMachine="1"/>
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/prim_export.tlb"
HeaderFileName=""/>
Name="VCALinkTool"
/>
<Tool
Name="VCPostBuildEventTool"/>
Name="VCManifestTool"
/>
<Tool
Name="VCPreBuildEventTool"/>
Name="VCXDCMakeTool"
/>
<Tool
Name="VCPreLinkEventTool"/>
Name="VCBscMakeTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
Name="VCFxCopTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
Name="VCAppVerifierTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
@ -259,57 +381,72 @@
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="main.cpp">
RelativePath="main.cpp"
>
<FileConfiguration
Name="ReleaseDebug|Win32">
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32">
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\master\ContinentCfg.h">
RelativePath="..\master\ContinentCfg.h"
>
</File>
<File
RelativePath="..\master\easy_cfg.h">
RelativePath="..\master\easy_cfg.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter>
<File
RelativePath="prim_export.cfg">
RelativePath="prim_export.cfg"
>
</File>
</Files>
<Globals>

View file

@ -29,7 +29,7 @@ int main(int argc, char *argv[])
// Add the search paths
CConfigFile::CVar &sp = cf.getVar("SearchPath");
for (int i=0; i<sp.size(); ++i)
for (uint i=0; i<sp.size(); ++i)
{
CPath::addSearchPath(sp.asString(i), true, false);
}
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
// parse the index file
CConfigFile::CVar &fl = indexFile.getVar("Files");
for (int i=0; i<(fl.size())/2; i++)
for (uint i=0; i<(fl.size())/2; i++)
{
string fileName;
uint32 index;
@ -82,7 +82,7 @@ int main(int argc, char *argv[])
}
// scan the search path
for (int i=0; i<ext.size(); ++i)
for (uint i=0; i<ext.size(); ++i)
{
vector<string> files;
CPath::getFileList(ext.asString(i), files);
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
// check the first on full path
bool filtered = false;
string path = CPath::lookup(fileName);
for (int i=0; i<filters.size(); ++i)
for (uint i=0; i<filters.size(); ++i)
{
if (path.find(filters.asString(i)) != string::npos)
{

View file

@ -1,16 +1,20 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="variable_parser"
ProjectGUID="{294FC08E-91F1-4838-AA4D-13A457E227E9}"
RootNamespace="variable_parser"
Keyword="MFCProj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
@ -20,7 +24,6 @@
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@ -84,6 +87,8 @@
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/variable_parser_r.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -106,9 +111,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -118,7 +120,6 @@
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@ -182,6 +183,8 @@
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/variable_parser_d.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -205,18 +208,110 @@
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="3"
TypeLibraryName=".\Release/variable_parser.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../../../code/nel/include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/variable_parser.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="nlmisc_r.lib"
OutputFile="variable_parser_r.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/variable_parser_r.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Release/variable_parser.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="DebugFast|Win32"
OutputDirectory=".\DebugFast"
IntermediateDirectory=".\DebugFast"
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@ -238,25 +333,24 @@
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\DebugFast/variable_parser.tlb"
TargetEnvironment="3"
TypeLibraryName=".\Debug/variable_parser.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../../../code/nel/include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\DebugFast/variable_parser.pch"
AssemblerListingLocation=".\DebugFast/"
ObjectFile=".\DebugFast/"
ProgramDataBaseFileName=".\DebugFast/"
PrecompiledHeaderFile=".\Debug/variable_parser.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
@ -274,14 +368,16 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="lua_r.lib"
OutputFile="variable_parser_df.exe"
AdditionalDependencies="nlmisc_d.lib"
OutputFile="variable_parser_d.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\DebugFast/variable_parser_df.pdb"
ProgramDatabaseFile=".\Debug/variable_parser_d.pdb"
SubSystem="2"
TargetMachine="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@ -295,7 +391,7 @@
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\DebugFast/variable_parser.bsc"
OutputFile=".\Debug/variable_parser.bsc"
/>
<Tool
Name="VCFxCopTool"
@ -303,106 +399,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseDebug|Win32"
OutputDirectory=".\ReleaseDebug"
IntermediateDirectory=".\ReleaseDebug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\ReleaseDebug/variable_parser.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../../../code/nel/include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\ReleaseDebug/variable_parser.pch"
AssemblerListingLocation=".\ReleaseDebug/"
ObjectFile=".\ReleaseDebug/"
ProgramDataBaseFileName=".\ReleaseDebug/"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="lua_r.lib"
OutputFile="variable_parser_rd.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\ReleaseDebug/variable_parser_rd.pdb"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\ReleaseDebug/variable_parser.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -437,7 +433,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -446,7 +442,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -479,7 +475,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -489,7 +485,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -521,7 +517,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -530,7 +526,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -559,7 +555,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
Name="Release|x64"
>
<Tool
Name="VCResourceCompilerTool"
@ -567,7 +563,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
Name="Debug|x64"
>
<Tool
Name="VCResourceCompilerTool"
@ -597,7 +593,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="DebugFast|Win32"
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -606,7 +602,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseDebug|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"

View file

@ -1889,7 +1889,7 @@ void CExport::cutZone (NL3D::CZone &bigZone, NL3D::CZone &bigZoneNoHeightmap, NL
PatchTransfered[i] = true;
DstPI.push_back (rPI);
DstPINoHeightmap.push_back (rPINoHeightmap);
OldToNewPatchId.insert (pair<int,int>(i, DstPI.size()-1));
OldToNewPatchId.insert (pair<int,int>(i, (int)DstPI.size()-1));
}
}
@ -1940,7 +1940,7 @@ void CExport::cutZone (NL3D::CZone &bigZone, NL3D::CZone &bigZoneNoHeightmap, NL
PatchTransfered[i] = true;
DstPI.push_back (rPI);
DstPINoHeightmap.push_back (rPINoHeightmap);
OldToNewPatchId.insert (pair<int,int>(i, DstPI.size()-1));
OldToNewPatchId.insert (pair<int,int>(i, (int)DstPI.size()-1));
foundOne = true;
break;
}
@ -1956,7 +1956,7 @@ void CExport::cutZone (NL3D::CZone &bigZone, NL3D::CZone &bigZoneNoHeightmap, NL
while (foundOne);
// Add all patch that are binded to one of those of the DstPI list
uint32 nPreviousDstPISize = DstPI.size();
uint32 nPreviousDstPISize = (uint32)DstPI.size();
for (;;)
{
for (i = 0; i < DstPI.size(); ++i)
@ -1977,7 +1977,7 @@ void CExport::cutZone (NL3D::CZone &bigZone, NL3D::CZone &bigZoneNoHeightmap, NL
}
DstPI.push_back (rPITmp);
DstPINoHeightmap.push_back (rPITmpNoHeightmap);
OldToNewPatchId.insert (pair<int,int>(next, DstPI.size()-1));
OldToNewPatchId.insert (pair<int,int>(next, (int)DstPI.size()-1));
PatchTransfered[next] = true;
}
}
@ -1998,7 +1998,7 @@ void CExport::cutZone (NL3D::CZone &bigZone, NL3D::CZone &bigZoneNoHeightmap, NL
}
DstPI.push_back (rPITmp);
DstPINoHeightmap.push_back (rPITmpNoHeightmap);
OldToNewPatchId.insert (pair<int,int>(next, DstPI.size()-1));
OldToNewPatchId.insert (pair<int,int>(next, (int)DstPI.size()-1));
PatchTransfered[next] = true;
}
}
@ -2009,7 +2009,7 @@ void CExport::cutZone (NL3D::CZone &bigZone, NL3D::CZone &bigZoneNoHeightmap, NL
// Do it until no more patch added
if (nPreviousDstPISize == DstPI.size())
break;
nPreviousDstPISize = DstPI.size();
nPreviousDstPISize = (uint32)DstPI.size();
}
for (i = 0; i < DstPI.size(); ++i)

View file

@ -93,7 +93,10 @@ MACRO(NL_SETUP_BUILD)
IF(WITH_COVERAGE)
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
ENDIF(WITH_COVERAGE)
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++ -lrt")
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++")
IF(NOT APPLE)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lrt")
ENDIF(NOT APPLE)
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -g")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -O6")
SET(NL_RELEASEDEBUG_CFLAGS "-DNL_RELEASE_DEBUG -g -finline-functions -O3 ")