Skip to content

Commit e7c0b7c

Browse files
committed
2 parents 6d6d3b5 + b142dde commit e7c0b7c

File tree

182 files changed

+17325
-2711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+17325
-2711
lines changed

Box2D/proj.win32/libbox2d.vcxproj

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,18 @@
117117
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
118118
<ConfigurationType>StaticLibrary</ConfigurationType>
119119
<CharacterSet>Unicode</CharacterSet>
120-
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
121-
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
122-
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
123120
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
124121
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v120_xp</PlatformToolset>
122+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
123+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v140_xp</PlatformToolset>
125124
</PropertyGroup>
126125
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
127126
<ConfigurationType>StaticLibrary</ConfigurationType>
128127
<CharacterSet>Unicode</CharacterSet>
129-
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
130-
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
131-
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
132128
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
133129
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v120_xp</PlatformToolset>
130+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
131+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v140_xp</PlatformToolset>
134132
</PropertyGroup>
135133
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
136134
<ImportGroup Label="ExtensionSettings">
@@ -143,7 +141,7 @@
143141
</ImportGroup>
144142
<PropertyGroup Label="UserMacros" />
145143
<PropertyGroup>
146-
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
144+
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
147145
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
148146
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration).win32\</IntDir>
149147
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>

bullet/BulletMultiThreaded/SequentialThreadSupport.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ class btDummyBarrier : public btBarrier
116116
virtual int getMaxCount() {return 1;}
117117
};
118118

