Merge with develop

--HG--
branch : compatibility-develop
This commit is contained in:
kervala 2015-11-08 14:14:53 +01:00
commit 1e892148c7
32 changed files with 111 additions and 79 deletions

View file

@ -429,7 +429,7 @@ private:
void resetTouchFlags() {_InternalFlags &= (uint16)(~TouchedAll);} void resetTouchFlags() {_InternalFlags &= (uint16)(~TouchedAll);}
// Force non resident memory // Force non resident memory
void restaureNonResidentMemory(); void restoreNonResidentMemory();
// Convert current index to a serializable vector // Convert current index to a serializable vector
void buildSerialVector(std::vector<uint32> &dest) const; void buildSerialVector(std::vector<uint32> &dest) const;

View file

@ -653,7 +653,7 @@ private:
void resetTouchFlags() {_InternalFlags &= (uint16)(~TouchedAll);} void resetTouchFlags() {_InternalFlags &= (uint16)(~TouchedAll);}
// Force non resident memory // Force non resident memory
void restaureNonResidentMemory(); void restoreNonResidentMemory();
private: private:

View file

@ -178,7 +178,7 @@ void CCloud::generate (CNoise3d &noise)
_Driver->activeVertexBuffer (rVB); _Driver->activeVertexBuffer (rVB);
_Driver->renderRawQuads (_CloudTexClamp->ToClamp, 0, 1); _Driver->renderRawQuads (_CloudTexClamp->ToClamp, 0, 1);
// Restaure render target // Restore render target
_Driver->setRenderTarget (NULL); _Driver->setRenderTarget (NULL);
_CloudTexTmp->Tex->setFilterMode (ITexture::Nearest, ITexture::NearestMipMapOff); _CloudTexTmp->Tex->setFilterMode (ITexture::Nearest, ITexture::NearestMipMapOff);
@ -685,7 +685,7 @@ void CCloud::genBill (CCamera *pCam, uint32 nBillSize)
dispXYZ (&_CloudTexTmp->ToBill); dispXYZ (&_CloudTexTmp->ToBill);
// Restaure render target // Restore render target
_Driver->setRenderTarget (NULL); _Driver->setRenderTarget (NULL);
// This is the end of render to texture like so reset all stuff // This is the end of render to texture like so reset all stuff

View file

