Skip to content

Commit

Permalink
Added steering and wheel slip
Browse files Browse the repository at this point in the history
Added steering in status bar and wheel slip in table; upgraded from Visual Studio 2013 to 2017; new release version 1.2.1.
  • Loading branch information
Electron-x committed Mar 27, 2019
1 parent 48e807a commit 669fd8f
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 177 deletions.
14 changes: 8 additions & 6 deletions Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BOOL FormatTime(LPTSTR lpszTime, SIZE_T cchStringLen, int nTime)
return FALSE;

if (nTime <= 0)
_tcsncpy(lpszTime, TEXT("0:00.000"), cchStringLen);
lstrcpyn(lpszTime, TEXT("0:00.000"), (int)cchStringLen);
else if (nTime < 3600000)
{
UINT uMinute = (nTime / 60000);
Expand Down Expand Up @@ -54,7 +54,7 @@ BOOL GetFileName(HWND hWnd, LPTSTR lpszFileName, SIZE_T cchStringLen, LPDWORD lp
TCHAR* pszInitialDir = szInitialDir;
if (lpszFileName[0] != TEXT('\0'))
{
_tcsncpy(pszInitialDir, lpszFileName, _countof(szInitialDir));
lstrcpyn(pszInitialDir, lpszFileName, _countof(szInitialDir));
TCHAR* token = _tcsrchr(pszInitialDir, TEXT('\\'));
if (token != NULL)
pszInitialDir[token - szInitialDir] = TEXT('\0');
Expand All @@ -69,9 +69,9 @@ BOOL GetFileName(HWND hWnd, LPTSTR lpszFileName, SIZE_T cchStringLen, LPDWORD lp
if (bSave)
{
if (lpszFileName[0] != TEXT('\0'))
_tcsncpy(szFile, lpszFileName, _countof(szFile));
lstrcpyn(szFile, lpszFileName, _countof(szFile));
else
_tcsncpy(szFile, TEXT("*"), _countof(szFile));
lstrcpyn(szFile, TEXT("*"), _countof(szFile));
TCHAR* token = _tcsrchr(szFile, TEXT('.'));
if (token != NULL)
szFile[token - szFile] = TEXT('\0');
Expand Down Expand Up @@ -111,7 +111,7 @@ BOOL GetFileName(HWND hWnd, LPTSTR lpszFileName, SIZE_T cchStringLen, LPDWORD lp

if (bRet)
{
_tcsncpy(lpszFileName, szFile, cchStringLen);
lstrcpyn(lpszFileName, szFile, (int)cchStringLen);
*lpdwFilterIndex = of.nFilterIndex;
}

Expand All @@ -126,7 +126,7 @@ BOOL StatusBar_SetText(HWND hwndCtl, UINT uIndexType, LPCTSTR lpszText, BOOL bCe
if (hwndCtl == NULL)
return FALSE;

// Set ToolTip
// Set tooltip
SendMessage(hwndCtl, SB_SETTIPTEXT, (WPARAM)LOBYTE(LOWORD(uIndexType)), (LPARAM)lpszText);

if (!bCenter)
Expand Down Expand Up @@ -413,6 +413,7 @@ int ListView_AddRaceText(HWND hwndCtl, int nRaceNumber, int nColumnWidth, LPCTST
// If necessary, rename the header if the application
// was started while a race was already in progress
TCHAR szHeading[MAX_CONTROLTEXT];
szHeading[0] = TEXT('\0');

LV_COLUMN col = { 0 };
col.mask = LVCF_TEXT;
Expand Down Expand Up @@ -533,6 +534,7 @@ BOOL ListView_DeleteAllRaces(HWND hwndCtl)
BOOL ListView_SaveAllItems(HWND hwndCtl, LPTSTR lpszFileName, BOOL bSaveAsCsv)
{
TCHAR szText[MAX_CONTROLTEXT];
szText[0] = TEXT('\0');

if (hwndCtl == NULL)
return FALSE;
Expand Down
6 changes: 4 additions & 2 deletions Helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ const TCHAR szSpeedKmh[] = TEXT("%d km/h");
const TCHAR szSpeedMph[] = TEXT("%d mph");
const TCHAR szEngineRpm[] = TEXT("%.0f rpm");
const TCHAR szEngineCurGear[] = TEXT("Gear: %d");
const TCHAR szGasPedal[] = TEXT("Throttle: %3.0f%%");
const TCHAR szRumbleIntensity[] = TEXT("Rumble: %3.0f%%");
const TCHAR szSteering[] = TEXT("Steering: %3.0f %%");
const TCHAR szGasPedal[] = TEXT("Throttle: %3.0f %%");
const TCHAR szRumbleIntensity[] = TEXT("Rumble: %3.0f %%");
const TCHAR szBraking[] = TEXT("Braking");

// List-view headings
Expand All @@ -49,6 +50,7 @@ const TCHAR szRumbles[] = TEXT("Rumbles");
const TCHAR szGearchanges[] = TEXT("Gearchanges");
const TCHAR szBrakesUsed[] = TEXT("Brakes Used");
const TCHAR szFullspeed[] = TEXT("Fullspeed");
const TCHAR szWheelSlip[] = TEXT("Wheel Slip");

// General functions
BOOL FormatTime(LPTSTR lpszTime, SIZE_T cchStringLen, int nTime);
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ The application does not log any data or perform any analyses. Also no gauges or

The source code is provided as an example and should show how to access the game data via the [telemetry interface](https://wiki.xaseco.org/wiki/Telemetry_interface) of [Maniaplanet 4](https://www.maniaplanet.com/) or [Trackmania Turbo](https://www.ubisoft.com/en-gb/game/trackmania-turbo/).

It's a generic C/C++ Win32 desktop project created with Visual Studio 2013. Since no external libraries are used, the project should be built without problems. An older VS2005 project file (.vcproj) and two Visual Studio Installer projects for x86 and x64 are also included.
This is a generic C/C++ Win32 desktop project created with Visual Studio 2017. Since no external libraries are used, the project should be built without problems. An older VS2005 project file (.vcproj) and two Visual Studio Installer projects for x86 and x64 are also included.
Binary file modified Resource.h
Binary file not shown.
76 changes: 7 additions & 69 deletions Setup/Setup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@
"SccProvider" = "8:"
"Hierarchy"
{
"Entry"
{
"MsmKey" = "8:_4CC65BCBC5E4BCEFC5CD50D2515A9741"
"OwnerKey" = "8:_E3461C036BF947D88556F74EC33D8DD0"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_5A4B9DAFE9768CBB38DC6AFA6DEF49E9"
"OwnerKey" = "8:_E3461C036BF947D88556F74EC33D8DD0"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_E3461C036BF947D88556F74EC33D8DD0"
Expand Down Expand Up @@ -58,11 +46,6 @@
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.4.5"
{
"Name" = "8:Windows Installer 4.5"
"ProductCode" = "8:Microsoft.Windows.Installer.4.5"
}
}
}
}
Expand Down Expand Up @@ -90,11 +73,6 @@
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.4.5"
{
"Name" = "8:Windows Installer 4.5"
"ProductCode" = "8:Microsoft.Windows.Installer.4.5"
}
}
}
}
Expand All @@ -118,46 +96,6 @@
}
"File"
{
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_4CC65BCBC5E4BCEFC5CD50D2515A9741"
{
"SourcePath" = "8:UxTheme.dll"
"TargetName" = "8:UxTheme.dll"
"Tag" = "8:"
"Folder" = "8:_41029E7D8E6B4E77BA5BF125181A456D"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:4"
"Exclude" = "11:TRUE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_5A4B9DAFE9768CBB38DC6AFA6DEF49E9"
{
"SourcePath" = "8:COMDLG32.dll"
"TargetName" = "8:COMDLG32.dll"
"Tag" = "8:"
"Folder" = "8:_41029E7D8E6B4E77BA5BF125181A456D"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:TRUE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
}
"FileType"
{
Expand Down Expand Up @@ -221,23 +159,23 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Telemetry Monitor"
"ProductCode" = "8:{04AB3FA0-7088-4EDC-AAB7-EC6D4A8255BE}"
"PackageCode" = "8:{026F0220-A0B9-43CC-B2D2-C638FB00272B}"
"ProductCode" = "8:{00160BFD-98BE-428E-AB3F-7EF3307A79CB}"
"PackageCode" = "8:{AB572D2F-0CB2-4142-B095-426F98383122}"
"UpgradeCode" = "8:{0059BDD4-CAF2-4273-B4E2-4446D5CA3E27}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.2.0"
"ProductVersion" = "8:1.2.1"
"Manufacturer" = "8:Electron"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://www.wolfgang-rolke.de/gbxdump/"
"Title" = "8:Telemetry Monitor (x86)"
"Subject" = "8:TrackMania Telemetry Monitor (32-bit)"
"ARPCONTACT" = "8:Electron"
"Keywords" = "8:Installer,MSI,TMTelemetry,x86"
"ARPCOMMENTS" = "8:Copyright (c) 2017, 2018 by Electron"
"ARPCOMMENTS" = "8:Copyright (c) 2017-2019 by Electron"
"ARPURLINFOABOUT" = "8:http://www.wolfgang-rolke.de/gbxdump/"
"ARPPRODUCTICON" = "8:_E3461C036BF947D88556F74EC33D8DD0"
"ARPIconIndex" = "3:102"
Expand Down Expand Up @@ -324,7 +262,7 @@
"Condition" = "8:"
"Transitive" = "11:FALSE"
"ValueTypes" = "3:3"
"Value" = "3:16352"
"Value" = "3:32736"
}
"{ADCFDA98-8FDD-45E4-90BC-E3D20B029870}:_7BCC539048DF4342AFC4C44B25DD3DE9"
{
Expand Down Expand Up @@ -505,7 +443,7 @@
"ContextData" = "8:"
"Attributes" = "3:0"
"Setting" = "3:2"
"Value" = "8:TrackMania Telemetry Monitor, Copyright © 2017, 2018 by Electron"
"Value" = "8:TrackMania Telemetry Monitor, Copyright © 2017-2019 by Electron"
"DefaultValue" = "8:#1202"
"UsePlugInResources" = "11:TRUE"
}
Expand Down Expand Up @@ -766,7 +704,7 @@
"ContextData" = "8:"
"Attributes" = "3:0"
"Setting" = "3:2"
"Value" = "8:TrackMania Telemetry Monitor, Copyright © 2017, 2018 by Electron"
"Value" = "8:TrackMania Telemetry Monitor, Copyright © 2017-2019 by Electron"
"DefaultValue" = "8:#1202"
"UsePlugInResources" = "11:TRUE"
}
Expand Down
Loading

0 comments on commit 669fd8f

Please sign in to comment.