Skip to content

Commit 3bc2358

Browse files
committed
ifdef RIVE_EXPERIMENTS
1 parent 46e3ccb commit 3bc2358

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

skia/viewer/build/premake5.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ project "rive_viewer"
5959
}
6060

6161
buildoptions {"-Wall", "-fno-exceptions", "-fno-rtti"}
62+
defines { "RIVE_EXPERIMENTS" }
6263

6364
filter "configurations:debug"
6465
buildoptions {"-g"}

skia/viewer/src/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ std::vector<std::string> stateMachineNames;
6969

7070
constexpr int REQUEST_DEFAULT_SCENE = -1;
7171

72+
#ifdef RIVE_EXPERIMENTS
7273
#include <time.h>
7374
double GetSecondsToday() {
7475
time_t m_time;
@@ -90,6 +91,7 @@ double GetSecondsToday() {
9091
// printf("%g %g %g\n", secs, secs/60, secs/60/60);
9192
return secs;
9293
}
94+
#endif
9395

9496
// We hold onto the file's bytes for the lifetime of the file, in case we want
9597
// to change animations or state-machines, we just rebuild the rive::File from
@@ -325,10 +327,12 @@ int main() {
325327
canvas->drawPaint(paint);
326328

327329
if (currentScene) {
330+
#ifdef RIVE_EXPERIMENTS
328331
// See if we can "set the time" e.g. clock statemachine
329332
if (auto num = currentScene->getNumber("isTime")) {
330333
num->value(GetSecondsToday()/60/60);
331334
}
335+
#endif
332336

333337
currentScene->advanceAndApply(elapsed);
334338

0 commit comments

Comments
 (0)