Przeglądaj źródła

device: use CROWN_CAN_RELOAD

Daniele Bartolini 1 rok temu
rodzic
commit
8c11ec67c2
2 zmienionych plików z 6 dodań i 2 usunięć
  1. 2 0
      src/config.h
  2. 4 2
      src/device/device.cpp

+ 2 - 0
src/config.h

@@ -27,6 +27,8 @@
 	&& (CROWN_PLATFORM_LINUX || CROWN_PLATFORM_WINDOWS)       \
 	&& (CROWN_PLATFORM_LINUX || CROWN_PLATFORM_WINDOWS)       \
 	? 1 : 0)
 	? 1 : 0)
 
 
+#define CROWN_CAN_RELOAD (CROWN_DEBUG || CROWN_DEVELOPMENT)
+
 #ifndef CROWN_BUILD_UNIT_TESTS
 #ifndef CROWN_BUILD_UNIT_TESTS
 	#define CROWN_BUILD_UNIT_TESTS 1
 	#define CROWN_BUILD_UNIT_TESTS 1
 #endif
 #endif

+ 4 - 2
src/device/device.cpp

@@ -854,7 +854,7 @@ void Device::destroy_resource_package(ResourcePackage &rp)
 
 
 void Device::refresh(const char *json)
 void Device::refresh(const char *json)
 {
 {
-#if CROWN_DEBUG
+#if CROWN_CAN_RELOAD
 	TempAllocator4096 ta;
 	TempAllocator4096 ta;
 	JsonObject obj(ta);
 	JsonObject obj(ta);
 	JsonArray list(ta);
 	JsonArray list(ta);
@@ -887,7 +887,9 @@ void Device::refresh(const char *json)
 
 
 	if (_paused)
 	if (_paused)
 		unpause();
 		unpause();
-#endif // if CROWN_DEBUG
+#else
+	CE_UNUSED(json);
+#endif // if CROWN_CAN_RELOAD
 }
 }
 
 
 void Device::screenshot(const char *path)
 void Device::screenshot(const char *path)