diff options
author | Ian Thompson <quornian@googlemail.com> | 2008-07-19 03:35:34 +0400 |
---|---|---|
committer | Ian Thompson <quornian@googlemail.com> | 2008-07-19 03:35:34 +0400 |
commit | f042a468fdd0f06ca41c022c9ed6ac59d35ff143 (patch) | |
tree | 634b6082233a7d8eaa520ddd760e72b1fd48131d /intern | |
parent | 123407e0b4ec616aef40216ab76e559e0dee5711 (diff) |
Merged 15170:15635 from trunk (no conflicts or even merges)
Diffstat (limited to 'intern')
-rw-r--r-- | intern/bsp/intern/BSP_CSGMesh.cpp | 2 | ||||
-rw-r--r-- | intern/container/CTR_TaggedIndex.h | 16 | ||||
-rw-r--r-- | intern/decimation/intern/LOD_ManMesh2.cpp | 6 | ||||
-rw-r--r-- | intern/elbeem/intern/solver_init.cpp | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 17 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 8 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 8 | ||||
-rw-r--r-- | intern/iksolver/intern/IK_QTask.h | 2 | ||||
-rw-r--r-- | intern/moto/include/GEN_Map.h | 18 | ||||
-rw-r--r-- | intern/moto/include/MT_random.h | 6 | ||||
-rw-r--r-- | intern/moto/intern/MT_random.cpp | 10 |
11 files changed, 77 insertions, 18 deletions
diff --git a/intern/bsp/intern/BSP_CSGMesh.cpp b/intern/bsp/intern/BSP_CSGMesh.cpp index 553f39a4642..ca7795b3cf5 100644 --- a/intern/bsp/intern/BSP_CSGMesh.cpp +++ b/intern/bsp/intern/BSP_CSGMesh.cpp @@ -197,7 +197,7 @@ BuildEdges( for (int vert = 0; vert < vertex_num; ++vert) { - BSP_FaceInd fi(f_it - f_it_begin); + BSP_FaceInd fi(size_t (f_it - f_it_begin)); InsertEdge(prev_vi,face.m_verts[vert],fi,dummy); prev_vi = face.m_verts[vert]; } diff --git a/intern/container/CTR_TaggedIndex.h b/intern/container/CTR_TaggedIndex.h index 7a7bd85e890..68d2536c879 100644 --- a/intern/container/CTR_TaggedIndex.h +++ b/intern/container/CTR_TaggedIndex.h @@ -93,6 +93,16 @@ public: } +#if defined(_WIN64) + CTR_TaggedIndex( + const unsigned __int64 val + ) : + m_val ( ((unsigned __int64)val & index_mask) + | ( (empty_tag << tag_shift) + & (~index_mask) ) ) { + } +#endif + CTR_TaggedIndex( const CTR_TaggedIndex &my_index ): @@ -124,6 +134,12 @@ public: return (long int)(m_val & index_mask); } +#if defined(_WIN64) + operator unsigned __int64 () const { + return (unsigned __int64)(m_val & index_mask); + } +#endif + bool IsEmpty( ) const { diff --git a/intern/decimation/intern/LOD_ManMesh2.cpp b/intern/decimation/intern/LOD_ManMesh2.cpp index eeb497bb09e..2fe49b36583 100644 --- a/intern/decimation/intern/LOD_ManMesh2.cpp +++ b/intern/decimation/intern/LOD_ManMesh2.cpp @@ -477,7 +477,7 @@ DeleteVertex( return; } - LOD_VertexInd last = LOD_VertexInd(verts.end() - verts.begin() - 1); + LOD_VertexInd last = LOD_VertexInd(size_t(verts.end() - verts.begin() - 1)); if (!(last == v)) { @@ -533,7 +533,7 @@ DeleteEdge( return; } - LOD_EdgeInd last = LOD_EdgeInd(edges.end() - edges.begin() - 1); + LOD_EdgeInd last = LOD_EdgeInd(size_t(edges.end() - edges.begin() - 1)); if (!(last == e)) { vector<LOD_EdgeInd> e_verts; @@ -573,7 +573,7 @@ DeleteFace( return; } - LOD_FaceInd last = LOD_FaceInd(faces.end() - faces.begin() - 1); + LOD_FaceInd last = LOD_FaceInd(size_t (faces.end() - faces.begin() - 1)); if (!(last == f)) { diff --git a/intern/elbeem/intern/solver_init.cpp b/intern/elbeem/intern/solver_init.cpp index c953d2f47da..a873f3c6987 100644 --- a/intern/elbeem/intern/solver_init.cpp +++ b/intern/elbeem/intern/solver_init.cpp @@ -694,7 +694,7 @@ bool LbmFsgrSolver::initializeSolverMemory() double maxDefaultMemChunk = 2.*1024.*1024.*1024.; //std::cerr<<" memEstFine "<< memEstFine <<" maxWin:" <<maxWinMemChunk <<" maxMac:" <<maxMacMemChunk ; // DEBUG #ifdef WIN32 - if(memEstFine> maxWinMemChunk) { + if(sizeof(void *)==4 && memEstFine>maxWinMemChunk) { memBlockAllocProblem = true; } #endif // WIN32 diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 82a76b3c706..f5c7c08ebfe 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -42,6 +42,14 @@ #include "GHOST_SystemWin32.h" +// win64 doesn't define GWL_USERDATA +#ifdef WIN32 +#ifndef GWL_USERDATA +#define GWL_USERDATA GWLP_USERDATA +#define GWL_WNDPROC GWLP_WNDPROC +#endif +#endif + /* * According to the docs the mouse wheel message is supported from windows 98 * upwards. Leaving WINVER at default value, the WM_MOUSEWHEEL message and the @@ -302,6 +310,15 @@ GHOST_TSuccess GHOST_SystemWin32::init() { GHOST_TSuccess success = GHOST_System::init(); + /* Disable scaling on high DPI displays on Vista */ + HMODULE user32 = ::LoadLibraryA("user32.dll"); + typedef BOOL (WINAPI * LPFNSETPROCESSDPIAWARE)(); + LPFNSETPROCESSDPIAWARE SetProcessDPIAware = + (LPFNSETPROCESSDPIAWARE)GetProcAddress(user32, "SetProcessDPIAware"); + if (SetProcessDPIAware) + SetProcessDPIAware(); + FreeLibrary(user32); + // Determine whether this system has a high frequency performance counter. */ m_hasPerformanceCounter = ::QueryPerformanceFrequency((LARGE_INTEGER*)&m_freq) == TRUE; if (m_hasPerformanceCounter) { diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index ff1bf51bbb5..3003e0b8b14 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -488,12 +488,12 @@ GHOST_SystemX11::processEvent(XEvent *xe) data.changed = 1; data.delta = xcme.data.s[8] - data.time; data.time = xcme.data.s[8]; - data.tx = xcme.data.s[2]; - data.ty = xcme.data.s[3]; - data.tz = xcme.data.s[4]; + data.tx = xcme.data.s[2] >> 2; + data.ty = xcme.data.s[3] >> 2; + data.tz = xcme.data.s[4] >> 2; data.rx = xcme.data.s[5]; data.ry = xcme.data.s[6]; - data.rz = xcme.data.s[7]; + data.rz =-xcme.data.s[7]; g_event = new GHOST_EventNDOF(getMilliSeconds(), GHOST_kEventNDOFMotion, window, data); diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 905b2f7ac63..fef58d071a4 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -48,6 +48,14 @@ #define M_PI 3.1415926536 #endif +// win64 doesn't define GWL_USERDATA +#ifdef WIN32 +#ifndef GWL_USERDATA +#define GWL_USERDATA GWLP_USERDATA +#define GWL_WNDPROC GWLP_WNDPROC +#endif +#endif + LPCSTR GHOST_WindowWin32::s_windowClassName = "GHOST_WindowClass"; const int GHOST_WindowWin32::s_maxTitleLength = 128; HGLRC GHOST_WindowWin32::s_firsthGLRc = NULL; diff --git a/intern/iksolver/intern/IK_QTask.h b/intern/iksolver/intern/IK_QTask.h index c291a0e7e50..4d469d737f8 100644 --- a/intern/iksolver/intern/IK_QTask.h +++ b/intern/iksolver/intern/IK_QTask.h @@ -74,7 +74,7 @@ public: virtual bool PositionTask() const { return false; } - virtual void Scale(float scale) {} + virtual void Scale(float) {} protected: int m_id; diff --git a/intern/moto/include/GEN_Map.h b/intern/moto/include/GEN_Map.h index db3335d6110..9f56924419e 100644 --- a/intern/moto/include/GEN_Map.h +++ b/intern/moto/include/GEN_Map.h @@ -82,6 +82,24 @@ public: } return 0; } + + Key* getKey(int index) { + int count=0; + for (int i=0;i<m_num_buckets;i++) + { + Entry* bucket = m_buckets[i]; + while(bucket) + { + if (count==index) + { + return &bucket->m_key; + } + bucket = bucket->m_next; + count++; + } + } + return 0; + } void clear() { for (int i = 0; i < m_num_buckets; ++i) { diff --git a/intern/moto/include/MT_random.h b/intern/moto/include/MT_random.h index d7da546cf03..3afe1dd1662 100644 --- a/intern/moto/include/MT_random.h +++ b/intern/moto/include/MT_random.h @@ -31,10 +31,10 @@ #include <limits.h> -#define MT_RAND_MAX ULONG_MAX +#define MT_RAND_MAX UINT_MAX -extern void MT_srand(unsigned long); -extern unsigned long MT_rand(); +extern void MT_srand(unsigned int); +extern unsigned int MT_rand(); #endif diff --git a/intern/moto/intern/MT_random.cpp b/intern/moto/intern/MT_random.cpp index 96cb394d3da..b8302e093ca 100644 --- a/intern/moto/intern/MT_random.cpp +++ b/intern/moto/intern/MT_random.cpp @@ -76,11 +76,11 @@ #define TEMPERING_SHIFT_T(y) (y << 15) #define TEMPERING_SHIFT_L(y) (y >> 18) -static unsigned long mt[N]; /* the array for the state vector */ +static unsigned int mt[N]; /* the array for the state vector */ static int mti = N+1; /* mti==N+1 means mt[N] is not initialized */ /* initializing the array with a NONZERO seed */ -void MT_srand(unsigned long seed) +void MT_srand(unsigned int seed) { /* setting initial seeds to mt[N] using */ /* the generator Line 25 of Table 1 in */ @@ -91,12 +91,12 @@ void MT_srand(unsigned long seed) mt[mti] = (69069 * mt[mti-1]) & 0xffffffff; } -unsigned long MT_rand() +unsigned int MT_rand() { - static unsigned long mag01[2] = { 0x0, MATRIX_A }; + static unsigned int mag01[2] = { 0x0, MATRIX_A }; /* mag01[x] = x * MATRIX_A for x=0,1 */ - unsigned long y; + unsigned int y; if (mti >= N) { /* generate N words at one time */ int kk; |