@ -1912,7 +1912,7 @@ bool CDriverD3D::clear2D(CRGBA rgba)
bool result = _DeviceInterface->Clear( 0, NULL, D3DCLEAR_TARGET, NL_D3DCOLOR_RGBA(rgba), 1.0f, 0 ) == D3D_OK; bool result = _DeviceInterface->Clear( 0, NULL, D3DCLEAR_TARGET, NL_D3DCOLOR_RGBA(rgba), 1.0f, 0 ) == D3D_OK;
// Restaure the old viewport // Restore the old viewport
setupViewport (oldViewport); setupViewport (oldViewport);
return result; return result;
} }
@ -1931,7 +1931,7 @@ bool CDriverD3D::clearZBuffer(float zval)
bool result = _DeviceInterface->Clear( 0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0,0,0,0), zval, 0 ) == D3D_OK; bool result = _DeviceInterface->Clear( 0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0,0,0,0), zval, 0 ) == D3D_OK;
// Restaure the old viewport // Restore the old viewport
setupViewport (oldViewport); setupViewport (oldViewport);
// NVidia driver 56.72 needs to reset the vertex buffer after a clear Z // NVidia driver 56.72 needs to reset the vertex buffer after a clear Z
@ -1954,7 +1954,7 @@ bool CDriverD3D::clearStencilBuffer(float stencilval)
bool result = _DeviceInterface->Clear( 0, NULL, D3DCLEAR_STENCIL, D3DCOLOR_ARGB(0,0,0,0), 1.0f, (unsigned long)stencilval ) == D3D_OK; bool result = _DeviceInterface->Clear( 0, NULL, D3DCLEAR_STENCIL, D3DCOLOR_ARGB(0,0,0,0), 1.0f, (unsigned long)stencilval ) == D3D_OK;
// Restaure the old viewport // Restore the old viewport
setupViewport (oldViewport); setupViewport (oldViewport);
return result; return result;
@ -2526,7 +2526,7 @@ bool CDriverD3D::reset (const GfxMode& mode)
_CurrentMaterial = NULL; _CurrentMaterial = NULL;
_CurrentMaterialInfo = NULL; _CurrentMaterialInfo = NULL;
// Restaure non managed vertex buffer in system memory // Restore non managed vertex buffer in system memory
ItVBDrvInfoPtrList iteVb = _VBDrvInfos.begin(); ItVBDrvInfoPtrList iteVb = _VBDrvInfos.begin();
while (iteVb != _VBDrvInfos.end()) while (iteVb != _VBDrvInfos.end())
{ {

View file

@ -49,7 +49,7 @@ uint indexCount=0;
CIBDrvInfosD3D::~CIBDrvInfosD3D() CIBDrvInfosD3D::~CIBDrvInfosD3D()
{ {
H_AUTO_D3D(CIBDrvInfosD3D_CIBDrvInfosD3DDtor); H_AUTO_D3D(CIBDrvInfosD3D_CIBDrvInfosD3DDtor);
// Restaure non resident memory // Restore non resident memory
if (IndexBufferPtr) if (IndexBufferPtr)
{ {
IndexBufferPtr->setLocation(CIndexBuffer::NotResident); IndexBufferPtr->setLocation(CIndexBuffer::NotResident);

View file

@ -818,7 +818,7 @@ bool CDriverD3D::setupMaterial(CMaterial &mat)
if (_CurrentMaterial != &mat) if (_CurrentMaterial != &mat)
{ {
// Material has changed ? // Material has changed ?
// Restaure fog state to its current value // Restore fog state to its current value
{ {
H_AUTO_D3D(CDriverD3D_setupMaterial_updateFog) H_AUTO_D3D(CDriverD3D_setupMaterial_updateFog)
setRenderState (D3DRS_FOGENABLE, _FogEnabled?TRUE:FALSE); setRenderState (D3DRS_FOGENABLE, _FogEnabled?TRUE:FALSE);

View file

@ -63,7 +63,7 @@ CVBDrvInfosD3D::~CVBDrvInfosD3D()
{ {
H_AUTO_D3D(CVBDrvInfosD3D_CVBDrvInfosD3D) H_AUTO_D3D(CVBDrvInfosD3D_CVBDrvInfosD3D)
CDriverD3D *driver = static_cast<CDriverD3D*>(_Driver); CDriverD3D *driver = static_cast<CDriverD3D*>(_Driver);
// Restaure non resident memory // Restore non resident memory
if (VertexBufferPtr) if (VertexBufferPtr)
{ {
VertexBufferPtr->setLocation(CVertexBuffer::NotResident); VertexBufferPtr->setLocation(CVertexBuffer::NotResident);

View file

@ -234,7 +234,7 @@ CDriverGL::CDriverGL()
_CursorScale = 1.f; _CursorScale = 1.f;
_MouseCaptured = false; _MouseCaptured = false;
_NeedToRestaureGammaRamp = false; _NeedToRestoreGammaRamp = false;
_win = EmptyWindow; _win = EmptyWindow;
_WindowX = 0; _WindowX = 0;

View file

@ -1558,7 +1558,7 @@ private:
// Monitor color parameters backup // Monitor color parameters backup
bool _NeedToRestaureGammaRamp; bool _NeedToRestoreGammaRamp;
uint16 _GammaRampBackuped[3*256]; uint16 _GammaRampBackuped[3*256];

View file

@ -532,7 +532,7 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
} }
else else
{ {
// Restaure fog state to its current value // Restore fog state to its current value
_DriverGLStates.enableFog(_FogEnabled); _DriverGLStates.enableFog(_FogEnabled);
} }

View file

@ -71,7 +71,7 @@ CVBDrvInfosGL::CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffe
CVBDrvInfosGL::~CVBDrvInfosGL() CVBDrvInfosGL::~CVBDrvInfosGL()
{ {
H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGLDtor) H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGLDtor)
// Restaure non resident memory // Restore non resident memory
if (VertexBufferPtr) if (VertexBufferPtr)
{ {
VertexBufferPtr->setLocation(CVertexBuffer::NotResident); VertexBufferPtr->setLocation(CVertexBuffer::NotResident);

View file

@ -329,7 +329,7 @@ bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc)
HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL); HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL);
if (dc) if (dc)
{ {
_NeedToRestaureGammaRamp = GetDeviceGammaRamp (dc, _GammaRampBackuped) != FALSE; _NeedToRestoreGammaRamp = GetDeviceGammaRamp (dc, _GammaRampBackuped) != FALSE;
// Release the DC // Release the DC
ReleaseDC (NULL, dc); ReleaseDC (NULL, dc);
@ -465,8 +465,8 @@ bool CDriverGL::unInit()
} }
_Registered = 0; _Registered = 0;
// Restaure monitor color parameters // Restore monitor color parameters
if (_NeedToRestaureGammaRamp) if (_NeedToRestoreGammaRamp)
{ {
HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL); HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL);
if (dc) if (dc)
@ -1758,14 +1758,14 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle)
#elif defined(NL_OS_MAC) #elif defined(NL_OS_MAC)
// leave fullscreen mode, enter windowed mode // leave fullscreen mode, enter windowed mode
if(windowStyle == EWSWindowed && [containerView() isInFullScreenMode]) if (windowStyle == EWSWindowed && [containerView() isInFullScreenMode])
{ {
// disable manual setting of back buffer size, cocoa handles this // disable manual setting of back buffer size, cocoa handles this
// automatically as soon as the view gets resized // automatically as soon as the view gets resized
CGLError error = CGLDisable((CGLContextObj)[_ctx CGLContextObj], CGLError error = CGLDisable((CGLContextObj)[_ctx CGLContextObj],
kCGLCESurfaceBackingSize); kCGLCESurfaceBackingSize);
if(error != kCGLNoError) if (error != kCGLNoError)
nlerror("cannot disable kCGLCESurfaceBackingSize (%s)", nlerror("cannot disable kCGLCESurfaceBackingSize (%s)",
CGLErrorString(error)); CGLErrorString(error));
@ -1780,20 +1780,20 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle)
} }
// enter fullscreen, leave windowed mode // enter fullscreen, leave windowed mode
else if(windowStyle == EWSFullscreen && ![containerView() isInFullScreenMode]) else if (windowStyle == EWSFullscreen && ![containerView() isInFullScreenMode])
{ {
// enable manual back buffer size for mode setting in fullscreen // enable manual back buffer size for mode setting in fullscreen
CGLError error = CGLEnable((CGLContextObj)[_ctx CGLContextObj], CGLError error = CGLEnable((CGLContextObj)[_ctx CGLContextObj],
kCGLCESurfaceBackingSize); kCGLCESurfaceBackingSize);
if(error != kCGLNoError) if (error != kCGLNoError)
nlerror("cannot enable kCGLCESurfaceBackingSize (%s)", nlerror("cannot enable kCGLCESurfaceBackingSize (%s)",
CGLErrorString(error)); CGLErrorString(error));
// put the view in fullscreen mode, hiding the dock but enabling the menubar // put the view in fullscreen mode, hiding the dock but enabling the menubar
// to pop up if the mouse hits the top screen border. // to pop up if the mouse hits the top screen border.
// NOTE: withOptions:nil disables <CMD>+<Tab> application switching! // NOTE: withOptions:nil disables <CMD>+<Tab> application switching!
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_MAC_VERSION_10_6_UP
[containerView() enterFullScreenMode:[NSScreen mainScreen] withOptions: [containerView() enterFullScreenMode:[NSScreen mainScreen] withOptions:
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: [NSNumber numberWithInt:
@ -1917,8 +1917,9 @@ bool CDriverGL::setMode(const GfxMode& mode)
return true; return true;
} }
#if defined(NL_OS_MAC) && defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_OS_MAC
#ifdef NL_MAC_VERSION_10_6_UP
/// helper to extract bits per pixel value from screen mode, only 16 or 32 bits /// helper to extract bits per pixel value from screen mode, only 16 or 32 bits
static int bppFromDisplayMode(CGDisplayModeRef mode) static int bppFromDisplayMode(CGDisplayModeRef mode)
@ -1936,7 +1937,7 @@ static int bppFromDisplayMode(CGDisplayModeRef mode)
return 0; return 0;
} }
#elif defined(NL_OS_MAC) #else
long GetDictionaryLong(CFDictionaryRef theDict, const void* key) long GetDictionaryLong(CFDictionaryRef theDict, const void* key)
{ {
@ -1953,7 +1954,9 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void* key)
#define GetModeHeight(mode) GetDictionaryLong((mode), kCGDisplayHeight) #define GetModeHeight(mode) GetDictionaryLong((mode), kCGDisplayHeight)
#define GetModeBitsPerPixel(mode) GetDictionaryLong((mode), kCGDisplayBitsPerPixel) #define GetModeBitsPerPixel(mode) GetDictionaryLong((mode), kCGDisplayBitsPerPixel)
#endif // defined(NL_OS_MAC) #endif
#endif // NL_OS_MAC
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::getModes(std::vector<GfxMode> &modes) bool CDriverGL::getModes(std::vector<GfxMode> &modes)
@ -2000,7 +2003,7 @@ bool CDriverGL::getModes(std::vector<GfxMode> &modes)
{ {
CGDirectDisplayID dspy = display[i]; CGDirectDisplayID dspy = display[i];
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_MAC_VERSION_10_6_UP
CFArrayRef modeList = CGDisplayCopyAllDisplayModes(dspy, NULL); CFArrayRef modeList = CGDisplayCopyAllDisplayModes(dspy, NULL);
#else #else
CFArrayRef modeList = CGDisplayAvailableModes(dspy); CFArrayRef modeList = CGDisplayAvailableModes(dspy);
@ -2014,7 +2017,7 @@ bool CDriverGL::getModes(std::vector<GfxMode> &modes)
for (CFIndex j = 0; j < CFArrayGetCount(modeList); ++j) for (CFIndex j = 0; j < CFArrayGetCount(modeList); ++j)
{ {
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_MAC_VERSION_10_6_UP
CGDisplayModeRef mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modeList, j); CGDisplayModeRef mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modeList, j);
uint8 bpp = bppFromDisplayMode(mode); uint8 bpp = bppFromDisplayMode(mode);
#else #else
@ -2024,7 +2027,7 @@ bool CDriverGL::getModes(std::vector<GfxMode> &modes)
if (bpp >= 16) if (bpp >= 16)
{ {
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_MAC_VERSION_10_6_UP
uint16 w = CGDisplayModeGetWidth(mode); uint16 w = CGDisplayModeGetWidth(mode);
uint16 h = CGDisplayModeGetHeight(mode); uint16 h = CGDisplayModeGetHeight(mode);
#else #else
@ -2047,6 +2050,10 @@ bool CDriverGL::getModes(std::vector<GfxMode> &modes)
// nldebug(" Display 0x%x: Mode %dx%d, %d BPP", dspy, w, h, bpp); // nldebug(" Display 0x%x: Mode %dx%d, %d BPP", dspy, w, h, bpp);
} }
} }
#ifdef NL_MAC_VERSION_10_6_UP
CFRelease(modeList);
#endif
} }
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)

View file

@ -27,7 +27,7 @@ using NL3D::CDriverGL;
#endif #endif
@interface CocoaApplicationDelegate : NSObject @interface CocoaApplicationDelegate : NSObject
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_MAC_VERSION_10_6_UP
<NSApplicationDelegate> <NSApplicationDelegate>
#endif #endif
{ {

View file

@ -14,6 +14,7 @@
// You should have received a copy of the GNU Affero General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../stdopengl.h"
#include "cocoa_event_emitter.h" #include "cocoa_event_emitter.h"
namespace NLMISC namespace NLMISC
@ -380,7 +381,7 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server)
case NSOtherMouseDown:break; case NSOtherMouseDown:break;
case NSOtherMouseUp:break; case NSOtherMouseUp:break;
case NSOtherMouseDragged:break; case NSOtherMouseDragged:break;
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_MAC_VERSION_10_6_UP
case NSEventTypeGesture:break; case NSEventTypeGesture:break;
case NSEventTypeMagnify:break; case NSEventTypeMagnify:break;
case NSEventTypeSwipe:break; case NSEventTypeSwipe:break;

View file

@ -47,7 +47,7 @@ static void viewDidResize(NSView* view, CDriverGL* driver)
-(void)keyDown:(NSEvent*)event -(void)keyDown:(NSEvent*)event
{ {
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_MAC_VERSION_10_6_UP
[[self inputContext] handleEvent:event]; [[self inputContext] handleEvent:event];
#endif #endif
} }

View file

@ -28,7 +28,7 @@ using NL3D::CDriverGL;
#endif #endif
@interface CocoaWindowDelegate : NSObject @interface CocoaWindowDelegate : NSObject
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 #ifdef NL_MAC_VERSION_10_6_UP
<NSWindowDelegate> <NSWindowDelegate>
#endif #endif
{ {

View file

@ -31,8 +31,7 @@ static void windowDidMove(NSWindow* window, CDriverGL* driver)
driver->_WindowX = windowRect.origin.x; driver->_WindowX = windowRect.origin.x;
// map y from cocoa to NeL coordinates before setting in driver // map y from cocoa to NeL coordinates before setting in driver
driver->_WindowY = driver->_WindowY = screenRect.size.height - windowRect.size.height - windowRect.origin.y;
screenRect.size.height - windowRect.size.height - windowRect.origin.y;
} }
@implementation CocoaWindowDelegate @implementation CocoaWindowDelegate

View file

@ -100,4 +100,10 @@
#include "nel/3d/light.h" #include "nel/3d/light.h"
#include "nel/3d/index_buffer.h" #include "nel/3d/index_buffer.h"
#ifdef NL_OS_MAC
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
#define NL_MAC_VERSION_10_6_UP
#else
#endif
#endif #endif

View file

@ -106,7 +106,7 @@ CIndexBuffer::~CIndexBuffer()
// Single value // Single value
if (DrvInfos) if (DrvInfos)
DrvInfos->IndexBufferPtr = NULL; // Tell the driver info to not restaure memory when it will die DrvInfos->IndexBufferPtr = NULL; // Tell the driver info to not restore memory when it will die
// Must kill the drv mirror of this VB. // Must kill the drv mirror of this VB.
DrvInfos.kill(); DrvInfos.kill();
@ -144,7 +144,7 @@ void CIndexBuffer::setPreferredMemory (TPreferredMemory preferredMemory, bool ke
_KeepLocalMemory = keepLocalMemory; _KeepLocalMemory = keepLocalMemory;
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
} }
@ -159,7 +159,7 @@ void CIndexBuffer::reserve(uint32 n)
_NbIndexes=std::min (_NbIndexes,_Capacity); _NbIndexes=std::min (_NbIndexes,_Capacity);
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
} }
@ -206,7 +206,7 @@ void CIndexBuffer::deleteAllIndexes()
} }
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
// Delete driver info // Delete driver info
nlassert (DrvInfos == NULL); nlassert (DrvInfos == NULL);
@ -276,12 +276,12 @@ void CIndexBuffer::setLocation (TLocation newLocation)
// *************************************************************************** // ***************************************************************************
void CIndexBuffer::restaureNonResidentMemory() void CIndexBuffer::restoreNonResidentMemory()
{ {
setLocation (NotResident); setLocation (NotResident);
if (DrvInfos) if (DrvInfos)
DrvInfos->IndexBufferPtr = NULL; // Tell the driver info to not restaure memory when it will die DrvInfos->IndexBufferPtr = NULL; // Tell the driver info to not restore memory when it will die
// Must kill the drv mirror of this VB. // Must kill the drv mirror of this VB.
DrvInfos.kill(); DrvInfos.kill();
@ -407,7 +407,7 @@ void CIndexBuffer::serial(NLMISC::IStream &f)
if (f.isReading()) if (f.isReading())
{ {
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
} }

View file

@ -166,7 +166,7 @@ CVertexBuffer::~CVertexBuffer()
* ***********************************************/ * ***********************************************/
if (DrvInfos) if (DrvInfos)
DrvInfos->VertexBufferPtr = NULL; // Tell the driver info to not restaure memory when it will die DrvInfos->VertexBufferPtr = NULL; // Tell the driver info to not restore memory when it will die
// Must kill the drv mirror of this VB. // Must kill the drv mirror of this VB.
DrvInfos.kill(); DrvInfos.kill();
@ -302,7 +302,7 @@ bool CVertexBuffer::setVertexFormat(uint32 flags)
initEx (); initEx ();
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
return (true); return (true);
} }
@ -468,7 +468,7 @@ void CVertexBuffer::initEx ()
_Capacity = 0; _Capacity = 0;
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
// -------------------------------------------------- // --------------------------------------------------
@ -482,7 +482,7 @@ void CVertexBuffer::reserve(uint32 n)
_NbVerts=std::min (_NbVerts,_Capacity); _NbVerts=std::min (_NbVerts,_Capacity);
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
} }
@ -518,7 +518,7 @@ void CVertexBuffer::deleteAllVertices()
} }
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
// Delete driver info // Delete driver info
nlassert (DrvInfos == NULL); nlassert (DrvInfos == NULL);
@ -725,7 +725,7 @@ void CVertexBuffer::serialOldV1Minus(NLMISC::IStream &f, sint ver)
if(f.isReading()) if(f.isReading())
{ {
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
} }
@ -979,7 +979,7 @@ void CVertexBuffer::serialSubset(NLMISC::IStream &f, uint vertexStart, uint ver
if(f.isReading()) if(f.isReading())
{ {
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
} }
@ -1029,7 +1029,7 @@ bool CVertexBuffer::setVertexColorFormat (TVertexColorType format)
_VertexColorFormat = (uint8)format; _VertexColorFormat = (uint8)format;
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
return true; return true;
} }
@ -1044,7 +1044,7 @@ void CVertexBuffer::setPreferredMemory (TPreferredMemory preferredMemory, bool k
_KeepLocalMemory = keepLocalMemory; _KeepLocalMemory = keepLocalMemory;
// Force non resident // Force non resident
restaureNonResidentMemory(); restoreNonResidentMemory();
} }
} }
@ -1110,12 +1110,12 @@ void CVertexBuffer::setLocation (TLocation newLocation)
} }
// -------------------------------------------------- // --------------------------------------------------
void CVertexBuffer::restaureNonResidentMemory() void CVertexBuffer::restoreNonResidentMemory()
{ {
setLocation (NotResident); setLocation (NotResident);
if (DrvInfos) if (DrvInfos)
DrvInfos->VertexBufferPtr = NULL; // Tell the driver info to not restaure memory when it will die DrvInfos->VertexBufferPtr = NULL; // Tell the driver info to not restore memory when it will die
// Must kill the drv mirror of this VB. // Must kill the drv mirror of this VB.
DrvInfos.kill(); DrvInfos.kill();

View file

@ -677,7 +677,7 @@ void CFairMutex::debugEndEnter()
if (_Mutex == (void*)0x88) if (_Mutex == (void*)0x88)
{ {
OutputDebugString (str); OutputDebugString (str);
if (entered) __asm int 3; if (entered) __debugbreak();
entered = true; entered = true;
} }
*/ */
@ -704,7 +704,7 @@ void CFairMutex::debugLeave()
if (_Mutex == (void*)0x88) if (_Mutex == (void*)0x88)
{ {
OutputDebugString (str); OutputDebugString (str);
if (!entered) __asm int 3; if (!entered) __debugbreak();
entered = false; entered = false;
} }
*/ */

View file

@ -298,7 +298,8 @@ void CRGBA::modulateColors(CRGBA *dest, const CRGBA *src1, const CRGBA *src2, ui
uint64 blank = 0; uint64 blank = 0;
/// well, this could be further optimized when stride is 4 /// well, this could be further optimized when stride is 4
if (dup == 1) if (dup == 1)
{ __asm {
__asm
{ {
push ebp push ebp
movq mm2, blank movq mm2, blank

View file

@ -24,21 +24,26 @@ void browseFAQ(NLMISC::CConfigFile &cf)
std::string url; std::string url;
std::string languageCode = "wk"; std::string languageCode = "wk";
CConfigFile::CVar *languageCodeVarPtr = cf.getVarPtr("LanguageCode"); CConfigFile::CVar *languageCodeVarPtr = cf.getVarPtr("LanguageCode");
if (languageCodeVarPtr) if (languageCodeVarPtr)
{ {
languageCode = languageCodeVarPtr->asString(); languageCode = languageCodeVarPtr->asString();
} }
CConfigFile::CVar *helpPages = cf.getVarPtr("HelpPages"); CConfigFile::CVar *helpPages = cf.getVarPtr("HelpPages");
if (helpPages) if (helpPages)
{ {
for (uint i = 0; i < helpPages->size(); ++i) for (uint i = 0; i < helpPages->size(); ++i)
{ {
std::string entry = helpPages->asString(i); std::string entry = helpPages->asString(i);
if (entry.size() >= languageCode.size()) if (entry.size() >= languageCode.size())
{ {
if (nlstricmp(entry.substr(0, languageCode.size()), languageCode) == 0) if (nlstricmp(entry.substr(0, languageCode.size()), languageCode) == 0)
{ {
std::string::size_type pos = entry.find("="); std::string::size_type pos = entry.find("=");
if (pos != std::string::npos) if (pos != std::string::npos)
{ {
url = entry.substr(pos + 1); url = entry.substr(pos + 1);

View file

@ -440,10 +440,9 @@ int main(int argc, char **argv)
if (string(cmdline) == "/crash") if (string(cmdline) == "/crash")
volatile int toto = *(int*)0; volatile int toto = *(int*)0;
if (string(cmdline) == "/break") if (string(cmdline) == "/break")
__asm {
{ __debugbreak();
int 3 }
};
#endif // TEST_CRASH_COUNTER #endif // TEST_CRASH_COUNTER
HInstance = hInstance; HInstance = hInstance;

View file

@ -54,7 +54,7 @@ END
// Icon with lowest ID value placed first to ensure application icon // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems. // remains consistent on all systems.
IDI_MAIN_ICON ICON DISCARDABLE "ryzom_small.ico" IDI_MAIN_ICON ICON DISCARDABLE "ryzom.ico"
#endif // English (U.S.) resources #endif // English (U.S.) resources
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View file

@ -187,7 +187,7 @@ bool hasPrivilegeEG() { return (UserPrivileges.find(":EG:") != std::string::npos
// Restore the video mode (fullscreen for example) after the connection (done in a window) // Restore the video mode (fullscreen for example) after the connection (done in a window)
void connectionRestaureVideoMode () void connectionRestoreVideoMode ()
{ {
// Setup full screen if we have to // Setup full screen if we have to
UDriver::CMode mode; UDriver::CMode mode;
@ -213,11 +213,11 @@ void connectionRestaureVideoMode ()
(ClientCfg.Width != mode.Width) || (ClientCfg.Width != mode.Width) ||
(ClientCfg.Height != mode.Height))) (ClientCfg.Height != mode.Height)))
{ {
mode.Windowed = ClientCfg.Windowed; mode.Windowed = ClientCfg.Windowed;
mode.Depth = uint8(ClientCfg.Depth); mode.Depth = uint8(ClientCfg.Depth);
mode.Width = ClientCfg.Width; mode.Width = ClientCfg.Width;
mode.Height = ClientCfg.Height; mode.Height = ClientCfg.Height;
mode.Frequency= ClientCfg.Frequency; mode.Frequency = ClientCfg.Frequency;
setVideoMode(mode); setVideoMode(mode);
} }
@ -342,7 +342,7 @@ bool connection (const string &cookie, const string &fsaddr)
// init the string manager cache. // init the string manager cache.
STRING_MANAGER::CStringManagerClient::instance()->initCache("", ClientCfg.LanguageCode); // VOIR BORIS STRING_MANAGER::CStringManagerClient::instance()->initCache("", ClientCfg.LanguageCode); // VOIR BORIS
#endif #endif
connectionRestaureVideoMode (); connectionRestoreVideoMode ();
return true; return true;
} }
@ -513,7 +513,7 @@ bool reconnection()
// init the string manager cache. // init the string manager cache.
STRING_MANAGER::CStringManagerClient::instance()->initCache("", ClientCfg.LanguageCode); // VOIR BORIS STRING_MANAGER::CStringManagerClient::instance()->initCache("", ClientCfg.LanguageCode); // VOIR BORIS
#endif #endif
connectionRestaureVideoMode (); connectionRestoreVideoMode ();
return true; return true;
} }
*/ */
@ -1266,10 +1266,10 @@ TInterfaceState globalMenu()
} }
// Restaure video mode // Restore video mode
if (ClientCfg.SelectCharacter == -1) if (ClientCfg.SelectCharacter == -1)
{ {
connectionRestaureVideoMode (); connectionRestoreVideoMode ();
} }
// Skip intro next time // Skip intro next time

View file

@ -539,7 +539,7 @@ void CInterface3DScene::draw ()
Driver->setViewport(oldVP); Driver->setViewport(oldVP);
Driver->setFrustum(oldFrustum); Driver->setFrustum(oldFrustum);
// Restaure render states // Restore render states
CViewRenderer::getInstance()->setRenderStates(); CViewRenderer::getInstance()->setRenderStates();
restoreClip (oldSciX, oldSciY, oldSciW, oldSciH); restoreClip (oldSciX, oldSciY, oldSciW, oldSciH);

View file

@ -291,11 +291,11 @@ public:
Driver->endDialogMode(); Driver->endDialogMode();
} }
// Restaure mouse // Restore mouse
InitMouseWithCursor (wasHardware); InitMouseWithCursor (wasHardware);
Driver->showCursor (wasHardware); Driver->showCursor (wasHardware);
// Restaure current path // Restore current path
CPath::setCurrentPath (currentPath.c_str()); CPath::setCurrentPath (currentPath.c_str());
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
} }

View file

@ -1403,19 +1403,25 @@ bool getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<st
// **** Init Video Modes // **** Init Video Modes
Driver->getModes(videoModes); Driver->getModes(videoModes);
// Remove modes under 800x600 and get the unique strings // Remove modes under 800x600 and get the unique strings
sint i, j; sint i, j;
for (i=0; i < (sint)videoModes.size(); ++i) for (i = 0; i < (sint)videoModes.size(); ++i)
{ {
if ((videoModes[i].Width < 800) || (videoModes[i].Height < 600)) if ((videoModes[i].Width < 800) || (videoModes[i].Height < 600))
{ {
// discard modes under 800x600
videoModes.erase(videoModes.begin()+i); videoModes.erase(videoModes.begin()+i);
--i; --i;
} }
else else
{ {
bool bFound = false; bool bFound = false;
// create string format with width and height
string res = toString(videoModes[i].Width)+" x "+toString(videoModes[i].Height); string res = toString(videoModes[i].Width)+" x "+toString(videoModes[i].Height);
// check if video mode already found in list
for (j = 0; j < (sint)stringModeList.size(); ++j) for (j = 0; j < (sint)stringModeList.size(); ++j)
{ {
if (stringModeList[j] == res) if (stringModeList[j] == res)
@ -1424,12 +1430,17 @@ bool getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<st
break; break;
} }
} }
// if not found
if (!bFound) if (!bFound)
{ {
// add it to the list
stringModeList.push_back(res); stringModeList.push_back(res);
// process all screen sizes less or equal to desired one
if ((videoModes[i].Width <= ClientCfg.Width) && (videoModes[i].Height <= ClientCfg.Height)) if ((videoModes[i].Width <= ClientCfg.Width) && (videoModes[i].Height <= ClientCfg.Height))
{ {
// take first one by default
if (nFoundStringMode == -1) if (nFoundStringMode == -1)
{ {
nFoundStringMode = j; nFoundStringMode = j;
@ -1437,6 +1448,7 @@ bool getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<st
} }
else else
{ {
// then take the largest one
if ((videoModes[i].Width >= videoModes[nFoundMode].Width) && if ((videoModes[i].Width >= videoModes[nFoundMode].Width) &&
(videoModes[i].Height >= videoModes[nFoundMode].Height)) (videoModes[i].Height >= videoModes[nFoundMode].Height))
{ {
@ -1459,13 +1471,15 @@ bool getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<st
else else
{ {
// add frequencies to frequencies list // add frequencies to frequencies list
for (i=0; i < (sint)videoModes.size(); ++i) for (i = 0; i < (sint)videoModes.size(); ++i)
{ {
// only take exact screen sizes
if (videoModes[i].Width == videoModes[nFoundMode].Width && videoModes[i].Height == videoModes[nFoundMode].Height) if (videoModes[i].Width == videoModes[nFoundMode].Width && videoModes[i].Height == videoModes[nFoundMode].Height)
{ {
uint freq = videoModes[i].Frequency; uint freq = videoModes[i].Frequency;
if (ClientCfg.Frequency > 0 && freq == ClientCfg.Frequency) // if frequency is 0, take the first one else use the exact one
if (nFoundStringFreq == -1 && ((ClientCfg.Frequency == 0) || (freq == ClientCfg.Frequency)))
{ {
nFoundStringFreq = stringFreqList.size(); nFoundStringFreq = stringFreqList.size();
} }

View file

@ -93,7 +93,7 @@ void CUserControls::mountModeStart()
//----------------------------------------------- //-----------------------------------------------
void CUserControls::mountModeStop() void CUserControls::mountModeStop()
{ {
// Restaure la hauteur des yeux. // Restore eyes height.
UserEntity->eyesHeight(ClientCfg.EyesHeight); UserEntity->eyesHeight(ClientCfg.EyesHeight);
// \todo GUIGUI : remove this after the UBI Demo. // \todo GUIGUI : remove this after the UBI Demo.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View file

@ -755,7 +755,7 @@ bool CUserEntity::mode(MBEHAV::EMode m)
break; break;
// Leave DEATH Mode // Leave DEATH Mode
case MBEHAV::DEATH: case MBEHAV::DEATH:
// Restaure the last view. // Restore the last view.
viewMode(viewMode()); viewMode(viewMode());
break; break;
case MBEHAV::SWIM: case MBEHAV::SWIM: