Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2011-08-02 14:26:20 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2011-08-02 14:26:20 +0400
commit6bc101fa7e9a51bdcd27a0bcf6d7d26fbe733c5b (patch)
tree2637d7f781679f73a68c8e62bffc2cedc898fb07 /intern/ghost
parent08426ec2e73164e709f2b020042f26af7b0ad5c5 (diff)
Indentation changes
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 4af5643eb75..c985c6dd0a6 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -766,8 +766,7 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
GHOST_TUns64 now = getMilliSeconds();
static bool firstEvent = true;
- if (firstEvent)
- { // determine exactly which device is plugged in
+ if (firstEvent) { // determine exactly which device is plugged in
RID_DEVICE_INFO info;
unsigned infoSize = sizeof(RID_DEVICE_INFO);
info.cbSize = infoSize;
@@ -776,23 +775,23 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
if (info.dwType == RIM_TYPEHID)
m_ndofManager->setDevice(info.hid.dwVendorId, info.hid.dwProductId);
else
- puts("<!> not a HID device... mouse/kb perhaps?");
+ puts("<!> not a HID device... mouse/kb perhaps?");
firstEvent = false;
- }
+ }
// The NDOF manager sends button changes immediately, and *pretends* to
// send motion. Mark as 'sent' so motion will always get dispatched.
eventSent = true;
#ifdef _MSC_VER
- // using Microsoft compiler & header files
- // they invented the RawInput API, so this version is (probably) correct
+ // using Microsoft compiler & header files
+ // they invented the RawInput API, so this version is (probably) correct
BYTE const* data = raw.data.hid.bRawData;
// struct RAWHID {
- // DWORD dwSizeHid;
- // DWORD dwCount;
- // BYTE bRawData[1];
+ // DWORD dwSizeHid;
+ // DWORD dwCount;
+ // BYTE bRawData[1];
// };
#else
// MinGW's definition (below) doesn't agree, so we need a slight
@@ -807,46 +806,46 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
BYTE packetType = data[0];
switch (packetType)
- {
+ {
case 1: // translation
- {
+ {
short* axis = (short*)(data + 1);
short t[3] = {axis[0], -axis[2], axis[1]};
m_ndofManager->updateTranslation(t, now);
if (raw.data.hid.dwSizeHid == 13)
- { // this report also includes rotation
+ { // this report also includes rotation
short r[3] = {-axis[3], axis[5], -axis[4]};
m_ndofManager->updateRotation(r, now);
// I've never gotten one of these, has anyone else?
puts("ndof: combined T + R");
- }
- break;
}
+ break;
+ }
case 2: // rotation
- {
+ {
short* axis = (short*)(data + 1);
short r[3] = {-axis[0], axis[2], -axis[1]};
m_ndofManager->updateRotation(r, now);
break;
- }
+ }
case 3: // buttons
- {
- #if 0
+ {
+#if 0
// I'm getting garbage bits -- examine whole report:
printf("ndof: HID report for buttons [");
for (int i = 0; i < raw.data.hid.dwSizeHid; ++i)
printf(" %02X", data[i]);
printf(" ]\n");
- #endif
+#endif
int button_bits;
memcpy(&button_bits, data + 1, sizeof(button_bits));
m_ndofManager->updateButtons(button_bits, now);
break;
- }
}
+ }
return eventSent;
}
#endif // WITH_INPUT_NDOF