From 39d472d3c473831a5be5c868a751b870f475dad6 Mon Sep 17 00:00:00 2001 From: Ferran Sole Date: Wed, 20 Apr 2016 14:53:26 +0100 Subject: [PATCH] Fixed for Emscripten wrapper not building Change-Id: I3e864b3c761077c1ff27930d6f2e2a8d7a784133 --- .../base/separate-update-render/frame-time.cpp | 1 - adaptors/emscripten/sdl-application.cpp | 22 ---- adaptors/emscripten/wrappers/dali-wrapper.cpp | 120 +-------------------- 3 files changed, 5 insertions(+), 138 deletions(-) diff --git a/adaptors/base/separate-update-render/frame-time.cpp b/adaptors/base/separate-update-render/frame-time.cpp index 7c49800..e8aa42d 100644 --- a/adaptors/base/separate-update-render/frame-time.cpp +++ b/adaptors/base/separate-update-render/frame-time.cpp @@ -43,7 +43,6 @@ Integration::Log::Filter* gLogFilter = Integration::Log::Filter::New(Debug::NoLo const unsigned int DEFAULT_MINIMUM_FRAME_TIME_INTERVAL( 16667u ); -const unsigned int MICROSECONDS_PER_SECOND( 1000000u ); const unsigned int MICROSECONDS_PER_MILLISECOND( 1000u ); const unsigned int NANOSECONDS_PER_MICROSECOND( 1000u); diff --git a/adaptors/emscripten/sdl-application.cpp b/adaptors/emscripten/sdl-application.cpp index 132cddf..62ddcc2 100644 --- a/adaptors/emscripten/sdl-application.cpp +++ b/adaptors/emscripten/sdl-application.cpp @@ -35,28 +35,6 @@ namespace { -int _kbhit() -{ - static const int STDIN = 0; - static bool initialized = false; - - if (! initialized) - { - // Use termios to turn off line buffering - termios term; - tcgetattr(STDIN, &term); - term.c_lflag &= ~ICANON; - tcsetattr(STDIN, TCSANOW, &term); - setbuf(stdin, NULL); - initialized = true; - } - - int bytesWaiting; - ioctl(STDIN, FIONREAD, &bytesWaiting); - return bytesWaiting; -} - - void LogFunction(Dali::Integration::Log::DebugPriority priority, std::string& message) { printf("%s", message.c_str()); diff --git a/adaptors/emscripten/wrappers/dali-wrapper.cpp b/adaptors/emscripten/wrappers/dali-wrapper.cpp index 3d105a8..8de62ac 100644 --- a/adaptors/emscripten/wrappers/dali-wrapper.cpp +++ b/adaptors/emscripten/wrappers/dali-wrapper.cpp @@ -143,116 +143,6 @@ std::string VersionString() return versionString.str(); } - -/** - * String conversions for C++ types. For PropertyValueToString() conversions. - */ -template -std::string ToString(const T& value) -{ - std::stringstream ss; - ss << value; - return ss.str(); -} - -/** - * Dali Rect to string template specialization - */ -template <> -std::string ToString(const Dali::Rect& value) -{ - std::stringstream ss; - ss << value.x << "," << value.y << "," << value.width << "," << value.height; - return ss.str(); -} - -/** - * Converts Dali Property Value to string - */ -std::string PropertyValueToString( const Dali::Property::Value& value ) -{ - std::string ret; - - switch( value.GetType() ) - { - case Dali::Property::NONE: - { - ret = "NONE"; - break; - } ///< No type - case Dali::Property::BOOLEAN: - { - ret = value.Get() ? "True" : "False"; - break; - } - case Dali::Property::FLOAT: - { - ret = ToString( value.Get() ); - break; - } - case Dali::Property::INTEGER: - { - ret = ToString( value.Get() ); - break; - } - case Dali::Property::VECTOR2: - { - ret = ToString( value.Get() ); - break; - } - case Dali::Property::VECTOR3: - { - ret = ToString( value.Get() ); - break; - } - case Dali::Property::VECTOR4: - { - ret = ToString( value.Get() ); - break; - } - case Dali::Property::MATRIX3: - { - ret = ToString( value.Get() ); - break; - } - case Dali::Property::MATRIX: - { - ret = ToString( value.Get() ); - break; - } - case Dali::Property::RECTANGLE: - { - ret = ToString( value.Get< Dali::Rect >() ); - break; - } - case Dali::Property::ROTATION: - { - break; - } - case Dali::Property::STRING: - { - ret = value.Get(); - break; - } - case Dali::Property::ARRAY: - { - Dali::Property::Array *array = value.GetArray(); - DALI_ASSERT_ALWAYS(array); - ret = std::string("Array Size=") + ToString( array->Count() ); - break; - } - case Dali::Property::MAP: - { - Dali::Property::Map *map = value.GetMap(); - DALI_ASSERT_ALWAYS(map); - ret = std::string("Map Size=") + ToString( map->Count() ); - break; - } - } - - return ret; -} - /** * Creates an Actor previously registered with the TypeRegistry by name * Actors are currently differentiated in the dali-wrapper.js and have accessor functions @@ -1181,11 +1071,11 @@ EMSCRIPTEN_BINDINGS(dali_wrapper) class_>("TextureSet") .constructor<>(&Dali::TextureSet::New) - .function("setShader", &Dali::TextureSet::SetShader) - .function("getShader", &Dali::TextureSet::GetShader) - .function("addTexture", &Dali::TextureSet::AddTexture) - .function("getNumberOfTextures", &Dali::TextureSet::GetNumberOfTextures) - .function("removeTexture", &Dali::TextureSet::RemoveTexture) + .function("setImage", &Dali::TextureSet::SetImage) + .function("setSampler", &Dali::TextureSet::SetSampler) + .function("getImage", &Dali::TextureSet::GetImage) + .function("getSampler", &Dali::TextureSet::GetSampler) + .function("getTextureCount", &Dali::TextureSet::GetTextureCount) ; class_>("Renderer") -- 2.7.4