Skip to content

Commit

Permalink
merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
pkurash committed Oct 10, 2024
1 parent 752d06a commit 358535a
Show file tree
Hide file tree
Showing 43 changed files with 911 additions and 917 deletions.
24 changes: 12 additions & 12 deletions GPU/GPUTracking/display/3rdparty/KHR/khrplatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ typedef unsigned __int64 khronos_uint64_t;
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#if defined(__arch64__) || defined(_LP64)
typedef long int khronos_int64_t;
typedef unsigned long int khronos_uint64_t;
typedef long khronos_int64_t;
typedef unsigned long khronos_uint64_t;
#else
typedef long long int khronos_int64_t;
typedef unsigned long long int khronos_uint64_t;
typedef long khronos_int64_t;
typedef unsigned long khronos_uint64_t;
#endif /* __arch64__ */
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
Expand Down Expand Up @@ -234,15 +234,15 @@ typedef unsigned short int khronos_uint16_t;
* to be the only LLP64 architecture in current use.
*/
#ifdef _WIN64
typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t;
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
typedef signed long khronos_intptr_t;
typedef unsigned long khronos_uintptr_t;
typedef signed long khronos_ssize_t;
typedef unsigned long khronos_usize_t;
#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
typedef signed long khronos_intptr_t;
typedef unsigned long khronos_uintptr_t;
typedef signed long khronos_ssize_t;
typedef unsigned long khronos_usize_t;
#endif

#if KHRONOS_SUPPORT_FLOAT
Expand Down
44 changes: 22 additions & 22 deletions GPU/GPUTracking/display/GPUDisplay.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ void GPUDisplay::calcXYZ(const float* matrix)
}*/
}

void GPUDisplay::SetCollisionFirstCluster(unsigned int collision, int slice, int cluster)
void GPUDisplay::SetCollisionFirstCluster(uint32_t collision, int32_t slice, int32_t cluster)
{
mNCollissions = std::max<unsigned int>(mNCollissions, collision + 1);
mNCollissions = std::max<uint32_t>(mNCollissions, collision + 1);
mOverlayTFClusters.resize(mNCollissions);
mOverlayTFClusters[collision][slice] = cluster;
}
Expand All @@ -128,13 +128,13 @@ void GPUDisplay::mAnimateCloseQuaternion(float* v, float lastx, float lasty, flo
float distPos2 = (lastx - v[0]) * (lastx - v[0]) + (lasty - v[1]) * (lasty - v[1]) + (lastz - v[2]) * (lastz - v[2]) + (lastw - v[3]) * (lastw - v[3]);
float distNeg2 = (lastx + v[0]) * (lastx + v[0]) + (lasty + v[1]) * (lasty + v[1]) + (lastz + v[2]) * (lastz + v[2]) + (lastw + v[3]) * (lastw + v[3]);
if (distPos2 > distNeg2) {
for (int i = 0; i < 4; i++) {
for (int32_t i = 0; i < 4; i++) {
v[i] = -v[i];
}
}
}

void GPUDisplay::ResizeScene(int width, int height, bool init)
void GPUDisplay::ResizeScene(int32_t width, int32_t height, bool init)
{
if (height == 0) { // Prevent A Divide By Zero By
height = 1; // Making Height Equal One
Expand All @@ -160,9 +160,9 @@ inline void GPUDisplay::drawVertices(const vboList& v, const GPUDisplayBackend::
mNDrawCalls += mBackend->drawVertices(v, t);
}

int GPUDisplay::InitDisplay(bool initFailure)
int32_t GPUDisplay::InitDisplay(bool initFailure)
{
int retVal = initFailure;
int32_t retVal = initFailure;
try {
if (!initFailure) {
retVal = InitDisplay_internal();
Expand All @@ -175,7 +175,7 @@ int GPUDisplay::InitDisplay(bool initFailure)
return (retVal);
}

int GPUDisplay::InitDisplay_internal()
int32_t GPUDisplay::InitDisplay_internal()
{
mThreadBuffers.resize(getNumThreads());
mThreadTracks.resize(getNumThreads());
Expand All @@ -184,7 +184,7 @@ int GPUDisplay::InitDisplay_internal()
}
mYFactor = mBackend->getYFactor();
mDrawTextInCompatMode = !mBackend->mFreetypeInitialized && mFrontend->mCanDrawText == 1;
int height = 0, width = 0;
int32_t height = 0, width = 0;
mFrontend->getSize(width, height);
if (height == 0 || width == 0) {
width = GPUDisplayFrontend::INIT_WIDTH;
Expand All @@ -199,12 +199,12 @@ void GPUDisplay::ExitDisplay()
mBackend->ExitBackend();
}

int GPUDisplay::DrawGLScene()
int32_t GPUDisplay::DrawGLScene()
{
// Make sure event gets not overwritten during display
mSemLockDisplay.Lock();

int retVal = 0;
int32_t retVal = 0;
if (mChain) {
mIOPtrs = &mChain->mIOPtrs;
mCalib = &mChain->calib();
Expand All @@ -227,7 +227,7 @@ int GPUDisplay::DrawGLScene()

void GPUDisplay::DrawGLScene_cameraAndAnimation(float animateTime, float& mixSlaveImage, hmm_mat4& nextViewMatrix)
{
int mMouseWheelTmp = mFrontend->mMouseWheel;
int32_t mMouseWheelTmp = mFrontend->mMouseWheel;
mFrontend->mMouseWheel = 0;
bool lookOrigin = mCfgR.camLookOrigin ^ mFrontend->mKeys[mFrontend->KEY_ALT];
bool yUp = mCfgR.camYUp ^ mFrontend->mKeys[mFrontend->KEY_CTRL] ^ lookOrigin;
Expand Down Expand Up @@ -270,10 +270,10 @@ void GPUDisplay::DrawGLScene_cameraAndAnimation(float animateTime, float& mixSla

mResetScene = 0;
} else {
float moveZ = scalefactor * ((float)mMouseWheelTmp / 150 + (float)(mFrontend->mKeys[(unsigned char)'W'] - mFrontend->mKeys[(unsigned char)'S']) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]) * 0.2f * mFPSScale);
float moveZ = scalefactor * ((float)mMouseWheelTmp / 150 + (float)(mFrontend->mKeys[(uint8_t)'W'] - mFrontend->mKeys[(uint8_t)'S']) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]) * 0.2f * mFPSScale);
float moveY = scalefactor * ((float)(mFrontend->mKeys[mFrontend->KEY_PAGEDOWN] - mFrontend->mKeys[mFrontend->KEY_PAGEUP]) * 0.2f * mFPSScale);
float moveX = scalefactor * ((float)(mFrontend->mKeys[(unsigned char)'A'] - mFrontend->mKeys[(unsigned char)'D']) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]) * 0.2f * mFPSScale);
float rotRoll = rotatescalefactor * mFPSScale * 2 * (mFrontend->mKeys[(unsigned char)'E'] - mFrontend->mKeys[(unsigned char)'F']) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]);
float moveX = scalefactor * ((float)(mFrontend->mKeys[(uint8_t)'A'] - mFrontend->mKeys[(uint8_t)'D']) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]) * 0.2f * mFPSScale);
float rotRoll = rotatescalefactor * mFPSScale * 2 * (mFrontend->mKeys[(uint8_t)'E'] - mFrontend->mKeys[(uint8_t)'F']) * (!mFrontend->mKeys[mFrontend->KEY_SHIFT]);
float rotYaw = rotatescalefactor * mFPSScale * 2 * (mFrontend->mKeys[mFrontend->KEY_RIGHT] - mFrontend->mKeys[mFrontend->KEY_LEFT]);
float rotPitch = rotatescalefactor * mFPSScale * 2 * (mFrontend->mKeys[mFrontend->KEY_DOWN] - mFrontend->mKeys[mFrontend->KEY_UP]);

