diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 15:35:22 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 15:35:22 +0100 |
commit | 2eac169518ab341d1b99b1ac6c2a88ab4e850ce5 (patch) | |
tree | 2a4023413cea16ee3407d763a80f5bcfef6f7a14 | |
parent | d283b2b8eb54c49b38bb9b60ea70e04d07eb5bbd (diff) |
proto/ft: fix logic error
-rw-r--r-- | bin/NPClient.dll | bin | 16384 -> 16384 bytes | |||
-rw-r--r-- | bin/NPClient64.dll | bin | 17408 -> 17408 bytes | |||
-rw-r--r-- | contrib/npclient/COMPILE.TXT | 4 | ||||
-rw-r--r-- | contrib/npclient/npclient.c | 4 | ||||
-rw-r--r-- | proto-ft/ftnoir_protocol_ft.cpp | 8 |
5 files changed, 7 insertions, 9 deletions
diff --git a/bin/NPClient.dll b/bin/NPClient.dll Binary files differindex a71a8594..ddfa667e 100644 --- a/bin/NPClient.dll +++ b/bin/NPClient.dll diff --git a/bin/NPClient64.dll b/bin/NPClient64.dll Binary files differindex b1e4ac68..eb56a256 100644 --- a/bin/NPClient64.dll +++ b/bin/NPClient64.dll diff --git a/contrib/npclient/COMPILE.TXT b/contrib/npclient/COMPILE.TXT index e61b6c14..d355fbcc 100644 --- a/contrib/npclient/COMPILE.TXT +++ b/contrib/npclient/COMPILE.TXT @@ -6,6 +6,6 @@ CC=clang CFLAGS='-Wall -Wextra -Wpedantic -Os -s -ffunction-sections -fdata-sections -Wl,--kill-at,--nxcompat,--dynamicbase,--as-needed,--gc-sections,--strip-all' cd -- "$(dirname -- "$0")" && -PATH=/mingw32/bin:"$PATH" sh -c "$CC $CFLAGS -mdll -o NPClient.dll npclient.c" && -PATH=/mingw64/bin:"$PATH" sh -c "$CC $CFLAGS -mdll -o NPClient64.dll npclient.c" && +PATH=/mingw32/bin:"$PATH" sh -c "$CC -m32 $CFLAGS -mdll -o NPClient.dll npclient.c" && +PATH=/mingw64/bin:"$PATH" sh -c "$CC -m64 $CFLAGS -mdll -o NPClient64.dll npclient.c" && ls -l NPClient{64,}.dll && mv NPClient{64,}.dll ../../bin/ diff --git a/contrib/npclient/npclient.c b/contrib/npclient/npclient.c index add5b4c1..42919d8f 100644 --- a/contrib/npclient/npclient.c +++ b/contrib/npclient/npclient.c @@ -349,8 +349,8 @@ NP_EXPORT(int) NP_GetData(tir_data_t * data) else { running = false; - // clamp to zero - InterlockedExchange((LONG volatile*) &pMemData->data.DataID, -1); + // clamp to (-1) if still negative + (void)InterlockedCompareExchange((LONG volatile*) &pMemData->data.DataID, -1, data_id); } data->status = running ? NPCLIENT_STATUS_OK : NPCLIENT_STATUS_DISABLED; diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index 0e07a103..766bddbf 100644 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -66,9 +66,7 @@ freetrack::~freetrack() { if (shm.success()) { - const double tmp[6] {}; - pose(tmp); - store(pMemData->data.DataID, 0); + store(pMemData->data.DataID, 1); store(pMemData->GameID2, -1); } @@ -98,10 +96,10 @@ void freetrack::pose(const double* headpose) store(data->Pitch, pitch); store(data->Roll, roll); - store(data->DataID, 60 * 30 + (rand() % 120)); - const std::int32_t id = load(ft->GameID); + store(data->DataID, 60 * 10 + (rand() % 64)); + if (intGameID != id) { QString gamename; |