119+
#ifdef WINRT
120+
__declspec(align(16)) class btDummyCriticalSection : public btCriticalSection
121+
#else
119122
class btDummyCriticalSection : public btCriticalSection
123+
#endif
120124
{
121125

122126
public:
@@ -128,6 +132,18 @@ class btDummyCriticalSection : public btCriticalSection
128132
{
129133
}
130134

135+
#ifdef WINRT
136+
void* operator new(size_t i)
137+
{
138+
return _aligned_malloc(i, 16);
139+
}
140+
141+
void operator delete(void* p)
142+
{
143+
_aligned_free(p);
144+
}
145+
#endif
146+
131147
unsigned int getSharedParam(int i)
132148
{
133149
btAssert(i>=0&&i<31);

bullet/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,26 @@ subject to the following restrictions:
2929

3030
#define MAX_NUM_BODIES 8192
3131

32+
#ifdef WINRT
33+
__declspec(align(16)) struct SampleTask_LocalStoreMemory
34+
#else
3235
struct SampleTask_LocalStoreMemory
36+
#endif
3337
{
3438
ATTRIBUTE_ALIGNED16(char gLocalRigidBody [sizeof(btRigidBody)+16]);
3539
ATTRIBUTE_ALIGNED16(void* gPointerArray[MAX_NUM_BODIES]);
3640

41+
#ifdef WINRT
42+
void* operator new(size_t i)
43+
{
44+
return _aligned_malloc(i, 16);
45+
}
46+
47+
void operator delete(void* p)
48+
{
49+
_aligned_free(p);
50+
}
51+
#endif
3752
};
3853

3954

bullet/BulletMultiThreaded/Win32ThreadSupport.cpp

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ subject to the following restrictions:
2323

2424
#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
2525

26-
26+
#ifdef WINRT
27+
#include <atlstr.h>
28+
#define InitializeCriticalSection(arg0) InitializeCriticalSectionEx(arg0, 0, 0)
29+
#define WaitForSingleObject(arg0, arg1) WaitForSingleObjectEx(arg0, arg1, false);
30+
#define WaitForMultipleObjects(arg0, arg1, arg2, arg3) WaitForMultipleObjectsEx(arg0, arg1, arg2, arg3, false);
31+
#endif
2732

2833
///The number of threads should be equal to the number of available cores
2934
///@todo: each worker should be linked to a single core, using SetThreadIdealProcessor.
@@ -223,7 +228,6 @@ bool Win32ThreadSupport::isTaskCompleted(unsigned int *puiArgument0, unsigned in
223228
return false;
224229
}
225230

226-
227231
void Win32ThreadSupport::startThreads(const Win32ThreadConstructionInfo& threadConstructionInfo)
228232
{
229233

@@ -248,19 +252,28 @@ void Win32ThreadSupport::startThreads(const Win32ThreadConstructionInfo& threadC
248252
spuStatus.m_userPtr=0;
249253

250254
sprintf(spuStatus.m_eventStartHandleName,"eventStart%s%d",threadConstructionInfo.m_uniqueName,i);
255+
#ifdef WINRT
256+
spuStatus.m_eventStartHandle = CreateEventEx(NULL, CString(spuStatus.m_eventStartHandleName), 0, EVENT_ALL_ACCESS);
257+
#else
251258
spuStatus.m_eventStartHandle = CreateEventA (0,false,false,spuStatus.m_eventStartHandleName);
259+
#endif
252260

253261
sprintf(spuStatus.m_eventCompletetHandleName,"eventComplete%s%d",threadConstructionInfo.m_uniqueName,i);
254-
spuStatus.m_eventCompletetHandle = CreateEventA (0,false,false,spuStatus.m_eventCompletetHandleName);
262+
#ifdef WINRT
263+
spuStatus.m_eventCompletetHandle = CreateEventEx(NULL, CString(spuStatus.m_eventStartHandleName), 0, EVENT_ALL_ACCESS);
264+
#else
265+
spuStatus.m_eventCompletetHandle = CreateEventA (0,false,false,spuStatus.m_eventCompletetHandleName);
266+
#endif
255267

256268
m_completeHandles[i] = spuStatus.m_eventCompletetHandle;
257269

258270
HANDLE handle = CreateThread(lpThreadAttributes,dwStackSize,lpStartAddress,lpParameter, dwCreationFlags,lpThreadId);
259271
SetThreadPriority(handle,THREAD_PRIORITY_HIGHEST);
260272
//SetThreadPriority(handle,THREAD_PRIORITY_TIME_CRITICAL);
261273

262-
SetThreadAffinityMask(handle, 1<<i);
263-
274+
#ifndef WINRT
275+
SetThreadAffinityMask(handle, 1<<i);
276+
#endif
264277
spuStatus.m_taskId = i;
265278
spuStatus.m_commandId = 0;
266279
spuStatus.m_status = 0;
@@ -326,8 +339,13 @@ class btWin32Barrier : public btBarrier
326339
mEnableCounter = 0;
327340
InitializeCriticalSection(&mExternalCriticalSection);
328341
InitializeCriticalSection(&mLocalCriticalSection);
329-
mRunEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
330-
mNotifyEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
342+
#ifdef WINRT
343+
mRunEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
344+
mNotifyEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
345+
#else
346+
mRunEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
347+
mNotifyEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
348+
#endif
331349
}
332350

333351
virtual ~btWin32Barrier()

bullet/BulletMultiThreaded/btParallelConstraintSolver.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,28 @@ ATTRIBUTE_ALIGNED16(struct) btConstraintSolverIO {
251251
uint32_t barrierAddr2;
252252
uint32_t criticalsectionAddr2;
253253
uint32_t maxTasks1;
254+
255+
#ifdef WINRT
256+
void* operator new(size_t i)
257+
{
258+
return _aligned_malloc(i, 16);
259+
}
260+
261+
void operator delete(void* p)
262+
{
263+
_aligned_free(p);
264+
}
265+
266+
void* operator new[](size_t i)
267+
{
268+
return _aligned_malloc(i, 16);
269+
}
270+
271+
void operator delete[](void* p)
272+
{
273+
_aligned_free(p);
274+
}
275+
#endif
254276
};
255277

256278

bullet/LinearMath/btQuickprof.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ static btClock gProfileClock;
3939
#define NOMCX
4040
#define NOIME
4141

42+
#ifdef WINRT
43+
#define GetTickCount GetTickCount64
44+
#endif
45+
4246
#ifdef _XBOX
4347
#include <Xtl.h>
4448
#else //_XBOX
@@ -59,7 +63,11 @@ struct btClockData
5963

6064
#ifdef BT_USE_WINDOWS_TIMERS
6165
LARGE_INTEGER mClockFrequency;
66+
#ifdef WINRT
67+
LONGLONG mStartTick;
68+
#else
6269
DWORD mStartTick;
70+
#endif
6371
LONGLONG mPrevElapsedTime;
6472
LARGE_INTEGER mStartTime;
6573
#else
@@ -136,7 +144,7 @@ unsigned long int btClock::getTimeMilliseconds()
136144
// Check for unexpected leaps in the Win32 performance counter.
137145
// (This is caused by unexpected data across the PCI to ISA
138146
// bridge, aka south bridge. See Microsoft KB274323.)
139-
unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick;
147+
unsigned long elapsedTicks = static_cast<unsigned long>(GetTickCount() - m_data->mStartTick);
140148
signed long msecOff = (signed long)(msecTicks - elapsedTicks);
141149
if (msecOff < -100 || msecOff > 100)
142150
{
@@ -194,7 +202,7 @@ unsigned long int btClock::getTimeMicroseconds()
194202
// Check for unexpected leaps in the Win32 performance counter.
195203
// (This is caused by unexpected data across the PCI to ISA
196204
// bridge, aka south bridge. See Microsoft KB274323.)
197-
unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick;
205+
unsigned long elapsedTicks = static_cast<unsigned long>(GetTickCount() - m_data->mStartTick);
198206
signed long msecOff = (signed long)(msecTicks - elapsedTicks);
199207
if (msecOff < -100 || msecOff > 100)
200208
{

bullet/LinearMath/btScalar.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ inline int btGetVersion()
4848
#define ATTRIBUTE_ALIGNED16(a) a
4949
#define ATTRIBUTE_ALIGNED64(a) a
5050
#define ATTRIBUTE_ALIGNED128(a) a
51+
#elif (_M_ARM)
52+
#define SIMD_FORCE_INLINE __forceinline
53+
#define ATTRIBUTE_ALIGNED16(a) __declspec() a
54+
#define ATTRIBUTE_ALIGNED64(a) __declspec() a
55+
#define ATTRIBUTE_ALIGNED128(a) __declspec () a
5156
#else
5257
//#define BT_HAS_ALIGNED_ALLOCATOR
5358
#pragma warning(disable : 4324) // disable padding warning

bullet/proj.win32/libbullet.vcxproj

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
55
<Configuration>Debug</Configuration>
@@ -420,13 +420,19 @@
420420
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
421421
<ConfigurationType>StaticLibrary</ConfigurationType>
422422
<UseDebugLibraries>true</UseDebugLibraries>
423-
<PlatformToolset>v110</PlatformToolset>
423+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
424+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v120_xp</PlatformToolset>
425+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
426+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v140_xp</PlatformToolset>
424427
<CharacterSet>Unicode</CharacterSet>
425428
</PropertyGroup>
426429
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
427430
<ConfigurationType>StaticLibrary</ConfigurationType>
428431
<UseDebugLibraries>false</UseDebugLibraries>
429-
<PlatformToolset>v110</PlatformToolset>
432+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
433+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v120_xp</PlatformToolset>
434+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
435+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v140_xp</PlatformToolset>
430436
<WholeProgramOptimization>true</WholeProgramOptimization>
431437
<CharacterSet>Unicode</CharacterSet>
432438
</PropertyGroup>
@@ -491,4 +497,4 @@
491497
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
492498
<ImportGroup Label="ExtensionTargets">
493499
</ImportGroup>
494-
</Project>
500+
</Project>

0 commit comments

Comments
 (0)