File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -123,14 +123,15 @@ const char *getValueString(int32_t slot)
123
123
uint32_t FPS = getCurrentFPS ();
124
124
125
125
int64_t CurrentTime = *reinterpret_cast <int64_t *>(Address) / (TimeBase / FPS);
126
- const char *NegativeSign = " " ;
126
+ bool ValueIsPositive = true ;
127
127
128
128
// Check if the value is negative
129
129
if (CurrentTime < 0 )
130
130
{
131
+ ValueIsPositive = false ;
132
+
131
133
// Convert the number to positive
132
134
CurrentTime = -CurrentTime;
133
- NegativeSign = " -" ;
134
135
}
135
136
136
137
// Handle the value as unsigned
@@ -141,13 +142,24 @@ const char *getValueString(int32_t slot)
141
142
uint32_t second = (CurrentTimeUnsigned / FPS) % 60 ;
142
143
uint32_t frame = CurrentTimeUnsigned % FPS;
143
144
144
- sprintf (tempDisplayBuffer,
145
- " %s%02" PRIu32 " :%02" PRIu32 " :%02" PRIu32 " .%02" PRIu32,
146
- NegativeSign,
147
- hour,
148
- minute,
149
- second,
150
- frame);
145
+ if (ValueIsPositive)
146
+ {
147
+ sprintf (tempDisplayBuffer,
148
+ " %02" PRIu32 " :%02" PRIu32 " :%02" PRIu32 " .%02" PRIu32,
149
+ hour,
150
+ minute,
151
+ second,
152
+ frame);
153
+ }
154
+ else
155
+ {
156
+ sprintf (tempDisplayBuffer,
157
+ " -%02" PRIu32 " :%02" PRIu32 " :%02" PRIu32 " .%02" PRIu32,
158
+ hour,
159
+ minute,
160
+ second,
161
+ frame);
162
+ }
151
163
return tempDisplayBuffer;
152
164
}
153
165
case s8:
You can’t perform that action at this time.
0 commit comments