Skip to content

Commit 9a722e3

Browse files
committed
win32: Fix 2 errors under MinGW - fixes #359
Signed-off-by: Benn Snyder <[email protected]>
1 parent 3b22efd commit 9a722e3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/glview.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,23 +217,23 @@ void keyPressed(unsigned char key, int x, int y)
217217
if (key == 'e') {
218218
static freenect_flag_value auto_exposure = FREENECT_ON;
219219
freenect_set_flag(f_dev, FREENECT_AUTO_EXPOSURE, auto_exposure);
220-
auto_exposure = !auto_exposure;
220+
auto_exposure = auto_exposure ? FREENECT_OFF : FREENECT_ON;
221221
}
222222
if (key == 'b') {
223223
static freenect_flag_value white_balance = FREENECT_ON;
224224
freenect_set_flag(f_dev, FREENECT_AUTO_WHITE_BALANCE, white_balance);
225-
white_balance = !white_balance;
225+
white_balance = white_balance ? FREENECT_OFF : FREENECT_ON;
226226
}
227227
if (key == 'r') {
228228
static freenect_flag_value raw_color = FREENECT_ON;
229229
freenect_set_flag(f_dev, FREENECT_RAW_COLOR, raw_color);
230-
raw_color = !raw_color;
230+
raw_color = raw_color ? FREENECT_OFF : FREENECT_ON;
231231
}
232232
if (key == 'm') {
233233
static freenect_flag_value mirror = FREENECT_ON;
234234
freenect_set_flag(f_dev, FREENECT_MIRROR_DEPTH, mirror);
235235
freenect_set_flag(f_dev, FREENECT_MIRROR_VIDEO, mirror);
236-
mirror = !mirror;
236+
mirror = mirror ? FREENECT_OFF : FREENECT_ON;
237237
}
238238
if (key == '1') {
239239
freenect_set_led(f_dev,LED_GREEN);

examples/regview.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int got_rgb = 0;
7474
int got_depth = 0;
7575

7676
int frame = 0;
77-
int ftime = 0;
77+
int my_ftime = 0;
7878
double fps = 0;
7979

8080
void idle()
@@ -140,8 +140,8 @@ void DrawGLScene() {
140140
frame++;
141141
if (frame % 30 == 0) {
142142
int ms = glutGet(GLUT_ELAPSED_TIME);
143-
fps = 30.0/((ms-ftime)/1000.0);
144-
ftime = ms;
143+
fps = 30.0/((ms - my_ftime)/1000.0);
144+
my_ftime = ms;
145145
}
146146
}
147147

0 commit comments

Comments
 (0)