Skip to content

Commit 4c39775

Browse files
committed
Fix Network declarations with GRAPHICS_DISABLED
1 parent 8aeb73e commit 4c39775

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lstm/network.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -282,27 +282,31 @@ double Network::Random(double range) {
282282
return randomizer_->SignedRand(range);
283283
}
284284

285-
#ifndef GRAPHICS_DISABLED
286285
// === Debug image display methods. ===
287286
// Displays the image of the matrix to the forward window.
288287
void Network::DisplayForward(const NetworkIO& matrix) {
288+
#ifndef GRAPHICS_DISABLED // do nothing if there's no graphics
289289
Pix* image = matrix.ToPix();
290290
ClearWindow(false, name_.string(), pixGetWidth(image),
291291
pixGetHeight(image), &forward_win_);
292292
DisplayImage(image, forward_win_);
293293
forward_win_->Update();
294+
#endif // GRAPHICS_DISABLED
294295
}
295296

296297
// Displays the image of the matrix to the backward window.
297298
void Network::DisplayBackward(const NetworkIO& matrix) {
299+
#ifndef GRAPHICS_DISABLED // do nothing if there's no graphics
298300
Pix* image = matrix.ToPix();
299301
STRING window_name = name_ + "-back";
300302
ClearWindow(false, window_name.string(), pixGetWidth(image),
301303
pixGetHeight(image), &backward_win_);
302304
DisplayImage(image, backward_win_);
303305
backward_win_->Update();
306+
#endif // GRAPHICS_DISABLED
304307
}
305308

309+
#ifndef GRAPHICS_DISABLED
306310
// Creates the window if needed, otherwise clears it.
307311
void Network::ClearWindow(bool tess_coords, const char* window_name,
308312
int width, int height, ScrollView** window) {

0 commit comments

Comments
 (0)