diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_Wintab.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_Wintab.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/intern/ghost/intern/GHOST_Wintab.cpp b/intern/ghost/intern/GHOST_Wintab.cpp index c75a39bb34b..f7075efcbdd 100644 --- a/intern/ghost/intern/GHOST_Wintab.cpp +++ b/intern/ghost/intern/GHOST_Wintab.cpp @@ -331,7 +331,7 @@ void GHOST_Wintab::getInput(std::vector<GHOST_WintabInfoWin32> &outWintabInfo) out.y = pkt.pkY; if (m_maxPressure > 0) { - out.tabletData.Pressure = (float)pkt.pkNormalPressure / (float)m_maxPressure; + out.tabletData.Pressure = float(pkt.pkNormalPressure) / float(m_maxPressure); } if ((m_maxAzimuth > 0) && (m_maxAltitude > 0)) { @@ -342,7 +342,7 @@ void GHOST_Wintab::getInput(std::vector<GHOST_WintabInfoWin32> &outWintabInfo) * Positive values specify an angle upward toward the positive z axis; negative values * specify an angle downward toward the negative z axis. * - * wintab.h defines orAltitude as a UINT but documents orAltitude as positive for upward + * wintab.h defines orAltitude as a `uint` but documents orAltitude as positive for upward * angles and negative for downward angles. WACOM uses negative altitude values to show that * the pen is inverted; therefore we cast orAltitude as an (int) and then use the absolute * value. @@ -351,15 +351,15 @@ void GHOST_Wintab::getInput(std::vector<GHOST_WintabInfoWin32> &outWintabInfo) ORIENTATION ort = pkt.pkOrientation; /* Convert raw fixed point data to radians. */ - float altRad = (float)((fabs((float)ort.orAltitude) / (float)m_maxAltitude) * M_PI_2); - float azmRad = (float)(((float)ort.orAzimuth / (float)m_maxAzimuth) * M_PI * 2.0); + float altRad = float((fabs(float(ort.orAltitude)) / float(m_maxAltitude)) * M_PI_2); + float azmRad = float((float(ort.orAzimuth) / float(m_maxAzimuth)) * M_PI * 2.0); /* Find length of the stylus' projected vector on the XY plane. */ float vecLen = cos(altRad); /* From there calculate X and Y components based on azimuth. */ out.tabletData.Xtilt = sin(azmRad) * vecLen; - out.tabletData.Ytilt = (float)(sin(M_PI_2 - azmRad) * vecLen); + out.tabletData.Ytilt = float(sin(M_PI_2 - azmRad) * vecLen); } out.time = pkt.pkTime; @@ -397,7 +397,7 @@ void GHOST_Wintab::getInput(std::vector<GHOST_WintabInfoWin32> &outWintabInfo) } } -GHOST_TButton GHOST_Wintab::mapWintabToGhostButton(UINT cursor, WORD physicalButton) +GHOST_TButton GHOST_Wintab::mapWintabToGhostButton(uint cursor, WORD physicalButton) { const WORD numButtons = 32; BYTE logicalButtons[numButtons] = {0}; @@ -502,7 +502,7 @@ void GHOST_Wintab::printContextDebugInfo() BYTE systemButtons[32] = {0}; for (int i = 0; i < 3; i++) { printf("initializeWintab cursor %d buttons\n", i); - UINT lbut = m_fpInfo(WTI_CURSORS + i, CSR_BUTTONMAP, &logicalButtons); + uint lbut = m_fpInfo(WTI_CURSORS + i, CSR_BUTTONMAP, &logicalButtons); if (lbut) { printf("%d", logicalButtons[0]); for (int j = 1; j < lbut; j++) { @@ -513,7 +513,7 @@ void GHOST_Wintab::printContextDebugInfo() else { printf("logical button error\n"); } - UINT sbut = m_fpInfo(WTI_CURSORS + i, CSR_SYSBTNMAP, &systemButtons); + uint sbut = m_fpInfo(WTI_CURSORS + i, CSR_SYSBTNMAP, &systemButtons); if (sbut) { printf("%d", systemButtons[0]); for (int j = 1; j < sbut; j++) { @@ -529,7 +529,7 @@ void GHOST_Wintab::printContextDebugInfo() /* Print context information. */ /* Print open context constraints. */ - UINT maxcontexts, opencontexts; + uint maxcontexts, opencontexts; m_fpInfo(WTI_INTERFACE, IFC_NCONTEXTS, &maxcontexts); m_fpInfo(WTI_STATUS, STA_CONTEXTS, &opencontexts); printf("%u max contexts, %u open contexts\n", maxcontexts, opencontexts); @@ -582,7 +582,7 @@ void GHOST_Wintab::printContextDebugInfo() printf("WTI_DEFSYSCTX CTX_*\n"); printContextRanges(lc); - for (unsigned int i = 0; i < m_numDevices; i++) { + for (uint i = 0; i < m_numDevices; i++) { /* Print individual device system context. */ m_fpInfo(WTI_DSCTXS + i, 0, &lc); printf("WTI_DSCTXS %u\n", i); |