Expand All @@ -289,7 +289,7 @@ void GPUDisplay::DrawGLScene_cameraAndAnimation(float animateTime, float& mixSla
rotPitch += rotatescalefactor * mouseScale * ((float)mFrontend->mMouseMvY - (float)mFrontend->mMouseDnY);
}

if (mFrontend->mKeys[(unsigned char)'<'] && !mFrontend->mKeysShift[(unsigned char)'<']) {
if (mFrontend->mKeys[(uint8_t)'<'] && !mFrontend->mKeysShift[(uint8_t)'<']) {
mAnimationDelay += moveX;
if (mAnimationDelay < 0.05f) {
mAnimationDelay = 0.05f;
Expand Down Expand Up @@ -379,7 +379,7 @@ void GPUDisplay::DrawGLScene_cameraAndAnimation(float animateTime, float& mixSla

// Graphichs Options
float minSize = 0.4f / (mCfgR.drawQualityDownsampleFSAA > 1 ? mCfgR.drawQualityDownsampleFSAA : 1);
int deltaLine = mFrontend->mKeys[(unsigned char)'+'] * mFrontend->mKeysShift[(unsigned char)'+'] - mFrontend->mKeys[(unsigned char)'-'] * mFrontend->mKeysShift[(unsigned char)'-'];
int32_t deltaLine = mFrontend->mKeys[(uint8_t)'+'] * mFrontend->mKeysShift[(uint8_t)'+'] - mFrontend->mKeys[(uint8_t)'-'] * mFrontend->mKeysShift[(uint8_t)'-'];
mCfgL.lineWidth += (float)deltaLine * mFPSScale * 0.02f * mCfgL.lineWidth;
if (mCfgL.lineWidth < minSize) {
mCfgL.lineWidth = minSize;
Expand All @@ -389,7 +389,7 @@ void GPUDisplay::DrawGLScene_cameraAndAnimation(float animateTime, float& mixSla
mUpdateDrawCommands = 1;
}
minSize *= 2;
int deltaPoint = mFrontend->mKeys[(unsigned char)'+'] * (!mFrontend->mKeysShift[(unsigned char)'+']) - mFrontend->mKeys[(unsigned char)'-'] * (!mFrontend->mKeysShift[(unsigned char)'-']);
int32_t deltaPoint = mFrontend->mKeys[(uint8_t)'+'] * (!mFrontend->mKeysShift[(uint8_t)'+']) - mFrontend->mKeys[(uint8_t)'-'] * (!mFrontend->mKeysShift[(uint8_t)'-']);
mCfgL.pointSize += (float)deltaPoint * mFPSScale * 0.02f * mCfgL.pointSize;
if (mCfgL.pointSize < minSize) {
mCfgL.pointSize = minSize;
Expand All @@ -414,9 +414,9 @@ void GPUDisplay::DrawGLScene_cameraAndAnimation(float animateTime, float& mixSla

void GPUDisplay::DrawGLScene_drawCommands()
{
#define LOOP_SLICE for (int iSlice = (mCfgL.drawSlice == -1 ? 0 : mCfgL.drawRelatedSlices ? (mCfgL.drawSlice % (NSLICES / 4)) : mCfgL.drawSlice); iSlice < NSLICES; iSlice += (mCfgL.drawSlice == -1 ? 1 : mCfgL.drawRelatedSlices ? (NSLICES / 4) : NSLICES))
#define LOOP_SLICE2 for (int iSlice = (mCfgL.drawSlice == -1 ? 0 : mCfgL.drawRelatedSlices ? (mCfgL.drawSlice % (NSLICES / 4)) : mCfgL.drawSlice) % (NSLICES / 2); iSlice < NSLICES / 2; iSlice += (mCfgL.drawSlice == -1 ? 1 : mCfgL.drawRelatedSlices ? (NSLICES / 4) : NSLICES))
#define LOOP_COLLISION for (int iCol = (mCfgL.showCollision == -1 ? 0 : mCfgL.showCollision); iCol < mNCollissions; iCol += (mCfgL.showCollision == -1 ? 1 : mNCollissions))
#define LOOP_SLICE for (int32_t iSlice = (mCfgL.drawSlice == -1 ? 0 : mCfgL.drawRelatedSlices ? (mCfgL.drawSlice % (NSLICES / 4)) : mCfgL.drawSlice); iSlice < NSLICES; iSlice += (mCfgL.drawSlice == -1 ? 1 : mCfgL.drawRelatedSlices ? (NSLICES / 4) : NSLICES))
#define LOOP_SLICE2 for (int32_t iSlice = (mCfgL.drawSlice == -1 ? 0 : mCfgL.drawRelatedSlices ? (mCfgL.drawSlice % (NSLICES / 4)) : mCfgL.drawSlice) % (NSLICES / 2); iSlice < NSLICES / 2; iSlice += (mCfgL.drawSlice == -1 ? 1 : mCfgL.drawRelatedSlices ? (NSLICES / 4) : NSLICES))
#define LOOP_COLLISION for (int32_t iCol = (mCfgL.showCollision == -1 ? 0 : mCfgL.showCollision); iCol < mNCollissions; iCol += (mCfgL.showCollision == -1 ? 1 : mNCollissions))
#define LOOP_COLLISION_COL(cmd) \
LOOP_COLLISION \
{ \
Expand Down Expand Up @@ -636,7 +636,7 @@ void GPUDisplay::DrawGLScene_internal(float animateTime, bool renderToMixBuffer)
if (mUpdateVertexLists && mIOPtrs) {
size_t totalVertizes = DrawGLScene_updateVertexList();
if (showTimer) {
printf("Event visualization time: %'d us (vertices %'lld / %'lld bytes)\n", (int)(mTimerDraw.GetCurrentElapsedTime() * 1000000.), (long long int)totalVertizes, (long long int)(totalVertizes * sizeof(mVertexBuffer[0][0])));
printf("Event visualization time: %'d us (vertices %'ld / %'ld bytes)\n", (int32_t)(mTimerDraw.GetCurrentElapsedTime() * 1000000.), (int64_t)totalVertizes, (int64_t)(totalVertizes * sizeof(mVertexBuffer[0][0])));
}
}

Expand Down Expand Up @@ -714,7 +714,7 @@ void GPUDisplay::ShowNextEvent(const GPUTrackingInOutPointers* ptrs)

void GPUDisplay::WaitForNextEvent() { mSemLockDisplay.Lock(); }

int GPUDisplay::StartDisplay()
int32_t GPUDisplay::StartDisplay()
{
if (mFrontend->StartDisplay()) {
return (1);
Expand Down
Loading

0 comments on commit 358535a

Please sign in to comment.