Browse Source

Windows updates

Josh Engebretson 9 years ago
parent
commit
41e55cce21
62 changed files with 664 additions and 488 deletions
  1. 2 1
      Build/CMake/Modules/AtomicCommon.cmake
  2. 0 1
      Script/AtomicNET/AtomicNET/Core/AtomicNET.cs
  3. 0 2
      Script/AtomicNET/AtomicNET/Core/Constants.cs
  4. 6 1
      Source/Atomic/Atomic2D/TmxFile2D.h
  5. 7 1
      Source/Atomic/Core/Object.h
  6. 5 3
      Source/Atomic/Engine/Engine.cpp
  7. 5 5
      Source/Atomic/Graphics/Direct3D11/D3D11ConstantBuffer.cpp
  8. 87 58
      Source/Atomic/Graphics/Direct3D11/D3D11Graphics.cpp
  9. 1 1
      Source/Atomic/Graphics/Direct3D11/D3D11GraphicsImpl.cpp
  10. 4 4
      Source/Atomic/Graphics/Direct3D11/D3D11GraphicsImpl.h
  11. 13 13
      Source/Atomic/Graphics/Direct3D11/D3D11IndexBuffer.cpp
  12. 3 3
      Source/Atomic/Graphics/Direct3D11/D3D11RenderSurface.cpp
  13. 4 2
      Source/Atomic/Graphics/Direct3D11/D3D11ShaderProgram.h
  14. 15 15
      Source/Atomic/Graphics/Direct3D11/D3D11ShaderVariation.cpp
  15. 21 4
      Source/Atomic/Graphics/Direct3D11/D3D11Texture.cpp
  16. 27 27
      Source/Atomic/Graphics/Direct3D11/D3D11Texture2D.cpp
  17. 31 31
      Source/Atomic/Graphics/Direct3D11/D3D11Texture2DArray.cpp
  18. 21 21
      Source/Atomic/Graphics/Direct3D11/D3D11Texture3D.cpp
  19. 29 29
      Source/Atomic/Graphics/Direct3D11/D3D11TextureCube.cpp
  20. 13 13
      Source/Atomic/Graphics/Direct3D11/D3D11VertexBuffer.cpp
  21. 4 4
      Source/Atomic/Graphics/Direct3D11/D3D11VertexDeclaration.cpp
  22. 4 2
      Source/Atomic/Graphics/Direct3D11/D3D11VertexDeclaration.h
  23. 2 2
      Source/Atomic/Graphics/Direct3D9/D3D9ConstantBuffer.cpp
  24. 100 44
      Source/Atomic/Graphics/Direct3D9/D3D9Graphics.cpp
  25. 1 1
      Source/Atomic/Graphics/Direct3D9/D3D9GraphicsImpl.cpp
  26. 4 4
      Source/Atomic/Graphics/Direct3D9/D3D9GraphicsImpl.h
  27. 16 16
      Source/Atomic/Graphics/Direct3D9/D3D9IndexBuffer.cpp
  28. 2 2
      Source/Atomic/Graphics/Direct3D9/D3D9RenderSurface.cpp
  29. 3 1
      Source/Atomic/Graphics/Direct3D9/D3D9ShaderProgram.h
  30. 13 13
      Source/Atomic/Graphics/Direct3D9/D3D9ShaderVariation.cpp
  31. 32 1
      Source/Atomic/Graphics/Direct3D9/D3D9Texture.cpp
  32. 26 26
      Source/Atomic/Graphics/Direct3D9/D3D9Texture2D.cpp
  33. 12 12
      Source/Atomic/Graphics/Direct3D9/D3D9Texture2DArray.cpp
  34. 18 18
      Source/Atomic/Graphics/Direct3D9/D3D9Texture3D.cpp
  35. 30 30
      Source/Atomic/Graphics/Direct3D9/D3D9TextureCube.cpp
  36. 16 16
      Source/Atomic/Graphics/Direct3D9/D3D9VertexBuffer.cpp
  37. 7 7
      Source/Atomic/Graphics/Direct3D9/D3D9VertexDeclaration.cpp
  38. 4 2
      Source/Atomic/Graphics/Direct3D9/D3D9VertexDeclaration.h
  39. 12 2
      Source/Atomic/Graphics/Drawable.cpp
  40. 6 1
      Source/Atomic/Graphics/Drawable.h
  41. 1 1
      Source/Atomic/Graphics/LMStaticModel.cpp
  42. 2 0
      Source/Atomic/Graphics/Texture.h
  43. 2 2
      Source/Atomic/IPC/IPC.cpp
  44. 1 1
      Source/Atomic/IPC/IPCWindows.cpp
  45. 1 1
      Source/Atomic/IPC/IPCWindows.h
  46. 2 2
      Source/Atomic/IPC/IPCWorker.cpp
  47. 1 1
      Source/Atomic/UI/UIDragDropWindows.cpp
  48. 4 4
      Source/AtomicApp/Player/IPCPlayerApp.cpp
  49. 3 3
      Source/AtomicApp/Player/PlayerApp.cpp
  50. 3 3
      Source/AtomicEditor/Application/AEEditorApp.cpp
  51. 1 1
      Source/AtomicNET/NETNative/NETServiceApplication.cpp
  52. 3 3
      Source/AtomicPlayer/Application/AtomicPlayer.cpp
  53. 2 2
      Source/AtomicWebView/WebKeyboardWindows.cpp
  54. 7 1
      Source/AtomicWebView/WebTexture2D.cpp
  55. 1 1
      Source/ThirdParty/LibCpuId/CMakeLists.txt
  56. 8 8
      Source/ThirdParty/SDL/CMakeLists.txt
  57. 1 1
      Source/ThirdParty/STB/CMakeLists.txt
  58. 2 2
      Source/ThirdParty/STB/stb_image_write.cpp
  59. 2 2
      Source/ToolCore/Build/BuildBase.cpp
  60. 1 1
      Source/ToolCore/Build/BuildWindows.cpp
  61. 1 0
      Source/ToolCore/JSBind/JSBModule.cpp
  62. 9 9
      Source/ToolCore/NETTools/NETProjectSystem.cpp

+ 2 - 1
Build/CMake/Modules/AtomicCommon.cmake

@@ -30,7 +30,8 @@ set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} AtomicBuildInfo)
 
 if(CMAKE_SIZEOF_VOID_P MATCHES 8)
   set(ATOMIC_PROJECT_ARCH "x86_64")
-  set (URHO3D_64BIT 1)
+  set(ATOMIC_64BIT 1)
+  add_definitions(-DATOMIC_64BIT=1)
 else()
   set(ATOMIC_PROJECT_ARCH "x86")
 endif()

+ 0 - 1
Script/AtomicNET/AtomicNET/Core/AtomicNET.cs

@@ -59,7 +59,6 @@ namespace AtomicEngine
             GraphicsModule.Initialize();
             SceneModule.Initialize();
             Atomic2DModule.Initialize();
-            Atomic3DModule.Initialize();
             NavigationModule.Initialize();
             NetworkModule.Initialize();
             PhysicsModule.Initialize();

+ 0 - 2
Script/AtomicNET/AtomicNET/Core/Constants.cs

@@ -9,8 +9,6 @@ namespace AtomicEngine
     {
         public const string LIBNAME = "AtomicNETNative.dll";
 
-        // Atomic2D
-        public const float PIXEL_SIZE = 0.01f;
     }
 
 }

+ 6 - 1
Source/Atomic/Atomic2D/TmxFile2D.h

@@ -40,7 +40,12 @@ class TmxLayer2D : public RefCounted
     ATOMIC_REFCOUNTED(TmxLayer2D)
 
 public:
-    TmxLayer2D(TmxFile2D* tmxFile, TileMapLayerType2D type);
+
+// ATOMIC BEGIN
+    // default arguments for script bindings on subclasses
+    TmxLayer2D(TmxFile2D* tmxFile = 0, TileMapLayerType2D type = LT_INVALID);
+// ATOMIC END
+
     virtual ~TmxLayer2D();
 
     /// Return tmx file.

+ 7 - 1
Source/Atomic/Core/Object.h

@@ -356,8 +356,14 @@ class EventHandler11Impl : public EventHandler
 public:
     /// Construct with receiver and function pointers and userdata.
     EventHandler11Impl(std::function<void(StringHash, VariantMap&)> function, void* userData = 0) :
-        EventHandler((Object*)0xDEADBEEF /* EventHandler insists for receiver_ not being null but it is captured in
+#ifdef ATOMIC_64BIT
+        EventHandler((Object*)0xDEADBEEFDEADBEEF /* EventHandler insists for receiver_ not being null but it is captured in
                                           * `function_` already and is not used by `EventHandler11Impl` */, userData),
+#else
+        EventHandler((Object*)0xDEADBEEF /* EventHandler insists for receiver_ not being null but it is captured in
+                                         * `function_` already and is not used by `EventHandler11Impl` */, userData),
+#endif
+
         function_(function)
     {
         assert(function_);

+ 5 - 3
Source/Atomic/Engine/Engine.cpp

@@ -250,7 +250,9 @@ bool Engine::Initialize(const VariantMap& parameters)
                         return false;
                 }
             }
-            if (j == resourcePrefixPaths.Size())
+
+            // ATOMIC: Only fail when CoreData can't be opened and not headless
+            if (j == resourcePrefixPaths.Size() && !headless_)
             {
                 ATOMIC_LOGERRORF(
                     "Failed to add resource path '%s', check the documentation on how to set the 'resource prefix path'",
@@ -282,12 +284,12 @@ bool Engine::Initialize(const VariantMap& parameters)
                     return false;
             }
         }
-        if (j == resourcePrefixPaths.Size())
+        // ATOMIC: Only fail when CoreData can't be opened and not headless
+        if (j == resourcePrefixPaths.Size() && !headless_)
         {
             ATOMIC_LOGERRORF(
                 "Failed to add resource package '%s', check the documentation on how to set the 'resource prefix path'",
                 resourcePackages[i].CString());
-            return false;
         }
     }
 

+ 5 - 5
Source/Atomic/Graphics/Direct3D11/D3D11ConstantBuffer.cpp

@@ -29,7 +29,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void ConstantBuffer::OnDeviceReset()
@@ -39,7 +39,7 @@ void ConstantBuffer::OnDeviceReset()
 
 void ConstantBuffer::Release()
 {
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 
     shadowData_.Reset();
     size_ = 0;
@@ -51,7 +51,7 @@ bool ConstantBuffer::SetSize(unsigned size)
 
     if (!size)
     {
-        URHO3D_LOGERROR("Can not create zero-sized constant buffer");
+        ATOMIC_LOGERROR("Can not create zero-sized constant buffer");
         return false;
     }
 
@@ -77,8 +77,8 @@ bool ConstantBuffer::SetSize(unsigned size)
         HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateBuffer(&bufferDesc, 0, (ID3D11Buffer**)&object_.ptr_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(object_.ptr_);
-            URHO3D_LOGD3DERROR("Failed to create constant buffer", hr);
+            ATOMIC_SAFE_RELEASE(object_.ptr_);
+            ATOMIC_LOGD3DERROR("Failed to create constant buffer", hr);
             return false;
         }
     }

+ 87 - 58
Source/Atomic/Graphics/Direct3D11/D3D11Graphics.cpp

@@ -41,8 +41,10 @@
 #include "../../IO/Log.h"
 #include "../../Resource/ResourceCache.h"
 
-#include <SDL/SDL.h>
-#include <SDL/SDL_syswm.h>
+// ATOMIC BEGIN
+#include <SDL/include/SDL.h>
+#include <SDL/include/SDL_syswm.h>
+// ATOMIC END
 
 #include "../../DebugNew.h"
 
@@ -57,7 +59,7 @@ __declspec(dllexport) DWORD NvOptimusEnablement = 1;
 __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
 }
 
-namespace Urho3D
+namespace Atomic
 {
 
 static const D3D11_COMPARISON_FUNC d3dCmpFunc[] =
@@ -257,30 +259,30 @@ Graphics::~Graphics()
 
     for (HashMap<unsigned, ID3D11BlendState*>::Iterator i = impl_->blendStates_.Begin(); i != impl_->blendStates_.End(); ++i)
     {
-        URHO3D_SAFE_RELEASE(i->second_);
+        ATOMIC_SAFE_RELEASE(i->second_);
     }
     impl_->blendStates_.Clear();
 
     for (HashMap<unsigned, ID3D11DepthStencilState*>::Iterator i = impl_->depthStates_.Begin(); i != impl_->depthStates_.End(); ++i)
     {
-        URHO3D_SAFE_RELEASE(i->second_);
+        ATOMIC_SAFE_RELEASE(i->second_);
     }
     impl_->depthStates_.Clear();
 
     for (HashMap<unsigned, ID3D11RasterizerState*>::Iterator i = impl_->rasterizerStates_.Begin();
          i != impl_->rasterizerStates_.End(); ++i)
     {
-        URHO3D_SAFE_RELEASE(i->second_);
+        ATOMIC_SAFE_RELEASE(i->second_);
     }
     impl_->rasterizerStates_.Clear();
 
-    URHO3D_SAFE_RELEASE(impl_->defaultRenderTargetView_);
-    URHO3D_SAFE_RELEASE(impl_->defaultDepthStencilView_);
-    URHO3D_SAFE_RELEASE(impl_->defaultDepthTexture_);
-    URHO3D_SAFE_RELEASE(impl_->resolveTexture_);
-    URHO3D_SAFE_RELEASE(impl_->swapChain_);
-    URHO3D_SAFE_RELEASE(impl_->deviceContext_);
-    URHO3D_SAFE_RELEASE(impl_->device_);
+    ATOMIC_SAFE_RELEASE(impl_->defaultRenderTargetView_);
+    ATOMIC_SAFE_RELEASE(impl_->defaultDepthStencilView_);
+    ATOMIC_SAFE_RELEASE(impl_->defaultDepthTexture_);
+    ATOMIC_SAFE_RELEASE(impl_->resolveTexture_);
+    ATOMIC_SAFE_RELEASE(impl_->swapChain_);
+    ATOMIC_SAFE_RELEASE(impl_->deviceContext_);
+    ATOMIC_SAFE_RELEASE(impl_->device_);
 
     if (window_)
     {
@@ -299,7 +301,7 @@ Graphics::~Graphics()
 bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless, bool resizable, bool highDPI, bool vsync, bool tripleBuffer,
     int multiSample)
 {
-    URHO3D_PROFILE(SetScreenMode);
+    ATOMIC_PROFILE(SetScreenMode);
 
     highDPI = false;   // SDL does not support High DPI mode on Windows platform yet, so always disable it for now
 
@@ -394,7 +396,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     Clear(CLEAR_COLOR);
     impl_->swapChain_->Present(0, 0);
 
-#ifdef URHO3D_LOGGING
+#ifdef ATOMIC_LOGGING
     String msg;
     msg.AppendWithFormat("Set screen mode %dx%d %s", width_, height_, (fullscreen_ ? "fullscreen" : "windowed"));
     if (borderless_)
@@ -403,7 +405,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
         msg.Append(" resizable");
     if (multiSample > 1)
         msg.AppendWithFormat(" multisample %d", multiSample);
-    URHO3D_LOGINFO(msg);
+    ATOMIC_LOGINFO(msg);
 #endif
 
     using namespace ScreenMode;
@@ -476,9 +478,9 @@ void Graphics::Close()
     }
 }
 
-bool Graphics::TakeScreenShot(Image& destImage)
+bool Graphics::TakeScreenShot(Image* destImage)
 {
-    URHO3D_PROFILE(TakeScreenShot);
+    ATOMIC_PROFILE(TakeScreenShot);
 
     if (!impl_->device_)
         return false;
@@ -499,8 +501,8 @@ bool Graphics::TakeScreenShot(Image& destImage)
     HRESULT hr = impl_->device_->CreateTexture2D(&textureDesc, 0, &stagingTexture);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(stagingTexture);
-        URHO3D_LOGD3DERROR("Could not create staging texture for screenshot", hr);
+        ATOMIC_SAFE_RELEASE(stagingTexture);
+        ATOMIC_LOGD3DERROR("Could not create staging texture for screenshot", hr);
         return false;
     }
 
@@ -532,13 +534,13 @@ bool Graphics::TakeScreenShot(Image& destImage)
     hr = impl_->deviceContext_->Map(stagingTexture, 0, D3D11_MAP_READ, 0, &mappedData);
     if (FAILED(hr) || !mappedData.pData)
     {
-        URHO3D_LOGD3DERROR("Could not map staging texture for screenshot", hr);
+        ATOMIC_LOGD3DERROR("Could not map staging texture for screenshot", hr);
         stagingTexture->Release();
         return false;
     }
 
-    destImage.SetSize(width_, height_, 3);
-    unsigned char* destData = destImage.GetData();
+    destImage->SetSize(width_, height_, 3);
+    unsigned char* destData = destImage->GetData();
     for (int y = 0; y < height_; ++y)
     {
         unsigned char* src = (unsigned char*)mappedData.pData + y * mappedData.RowPitch;
@@ -598,7 +600,7 @@ void Graphics::EndFrame()
         return;
 
     {
-        URHO3D_PROFILE(Present);
+        ATOMIC_PROFILE(Present);
 
         SendEvent(E_ENDRENDERING);
         impl_->swapChain_->Present(vsync_ ? 1 : 0, 0);
@@ -677,7 +679,7 @@ bool Graphics::ResolveToTexture(Texture2D* destination, const IntRect& viewport)
     if (!destination || !destination->GetRenderSurface())
         return false;
 
-    URHO3D_PROFILE(ResolveToTexture);
+    ATOMIC_PROFILE(ResolveToTexture);
 
     IntRect vpCopy = viewport;
     if (vpCopy.right_ <= vpCopy.left_)
@@ -867,7 +869,7 @@ bool Graphics::SetVertexBuffers(const PODVector<VertexBuffer*>& buffers, unsigne
 {
     if (buffers.Size() > MAX_VERTEX_STREAMS)
     {
-        URHO3D_LOGERROR("Too many vertex buffers");
+        ATOMIC_LOGERROR("Too many vertex buffers");
         return false;
     }
 
@@ -961,12 +963,12 @@ void Graphics::SetShaders(ShaderVariation* vs, ShaderVariation* ps)
         {
             if (vs->GetCompilerOutput().Empty())
             {
-                URHO3D_PROFILE(CompileVertexShader);
+                ATOMIC_PROFILE(CompileVertexShader);
 
                 bool success = vs->Create();
                 if (!success)
                 {
-                    URHO3D_LOGERROR("Failed to compile vertex shader " + vs->GetFullName() + ":\n" + vs->GetCompilerOutput());
+                    ATOMIC_LOGERROR("Failed to compile vertex shader " + vs->GetFullName() + ":\n" + vs->GetCompilerOutput());
                     vs = 0;
                 }
             }
@@ -985,12 +987,12 @@ void Graphics::SetShaders(ShaderVariation* vs, ShaderVariation* ps)
         {
             if (ps->GetCompilerOutput().Empty())
             {
-                URHO3D_PROFILE(CompilePixelShader);
+                ATOMIC_PROFILE(CompilePixelShader);
 
                 bool success = ps->Create();
                 if (!success)
                 {
-                    URHO3D_LOGERROR("Failed to compile pixel shader " + ps->GetFullName() + ":\n" + ps->GetCompilerOutput());
+                    ATOMIC_LOGERROR("Failed to compile pixel shader " + ps->GetFullName() + ":\n" + ps->GetCompilerOutput());
                     ps = 0;
                 }
             }
@@ -1664,7 +1666,7 @@ void Graphics::EndDumpShaders()
 
 void Graphics::PrecacheShaders(Deserializer& source)
 {
-    URHO3D_PROFILE(PrecacheShaders);
+    ATOMIC_PROFILE(PrecacheShaders);
 
     ShaderPrecache::LoadShaders(this, source);
 }
@@ -1828,7 +1830,7 @@ void Graphics::OnWindowResized()
     // Reset rendertargets and viewport for the new screen size
     ResetRenderTargets();
 
-    URHO3D_LOGDEBUGF("Window was resized to %dx%d", width_, height_);
+    ATOMIC_LOGDEBUGF("Window was resized to %dx%d", width_, height_);
 
     using namespace ScreenMode;
 
@@ -1855,7 +1857,7 @@ void Graphics::OnWindowMoved()
     position_.x_ = newX;
     position_.y_ = newY;
 
-    URHO3D_LOGDEBUGF("Window was moved to %d,%d", position_.x_, position_.y_);
+    ATOMIC_LOGDEBUGF("Window was moved to %d,%d", position_.x_, position_.y_);
 
     using namespace WindowPos;
 
@@ -2049,7 +2051,7 @@ bool Graphics::OpenWindow(int width, int height, bool resizable, bool borderless
 
     if (!window_)
     {
-        URHO3D_LOGERRORF("Could not create window, root cause: '%s'", SDL_GetError());
+        ATOMIC_LOGERRORF("Could not create window, root cause: '%s'", SDL_GetError());
         return false;
     }
 
@@ -2106,9 +2108,9 @@ bool Graphics::CreateDevice(int width, int height, int multiSample)
 
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(impl_->device_);
-            URHO3D_SAFE_RELEASE(impl_->deviceContext_);
-            URHO3D_LOGD3DERROR("Failed to create D3D11 device", hr);
+            ATOMIC_SAFE_RELEASE(impl_->device_);
+            ATOMIC_SAFE_RELEASE(impl_->deviceContext_);
+            ATOMIC_LOGD3DERROR("Failed to create D3D11 device", hr);
             return false;
         }
 
@@ -2159,8 +2161,8 @@ bool Graphics::CreateDevice(int width, int height, int multiSample)
 
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(impl_->swapChain_);
-        URHO3D_LOGD3DERROR("Failed to create D3D11 swap chain", hr);
+        ATOMIC_SAFE_RELEASE(impl_->swapChain_);
+        ATOMIC_LOGD3DERROR("Failed to create D3D11 swap chain", hr);
         return false;
     }
 
@@ -2207,8 +2209,8 @@ bool Graphics::UpdateSwapChain(int width, int height)
     HRESULT hr = impl_->swapChain_->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backbufferTexture);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(backbufferTexture);
-        URHO3D_LOGD3DERROR("Failed to get backbuffer texture", hr);
+        ATOMIC_SAFE_RELEASE(backbufferTexture);
+        ATOMIC_LOGD3DERROR("Failed to get backbuffer texture", hr);
         success = false;
     }
     else
@@ -2217,8 +2219,8 @@ bool Graphics::UpdateSwapChain(int width, int height)
         backbufferTexture->Release();
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(impl_->defaultRenderTargetView_);
-            URHO3D_LOGD3DERROR("Failed to create backbuffer rendertarget view", hr);
+            ATOMIC_SAFE_RELEASE(impl_->defaultRenderTargetView_);
+            ATOMIC_LOGD3DERROR("Failed to create backbuffer rendertarget view", hr);
             success = false;
         }
     }
@@ -2240,8 +2242,8 @@ bool Graphics::UpdateSwapChain(int width, int height)
     hr = impl_->device_->CreateTexture2D(&depthDesc, 0, &impl_->defaultDepthTexture_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(impl_->defaultDepthTexture_);
-        URHO3D_LOGD3DERROR("Failed to create backbuffer depth-stencil texture", hr);
+        ATOMIC_SAFE_RELEASE(impl_->defaultDepthTexture_);
+        ATOMIC_LOGD3DERROR("Failed to create backbuffer depth-stencil texture", hr);
         success = false;
     }
     else
@@ -2249,8 +2251,8 @@ bool Graphics::UpdateSwapChain(int width, int height)
         hr = impl_->device_->CreateDepthStencilView(impl_->defaultDepthTexture_, 0, &impl_->defaultDepthStencilView_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(impl_->defaultDepthStencilView_);
-            URHO3D_LOGD3DERROR("Failed to create backbuffer depth-stencil view", hr);
+            ATOMIC_SAFE_RELEASE(impl_->defaultDepthStencilView_);
+            ATOMIC_LOGD3DERROR("Failed to create backbuffer depth-stencil view", hr);
             success = false;
         }
     }
@@ -2442,7 +2444,7 @@ void Graphics::PrepareDraw()
             HashMap<unsigned, ID3D11BlendState*>::Iterator i = impl_->blendStates_.Find(newBlendStateHash);
             if (i == impl_->blendStates_.End())
             {
-                URHO3D_PROFILE(CreateBlendState);
+                ATOMIC_PROFILE(CreateBlendState);
 
                 D3D11_BLEND_DESC stateDesc;
                 memset(&stateDesc, 0, sizeof stateDesc);
@@ -2461,8 +2463,8 @@ void Graphics::PrepareDraw()
                 HRESULT hr = impl_->device_->CreateBlendState(&stateDesc, &newBlendState);
                 if (FAILED(hr))
                 {
-                    URHO3D_SAFE_RELEASE(newBlendState);
-                    URHO3D_LOGD3DERROR("Failed to create blend state", hr);
+                    ATOMIC_SAFE_RELEASE(newBlendState);
+                    ATOMIC_LOGD3DERROR("Failed to create blend state", hr);
                 }
 
                 i = impl_->blendStates_.Insert(MakePair(newBlendStateHash, newBlendState));
@@ -2486,7 +2488,7 @@ void Graphics::PrepareDraw()
             HashMap<unsigned, ID3D11DepthStencilState*>::Iterator i = impl_->depthStates_.Find(newDepthStateHash);
             if (i == impl_->depthStates_.End())
             {
-                URHO3D_PROFILE(CreateDepthState);
+                ATOMIC_PROFILE(CreateDepthState);
 
                 D3D11_DEPTH_STENCIL_DESC stateDesc;
                 memset(&stateDesc, 0, sizeof stateDesc);
@@ -2509,8 +2511,8 @@ void Graphics::PrepareDraw()
                 HRESULT hr = impl_->device_->CreateDepthStencilState(&stateDesc, &newDepthState);
                 if (FAILED(hr))
                 {
-                    URHO3D_SAFE_RELEASE(newDepthState);
-                    URHO3D_LOGD3DERROR("Failed to create depth state", hr);
+                    ATOMIC_SAFE_RELEASE(newDepthState);
+                    ATOMIC_LOGD3DERROR("Failed to create depth state", hr);
                 }
 
                 i = impl_->depthStates_.Insert(MakePair(newDepthStateHash, newDepthState));
@@ -2539,7 +2541,7 @@ void Graphics::PrepareDraw()
             HashMap<unsigned, ID3D11RasterizerState*>::Iterator i = impl_->rasterizerStates_.Find(newRasterizerStateHash);
             if (i == impl_->rasterizerStates_.End())
             {
-                URHO3D_PROFILE(CreateRasterizerState);
+                ATOMIC_PROFILE(CreateRasterizerState);
 
                 D3D11_RASTERIZER_DESC stateDesc;
                 memset(&stateDesc, 0, sizeof stateDesc);
@@ -2558,8 +2560,8 @@ void Graphics::PrepareDraw()
                 HRESULT hr = impl_->device_->CreateRasterizerState(&stateDesc, &newRasterizerState);
                 if (FAILED(hr))
                 {
-                    URHO3D_SAFE_RELEASE(newRasterizerState);
-                    URHO3D_LOGD3DERROR("Failed to create rasterizer state", hr);
+                    ATOMIC_SAFE_RELEASE(newRasterizerState);
+                    ATOMIC_LOGD3DERROR("Failed to create rasterizer state", hr);
                 }
 
                 i = impl_->rasterizerStates_.Insert(MakePair(newRasterizerStateHash, newRasterizerState));
@@ -2608,8 +2610,8 @@ void Graphics::CreateResolveTexture()
     HRESULT hr = impl_->device_->CreateTexture2D(&textureDesc, 0, &impl_->resolveTexture_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(impl_->resolveTexture_);
-        URHO3D_LOGD3DERROR("Could not create resolve texture", hr);
+        ATOMIC_SAFE_RELEASE(impl_->resolveTexture_);
+        ATOMIC_LOGD3DERROR("Could not create resolve texture", hr);
     }
 }
 
@@ -2633,4 +2635,31 @@ void Graphics::SetTextureUnitMappings()
     textureUnits_["ZoneVolumeMap"] = TU_ZONE;
 }
 
+// ATOMIC BEGIN
+
+// To satisfy script binding linking
+void Graphics::SetTextureForUpdate(Texture* texture)
+{
+
+}
+
+void Graphics::MarkFBODirty()
+{
+
+}
+
+void Graphics::SetVBO(unsigned object)
+{
+
+}
+
+void Graphics::SetUBO(unsigned object)
+{
+
+}
+
+
+// ATOMIC END
+
+
 }

+ 1 - 1
Source/Atomic/Graphics/Direct3D11/D3D11GraphicsImpl.cpp

@@ -27,7 +27,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 GraphicsImpl::GraphicsImpl() :

+ 4 - 4
Source/Atomic/Graphics/Direct3D11/D3D11GraphicsImpl.h

@@ -31,19 +31,19 @@
 #include <d3d11.h>
 #include <dxgi.h>
 
-namespace Urho3D
+namespace Atomic
 {
 
-#define URHO3D_SAFE_RELEASE(p) if (p) { ((IUnknown*)p)->Release();  p = 0; }
+#define ATOMIC_SAFE_RELEASE(p) if (p) { ((IUnknown*)p)->Release();  p = 0; }
 
-#define URHO3D_LOGD3DERROR(msg, hr) URHO3D_LOGERRORF("%s (HRESULT %x)", msg, (unsigned)hr)
+#define ATOMIC_LOGD3DERROR(msg, hr) ATOMIC_LOGERRORF("%s (HRESULT %x)", msg, (unsigned)hr)
 
 typedef HashMap<Pair<ShaderVariation*, ShaderVariation*>, SharedPtr<ShaderProgram> > ShaderProgramMap;
 typedef HashMap<unsigned long long, SharedPtr<VertexDeclaration> > VertexDeclarationMap;
 typedef HashMap<unsigned, SharedPtr<ConstantBuffer> > ConstantBufferMap;
 
 /// %Graphics implementation. Holds API-specific objects.
-class URHO3D_API GraphicsImpl
+class ATOMIC_API GraphicsImpl
 {
     friend class Graphics;
 

+ 13 - 13
Source/Atomic/Graphics/Direct3D11/D3D11IndexBuffer.cpp

@@ -30,7 +30,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void IndexBuffer::OnDeviceLost()
@@ -50,20 +50,20 @@ void IndexBuffer::Release()
     if (graphics_ && graphics_->GetIndexBuffer() == this)
         graphics_->SetIndexBuffer(0);
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 }
 
 bool IndexBuffer::SetData(const void* data)
 {
     if (!data)
     {
-        URHO3D_LOGERROR("Null pointer for index buffer data");
+        ATOMIC_LOGERROR("Null pointer for index buffer data");
         return false;
     }
 
     if (!indexSize_)
     {
-        URHO3D_LOGERROR("Index size not defined, can not set index buffer data");
+        ATOMIC_LOGERROR("Index size not defined, can not set index buffer data");
         return false;
     }
 
@@ -107,19 +107,19 @@ bool IndexBuffer::SetDataRange(const void* data, unsigned start, unsigned count,
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null pointer for index buffer data");
+        ATOMIC_LOGERROR("Null pointer for index buffer data");
         return false;
     }
 
     if (!indexSize_)
     {
-        URHO3D_LOGERROR("Index size not defined, can not set index buffer data");
+        ATOMIC_LOGERROR("Index size not defined, can not set index buffer data");
         return false;
     }
 
     if (start + count > indexCount_)
     {
-        URHO3D_LOGERROR("Illegal range for setting new index buffer data");
+        ATOMIC_LOGERROR("Illegal range for setting new index buffer data");
         return false;
     }
 
@@ -163,19 +163,19 @@ void* IndexBuffer::Lock(unsigned start, unsigned count, bool discard)
 {
     if (lockState_ != LOCK_NONE)
     {
-        URHO3D_LOGERROR("Index buffer already locked");
+        ATOMIC_LOGERROR("Index buffer already locked");
         return 0;
     }
 
     if (!indexSize_)
     {
-        URHO3D_LOGERROR("Index size not defined, can not lock index buffer");
+        ATOMIC_LOGERROR("Index size not defined, can not lock index buffer");
         return 0;
     }
 
     if (start + count > indexCount_)
     {
-        URHO3D_LOGERROR("Illegal range for locking index buffer");
+        ATOMIC_LOGERROR("Illegal range for locking index buffer");
         return 0;
     }
 
@@ -247,8 +247,8 @@ bool IndexBuffer::Create()
         HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateBuffer(&bufferDesc, 0, (ID3D11Buffer**)&object_.ptr_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(object_.ptr_);
-            URHO3D_LOGD3DERROR("Failed to create index buffer", hr);
+            ATOMIC_SAFE_RELEASE(object_.ptr_);
+            ATOMIC_LOGD3DERROR("Failed to create index buffer", hr);
             return false;
         }
     }
@@ -276,7 +276,7 @@ void* IndexBuffer::MapBuffer(unsigned start, unsigned count, bool discard)
         HRESULT hr = graphics_->GetImpl()->GetDeviceContext()->Map((ID3D11Buffer*)object_.ptr_, 0, discard ? D3D11_MAP_WRITE_DISCARD :
             D3D11_MAP_WRITE, 0, &mappedData);
         if (FAILED(hr) || !mappedData.pData)
-            URHO3D_LOGD3DERROR("Failed to map index buffer", hr);
+            ATOMIC_LOGD3DERROR("Failed to map index buffer", hr);
         else
         {
             hwData = mappedData.pData;

+ 3 - 3
Source/Atomic/Graphics/Direct3D11/D3D11RenderSurface.cpp

@@ -31,7 +31,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 RenderSurface::RenderSurface(Texture* parentTexture) :
@@ -58,8 +58,8 @@ void RenderSurface::Release()
             graphics->ResetDepthStencil();
     }
 
-    URHO3D_SAFE_RELEASE(renderTargetView_);
-    URHO3D_SAFE_RELEASE(readOnlyView_);
+    ATOMIC_SAFE_RELEASE(renderTargetView_);
+    ATOMIC_SAFE_RELEASE(readOnlyView_);
 }
 
 bool RenderSurface::CreateRenderBuffer(unsigned width, unsigned height, unsigned format)

+ 4 - 2
Source/Atomic/Graphics/Direct3D11/D3D11ShaderProgram.h

@@ -27,12 +27,14 @@
 #include "../../Graphics/Graphics.h"
 #include "../../Graphics/ShaderVariation.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 /// Combined information for specific vertex and pixel shaders.
-class URHO3D_API ShaderProgram : public RefCounted
+class ATOMIC_API ShaderProgram : public RefCounted
 {
+    ATOMIC_REFCOUNTED(ShaderProgram)
+
 public:
     /// Construct.
     ShaderProgram(Graphics* graphics, ShaderVariation* vertexShader, ShaderVariation* pixelShader)

+ 15 - 15
Source/Atomic/Graphics/Direct3D11/D3D11ShaderVariation.cpp

@@ -35,7 +35,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 const char* ShaderVariation::elementSemanticNames[] =
@@ -95,7 +95,7 @@ bool ShaderVariation::Create()
             HRESULT hr = device->CreateVertexShader(&byteCode_[0], byteCode_.Size(), 0, (ID3D11VertexShader**)&object_.ptr_);
             if (FAILED(hr))
             {
-                URHO3D_SAFE_RELEASE(object_.ptr_);
+                ATOMIC_SAFE_RELEASE(object_.ptr_);
                 compilerOutput_ = "Could not create vertex shader (HRESULT " + ToStringHex((unsigned)hr) + ")";
             }
         }
@@ -109,7 +109,7 @@ bool ShaderVariation::Create()
             HRESULT hr = device->CreatePixelShader(&byteCode_[0], byteCode_.Size(), 0, (ID3D11PixelShader**)&object_.ptr_);
             if (FAILED(hr))
             {
-                URHO3D_SAFE_RELEASE(object_.ptr_);
+                ATOMIC_SAFE_RELEASE(object_.ptr_);
                 compilerOutput_ = "Could not create pixel shader (HRESULT " + ToStringHex((unsigned)hr) + ")";
             }
         }
@@ -140,7 +140,7 @@ void ShaderVariation::Release()
                 graphics_->SetShaders(0, 0);
         }
 
-        URHO3D_SAFE_RELEASE(object_.ptr_);
+        ATOMIC_SAFE_RELEASE(object_.ptr_);
     }
 
     compilerOutput_.Clear();
@@ -180,7 +180,7 @@ bool ShaderVariation::LoadByteCode(const String& binaryShaderName)
     SharedPtr<File> file = cache->GetFile(binaryShaderName);
     if (!file || file->ReadFileID() != "USHD")
     {
-        URHO3D_LOGERROR(binaryShaderName + " is not a valid shader bytecode file");
+        ATOMIC_LOGERROR(binaryShaderName + " is not a valid shader bytecode file");
         return false;
     }
 
@@ -224,16 +224,16 @@ bool ShaderVariation::LoadByteCode(const String& binaryShaderName)
         file->Read(&byteCode_[0], byteCodeSize);
 
         if (type_ == VS)
-            URHO3D_LOGDEBUG("Loaded cached vertex shader " + GetFullName());
+            ATOMIC_LOGDEBUG("Loaded cached vertex shader " + GetFullName());
         else
-            URHO3D_LOGDEBUG("Loaded cached pixel shader " + GetFullName());
+            ATOMIC_LOGDEBUG("Loaded cached pixel shader " + GetFullName());
 
         CalculateConstantBufferSizes();
         return true;
     }
     else
     {
-        URHO3D_LOGERROR(binaryShaderName + " has zero length bytecode");
+        ATOMIC_LOGERROR(binaryShaderName + " has zero length bytecode");
         return false;
     }
 }
@@ -291,7 +291,7 @@ bool ShaderVariation::Compile()
         // In debug mode, check that all defines are referenced by the shader code
 #ifdef _DEBUG
         if (sourceCode.Find(defines[i]) == String::NPOS)
-            URHO3D_LOGWARNING("Shader " + GetFullName() + " does not use the define " + defines[i]);
+            ATOMIC_LOGWARNING("Shader " + GetFullName() + " does not use the define " + defines[i]);
 #endif
     }
 
@@ -314,9 +314,9 @@ bool ShaderVariation::Compile()
     else
     {
         if (type_ == VS)
-            URHO3D_LOGDEBUG("Compiled vertex shader " + GetFullName());
+            ATOMIC_LOGDEBUG("Compiled vertex shader " + GetFullName());
         else
-            URHO3D_LOGDEBUG("Compiled pixel shader " + GetFullName());
+            ATOMIC_LOGDEBUG("Compiled pixel shader " + GetFullName());
 
         unsigned char* bufData = (unsigned char*)shaderCode->GetBufferPointer();
         unsigned bufSize = (unsigned)shaderCode->GetBufferSize();
@@ -333,8 +333,8 @@ bool ShaderVariation::Compile()
         strippedCode->Release();
     }
 
-    URHO3D_SAFE_RELEASE(shaderCode);
-    URHO3D_SAFE_RELEASE(errorMsgs);
+    ATOMIC_SAFE_RELEASE(shaderCode);
+    ATOMIC_SAFE_RELEASE(errorMsgs);
     
     return !byteCode_.Empty();
 }
@@ -347,8 +347,8 @@ void ShaderVariation::ParseParameters(unsigned char* bufData, unsigned bufSize)
     HRESULT hr = D3DReflect(bufData, bufSize, IID_ID3D11ShaderReflection, (void**)&reflection);
     if (FAILED(hr) || !reflection)
     {
-        URHO3D_SAFE_RELEASE(reflection);
-        URHO3D_LOGD3DERROR("Failed to reflect vertex shader's input signature", hr);
+        ATOMIC_SAFE_RELEASE(reflection);
+        ATOMIC_LOGD3DERROR("Failed to reflect vertex shader's input signature", hr);
         return;
     }
 

+ 21 - 4
Source/Atomic/Graphics/Direct3D11/D3D11Texture.cpp

@@ -33,7 +33,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 static const D3D11_FILTER d3dFilterMode[] =
@@ -127,7 +127,7 @@ void Texture::UpdateParameters()
         return;
 
     // Release old sampler
-    URHO3D_SAFE_RELEASE(sampler_);
+    ATOMIC_SAFE_RELEASE(sampler_);
 
     D3D11_SAMPLER_DESC samplerDesc;
     memset(&samplerDesc, 0, sizeof samplerDesc);
@@ -147,8 +147,8 @@ void Texture::UpdateParameters()
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateSamplerState(&samplerDesc, (ID3D11SamplerState**)&sampler_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(sampler_);
-        URHO3D_LOGD3DERROR("Failed to create sampler state", hr);
+        ATOMIC_SAFE_RELEASE(sampler_);
+        ATOMIC_LOGD3DERROR("Failed to create sampler state", hr);
     }
 
     parametersDirty_ = false;
@@ -192,4 +192,21 @@ unsigned Texture::GetSRGBFormat(unsigned format)
         return format;
 }
 
+// ATOMIC BEGIN
+
+// Satisfy script binding link
+
+unsigned Texture::GetExternalFormat(unsigned format)
+{
+    return 0;
+}
+
+unsigned Texture::GetDataType(unsigned format)
+{
+    return 0;
+}
+
+// ATOMIC END
+
+
 }

+ 27 - 27
Source/Atomic/Graphics/Direct3D11/D3D11Texture2D.cpp

@@ -36,7 +36,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void Texture2D::OnDeviceLost()
@@ -63,30 +63,30 @@ void Texture2D::Release()
     if (renderSurface_)
         renderSurface_->Release();
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
-    URHO3D_SAFE_RELEASE(shaderResourceView_);
-    URHO3D_SAFE_RELEASE(sampler_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(shaderResourceView_);
+    ATOMIC_SAFE_RELEASE(sampler_);
 }
 
 bool Texture2D::SetData(unsigned level, int x, int y, int width, int height, const void* data)
 {
-    URHO3D_PROFILE(SetTextureData);
+    ATOMIC_PROFILE(SetTextureData);
 
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not set data");
+        ATOMIC_LOGERROR("No texture created, can not set data");
         return false;
     }
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null source for setting data");
+        ATOMIC_LOGERROR("Null source for setting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for setting data");
+        ATOMIC_LOGERROR("Illegal mip level for setting data");
         return false;
     }
 
@@ -94,7 +94,7 @@ bool Texture2D::SetData(unsigned level, int x, int y, int width, int height, con
     int levelHeight = GetLevelHeight(level);
     if (x < 0 || x + width > levelWidth || y < 0 || y + height > levelHeight || width <= 0 || height <= 0)
     {
-        URHO3D_LOGERROR("Illegal dimensions for setting data");
+        ATOMIC_LOGERROR("Illegal dimensions for setting data");
         return false;
     }
 
@@ -129,7 +129,7 @@ bool Texture2D::SetData(unsigned level, int x, int y, int width, int height, con
             &mappedData);
         if (FAILED(hr) || !mappedData.pData)
         {
-            URHO3D_LOGD3DERROR("Failed to map texture for update", hr);
+            ATOMIC_LOGD3DERROR("Failed to map texture for update", hr);
             return false;
         }
         else
@@ -160,7 +160,7 @@ bool Texture2D::SetData(Image* image, bool useAlpha)
 {
     if (!image)
     {
-        URHO3D_LOGERROR("Null image, can not load texture");
+        ATOMIC_LOGERROR("Null image, can not load texture");
         return false;
     }
 
@@ -282,19 +282,19 @@ bool Texture2D::GetData(unsigned level, void* dest) const
 {
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not get data");
+        ATOMIC_LOGERROR("No texture created, can not get data");
         return false;
     }
 
     if (!dest)
     {
-        URHO3D_LOGERROR("Null destination for getting data");
+        ATOMIC_LOGERROR("Null destination for getting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for getting data");
+        ATOMIC_LOGERROR("Illegal mip level for getting data");
         return false;
     }
 
@@ -317,8 +317,8 @@ bool Texture2D::GetData(unsigned level, void* dest) const
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateTexture2D(&textureDesc, 0, &stagingTexture);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(stagingTexture);
-        URHO3D_LOGD3DERROR("Failed to create staging texture for GetData", hr);
+        ATOMIC_SAFE_RELEASE(stagingTexture);
+        ATOMIC_LOGD3DERROR("Failed to create staging texture for GetData", hr);
         return false;
     }
 
@@ -341,7 +341,7 @@ bool Texture2D::GetData(unsigned level, void* dest) const
     hr = graphics_->GetImpl()->GetDeviceContext()->Map((ID3D11Resource*)stagingTexture, 0, D3D11_MAP_READ, 0, &mappedData);
     if (FAILED(hr) || !mappedData.pData)
     {
-        URHO3D_LOGD3DERROR("Failed to map staging texture for GetData", hr);
+        ATOMIC_LOGD3DERROR("Failed to map staging texture for GetData", hr);
         stagingTexture->Release();
         return false;
     }
@@ -384,8 +384,8 @@ bool Texture2D::Create()
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateTexture2D(&textureDesc, 0, (ID3D11Texture2D**)&object_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(object_.ptr_);
-        URHO3D_LOGD3DERROR("Failed to create texture", hr);
+        ATOMIC_SAFE_RELEASE(object_.ptr_);
+        ATOMIC_LOGD3DERROR("Failed to create texture", hr);
         return false;
     }
 
@@ -399,8 +399,8 @@ bool Texture2D::Create()
         (ID3D11ShaderResourceView**)&shaderResourceView_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(shaderResourceView_);
-        URHO3D_LOGD3DERROR("Failed to create shader resource view for texture", hr);
+        ATOMIC_SAFE_RELEASE(shaderResourceView_);
+        ATOMIC_LOGD3DERROR("Failed to create shader resource view for texture", hr);
         return false;
     }
 
@@ -415,8 +415,8 @@ bool Texture2D::Create()
             (ID3D11RenderTargetView**)&renderSurface_->renderTargetView_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(renderSurface_->renderTargetView_);
-            URHO3D_LOGD3DERROR("Failed to create rendertarget view for texture", hr);
+            ATOMIC_SAFE_RELEASE(renderSurface_->renderTargetView_);
+            ATOMIC_LOGD3DERROR("Failed to create rendertarget view for texture", hr);
             return false;
         }
     }
@@ -431,8 +431,8 @@ bool Texture2D::Create()
             (ID3D11DepthStencilView**)&renderSurface_->renderTargetView_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(renderSurface_->renderTargetView_);
-            URHO3D_LOGD3DERROR("Failed to create depth-stencil view for texture", hr);
+            ATOMIC_SAFE_RELEASE(renderSurface_->renderTargetView_);
+            ATOMIC_LOGD3DERROR("Failed to create depth-stencil view for texture", hr);
             return false;
         }
 
@@ -442,8 +442,8 @@ bool Texture2D::Create()
             (ID3D11DepthStencilView**)&renderSurface_->readOnlyView_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(renderSurface_->readOnlyView_);
-            URHO3D_LOGD3DERROR("Failed to create read-only depth-stencil view for texture", hr);
+            ATOMIC_SAFE_RELEASE(renderSurface_->readOnlyView_);
+            ATOMIC_LOGD3DERROR("Failed to create read-only depth-stencil view for texture", hr);
         }
     }
 

+ 31 - 31
Source/Atomic/Graphics/Direct3D11/D3D11Texture2DArray.cpp

@@ -40,7 +40,7 @@
 #pragma warning(disable:4355)
 #endif
 
-namespace Urho3D
+namespace Atomic
 {
 
 void Texture2DArray::OnDeviceLost()
@@ -67,36 +67,36 @@ void Texture2DArray::Release()
     if (renderSurface_)
         renderSurface_->Release();
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
-    URHO3D_SAFE_RELEASE(shaderResourceView_);
-    URHO3D_SAFE_RELEASE(sampler_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(shaderResourceView_);
+    ATOMIC_SAFE_RELEASE(sampler_);
 }
 
 bool Texture2DArray::SetData(unsigned layer, unsigned level, int x, int y, int width, int height, const void* data)
 {
-    URHO3D_PROFILE(SetTextureData);
+    ATOMIC_PROFILE(SetTextureData);
 
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("Texture array not created, can not set data");
+        ATOMIC_LOGERROR("Texture array not created, can not set data");
         return false;
     }
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null source for setting data");
+        ATOMIC_LOGERROR("Null source for setting data");
         return false;
     }
 
     if (layer >= layers_)
     {
-        URHO3D_LOGERROR("Illegal layer for setting data");
+        ATOMIC_LOGERROR("Illegal layer for setting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for setting data");
+        ATOMIC_LOGERROR("Illegal mip level for setting data");
         return false;
     }
 
@@ -104,7 +104,7 @@ bool Texture2DArray::SetData(unsigned layer, unsigned level, int x, int y, int w
     int levelHeight = GetLevelHeight(level);
     if (x < 0 || x + width > levelWidth || y < 0 || y + height > levelHeight || width <= 0 || height <= 0)
     {
-        URHO3D_LOGERROR("Illegal dimensions for setting data");
+        ATOMIC_LOGERROR("Illegal dimensions for setting data");
         return false;
     }
 
@@ -139,7 +139,7 @@ bool Texture2DArray::SetData(unsigned layer, unsigned level, int x, int y, int w
             &mappedData);
         if (FAILED(hr) || !mappedData.pData)
         {
-            URHO3D_LOGD3DERROR("Failed to map texture for update", hr);
+            ATOMIC_LOGD3DERROR("Failed to map texture for update", hr);
             return false;
         }
         else
@@ -179,17 +179,17 @@ bool Texture2DArray::SetData(unsigned layer, Image* image, bool useAlpha)
 {
     if (!image)
     {
-        URHO3D_LOGERROR("Null image, can not set data");
+        ATOMIC_LOGERROR("Null image, can not set data");
         return false;
     }
     if (!layers_)
     {
-        URHO3D_LOGERROR("Number of layers in the array must be set first");
+        ATOMIC_LOGERROR("Number of layers in the array must be set first");
         return false;
     }
     if (layer >= layers_)
     {
-        URHO3D_LOGERROR("Illegal layer for setting data");
+        ATOMIC_LOGERROR("Illegal layer for setting data");
         return false;
     }
 
@@ -253,12 +253,12 @@ bool Texture2DArray::SetData(unsigned layer, Image* image, bool useAlpha)
         {
             if (!object_.ptr_)
             {
-                URHO3D_LOGERROR("Texture array layer 0 must be loaded first");
+                ATOMIC_LOGERROR("Texture array layer 0 must be loaded first");
                 return false;
             }
             if (levelWidth != width_ || levelHeight != height_ || format != format_)
             {
-                URHO3D_LOGERROR("Texture array layer does not match size or format of layer 0");
+                ATOMIC_LOGERROR("Texture array layer does not match size or format of layer 0");
                 return false;
             }
         }
@@ -309,12 +309,12 @@ bool Texture2DArray::SetData(unsigned layer, Image* image, bool useAlpha)
         {
             if (!object_.ptr_)
             {
-                URHO3D_LOGERROR("Texture array layer 0 must be loaded first");
+                ATOMIC_LOGERROR("Texture array layer 0 must be loaded first");
                 return false;
             }
             if (width != width_ || height != height_ || format != format_)
             {
-                URHO3D_LOGERROR("Texture array layer does not match size or format of layer 0");
+                ATOMIC_LOGERROR("Texture array layer does not match size or format of layer 0");
                 return false;
             }
         }
@@ -351,25 +351,25 @@ bool Texture2DArray::GetData(unsigned layer, unsigned level, void* dest) const
 {
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("Texture array not created, can not get data");
+        ATOMIC_LOGERROR("Texture array not created, can not get data");
         return false;
     }
 
     if (!dest)
     {
-        URHO3D_LOGERROR("Null destination for getting data");
+        ATOMIC_LOGERROR("Null destination for getting data");
         return false;
     }
 
     if (layer >= layers_)
     {
-        URHO3D_LOGERROR("Illegal layer for getting data");
+        ATOMIC_LOGERROR("Illegal layer for getting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for getting data");
+        ATOMIC_LOGERROR("Illegal mip level for getting data");
         return false;
     }
 
@@ -392,8 +392,8 @@ bool Texture2DArray::GetData(unsigned layer, unsigned level, void* dest) const
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateTexture2D(&textureDesc, 0, &stagingTexture);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(stagingTexture);
-        URHO3D_LOGD3DERROR("Failed to create staging texture for GetData", hr);
+        ATOMIC_SAFE_RELEASE(stagingTexture);
+        ATOMIC_LOGD3DERROR("Failed to create staging texture for GetData", hr);
         return false;
     }
 
@@ -416,7 +416,7 @@ bool Texture2DArray::GetData(unsigned layer, unsigned level, void* dest) const
     hr = graphics_->GetImpl()->GetDeviceContext()->Map((ID3D11Resource*)stagingTexture, 0, D3D11_MAP_READ, 0, &mappedData);
     if (FAILED(hr) || !mappedData.pData)
     {
-        URHO3D_LOGD3DERROR("Failed to map staging texture for GetData", hr);
+        ATOMIC_LOGD3DERROR("Failed to map staging texture for GetData", hr);
         stagingTexture->Release();
         return false;
     }
@@ -459,8 +459,8 @@ bool Texture2DArray::Create()
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateTexture2D(&textureDesc, 0, (ID3D11Texture2D**)&object_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(object_.ptr_);
-        URHO3D_LOGD3DERROR("Failed to create texture array", hr);
+        ATOMIC_SAFE_RELEASE(object_.ptr_);
+        ATOMIC_LOGD3DERROR("Failed to create texture array", hr);
         return false;
     }
 
@@ -486,8 +486,8 @@ bool Texture2DArray::Create()
         (ID3D11ShaderResourceView**)&shaderResourceView_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(shaderResourceView_);
-        URHO3D_LOGD3DERROR("Failed to create shader resource view for texture array", hr);
+        ATOMIC_SAFE_RELEASE(shaderResourceView_);
+        ATOMIC_LOGD3DERROR("Failed to create shader resource view for texture array", hr);
         return false;
     }
 
@@ -514,8 +514,8 @@ bool Texture2DArray::Create()
 
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(renderSurface_->renderTargetView_);
-            URHO3D_LOGD3DERROR("Failed to create rendertarget view for texture array", hr);
+            ATOMIC_SAFE_RELEASE(renderSurface_->renderTargetView_);
+            ATOMIC_LOGD3DERROR("Failed to create rendertarget view for texture array", hr);
             return false;
         }
     }

+ 21 - 21
Source/Atomic/Graphics/Direct3D11/D3D11Texture3D.cpp

@@ -36,7 +36,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void Texture3D::OnDeviceLost()
@@ -60,30 +60,30 @@ void Texture3D::Release()
         }
     }
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
-    URHO3D_SAFE_RELEASE(shaderResourceView_);
-    URHO3D_SAFE_RELEASE(sampler_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(shaderResourceView_);
+    ATOMIC_SAFE_RELEASE(sampler_);
 }
 
 bool Texture3D::SetData(unsigned level, int x, int y, int z, int width, int height, int depth, const void* data)
 {
-    URHO3D_PROFILE(SetTextureData);
+    ATOMIC_PROFILE(SetTextureData);
 
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not set data");
+        ATOMIC_LOGERROR("No texture created, can not set data");
         return false;
     }
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null source for setting data");
+        ATOMIC_LOGERROR("Null source for setting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for setting data");
+        ATOMIC_LOGERROR("Illegal mip level for setting data");
         return false;
     }
 
@@ -93,7 +93,7 @@ bool Texture3D::SetData(unsigned level, int x, int y, int z, int width, int heig
     if (x < 0 || x + width > levelWidth || y < 0 || y + height > levelHeight || z < 0 || z + depth > levelDepth || width <= 0 ||
         height <= 0 || depth <= 0)
     {
-        URHO3D_LOGERROR("Illegal dimensions for setting data");
+        ATOMIC_LOGERROR("Illegal dimensions for setting data");
         return false;
     }
 
@@ -128,7 +128,7 @@ bool Texture3D::SetData(unsigned level, int x, int y, int z, int width, int heig
             &mappedData);
         if (FAILED(hr) || !mappedData.pData)
         {
-            URHO3D_LOGD3DERROR("Failed to map texture for update", hr);
+            ATOMIC_LOGD3DERROR("Failed to map texture for update", hr);
             return false;
         }
         else
@@ -169,7 +169,7 @@ bool Texture3D::SetData(Image* image, bool useAlpha)
 {
     if (!image)
     {
-        URHO3D_LOGERROR("Null image, can not load texture");
+        ATOMIC_LOGERROR("Null image, can not load texture");
         return false;
     }
 
@@ -296,19 +296,19 @@ bool Texture3D::GetData(unsigned level, void* dest) const
 {
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not get data");
+        ATOMIC_LOGERROR("No texture created, can not get data");
         return false;
     }
 
     if (!dest)
     {
-        URHO3D_LOGERROR("Null destination for getting data");
+        ATOMIC_LOGERROR("Null destination for getting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for getting data");
+        ATOMIC_LOGERROR("Illegal mip level for getting data");
         return false;
     }
 
@@ -330,8 +330,8 @@ bool Texture3D::GetData(unsigned level, void* dest) const
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateTexture3D(&textureDesc, 0, &stagingTexture);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(stagingTexture);
-        URHO3D_LOGD3DERROR("Failed to create staging texture for GetData", hr);
+        ATOMIC_SAFE_RELEASE(stagingTexture);
+        ATOMIC_LOGD3DERROR("Failed to create staging texture for GetData", hr);
         return false;
     }
 
@@ -354,7 +354,7 @@ bool Texture3D::GetData(unsigned level, void* dest) const
     hr = graphics_->GetImpl()->GetDeviceContext()->Map((ID3D11Resource*)stagingTexture, 0, D3D11_MAP_READ, 0, &mappedData);
     if (FAILED(hr) || !mappedData.pData)
     {
-        URHO3D_LOGD3DERROR("Failed to map staging texture for GetData", hr);
+        ATOMIC_LOGD3DERROR("Failed to map staging texture for GetData", hr);
         stagingTexture->Release();
         return false;
     }
@@ -397,8 +397,8 @@ bool Texture3D::Create()
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateTexture3D(&textureDesc, 0, (ID3D11Texture3D**)&object_.ptr_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(object_.ptr_);
-        URHO3D_LOGD3DERROR("Failed to create texture", hr);
+        ATOMIC_SAFE_RELEASE(object_.ptr_);
+        ATOMIC_LOGD3DERROR("Failed to create texture", hr);
         return false;
     }
 
@@ -412,8 +412,8 @@ bool Texture3D::Create()
         (ID3D11ShaderResourceView**)&shaderResourceView_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(shaderResourceView_);
-        URHO3D_LOGD3DERROR("Failed to create shader resource view for texture", hr);
+        ATOMIC_SAFE_RELEASE(shaderResourceView_);
+        ATOMIC_LOGD3DERROR("Failed to create shader resource view for texture", hr);
         return false;
     }
 

+ 29 - 29
Source/Atomic/Graphics/Direct3D11/D3D11TextureCube.cpp

@@ -40,7 +40,7 @@
 #pragma warning(disable:4355)
 #endif
 
-namespace Urho3D
+namespace Atomic
 {
 
 void TextureCube::OnDeviceLost()
@@ -70,30 +70,30 @@ void TextureCube::Release()
             renderSurfaces_[i]->Release();
     }
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
-    URHO3D_SAFE_RELEASE(shaderResourceView_);
-    URHO3D_SAFE_RELEASE(sampler_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(shaderResourceView_);
+    ATOMIC_SAFE_RELEASE(sampler_);
 }
 
 bool TextureCube::SetData(CubeMapFace face, unsigned level, int x, int y, int width, int height, const void* data)
 {
-    URHO3D_PROFILE(SetTextureData);
+    ATOMIC_PROFILE(SetTextureData);
 
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not set data");
+        ATOMIC_LOGERROR("No texture created, can not set data");
         return false;
     }
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null source for setting data");
+        ATOMIC_LOGERROR("Null source for setting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for setting data");
+        ATOMIC_LOGERROR("Illegal mip level for setting data");
         return false;
     }
 
@@ -101,7 +101,7 @@ bool TextureCube::SetData(CubeMapFace face, unsigned level, int x, int y, int wi
     int levelHeight = GetLevelHeight(level);
     if (x < 0 || x + width > levelWidth || y < 0 || y + height > levelHeight || width <= 0 || height <= 0)
     {
-        URHO3D_LOGERROR("Illegal dimensions for setting data");
+        ATOMIC_LOGERROR("Illegal dimensions for setting data");
         return false;
     }
 
@@ -136,7 +136,7 @@ bool TextureCube::SetData(CubeMapFace face, unsigned level, int x, int y, int wi
             &mappedData);
         if (FAILED(hr) || !mappedData.pData)
         {
-            URHO3D_LOGD3DERROR("Failed to map texture for update", hr);
+            ATOMIC_LOGD3DERROR("Failed to map texture for update", hr);
             return false;
         }
         else
@@ -176,7 +176,7 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
 {
     if (!image)
     {
-        URHO3D_LOGERROR("Null image, can not load texture");
+        ATOMIC_LOGERROR("Null image, can not load texture");
         return false;
     }
 
@@ -207,7 +207,7 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
 
         if (levelWidth != levelHeight)
         {
-            URHO3D_LOGERROR("Cube texture width not equal to height");
+            ATOMIC_LOGERROR("Cube texture width not equal to height");
             return false;
         }
 
@@ -245,12 +245,12 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
         {
             if (!object_.ptr_)
             {
-                URHO3D_LOGERROR("Cube texture face 0 must be loaded first");
+                ATOMIC_LOGERROR("Cube texture face 0 must be loaded first");
                 return false;
             }
             if (levelWidth != width_ || format != format_)
             {
-                URHO3D_LOGERROR("Cube texture face does not match size or format of face 0");
+                ATOMIC_LOGERROR("Cube texture face does not match size or format of face 0");
                 return false;
             }
         }
@@ -279,7 +279,7 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
 
         if (width != height)
         {
-            URHO3D_LOGERROR("Cube texture width not equal to height");
+            ATOMIC_LOGERROR("Cube texture width not equal to height");
             return false;
         }
 
@@ -307,12 +307,12 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
         {
             if (!object_.ptr_)
             {
-                URHO3D_LOGERROR("Cube texture face 0 must be loaded first");
+                ATOMIC_LOGERROR("Cube texture face 0 must be loaded first");
                 return false;
             }
             if (width != width_ || format != format_)
             {
-                URHO3D_LOGERROR("Cube texture face does not match size or format of face 0");
+                ATOMIC_LOGERROR("Cube texture face does not match size or format of face 0");
                 return false;
             }
         }
@@ -349,19 +349,19 @@ bool TextureCube::GetData(CubeMapFace face, unsigned level, void* dest) const
 {
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not get data");
+        ATOMIC_LOGERROR("No texture created, can not get data");
         return false;
     }
 
     if (!dest)
     {
-        URHO3D_LOGERROR("Null destination for getting data");
+        ATOMIC_LOGERROR("Null destination for getting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for getting data");
+        ATOMIC_LOGERROR("Illegal mip level for getting data");
         return false;
     }
 
@@ -384,8 +384,8 @@ bool TextureCube::GetData(CubeMapFace face, unsigned level, void* dest) const
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateTexture2D(&textureDesc, 0, &stagingTexture);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(stagingTexture);
-        URHO3D_LOGD3DERROR("Failed to create staging texture for GetData", hr);
+        ATOMIC_SAFE_RELEASE(stagingTexture);
+        ATOMIC_LOGD3DERROR("Failed to create staging texture for GetData", hr);
         return false;
     }
 
@@ -408,7 +408,7 @@ bool TextureCube::GetData(CubeMapFace face, unsigned level, void* dest) const
     hr = graphics_->GetImpl()->GetDeviceContext()->Map((ID3D11Resource*)stagingTexture, 0, D3D11_MAP_READ, 0, &mappedData);
     if (FAILED(hr) || !mappedData.pData)
     {
-        URHO3D_LOGD3DERROR("Failed to map staging texture for GetData", hr);
+        ATOMIC_LOGD3DERROR("Failed to map staging texture for GetData", hr);
         stagingTexture->Release();
         return false;
     }
@@ -452,8 +452,8 @@ bool TextureCube::Create()
     HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateTexture2D(&textureDesc, 0, (ID3D11Texture2D**)&object_.ptr_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(object_.ptr_);
-        URHO3D_LOGD3DERROR("Failed to create texture", hr);
+        ATOMIC_SAFE_RELEASE(object_.ptr_);
+        ATOMIC_LOGD3DERROR("Failed to create texture", hr);
         return false;
     }
 
@@ -467,8 +467,8 @@ bool TextureCube::Create()
         (ID3D11ShaderResourceView**)&shaderResourceView_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(shaderResourceView_);
-        URHO3D_LOGD3DERROR("Failed to create shader resource view for texture", hr);
+        ATOMIC_SAFE_RELEASE(shaderResourceView_);
+        ATOMIC_LOGD3DERROR("Failed to create shader resource view for texture", hr);
         return false;
     }
 
@@ -489,8 +489,8 @@ bool TextureCube::Create()
 
             if (FAILED(hr))
             {
-                URHO3D_SAFE_RELEASE(renderSurfaces_[i]->renderTargetView_);
-                URHO3D_LOGD3DERROR("Failed to create rendertarget view for texture", hr);
+                ATOMIC_SAFE_RELEASE(renderSurfaces_[i]->renderTargetView_);
+                ATOMIC_LOGD3DERROR("Failed to create rendertarget view for texture", hr);
                 return false;
             }
         }

+ 13 - 13
Source/Atomic/Graphics/Direct3D11/D3D11VertexBuffer.cpp

@@ -29,7 +29,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void VertexBuffer::OnDeviceLost()
@@ -55,20 +55,20 @@ void VertexBuffer::Release()
         }
     }
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 }
 
 bool VertexBuffer::SetData(const void* data)
 {
     if (!data)
     {
-        URHO3D_LOGERROR("Null pointer for vertex buffer data");
+        ATOMIC_LOGERROR("Null pointer for vertex buffer data");
         return false;
     }
 
     if (!vertexSize_)
     {
-        URHO3D_LOGERROR("Vertex elements not defined, can not set vertex buffer data");
+        ATOMIC_LOGERROR("Vertex elements not defined, can not set vertex buffer data");
         return false;
     }
 
@@ -112,19 +112,19 @@ bool VertexBuffer::SetDataRange(const void* data, unsigned start, unsigned count
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null pointer for vertex buffer data");
+        ATOMIC_LOGERROR("Null pointer for vertex buffer data");
         return false;
     }
 
     if (!vertexSize_)
     {
-        URHO3D_LOGERROR("Vertex elements not defined, can not set vertex buffer data");
+        ATOMIC_LOGERROR("Vertex elements not defined, can not set vertex buffer data");
         return false;
     }
 
     if (start + count > vertexCount_)
     {
-        URHO3D_LOGERROR("Illegal range for setting new vertex buffer data");
+        ATOMIC_LOGERROR("Illegal range for setting new vertex buffer data");
         return false;
     }
 
@@ -168,19 +168,19 @@ void* VertexBuffer::Lock(unsigned start, unsigned count, bool discard)
 {
     if (lockState_ != LOCK_NONE)
     {
-        URHO3D_LOGERROR("Vertex buffer already locked");
+        ATOMIC_LOGERROR("Vertex buffer already locked");
         return 0;
     }
 
     if (!vertexSize_)
     {
-        URHO3D_LOGERROR("Vertex elements not defined, can not lock vertex buffer");
+        ATOMIC_LOGERROR("Vertex elements not defined, can not lock vertex buffer");
         return 0;
     }
 
     if (start + count > vertexCount_)
     {
-        URHO3D_LOGERROR("Illegal range for locking vertex buffer");
+        ATOMIC_LOGERROR("Illegal range for locking vertex buffer");
         return 0;
     }
 
@@ -252,8 +252,8 @@ bool VertexBuffer::Create()
         HRESULT hr = graphics_->GetImpl()->GetDevice()->CreateBuffer(&bufferDesc, 0, (ID3D11Buffer**)&object_.ptr_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(object_.ptr_);
-            URHO3D_LOGD3DERROR("Failed to create vertex buffer", hr);
+            ATOMIC_SAFE_RELEASE(object_.ptr_);
+            ATOMIC_LOGD3DERROR("Failed to create vertex buffer", hr);
             return false;
         }
     }
@@ -281,7 +281,7 @@ void* VertexBuffer::MapBuffer(unsigned start, unsigned count, bool discard)
         HRESULT hr = graphics_->GetImpl()->GetDeviceContext()->Map((ID3D11Buffer*)object_.ptr_, 0, discard ? D3D11_MAP_WRITE_DISCARD :
             D3D11_MAP_WRITE, 0, &mappedData);
         if (FAILED(hr) || !mappedData.pData)
-            URHO3D_LOGD3DERROR("Failed to map vertex buffer", hr);
+            ATOMIC_LOGD3DERROR("Failed to map vertex buffer", hr);
         else
         {
             hwData = mappedData.pData;

+ 4 - 4
Source/Atomic/Graphics/Direct3D11/D3D11VertexDeclaration.cpp

@@ -31,7 +31,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 static const DXGI_FORMAT d3dElementFormats[] =
@@ -104,15 +104,15 @@ VertexDeclaration::VertexDeclaration(Graphics* graphics, ShaderVariation* vertex
         byteCode.Size(), (ID3D11InputLayout**)&inputLayout_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(inputLayout_);
-        URHO3D_LOGERRORF("Failed to create input layout for shader %s due to missing vertex element(s) (HRESULT %x)",
+        ATOMIC_SAFE_RELEASE(inputLayout_);
+        ATOMIC_LOGERRORF("Failed to create input layout for shader %s due to missing vertex element(s) (HRESULT %x)",
             vertexShader->GetFullName().CString(), (unsigned)hr);
     }
 }
 
 VertexDeclaration::~VertexDeclaration()
 {
-    URHO3D_SAFE_RELEASE(inputLayout_);
+    ATOMIC_SAFE_RELEASE(inputLayout_);
 }
 
 }

+ 4 - 2
Source/Atomic/Graphics/Direct3D11/D3D11VertexDeclaration.h

@@ -26,7 +26,7 @@
 #include "../../Container/Vector.h"
 #include "../../Graphics/GraphicsDefs.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 class Graphics;
@@ -34,8 +34,10 @@ class ShaderVariation;
 class VertexBuffer;
 
 /// Vertex declaration.
-class URHO3D_API VertexDeclaration : public RefCounted
+class ATOMIC_API VertexDeclaration : public RefCounted
 {
+    ATOMIC_REFCOUNTED(VertexDeclaration)
+
 public:
     /// Construct with vertex buffers and element masks to base declaration on.
     VertexDeclaration(Graphics* graphics, ShaderVariation* vertexShader, VertexBuffer** buffers);

+ 2 - 2
Source/Atomic/Graphics/Direct3D9/D3D9ConstantBuffer.cpp

@@ -28,7 +28,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void ConstantBuffer::OnDeviceReset()
@@ -41,7 +41,7 @@ void ConstantBuffer::Release()
 
 bool ConstantBuffer::SetSize(unsigned size)
 {
-    URHO3D_LOGERROR("Constant buffers are not supported on Direct3D9");
+    ATOMIC_LOGERROR("Constant buffers are not supported on Direct3D9");
     return false;
 }
 

+ 100 - 44
Source/Atomic/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -40,8 +40,10 @@
 #include "../../IO/Log.h"
 #include "../../Resource/ResourceCache.h"
 
-#include <SDL/SDL.h>
-#include <SDL/SDL_syswm.h>
+// ATOMIC BEGIN
+#include <SDL/include/SDL.h>
+#include <SDL/include/SDL_syswm.h>
+// ATOMIC END
 
 #include "../../DebugNew.h"
 
@@ -67,7 +69,7 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
 #define D3DSTREAMSOURCE_INSTANCEDATA (2<<30)
 #endif
 
-namespace Urho3D
+namespace Atomic
 {
 
 static const D3DCMPFUNC d3dCmpFunc[] =
@@ -296,11 +298,11 @@ Graphics::~Graphics()
 
     impl_->vertexDeclarations_.Clear();
 
-    URHO3D_SAFE_RELEASE(impl_->defaultColorSurface_);
-    URHO3D_SAFE_RELEASE(impl_->defaultDepthStencilSurface_);
-    URHO3D_SAFE_RELEASE(impl_->frameQuery_);
-    URHO3D_SAFE_RELEASE(impl_->device_);
-    URHO3D_SAFE_RELEASE(impl_->interface_);
+    ATOMIC_SAFE_RELEASE(impl_->defaultColorSurface_);
+    ATOMIC_SAFE_RELEASE(impl_->defaultDepthStencilSurface_);
+    ATOMIC_SAFE_RELEASE(impl_->frameQuery_);
+    ATOMIC_SAFE_RELEASE(impl_->device_);
+    ATOMIC_SAFE_RELEASE(impl_->interface_);
 
     if (window_)
     {
@@ -319,7 +321,7 @@ Graphics::~Graphics()
 bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless, bool resizable, bool highDPI, bool vsync,
     bool tripleBuffer, int multiSample)
 {
-    URHO3D_PROFILE(SetScreenMode);
+    ATOMIC_PROFILE(SetScreenMode);
 
     highDPI = false;   // SDL does not support High DPI mode on Windows platform yet, so always disable it for now
 
@@ -488,7 +490,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     impl_->device_->EndScene();
     impl_->device_->Present(0, 0, 0, 0);
 
-#ifdef URHO3D_LOGGING
+#ifdef ATOMIC_LOGGING
     String msg;
     msg.AppendWithFormat("Set screen mode %dx%d %s", width_, height_, (fullscreen_ ? "fullscreen" : "windowed"));
     if (borderless_)
@@ -497,7 +499,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
         msg.Append(" resizable");
     if (multiSample > 1)
         msg.AppendWithFormat(" multisample %d", multiSample);
-    URHO3D_LOGINFO(msg);
+    ATOMIC_LOGINFO(msg);
 #endif
 
     using namespace ScreenMode;
@@ -549,16 +551,16 @@ void Graphics::Close()
     }
 }
 
-bool Graphics::TakeScreenShot(Image& destImage)
+bool Graphics::TakeScreenShot(Image* destImage)
 {
-    URHO3D_PROFILE(TakeScreenShot);
+    ATOMIC_PROFILE(TakeScreenShot);
 
     if (!impl_->device_)
         return false;
 
     if (IsDeviceLost())
     {
-        URHO3D_LOGERROR("Can not take screenshot while device is lost");
+        ATOMIC_LOGERROR("Can not take screenshot while device is lost");
         return false;
     }
 
@@ -588,8 +590,8 @@ bool Graphics::TakeScreenShot(Image& destImage)
     HRESULT hr = impl_->device_->CreateOffscreenPlainSurface(surfaceWidth, surfaceHeight, surfaceDesc.Format, D3DPOOL_SYSTEMMEM, &surface, 0);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(surface);
-        URHO3D_LOGD3DERROR("Could not create surface for taking a screenshot", hr);
+        ATOMIC_SAFE_RELEASE(surface);
+        ATOMIC_LOGD3DERROR("Could not create surface for taking a screenshot", hr);
         return false;
     }
 
@@ -599,8 +601,8 @@ bool Graphics::TakeScreenShot(Image& destImage)
         hr = impl_->device_->GetFrontBufferData(0, surface);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(surface);
-        URHO3D_LOGD3DERROR("Could not get rendertarget data for taking a screenshot", hr);
+        ATOMIC_SAFE_RELEASE(surface);
+        ATOMIC_LOGD3DERROR("Could not get rendertarget data for taking a screenshot", hr);
         return false;
     }
 
@@ -625,13 +627,13 @@ bool Graphics::TakeScreenShot(Image& destImage)
     hr = surface->LockRect(&lockedRect, &sourceRect, D3DLOCK_NOSYSLOCK | D3DLOCK_READONLY);
     if (FAILED(hr) || !lockedRect.pBits)
     {
-        URHO3D_SAFE_RELEASE(surface);
-        URHO3D_LOGD3DERROR("Could not lock surface for taking a screenshot", hr);
+        ATOMIC_SAFE_RELEASE(surface);
+        ATOMIC_LOGD3DERROR("Could not lock surface for taking a screenshot", hr);
         return false;
     }
 
-    destImage.SetSize(width_, height_, 3);
-    unsigned char* destData = destImage.GetData();
+    destImage->SetSize(width_, height_, 3);
+    unsigned char* destData = destImage->GetData();
 
     if (surfaceDesc.Format == D3DFMT_R5G6B5)
     {
@@ -704,7 +706,7 @@ bool Graphics::BeginFrame()
     HRESULT hr = impl_->device_->TestCooperativeLevel();
     if (hr != D3D_OK)
     {
-        URHO3D_PROFILE(DeviceLost);
+        ATOMIC_PROFILE(DeviceLost);
 
         impl_->deviceLost_ = true;
 
@@ -745,7 +747,7 @@ void Graphics::EndFrame()
         return;
 
     {
-        URHO3D_PROFILE(Present);
+        ATOMIC_PROFILE(Present);
 
         SendEvent(E_ENDRENDERING);
 
@@ -759,7 +761,7 @@ void Graphics::EndFrame()
     {
         if (impl_->queryIssued_)
         {
-            URHO3D_PROFILE(FlushGPU);
+            ATOMIC_PROFILE(FlushGPU);
 
             while (impl_->frameQuery_->GetData(0, 0, D3DGETDATA_FLUSH) == S_FALSE)
             {
@@ -797,7 +799,7 @@ bool Graphics::ResolveToTexture(Texture2D* destination, const IntRect& viewport)
     if (!destination || !destination->GetRenderSurface())
         return false;
 
-    URHO3D_PROFILE(ResolveToTexture);
+    ATOMIC_PROFILE(ResolveToTexture);
 
     IntRect vpCopy = viewport;
     if (vpCopy.right_ <= vpCopy.left_)
@@ -821,7 +823,7 @@ bool Graphics::ResolveToTexture(Texture2D* destination, const IntRect& viewport)
         (IDirect3DSurface9*)destination->GetRenderSurface()->GetSurface(), &destRect, D3DTEXF_NONE);
     if (FAILED(hr))
     {
-        URHO3D_LOGD3DERROR("Failed to resolve to texture", hr);
+        ATOMIC_LOGD3DERROR("Failed to resolve to texture", hr);
         return false;
     }
     else
@@ -951,7 +953,7 @@ bool Graphics::SetVertexBuffers(const PODVector<VertexBuffer*>& buffers, unsigne
 {
     if (buffers.Size() > MAX_VERTEX_STREAMS)
     {
-        URHO3D_LOGERROR("Too many vertex buffers");
+        ATOMIC_LOGERROR("Too many vertex buffers");
         return false;
     }
 
@@ -1048,12 +1050,12 @@ void Graphics::SetShaders(ShaderVariation* vs, ShaderVariation* ps)
         {
             if (vs->GetCompilerOutput().Empty())
             {
-                URHO3D_PROFILE(CompileVertexShader);
+                ATOMIC_PROFILE(CompileVertexShader);
 
                 bool success = vs->Create();
                 if (!success)
                 {
-                    URHO3D_LOGERROR("Failed to compile vertex shader " + vs->GetFullName() + ":\n" + vs->GetCompilerOutput());
+                    ATOMIC_LOGERROR("Failed to compile vertex shader " + vs->GetFullName() + ":\n" + vs->GetCompilerOutput());
                     vs = 0;
                 }
             }
@@ -1078,12 +1080,12 @@ void Graphics::SetShaders(ShaderVariation* vs, ShaderVariation* ps)
         {
             if (ps->GetCompilerOutput().Empty())
             {
-                URHO3D_PROFILE(CompilePixelShader);
+                ATOMIC_PROFILE(CompilePixelShader);
 
                 bool success = ps->Create();
                 if (!success)
                 {
-                    URHO3D_LOGERROR("Failed to compile pixel shader " + ps->GetFullName() + ":\n" + ps->GetCompilerOutput());
+                    ATOMIC_LOGERROR("Failed to compile pixel shader " + ps->GetFullName() + ":\n" + ps->GetCompilerOutput());
                     ps = 0;
                 }
             }
@@ -1871,7 +1873,7 @@ void Graphics::EndDumpShaders()
 
 void Graphics::PrecacheShaders(Deserializer& source)
 {
-    URHO3D_PROFILE(PrecacheShaders);
+    ATOMIC_PROFILE(PrecacheShaders);
 
     ShaderPrecache::LoadShaders(this, source);
 }
@@ -2031,7 +2033,7 @@ void Graphics::OnWindowResized()
     // Reset rendertargets and viewport for the new screen size
     ResetRenderTargets();
 
-    URHO3D_LOGDEBUGF("Window was resized to %dx%d", width_, height_);
+    ATOMIC_LOGDEBUGF("Window was resized to %dx%d", width_, height_);
 
     using namespace ScreenMode;
 
@@ -2058,7 +2060,7 @@ void Graphics::OnWindowMoved()
     position_.x_ = newX;
     position_.y_ = newY;
 
-    URHO3D_LOGDEBUGF("Window was moved to %d,%d", position_.x_, position_.y_);
+    ATOMIC_LOGDEBUGF("Window was moved to %d,%d", position_.x_, position_.y_);
 
     using namespace WindowPos;
 
@@ -2250,7 +2252,7 @@ bool Graphics::OpenWindow(int width, int height, bool resizable, bool borderless
 
     if (!window_)
     {
-        URHO3D_LOGERRORF("Could not create window, root cause: '%s'", SDL_GetError());
+        ATOMIC_LOGERRORF("Could not create window, root cause: '%s'", SDL_GetError());
         return false;
     }
 
@@ -2292,27 +2294,27 @@ bool Graphics::CreateInterface()
     impl_->interface_ = Direct3DCreate9(D3D_SDK_VERSION);
     if (!impl_->interface_)
     {
-        URHO3D_LOGERROR("Could not create Direct3D9 interface");
+        ATOMIC_LOGERROR("Could not create Direct3D9 interface");
         return false;
     }
 
     HRESULT hr = impl_->interface_->GetDeviceCaps(impl_->adapter_, impl_->deviceType_, &impl_->deviceCaps_);
     if (FAILED(hr))
     {
-        URHO3D_LOGD3DERROR("Could not get Direct3D capabilities", hr);
+        ATOMIC_LOGD3DERROR("Could not get Direct3D capabilities", hr);
         return false;
     }
 
     hr = impl_->interface_->GetAdapterIdentifier(impl_->adapter_, 0, &impl_->adapterIdentifier_);
     if (FAILED(hr))
     {
-        URHO3D_LOGD3DERROR("Could not get Direct3D adapter identifier", hr);
+        ATOMIC_LOGD3DERROR("Could not get Direct3D adapter identifier", hr);
         return false;
     }
 
     if (impl_->deviceCaps_.PixelShaderVersion < D3DPS_VERSION(3, 0))
     {
-        URHO3D_LOGERROR("Shader model 3.0 display adapter is required");
+        ATOMIC_LOGERROR("Shader model 3.0 display adapter is required");
         return false;
     }
 
@@ -2321,7 +2323,7 @@ bool Graphics::CreateInterface()
 
 bool Graphics::CreateDevice(unsigned adapter, unsigned deviceType)
 {
-#ifdef URHO3D_LUAJIT
+#ifdef ATOMIC_LUAJIT
     DWORD behaviorFlags = D3DCREATE_FPU_PRESERVE;
 #else
     DWORD behaviorFlags = 0;
@@ -2344,7 +2346,7 @@ bool Graphics::CreateDevice(unsigned adapter, unsigned deviceType)
         &impl_->device_);
     if (FAILED(hr))
     {
-        URHO3D_LOGD3DERROR("Could not create Direct3D9 device", hr);
+        ATOMIC_LOGD3DERROR("Could not create Direct3D9 device", hr);
         return false;
     }
 
@@ -2353,7 +2355,7 @@ bool Graphics::CreateDevice(unsigned adapter, unsigned deviceType)
 
     OnDeviceReset();
 
-    URHO3D_LOGINFO("Created Direct3D9 device");
+    ATOMIC_LOGINFO("Created Direct3D9 device");
     return true;
 }
 
@@ -2456,7 +2458,7 @@ void Graphics::ResetDevice()
 
 void Graphics::OnDeviceLost()
 {
-    URHO3D_LOGINFO("Device lost");
+    ATOMIC_LOGINFO("Device lost");
 
     if (impl_->defaultColorSurface_)
     {
@@ -2590,4 +2592,58 @@ void Graphics::SetTextureUnitMappings()
     textureUnits_["ZoneVolumeMap"] = TU_ZONE;
 }
 
+// ATOMIC BEGIN
+
+// To satisfy script binding linking
+void Graphics::SetTextureForUpdate(Texture* texture)
+{
+
+}
+
+void Graphics::SetTextureParametersDirty()
+{
+
+}
+
+/// Return shader program. This is an API-specific class and should not be used by applications.
+ShaderProgram* Graphics::GetShaderProgram() const
+{
+    return 0;
+}
+
+/// Restore GPU objects and reinitialize state. Requires an open window. Used only on OpenGL.
+void Graphics::Restore()
+{
+
+}
+
+void Graphics::CleanupRenderSurface(RenderSurface* surface)
+{
+
+}
+
+ConstantBuffer* Graphics::GetOrCreateConstantBuffer(ShaderType type, unsigned index, unsigned size)
+{
+    return 0;
+}
+
+void Graphics::MarkFBODirty()
+{
+
+}
+
+void Graphics::SetVBO(unsigned object)
+{
+
 }
+
+void Graphics::SetUBO(unsigned object)
+{
+
+}
+
+
+// ATOMIC END
+
+}
+

+ 1 - 1
Source/Atomic/Graphics/Direct3D9/D3D9GraphicsImpl.cpp

@@ -27,7 +27,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 GraphicsImpl::GraphicsImpl() :

+ 4 - 4
Source/Atomic/Graphics/Direct3D9/D3D9GraphicsImpl.h

@@ -28,18 +28,18 @@
 
 #include <d3d9.h>
 
-namespace Urho3D
+namespace Atomic
 {
 
-#define URHO3D_SAFE_RELEASE(p) if (p) { ((IUnknown*)p)->Release();  p = 0; }
+#define ATOMIC_SAFE_RELEASE(p) if (p) { ((IUnknown*)p)->Release();  p = 0; }
 
-#define URHO3D_LOGD3DERROR(msg, hr) URHO3D_LOGERRORF("%s (HRESULT %x)", msg, (unsigned)hr)
+#define ATOMIC_LOGD3DERROR(msg, hr) ATOMIC_LOGERRORF("%s (HRESULT %x)", msg, (unsigned)hr)
 
 typedef HashMap<Pair<ShaderVariation*, ShaderVariation*>, SharedPtr<ShaderProgram> > ShaderProgramMap;
 typedef HashMap<unsigned long long, SharedPtr<VertexDeclaration> > VertexDeclarationMap;
 
 /// %Graphics implementation. Holds API-specific objects.
-class URHO3D_API GraphicsImpl
+class ATOMIC_API GraphicsImpl
 {
     friend class Graphics;
 

+ 16 - 16
Source/Atomic/Graphics/Direct3D9/D3D9IndexBuffer.cpp

@@ -30,7 +30,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void IndexBuffer::OnDeviceLost()
@@ -61,20 +61,20 @@ void IndexBuffer::Release()
     if (graphics_ && graphics_->GetIndexBuffer() == this)
         graphics_->SetIndexBuffer(0);
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 }
 
 bool IndexBuffer::SetData(const void* data)
 {
     if (!data)
     {
-        URHO3D_LOGERROR("Null pointer for index buffer data");
+        ATOMIC_LOGERROR("Null pointer for index buffer data");
         return false;
     }
 
     if (!indexSize_)
     {
-        URHO3D_LOGERROR("Index size not defined, can not set index buffer data");
+        ATOMIC_LOGERROR("Index size not defined, can not set index buffer data");
         return false;
     }
 
@@ -85,7 +85,7 @@ bool IndexBuffer::SetData(const void* data)
     {
         if (graphics_->IsDeviceLost())
         {
-            URHO3D_LOGWARNING("Index buffer data assignment while device is lost");
+            ATOMIC_LOGWARNING("Index buffer data assignment while device is lost");
             dataPending_ = true;
             return true;
         }
@@ -111,19 +111,19 @@ bool IndexBuffer::SetDataRange(const void* data, unsigned start, unsigned count,
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null pointer for index buffer data");
+        ATOMIC_LOGERROR("Null pointer for index buffer data");
         return false;
     }
 
     if (!indexSize_)
     {
-        URHO3D_LOGERROR("Index size not defined, can not set index buffer data");
+        ATOMIC_LOGERROR("Index size not defined, can not set index buffer data");
         return false;
     }
 
     if (start + count > indexCount_)
     {
-        URHO3D_LOGERROR("Illegal range for setting new index buffer data");
+        ATOMIC_LOGERROR("Illegal range for setting new index buffer data");
         return false;
     }
 
@@ -137,7 +137,7 @@ bool IndexBuffer::SetDataRange(const void* data, unsigned start, unsigned count,
     {
         if (graphics_->IsDeviceLost())
         {
-            URHO3D_LOGWARNING("Index buffer data assignment while device is lost");
+            ATOMIC_LOGWARNING("Index buffer data assignment while device is lost");
             dataPending_ = true;
             return true;
         }
@@ -159,19 +159,19 @@ void* IndexBuffer::Lock(unsigned start, unsigned count, bool discard)
 {
     if (lockState_ != LOCK_NONE)
     {
-        URHO3D_LOGERROR("Index buffer already locked");
+        ATOMIC_LOGERROR("Index buffer already locked");
         return 0;
     }
 
     if (!indexSize_)
     {
-        URHO3D_LOGERROR("Index size not defined, can not lock index buffer");
+        ATOMIC_LOGERROR("Index size not defined, can not lock index buffer");
         return 0;
     }
 
     if (start + count > indexCount_)
     {
-        URHO3D_LOGERROR("Illegal range for locking index buffer");
+        ATOMIC_LOGERROR("Illegal range for locking index buffer");
         return 0;
     }
 
@@ -235,7 +235,7 @@ bool IndexBuffer::Create()
     {
         if (graphics_->IsDeviceLost())
         {
-            URHO3D_LOGWARNING("Index buffer creation while device is lost");
+            ATOMIC_LOGWARNING("Index buffer creation while device is lost");
             return true;
         }
 
@@ -252,8 +252,8 @@ bool IndexBuffer::Create()
             0);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(object_.ptr_)
-            URHO3D_LOGD3DERROR("Could not create index buffer", hr);
+            ATOMIC_SAFE_RELEASE(object_.ptr_)
+            ATOMIC_LOGD3DERROR("Could not create index buffer", hr);
             return false;
         }
     }
@@ -282,7 +282,7 @@ void* IndexBuffer::MapBuffer(unsigned start, unsigned count, bool discard)
 
         HRESULT hr = ((IDirect3DIndexBuffer9*)object_.ptr_)->Lock(start * indexSize_, count * indexSize_, &hwData, flags);
         if (FAILED(hr))
-            URHO3D_LOGD3DERROR("Could not lock index buffer", hr);
+            ATOMIC_LOGD3DERROR("Could not lock index buffer", hr);
         else
             lockState_ = LOCK_HARDWARE;
     }

+ 2 - 2
Source/Atomic/Graphics/Direct3D9/D3D9RenderSurface.cpp

@@ -31,7 +31,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 RenderSurface::RenderSurface(Texture* parentTexture) :
@@ -57,7 +57,7 @@ void RenderSurface::Release()
             graphics->ResetDepthStencil();
     }
 
-    URHO3D_SAFE_RELEASE(surface_);
+    ATOMIC_SAFE_RELEASE(surface_);
 }
 
 bool RenderSurface::CreateRenderBuffer(unsigned width, unsigned height, unsigned format)

+ 3 - 1
Source/Atomic/Graphics/Direct3D9/D3D9ShaderProgram.h

@@ -25,12 +25,14 @@
 #include "../../Container/HashMap.h"
 #include "../../Graphics/ShaderVariation.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 /// Combined information for specific vertex and pixel shaders.
 class ShaderProgram : public RefCounted
 {
+    ATOMIC_REFCOUNTED(ShaderProgram)
+
 public:
     /// Construct.
     ShaderProgram(ShaderVariation* vertexShader, ShaderVariation* pixelShader)

+ 13 - 13
Source/Atomic/Graphics/Direct3D9/D3D9ShaderVariation.cpp

@@ -36,7 +36,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void CopyStrippedCode(PODVector<unsigned char>& byteCode, unsigned char* bufData, unsigned bufSize)
@@ -113,7 +113,7 @@ bool ShaderVariation::Create()
             (IDirect3DVertexShader9**)&object_.ptr_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(object_.ptr_);
+            ATOMIC_SAFE_RELEASE(object_.ptr_);
             compilerOutput_ = "Could not create vertex shader (HRESULT " + ToStringHex((unsigned)hr) + ")";
         }
     }
@@ -124,7 +124,7 @@ bool ShaderVariation::Create()
             (IDirect3DPixelShader9**)&object_.ptr_);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(object_.ptr_);
+            ATOMIC_SAFE_RELEASE(object_.ptr_);
             compilerOutput_ = "Could not create pixel shader (HRESULT " + ToStringHex((unsigned)hr) + ")";
         }
     }
@@ -154,7 +154,7 @@ void ShaderVariation::Release()
         }
     }
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 
     compilerOutput_.Clear();
 
@@ -184,7 +184,7 @@ bool ShaderVariation::LoadByteCode(const String& binaryShaderName)
     SharedPtr<File> file = cache->GetFile(binaryShaderName);
     if (!file || file->ReadFileID() != "USHD")
     {
-        URHO3D_LOGERROR(binaryShaderName + " is not a valid shader bytecode file");
+        ATOMIC_LOGERROR(binaryShaderName + " is not a valid shader bytecode file");
         return false;
     }
 
@@ -224,15 +224,15 @@ bool ShaderVariation::LoadByteCode(const String& binaryShaderName)
         file->Read(&byteCode_[0], byteCodeSize);
 
         if (type_ == VS)
-            URHO3D_LOGDEBUG("Loaded cached vertex shader " + GetFullName());
+            ATOMIC_LOGDEBUG("Loaded cached vertex shader " + GetFullName());
         else
-            URHO3D_LOGDEBUG("Loaded cached pixel shader " + GetFullName());
+            ATOMIC_LOGDEBUG("Loaded cached pixel shader " + GetFullName());
 
         return true;
     }
     else
     {
-        URHO3D_LOGERROR(binaryShaderName + " has zero length bytecode");
+        ATOMIC_LOGERROR(binaryShaderName + " has zero length bytecode");
         return false;
     }
 }
@@ -288,7 +288,7 @@ bool ShaderVariation::Compile()
         // In debug mode, check that all defines are referenced by the shader code
 #ifdef _DEBUG
         if (sourceCode.Find(defines[i]) == String::NPOS)
-            URHO3D_LOGWARNING("Shader " + GetFullName() + " does not use the define " + defines[i]);
+            ATOMIC_LOGWARNING("Shader " + GetFullName() + " does not use the define " + defines[i]);
 #endif
     }
 
@@ -311,9 +311,9 @@ bool ShaderVariation::Compile()
     else
     {
         if (type_ == VS)
-            URHO3D_LOGDEBUG("Compiled vertex shader " + GetFullName());
+            ATOMIC_LOGDEBUG("Compiled vertex shader " + GetFullName());
         else
-            URHO3D_LOGDEBUG("Compiled pixel shader " + GetFullName());
+            ATOMIC_LOGDEBUG("Compiled pixel shader " + GetFullName());
 
         // Inspect the produced bytecode using MojoShader, then strip and store it
         unsigned char* bufData = (unsigned char*)shaderCode->GetBufferPointer();
@@ -322,8 +322,8 @@ bool ShaderVariation::Compile()
         CopyStrippedCode(byteCode_, bufData, bufSize);
     }
 
-    URHO3D_SAFE_RELEASE(shaderCode);
-    URHO3D_SAFE_RELEASE(errorMsgs);
+    ATOMIC_SAFE_RELEASE(shaderCode);
+    ATOMIC_SAFE_RELEASE(errorMsgs);
 
     return !byteCode_.Empty();
 }

+ 32 - 1
Source/Atomic/Graphics/Direct3D9/D3D9Texture.cpp

@@ -32,7 +32,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void Texture::SetSRGB(bool enable)
@@ -104,4 +104,35 @@ unsigned Texture::GetRowDataSize(int width) const
     }
 }
 
+// ATOMIC BEGIN
+
+// Satisfy script binding link
+
+unsigned Texture::GetSRGBFormat(unsigned format)
+{
+    return 0;
+}
+
+unsigned Texture::GetSRVFormat(unsigned format)
+{
+    return 0;
+}
+
+unsigned Texture::GetDSVFormat(unsigned format)
+{
+    return 0;
+}
+
+unsigned Texture::GetExternalFormat(unsigned format)
+{
+    return 0;
+}
+
+unsigned Texture::GetDataType(unsigned format)
+{
+    return 0;
+}
+
+// ATOMIC END
+
 }

+ 26 - 26
Source/Atomic/Graphics/Direct3D9/D3D9Texture2D.cpp

@@ -36,7 +36,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void Texture2D::OnDeviceLost()
@@ -78,34 +78,34 @@ void Texture2D::Release()
     if (renderSurface_)
         renderSurface_->Release();
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 }
 
 bool Texture2D::SetData(unsigned level, int x, int y, int width, int height, const void* data)
 {
-    URHO3D_PROFILE(SetTextureData);
+    ATOMIC_PROFILE(SetTextureData);
 
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not set data");
+        ATOMIC_LOGERROR("No texture created, can not set data");
         return false;
     }
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null source for setting data");
+        ATOMIC_LOGERROR("Null source for setting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for setting data");
+        ATOMIC_LOGERROR("Illegal mip level for setting data");
         return false;
     }
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Texture data assignment while device is lost");
+        ATOMIC_LOGWARNING("Texture data assignment while device is lost");
         dataPending_ = true;
         return true;
     }
@@ -120,7 +120,7 @@ bool Texture2D::SetData(unsigned level, int x, int y, int width, int height, con
     int levelHeight = GetLevelHeight(level);
     if (x < 0 || x + width > levelWidth || y < 0 || y + height > levelHeight || width <= 0 || height <= 0)
     {
-        URHO3D_LOGERROR("Illegal dimensions for setting data");
+        ATOMIC_LOGERROR("Illegal dimensions for setting data");
         return false;
     }
 
@@ -138,7 +138,7 @@ bool Texture2D::SetData(unsigned level, int x, int y, int width, int height, con
     HRESULT hr = ((IDirect3DTexture9*)object_.ptr_)->LockRect(level, &d3dLockedRect, (flags & D3DLOCK_DISCARD) ? 0 : &d3dRect, flags);
     if (FAILED(hr))
     {
-        URHO3D_LOGD3DERROR("Could not lock texture", hr);
+        ATOMIC_LOGD3DERROR("Could not lock texture", hr);
         return false;
     }
 
@@ -206,7 +206,7 @@ bool Texture2D::SetData(Image* image, bool useAlpha)
 {
     if (!image)
     {
-        URHO3D_LOGERROR("Null image, can not load texture");
+        ATOMIC_LOGERROR("Null image, can not load texture");
         return false;
     }
 
@@ -329,25 +329,25 @@ bool Texture2D::GetData(unsigned level, void* dest) const
 {
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not get data");
+        ATOMIC_LOGERROR("No texture created, can not get data");
         return false;
     }
 
     if (!dest)
     {
-        URHO3D_LOGERROR("Null destination for getting data");
+        ATOMIC_LOGERROR("Null destination for getting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for getting data");
+        ATOMIC_LOGERROR("Illegal mip level for getting data");
         return false;
     }
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Getting texture data while device is lost");
+        ATOMIC_LOGWARNING("Getting texture data while device is lost");
         return false;
     }
 
@@ -367,7 +367,7 @@ bool Texture2D::GetData(unsigned level, void* dest) const
     {
         if (level != 0)
         {
-            URHO3D_LOGERROR("Can only get mip level 0 data from a rendertarget");
+            ATOMIC_LOGERROR("Can only get mip level 0 data from a rendertarget");
             return false;
         }
 
@@ -376,21 +376,21 @@ bool Texture2D::GetData(unsigned level, void* dest) const
             D3DPOOL_SYSTEMMEM, &offscreenSurface, 0);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(offscreenSurface);
-            URHO3D_LOGD3DERROR("Could not create surface for getting rendertarget data", hr);
+            ATOMIC_SAFE_RELEASE(offscreenSurface);
+            ATOMIC_LOGD3DERROR("Could not create surface for getting rendertarget data", hr);
             return false;
         }
         hr = device->GetRenderTargetData((IDirect3DSurface9*)renderSurface_->GetSurface(), offscreenSurface);
         if (FAILED(hr))
         {
-            URHO3D_LOGD3DERROR("Could not get rendertarget data", hr);
+            ATOMIC_LOGD3DERROR("Could not get rendertarget data", hr);
             offscreenSurface->Release();
             return false;
         }
         hr = offscreenSurface->LockRect(&d3dLockedRect, &d3dRect, D3DLOCK_READONLY);
         if (FAILED(hr))
         {
-            URHO3D_LOGD3DERROR("Could not lock surface for getting rendertarget data", hr);
+            ATOMIC_LOGD3DERROR("Could not lock surface for getting rendertarget data", hr);
             offscreenSurface->Release();
             return false;
         }
@@ -400,7 +400,7 @@ bool Texture2D::GetData(unsigned level, void* dest) const
         HRESULT hr = ((IDirect3DTexture9*)object_.ptr_)->LockRect(level, &d3dLockedRect, &d3dRect, D3DLOCK_READONLY);
         if (FAILED(hr))
         {
-            URHO3D_LOGD3DERROR("Could not lock texture", hr);
+            ATOMIC_LOGD3DERROR("Could not lock texture", hr);
             return false;
         }
     }
@@ -478,7 +478,7 @@ bool Texture2D::Create()
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Texture creation while device is lost");
+        ATOMIC_LOGWARNING("Texture creation while device is lost");
         return true;
     }
 
@@ -515,8 +515,8 @@ bool Texture2D::Create()
             0);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(renderSurface_->surface_);
-            URHO3D_LOGD3DERROR("Could not create depth-stencil surface", hr);
+            ATOMIC_SAFE_RELEASE(renderSurface_->surface_);
+            ATOMIC_LOGD3DERROR("Could not create depth-stencil surface", hr);
             return false;
         }
 
@@ -535,8 +535,8 @@ bool Texture2D::Create()
             0);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(object_.ptr_);
-            URHO3D_LOGD3DERROR("Could not create texture", hr);
+            ATOMIC_SAFE_RELEASE(object_.ptr_);
+            ATOMIC_LOGD3DERROR("Could not create texture", hr);
             return false;
         }
 
@@ -546,7 +546,7 @@ bool Texture2D::Create()
         {
             hr = ((IDirect3DTexture9*)object_.ptr_)->GetSurfaceLevel(0, (IDirect3DSurface9**)&renderSurface_->surface_);
             if (FAILED(hr))
-                URHO3D_LOGD3DERROR("Could not get rendertarget surface", hr);
+                ATOMIC_LOGD3DERROR("Could not get rendertarget surface", hr);
         }
     }
 

+ 12 - 12
Source/Atomic/Graphics/Direct3D9/D3D9Texture2DArray.cpp

@@ -40,7 +40,7 @@
 #pragma warning(disable:4355)
 #endif
 
-namespace Urho3D
+namespace Atomic
 {
 
 void Texture2DArray::OnDeviceLost()
@@ -82,12 +82,12 @@ void Texture2DArray::Release()
     if (renderSurface_)
         renderSurface_->Release();
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 }
 
 bool Texture2DArray::SetData(unsigned layer, unsigned level, int x, int y, int width, int height, const void* data)
 {
-    URHO3D_LOGERROR("Texture2DArray not supported on Direct3D9, can not set data");
+    ATOMIC_LOGERROR("Texture2DArray not supported on Direct3D9, can not set data");
     return false;
 }
 
@@ -104,17 +104,17 @@ bool Texture2DArray::SetData(unsigned layer, Image* image, bool useAlpha)
 {
     if (!image)
     {
-        URHO3D_LOGERROR("Null image, can not set data");
+        ATOMIC_LOGERROR("Null image, can not set data");
         return false;
     }
     if (!layers_)
     {
-        URHO3D_LOGERROR("Number of layers in the array must be set first");
+        ATOMIC_LOGERROR("Number of layers in the array must be set first");
         return false;
     }
     if (layer >= layers_)
     {
-        URHO3D_LOGERROR("Illegal layer for setting data");
+        ATOMIC_LOGERROR("Illegal layer for setting data");
         return false;
     }
 
@@ -170,12 +170,12 @@ bool Texture2DArray::SetData(unsigned layer, Image* image, bool useAlpha)
             if (!object_.ptr_)
             {
                 // Do not spam this error on D3D9
-                //URHO3D_LOGERROR("Texture array layer 0 must be loaded first");
+                //ATOMIC_LOGERROR("Texture array layer 0 must be loaded first");
                 return false;
             }
             if (levelWidth != width_ || levelHeight != height_ || format != format_)
             {
-                URHO3D_LOGERROR("Texture array layer does not match size or format of layer 0");
+                ATOMIC_LOGERROR("Texture array layer does not match size or format of layer 0");
                 return false;
             }
         }
@@ -226,12 +226,12 @@ bool Texture2DArray::SetData(unsigned layer, Image* image, bool useAlpha)
         {
             if (!object_.ptr_)
             {
-                //URHO3D_LOGERROR("Texture array layer 0 must be loaded first");
+                //ATOMIC_LOGERROR("Texture array layer 0 must be loaded first");
                 return false;
             }
             if (width != width_ || height != height_ || format != format_)
             {
-                URHO3D_LOGERROR("Texture array layer does not match size or format of layer 0");
+                ATOMIC_LOGERROR("Texture array layer does not match size or format of layer 0");
                 return false;
             }
         }
@@ -266,7 +266,7 @@ bool Texture2DArray::SetData(unsigned layer, Image* image, bool useAlpha)
 
 bool Texture2DArray::GetData(unsigned layer, unsigned level, void* dest) const
 {
-    URHO3D_LOGERROR("Texture2DArray not supported on Direct3D9, can not get data");
+    ATOMIC_LOGERROR("Texture2DArray not supported on Direct3D9, can not get data");
     return false;
 }
 
@@ -277,7 +277,7 @@ bool Texture2DArray::Create()
     if (!graphics_ || !width_ || !height_ || !layers_)
         return false;
 
-    URHO3D_LOGERROR("Texture2DArray not supported on Direct3D9, can not create");
+    ATOMIC_LOGERROR("Texture2DArray not supported on Direct3D9, can not create");
     return false;
 }
 

+ 18 - 18
Source/Atomic/Graphics/Direct3D9/D3D9Texture3D.cpp

@@ -36,7 +36,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void Texture3D::OnDeviceLost()
@@ -75,34 +75,34 @@ void Texture3D::Release()
         }
     }
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 }
 
 bool Texture3D::SetData(unsigned level, int x, int y, int z, int width, int height, int depth, const void* data)
 {
-    URHO3D_PROFILE(SetTextureData);
+    ATOMIC_PROFILE(SetTextureData);
 
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not set data");
+        ATOMIC_LOGERROR("No texture created, can not set data");
         return false;
     }
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null source for setting data");
+        ATOMIC_LOGERROR("Null source for setting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for setting data");
+        ATOMIC_LOGERROR("Illegal mip level for setting data");
         return false;
     }
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Texture data assignment while device is lost");
+        ATOMIC_LOGWARNING("Texture data assignment while device is lost");
         dataPending_ = true;
         return true;
     }
@@ -119,7 +119,7 @@ bool Texture3D::SetData(unsigned level, int x, int y, int z, int width, int heig
     if (x < 0 || x + width > levelWidth || y < 0 || y + height > levelHeight || z < 0 || z + depth > levelDepth || width <= 0 ||
         height <= 0 || depth <= 0)
     {
-        URHO3D_LOGERROR("Illegal dimensions for setting data");
+        ATOMIC_LOGERROR("Illegal dimensions for setting data");
         return false;
     }
 
@@ -140,7 +140,7 @@ bool Texture3D::SetData(unsigned level, int x, int y, int z, int width, int heig
     HRESULT hr = ((IDirect3DVolumeTexture9*)object_.ptr_)->LockBox(level, &d3dLockedBox, (flags & D3DLOCK_DISCARD) ? 0 : &d3dBox, flags);
     if (FAILED(hr))
     {
-        URHO3D_LOGD3DERROR("Could not lock texture", hr);
+        ATOMIC_LOGD3DERROR("Could not lock texture", hr);
         return false;
     }
 
@@ -220,7 +220,7 @@ bool Texture3D::SetData(Image* image, bool useAlpha)
 {
     if (!image)
     {
-        URHO3D_LOGERROR("Null image, can not load texture");
+        ATOMIC_LOGERROR("Null image, can not load texture");
         return false;
     }
 
@@ -348,25 +348,25 @@ bool Texture3D::GetData(unsigned level, void* dest) const
 {
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not get data");
+        ATOMIC_LOGERROR("No texture created, can not get data");
         return false;
     }
 
     if (!dest)
     {
-        URHO3D_LOGERROR("Null destination for getting data");
+        ATOMIC_LOGERROR("Null destination for getting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for getting data");
+        ATOMIC_LOGERROR("Illegal mip level for getting data");
         return false;
     }
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Getting texture data while device is lost");
+        ATOMIC_LOGWARNING("Getting texture data while device is lost");
         return false;
     }
 
@@ -386,7 +386,7 @@ bool Texture3D::GetData(unsigned level, void* dest) const
     HRESULT hr = ((IDirect3DVolumeTexture9*)object_.ptr_)->LockBox(level, &d3dLockedBox, &d3dBox, D3DLOCK_READONLY);
     if (FAILED(hr))
     {
-        URHO3D_LOGD3DERROR("Could not lock texture", hr);
+        ATOMIC_LOGD3DERROR("Could not lock texture", hr);
         return false;
     }
 
@@ -465,7 +465,7 @@ bool Texture3D::Create()
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Texture creation while device is lost");
+        ATOMIC_LOGWARNING("Texture creation while device is lost");
         return true;
     }
 
@@ -485,8 +485,8 @@ bool Texture3D::Create()
         0);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(object_.ptr_);
-        URHO3D_LOGD3DERROR("Could not create texture", hr);
+        ATOMIC_SAFE_RELEASE(object_.ptr_);
+        ATOMIC_LOGD3DERROR("Could not create texture", hr);
         return false;
     }
 

+ 30 - 30
Source/Atomic/Graphics/Direct3D9/D3D9TextureCube.cpp

@@ -40,7 +40,7 @@
 #pragma warning(disable:4355)
 #endif
 
-namespace Urho3D
+namespace Atomic
 {
 
 void TextureCube::OnDeviceLost()
@@ -85,34 +85,34 @@ void TextureCube::Release()
             renderSurfaces_[i]->Release();
     }
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 }
 
 bool TextureCube::SetData(CubeMapFace face, unsigned level, int x, int y, int width, int height, const void* data)
 {
-    URHO3D_PROFILE(SetTextureData);
+    ATOMIC_PROFILE(SetTextureData);
 
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not set data");
+        ATOMIC_LOGERROR("No texture created, can not set data");
         return false;
     }
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null source for setting data");
+        ATOMIC_LOGERROR("Null source for setting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for setting data");
+        ATOMIC_LOGERROR("Illegal mip level for setting data");
         return false;
     }
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Texture data assignment while device is lost");
+        ATOMIC_LOGWARNING("Texture data assignment while device is lost");
         dataPending_ = true;
         return true;
     }
@@ -127,7 +127,7 @@ bool TextureCube::SetData(CubeMapFace face, unsigned level, int x, int y, int wi
     int levelHeight = GetLevelHeight(level);
     if (x < 0 || x + width > levelWidth || y < 0 || y + height > levelHeight || width <= 0 || height <= 0)
     {
-        URHO3D_LOGERROR("Illegal dimensions for setting data");
+        ATOMIC_LOGERROR("Illegal dimensions for setting data");
         return false;
     }
 
@@ -146,7 +146,7 @@ bool TextureCube::SetData(CubeMapFace face, unsigned level, int x, int y, int wi
         (flags & D3DLOCK_DISCARD) ? 0 : &d3dRect, flags);
     if (FAILED(hr))
     {
-        URHO3D_LOGD3DERROR("Could not lock texture", hr);
+        ATOMIC_LOGD3DERROR("Could not lock texture", hr);
         return false;
     }
 
@@ -223,7 +223,7 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
 {
     if (!image)
     {
-        URHO3D_LOGERROR("Null image, can not load texture");
+        ATOMIC_LOGERROR("Null image, can not load texture");
         return false;
     }
 
@@ -245,7 +245,7 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
 
         if (levelWidth != levelHeight)
         {
-            URHO3D_LOGERROR("Cube texture width not equal to height");
+            ATOMIC_LOGERROR("Cube texture width not equal to height");
             return false;
         }
 
@@ -293,12 +293,12 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
         {
             if (!object_.ptr_)
             {
-                URHO3D_LOGERROR("Cube texture face 0 must be loaded first");
+                ATOMIC_LOGERROR("Cube texture face 0 must be loaded first");
                 return false;
             }
             if (levelWidth != width_ || format != format_)
             {
-                URHO3D_LOGERROR("Cube texture face does not match size or format of face 0");
+                ATOMIC_LOGERROR("Cube texture face does not match size or format of face 0");
                 return false;
             }
         }
@@ -327,7 +327,7 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
 
         if (width != height)
         {
-            URHO3D_LOGERROR("Cube texture width not equal to height");
+            ATOMIC_LOGERROR("Cube texture width not equal to height");
             return false;
         }
 
@@ -355,12 +355,12 @@ bool TextureCube::SetData(CubeMapFace face, Image* image, bool useAlpha)
         {
             if (!object_.ptr_)
             {
-                URHO3D_LOGERROR("Cube texture face 0 must be loaded first");
+                ATOMIC_LOGERROR("Cube texture face 0 must be loaded first");
                 return false;
             }
             if (width != width_ || format != format_)
             {
-                URHO3D_LOGERROR("Cube texture face does not match size or format of face 0");
+                ATOMIC_LOGERROR("Cube texture face does not match size or format of face 0");
                 return false;
             }
         }
@@ -397,25 +397,25 @@ bool TextureCube::GetData(CubeMapFace face, unsigned level, void* dest) const
 {
     if (!object_.ptr_)
     {
-        URHO3D_LOGERROR("No texture created, can not get data");
+        ATOMIC_LOGERROR("No texture created, can not get data");
         return false;
     }
 
     if (!dest)
     {
-        URHO3D_LOGERROR("Null destination for getting data");
+        ATOMIC_LOGERROR("Null destination for getting data");
         return false;
     }
 
     if (level >= levels_)
     {
-        URHO3D_LOGERROR("Illegal mip level for getting data");
+        ATOMIC_LOGERROR("Illegal mip level for getting data");
         return false;
     }
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Getting texture data while device is lost");
+        ATOMIC_LOGWARNING("Getting texture data while device is lost");
         return false;
     }
 
@@ -435,7 +435,7 @@ bool TextureCube::GetData(CubeMapFace face, unsigned level, void* dest) const
     {
         if (level != 0)
         {
-            URHO3D_LOGERROR("Can only get mip level 0 data from a rendertarget");
+            ATOMIC_LOGERROR("Can only get mip level 0 data from a rendertarget");
             return false;
         }
 
@@ -443,20 +443,20 @@ bool TextureCube::GetData(CubeMapFace face, unsigned level, void* dest) const
         HRESULT hr = device->CreateOffscreenPlainSurface((UINT)width_, (UINT)height_, (D3DFORMAT)format_, D3DPOOL_SYSTEMMEM, &offscreenSurface, 0);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(offscreenSurface);
-            URHO3D_LOGD3DERROR("Could not create surface for getting rendertarget data", hr);
+            ATOMIC_SAFE_RELEASE(offscreenSurface);
+            ATOMIC_LOGD3DERROR("Could not create surface for getting rendertarget data", hr);
             return false;
         }
         hr = device->GetRenderTargetData((IDirect3DSurface9*)renderSurfaces_[face]->GetSurface(), offscreenSurface);
         if (FAILED(hr))
         {
-            URHO3D_LOGD3DERROR("Could not get rendertarget data", hr);
+            ATOMIC_LOGD3DERROR("Could not get rendertarget data", hr);
             offscreenSurface->Release();
             return false;
         }
         if (FAILED(offscreenSurface->LockRect(&d3dLockedRect, &d3dRect, D3DLOCK_READONLY)))
         {
-            URHO3D_LOGD3DERROR("Could not lock surface for getting rendertarget data", hr);
+            ATOMIC_LOGD3DERROR("Could not lock surface for getting rendertarget data", hr);
             offscreenSurface->Release();
             return false;
         }
@@ -466,7 +466,7 @@ bool TextureCube::GetData(CubeMapFace face, unsigned level, void* dest) const
         HRESULT hr = ((IDirect3DCubeTexture9*)object_.ptr_)->LockRect((D3DCUBEMAP_FACES)face, level, &d3dLockedRect, &d3dRect, D3DLOCK_READONLY);
         if (FAILED(hr))
         {
-            URHO3D_LOGD3DERROR("Could not lock texture", hr);
+            ATOMIC_LOGD3DERROR("Could not lock texture", hr);
             return false;
         }
     }
@@ -544,7 +544,7 @@ bool TextureCube::Create()
 
     if (graphics_->IsDeviceLost())
     {
-        URHO3D_LOGWARNING("Texture creation while device is lost");
+        ATOMIC_LOGWARNING("Texture creation while device is lost");
         return true;
     }
 
@@ -574,8 +574,8 @@ bool TextureCube::Create()
         0);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(object_.ptr_);
-        URHO3D_LOGD3DERROR("Could not create cube texture", hr);
+        ATOMIC_SAFE_RELEASE(object_.ptr_);
+        ATOMIC_LOGD3DERROR("Could not create cube texture", hr);
         return false;
     }
 
@@ -588,7 +588,7 @@ bool TextureCube::Create()
             hr = ((IDirect3DCubeTexture9*)object_.ptr_)->GetCubeMapSurface((D3DCUBEMAP_FACES)i, 0,
                 (IDirect3DSurface9**)&renderSurfaces_[i]->surface_);
             if (FAILED(hr))
-                URHO3D_LOGD3DERROR("Could not get rendertarget surface", hr);
+                ATOMIC_LOGD3DERROR("Could not get rendertarget surface", hr);
         }
     }
 

+ 16 - 16
Source/Atomic/Graphics/Direct3D9/D3D9VertexBuffer.cpp

@@ -29,7 +29,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 void VertexBuffer::OnDeviceLost()
@@ -66,20 +66,20 @@ void VertexBuffer::Release()
         }
     }
 
-    URHO3D_SAFE_RELEASE(object_.ptr_);
+    ATOMIC_SAFE_RELEASE(object_.ptr_);
 }
 
 bool VertexBuffer::SetData(const void* data)
 {
     if (!data)
     {
-        URHO3D_LOGERROR("Null pointer for vertex buffer data");
+        ATOMIC_LOGERROR("Null pointer for vertex buffer data");
         return false;
     }
 
     if (!vertexSize_)
     {
-        URHO3D_LOGERROR("Vertex elements not defined, can not set vertex buffer data");
+        ATOMIC_LOGERROR("Vertex elements not defined, can not set vertex buffer data");
         return false;
     }
 
@@ -90,7 +90,7 @@ bool VertexBuffer::SetData(const void* data)
     {
         if (graphics_->IsDeviceLost())
         {
-            URHO3D_LOGWARNING("Vertex buffer data assignment while device is lost");
+            ATOMIC_LOGWARNING("Vertex buffer data assignment while device is lost");
             dataPending_ = true;
             return true;
         }
@@ -116,19 +116,19 @@ bool VertexBuffer::SetDataRange(const void* data, unsigned start, unsigned count
 
     if (!data)
     {
-        URHO3D_LOGERROR("Null pointer for vertex buffer data");
+        ATOMIC_LOGERROR("Null pointer for vertex buffer data");
         return false;
     }
 
     if (!vertexSize_)
     {
-        URHO3D_LOGERROR("Vertex elements not defined, can not set vertex buffer data");
+        ATOMIC_LOGERROR("Vertex elements not defined, can not set vertex buffer data");
         return false;
     }
 
     if (start + count > vertexCount_)
     {
-        URHO3D_LOGERROR("Illegal range for setting new vertex buffer data");
+        ATOMIC_LOGERROR("Illegal range for setting new vertex buffer data");
         return false;
     }
 
@@ -142,7 +142,7 @@ bool VertexBuffer::SetDataRange(const void* data, unsigned start, unsigned count
     {
         if (graphics_->IsDeviceLost())
         {
-            URHO3D_LOGWARNING("Vertex buffer data assignment while device is lost");
+            ATOMIC_LOGWARNING("Vertex buffer data assignment while device is lost");
             dataPending_ = true;
             return true;
         }
@@ -164,19 +164,19 @@ void* VertexBuffer::Lock(unsigned start, unsigned count, bool discard)
 {
     if (lockState_ != LOCK_NONE)
     {
-        URHO3D_LOGERROR("Vertex buffer already locked");
+        ATOMIC_LOGERROR("Vertex buffer already locked");
         return 0;
     }
 
     if (!vertexSize_)
     {
-        URHO3D_LOGERROR("Vertex elements not defined, can not lock vertex buffer");
+        ATOMIC_LOGERROR("Vertex elements not defined, can not lock vertex buffer");
         return 0;
     }
 
     if (start + count > vertexCount_)
     {
-        URHO3D_LOGERROR("Illegal range for locking vertex buffer");
+        ATOMIC_LOGERROR("Illegal range for locking vertex buffer");
         return 0;
     }
 
@@ -240,7 +240,7 @@ bool VertexBuffer::Create()
     {
         if (graphics_->IsDeviceLost())
         {
-            URHO3D_LOGWARNING("Vertex buffer creation while device is lost");
+            ATOMIC_LOGWARNING("Vertex buffer creation while device is lost");
             return true;
         }
 
@@ -257,8 +257,8 @@ bool VertexBuffer::Create()
             0);
         if (FAILED(hr))
         {
-            URHO3D_SAFE_RELEASE(object_.ptr_);
-            URHO3D_LOGD3DERROR("Could not create vertex buffer", hr);
+            ATOMIC_SAFE_RELEASE(object_.ptr_);
+            ATOMIC_LOGD3DERROR("Could not create vertex buffer", hr);
             return false;
         }
     }
@@ -287,7 +287,7 @@ void* VertexBuffer::MapBuffer(unsigned start, unsigned count, bool discard)
 
         HRESULT hr = ((IDirect3DVertexBuffer9*)object_.ptr_)->Lock(start * vertexSize_, count * vertexSize_, &hwData, flags);
         if (FAILED(hr))
-            URHO3D_LOGD3DERROR("Could not lock vertex buffer", hr);
+            ATOMIC_LOGD3DERROR("Could not lock vertex buffer", hr);
         else
             lockState_ = LOCK_HARDWARE;
     }

+ 7 - 7
Source/Atomic/Graphics/Direct3D9/D3D9VertexDeclaration.cpp

@@ -30,7 +30,7 @@
 
 #include "../../DebugNew.h"
 
-namespace Urho3D
+namespace Atomic
 {
 
 const BYTE d3dElementType[] =
@@ -68,7 +68,7 @@ VertexDeclaration::VertexDeclaration(Graphics* graphics, const PODVector<VertexE
 
         if (srcElement.semantic_ == SEM_OBJECTINDEX)
         {
-            URHO3D_LOGWARNING("Object index attribute is not supported on Direct3D9 and will be ignored");
+            ATOMIC_LOGWARNING("Object index attribute is not supported on Direct3D9 and will be ignored");
             continue;
         }
 
@@ -104,7 +104,7 @@ VertexDeclaration::VertexDeclaration(Graphics* graphics, const PODVector<VertexB
 
             if (srcElement.semantic_ == SEM_OBJECTINDEX)
             {
-                URHO3D_LOGWARNING("Object index attribute is not supported on Direct3D9 and will be ignored");
+                ATOMIC_LOGWARNING("Object index attribute is not supported on Direct3D9 and will be ignored");
                 continue;
             }
 
@@ -158,7 +158,7 @@ VertexDeclaration::VertexDeclaration(Graphics* graphics, const Vector<SharedPtr<
 
             if (srcElement.semantic_ == SEM_OBJECTINDEX)
             {
-                URHO3D_LOGWARNING("Object index attribute is not supported on Direct3D9 and will be ignored");
+                ATOMIC_LOGWARNING("Object index attribute is not supported on Direct3D9 and will be ignored");
                 continue;
             }
 
@@ -224,14 +224,14 @@ void VertexDeclaration::Create(Graphics* graphics, const PODVector<VertexDeclara
     HRESULT hr = device->CreateVertexDeclaration(elementArray, &declaration_);
     if (FAILED(hr))
     {
-        URHO3D_SAFE_RELEASE(declaration_);
-        URHO3D_LOGD3DERROR("Failed to create vertex declaration", hr);
+        ATOMIC_SAFE_RELEASE(declaration_);
+        ATOMIC_LOGD3DERROR("Failed to create vertex declaration", hr);
     }
 }
 
 void VertexDeclaration::Release()
 {
-    URHO3D_SAFE_RELEASE(declaration_);
+    ATOMIC_SAFE_RELEASE(declaration_);
 }
 
 }

+ 4 - 2
Source/Atomic/Graphics/Direct3D9/D3D9VertexDeclaration.h

@@ -28,7 +28,7 @@
 
 #include <d3d9.h>
 
-namespace Urho3D
+namespace Atomic
 {
 
 class Graphics;
@@ -50,8 +50,10 @@ struct VertexDeclarationElement
 };
 
 /// Vertex declaration.
-class URHO3D_API VertexDeclaration : public RefCounted
+class ATOMIC_API VertexDeclaration : public RefCounted
 {
+    ATOMIC_REFCOUNTED(VertexDeclaration)
+
 public:
     /// Construct with a single buffer's vertex element list.
     VertexDeclaration(Graphics* graphics, const PODVector<VertexElement>& srcElements);

+ 12 - 2
Source/Atomic/Graphics/Drawable.cpp

@@ -36,6 +36,10 @@
 #include "../IO/Log.h"
 #include "../Scene/Scene.h"
 
+// ATOMIC BEGIN
+#include "../IO/Log.h"
+// ATOMIC END
+
 #include "../DebugNew.h"
 
 #ifdef _MSC_VER
@@ -80,10 +84,10 @@ SourceBatch& SourceBatch::operator =(const SourceBatch& rhs)
 }
 
 
-Drawable::Drawable(Context* context, unsigned char drawableFlags) :
+Drawable::Drawable(Context* context, unsigned drawableFlags) :
     Component(context),
     boundingBox_(0.0f, 0.0f),
-    drawableFlags_(drawableFlags),
+    drawableFlags_((unsigned char)drawableFlags),
     worldBoundingBoxDirty_(true),
     castShadows_(false),
     occluder_(false),
@@ -109,6 +113,12 @@ Drawable::Drawable(Context* context, unsigned char drawableFlags) :
     maxLights_(0),
     firstLight_(0)
 {
+// ATOMIC BEGIN
+    if (drawableFlags == DRAWABLE_UNDEFINED || drawableFlags > DRAWABLE_ANY)
+    {
+        ATOMIC_LOGERROR("Drawable with undefined drawableFlags");
+    }
+// ATOMIC END
 }
 
 Drawable::~Drawable()

+ 6 - 1
Source/Atomic/Graphics/Drawable.h

@@ -29,6 +29,9 @@
 namespace Atomic
 {
 
+// ATOMIC BEGIN
+static const unsigned DRAWABLE_UNDEFINED = 0x0;
+// ATOMIC END
 static const unsigned DRAWABLE_GEOMETRY = 0x1;
 static const unsigned DRAWABLE_LIGHT = 0x2;
 static const unsigned DRAWABLE_ZONE = 0x4;
@@ -114,7 +117,9 @@ class ATOMIC_API Drawable : public Component
 
 public:
     /// Construct.
-    Drawable(Context* context, unsigned char drawableFlags);
+// ATOMIC BEGIN
+    Drawable(Context* context, unsigned drawableFlags = DRAWABLE_UNDEFINED);
+// ATOMIC END
     /// Destruct.
     virtual ~Drawable();
     /// Register object attributes. Drawable must be registered first.

+ 1 - 1
Source/Atomic/Graphics/LMStaticModel.cpp

@@ -6,7 +6,7 @@
 #include "../Core/Context.h"
 #include "../Resource/ResourceCache.h"
 #include "../Graphics/Technique.h"
-#include "../Atomic3D/LMStaticModel.h"
+#include "LMStaticModel.h"
 
 namespace Atomic
 {

+ 2 - 0
Source/Atomic/Graphics/Texture.h

@@ -38,6 +38,8 @@ class XMLFile;
 /// Base class for texture resources.
 class ATOMIC_API Texture : public Resource, public GPUObject
 {
+    ATOMIC_OBJECT(Texture, Resource)
+
 public:
     /// Construct.
     Texture(Context* context);

+ 2 - 2
Source/Atomic/IPC/IPC.cpp

@@ -53,7 +53,7 @@ IPC::IPC(Context* context) : Object(context),
     jobHandle_ = CreateJobObject(NULL, NULL);
     if (!jobHandle_)
     {
-        LOGERROR("IPC::IPC - Unable to create IPC job");
+        ATOMIC_LOGERROR("IPC::IPC - Unable to create IPC job");
     }
     else
     {
@@ -63,7 +63,7 @@ IPC::IPC(Context* context) : Object(context),
         jeli.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
         if (0 == SetInformationJobObject(jobHandle_, JobObjectExtendedLimitInformation, &jeli, sizeof(jeli)))
         {
-            LOGERROR("IPC::IPC - Unable set job information");
+            ATOMIC_LOGERROR("IPC::IPC - Unable set job information");
             jobHandle_ = 0;
         }
     }

+ 1 - 1
Source/Atomic/IPC/IPCWindows.cpp

@@ -315,7 +315,7 @@ bool IPCProcess::Launch(const String& command, const Vector<String>& args, const
     {
         if (0 == AssignProcessToJobObject(jobHandle, pi.hProcess))
         {
-            LOGERROR("IPCProcess::Launch - unable to assign job");
+            ATOMIC_LOGERROR("IPCProcess::Launch - unable to assign job");
         }
     }
 

+ 1 - 1
Source/Atomic/IPC/IPCWindows.h

@@ -114,7 +114,7 @@ private:
 
 class IPCProcess : public Object
 {
-    OBJECT(IPCProcess)
+    ATOMIC_OBJECT(IPCProcess, Object)
 
     public:
 

+ 2 - 2
Source/Atomic/IPC/IPCWorker.cpp

@@ -46,12 +46,12 @@ IPCWorker::IPCWorker(Context* context, IPCHandle clientRead, IPCHandle clientWri
 
 	if (!transport_.OpenClient(clientRead, clientWrite))
 	{
-		LOGERRORF("Unable to open IPC transport clientRead = %i", clientRead);
+        ATOMIC_LOGERRORF("Unable to open IPC transport clientRead = %i", clientRead);
 		shouldRun_ = false;
 		return;
 	}
 
-	LOGERRORF("Opened IPC transport fd = %i", clientRead);
+    ATOMIC_LOGERRORF("Opened IPC transport fd = %i", clientRead);
 
 #endif
 

+ 1 - 1
Source/Atomic/UI/UIDragDropWindows.cpp

@@ -346,7 +346,7 @@ namespace Atomic
 
     class UIDragDropWindows : public Object
     {
-        OBJECT(UIDragDropWindows);
+        ATOMIC_OBJECT(UIDragDropWindows, Object);
 
     public:
         /// Construct.

+ 4 - 4
Source/AtomicApp/Player/IPCPlayerApp.cpp

@@ -76,7 +76,7 @@ namespace Atomic
         }
 
         String resourcePrefix;
-        engineParameters_["ResourcePrefixPath"] = "";
+        engineParameters_["ResourcePrefixPaths"] = "";
 
         for (unsigned i = 0; i < arguments_.Size(); ++i)
         {
@@ -96,7 +96,7 @@ namespace Atomic
                 else if (argument == "--resourceprefix" && value.Length())
                 {
                     resourcePrefix = value;
-                    engineParameters_["ResourcePrefixPath"] = resourcePrefix;
+                    engineParameters_["ResourcePrefixPaths"] = resourcePrefix;
                 }
                 else if (argument == "--project" && value.Length())
                 {
@@ -119,11 +119,11 @@ namespace Atomic
 #else
 
 #ifdef __APPLE__
-                    engineParameters_["ResourcePrefixPath"] = "../Resources";
+                    engineParameters_["ResourcePrefixPaths"] = "../Resources";
 #else
                     if (!resourcePrefix.Length())
                     {
-                        engineParameters_["ResourcePrefixPath"] = fileSystem->GetProgramDir() + "Resources";
+                        engineParameters_["ResourcePrefixPaths"] = fileSystem->GetProgramDir() + "Resources";
                     }
 
 #endif

+ 3 - 3
Source/AtomicApp/Player/PlayerApp.cpp

@@ -78,12 +78,12 @@ namespace Atomic
 #if ATOMIC_PLATFORM_WINDOWS || ATOMIC_PLATFORM_LINUX
 
         engineParameters_.InsertNew("WindowIcon", "Images/AtomicLogo32.png");
-        engineParameters_.InsertNew("ResourcePrefixPath", "AtomicPlayer_Resources");
+        engineParameters_.InsertNew("ResourcePrefixPaths", "AtomicPlayer_Resources");
 
 #elif ATOMIC_PLATFORM_ANDROID
-        //engineParameters_.InsertNew("ResourcePrefixPath"], "assets");
+        //engineParameters_.InsertNew("ResourcePrefixPaths"], "assets");
 #elif ATOMIC_PLATFORM_OSX
-        engineParameters_.InsertNew("ResourcePrefixPath", "../Resources");
+        engineParameters_.InsertNew("ResourcePrefixPaths", "../Resources");
 #endif
 
         // Setup player log

+ 3 - 3
Source/AtomicEditor/Application/AEEditorApp.cpp

@@ -118,7 +118,7 @@ namespace AtomicEditor
 #endif
 
 #ifdef ATOMIC_DEV_BUILD
-        engineParameters_["ResourcePrefixPath"] = "";
+        engineParameters_["ResourcePrefixPaths"] = "";
         String resourcePaths = env->GetCoreDataDir() + ";" + env->GetEditorDataDir();
         // for dev builds, add the compile editor scripts from artifacts
         resourcePaths += ";" + env->GetRootSourceDir() + "Artifacts/Build/Resources/EditorData/";
@@ -126,10 +126,10 @@ namespace AtomicEditor
 #else
 
 #ifdef ATOMIC_PLATFORM_OSX
-        engineParameters_["ResourcePrefixPath"] = "../Resources";
+        engineParameters_["ResourcePrefixPaths"] = "../Resources";
 
 #else
-        engineParameters_["ResourcePrefixPath"] = filesystem->GetProgramDir() + "Resources";
+        engineParameters_["ResourcePrefixPaths"] = filesystem->GetProgramDir() + "Resources";
 #endif
 
         engineParameters_["ResourcePaths"] = "CoreData;EditorData";

+ 1 - 1
Source/AtomicNET/NETNative/NETServiceApplication.cpp

@@ -59,7 +59,7 @@ namespace Atomic
         engineParameters_["Headless"] = true;
 
         // FIXME AtomicNET:
-        engineParameters_["ResourcePrefixPath"] = "C:/Dev/atomic/AtomicGameEngine/Resources/";
+        // engineParameters_["ResourcePrefixPaths"] = "C:/Dev/atomic/AtomicGameEngine/Resources/";
 
         FileSystem* filesystem = GetSubsystem<FileSystem>();
         engineParameters_.InsertNew("LogName", filesystem->GetAppPreferencesDir("AtomicEditor", "Logs") + "NETServiceApplication.log");

+ 3 - 3
Source/AtomicPlayer/Application/AtomicPlayer.cpp

@@ -98,12 +98,12 @@ void AtomicPlayerApp::Setup()
 #if ATOMIC_PLATFORM_WINDOWS || ATOMIC_PLATFORM_LINUX
 
     engineParameters_.InsertNew("WindowIcon", "Images/AtomicLogo32.png");
-    engineParameters_.InsertNew("ResourcePrefixPath", "AtomicPlayer_Resources");
+    engineParameters_.InsertNew("ResourcePrefixPaths", "AtomicPlayer_Resources");
 
 #elif ATOMIC_PLATFORM_ANDROID
-    //engineParameters_.InsertNew("ResourcePrefixPath"], "assets");
+    //engineParameters_.InsertNew("ResourcePrefixPaths"], "assets");
 #elif ATOMIC_PLATFORM_OSX
-    engineParameters_.InsertNew("ResourcePrefixPath", "../Resources");
+    engineParameters_.InsertNew("ResourcePrefixPaths", "../Resources");
 #endif
 
     const Vector<String>& arguments = GetArguments();

+ 2 - 2
Source/AtomicWebView/WebKeyboardWindows.cpp

@@ -94,7 +94,7 @@ bool ConvertKeyEvent(Input* input, const StringHash eventType, VariantMap& event
 {
     if (eventType != "KeyDown" && eventType != "KeyUp")
     {
-        LOGERROR("ConvertKeyEvent - Unknown event type");
+        ATOMIC_LOGERROR("ConvertKeyEvent - Unknown event type");
         return false;
     }
 
@@ -138,7 +138,7 @@ bool ConvertTextInputEvent(StringHash eventType, VariantMap& eventData, CefKeyEv
 {
     if (eventType != "TextInput")
     {
-        LOGERROR("ConvertTextInputEvent - Unknown event type");
+        ATOMIC_LOGERROR("ConvertTextInputEvent - Unknown event type");
         return false;
     }
 

+ 7 - 1
Source/AtomicWebView/WebTexture2D.cpp

@@ -209,6 +209,8 @@ public:
 
     void D3D9Blit(const IntRect& dstRect, unsigned char* src, unsigned srcStride, bool discard = false)
     {
+#ifndef ATOMIC_D3D11
+
         RECT d3dRect;
 
         d3dRect.left = dstRect.left_;
@@ -224,7 +226,7 @@ public:
 
         if (FAILED(object->LockRect(level, &d3dLockedRect, (flags & D3DLOCK_DISCARD) ? 0 : &d3dRect, flags)))
         {
-            LOGERROR("WebTexture2D - Could not lock texture");
+            ATOMIC_LOGERROR("WebTexture2D - Could not lock texture");
             return;
         }
 
@@ -239,11 +241,13 @@ public:
         }
 
         object->UnlockRect(level);
+#endif
     }
 
     void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList &dirtyRects,
                  const void *buffer, int width, int height) OVERRIDE
     {
+#ifndef ATOMIC_D3D11
 
         if (type == PET_VIEW)
         {
@@ -298,6 +302,8 @@ public:
 
         }
 
+#endif
+
     }
 
 #endif

+ 1 - 1
Source/ThirdParty/LibCpuId/CMakeLists.txt

@@ -24,7 +24,7 @@
 set (TARGET_NAME LibCpuId)
 
 # Define generated source files
-if (MSVC AND URHO3D_64BIT)
+if (MSVC AND ATOMIC_64BIT)
     enable_language (ASM_MASM)
     # Commented out due to cmake bug
     #set (ASM_FILES src/masm-x64.asm)

+ 8 - 8
Source/ThirdParty/SDL/CMakeLists.txt

@@ -93,8 +93,8 @@ set(LT_VERSION "${LT_MAJOR}.${LT_AGE}.${LT_REVISION}")
 # General settings & flags
 # Urho3D - commented out LIBRARY_OUTPUT_DIRECTORY configuration so that it does not mess up with our global configuration setup
 # Check for 64 or 32 bit
-# Urho3D - bug fix - using CMAKE_SIZEOF_VOID_P is not accurate in a situation where a multilib-capable compiler is chosen and user has opted to use non-native ABI; instead using URHO3D_64BIT build option as it also captures the user intention
-if(URHO3D_64BIT)
+# Urho3D - bug fix - using CMAKE_SIZEOF_VOID_P is not accurate in a situation where a multilib-capable compiler is chosen and user has opted to use non-native ABI; instead using ATOMIC_64BIT build option as it also captures the user intention
+if(ATOMIC_64BIT)
   set(ARCH_64 TRUE)
   set(PROCESSOR_ARCH "x64")
 else()
@@ -308,16 +308,16 @@ endforeach()
 # Urho3D - bug fix - only make the COCOA option available on OSX platform but not iOS/tvOS; it does not make too much sense now for user to disable it because SDL/Apple has dropped support for XQuartz (X11 on Mac), so Cocoa is the only video driver available
 #          But we still keep it as an option here because it should be possible to add back the XQuartz support
 dep_option(VIDEO_COCOA         "Use Cocoa video driver" ON "APPLE AND NOT IOS AND NOT TVOS" OFF)
-# Urho3D - only make DIRECTX option available on Windows platform when URHO3D_OPENGL is enabled, i.e. DIRECTX variable must always be ON (not an option) when URHO3D_OPENGL is disabled because in this case it must depend on Direct3D which is a component of DirectX
+# Urho3D - only make DIRECTX option available on Windows platform when ATOMIC_OPENGL is enabled, i.e. DIRECTX variable must always be ON (not an option) when ATOMIC_OPENGL is disabled because in this case it must depend on Direct3D which is a component of DirectX
 if (WINDOWS)
-  dep_option(DIRECTX           "Use DirectX for Windows audio/video" ON URHO3D_OPENGL ON)
+  dep_option(DIRECTX           "Use DirectX for Windows audio/video" ON ATOMIC_OPENGL ON)
 else ()
   set (DIRECTX OFF)  # Make it off explicitly when not targeting Windows platform, just in case user passes it in accidentally via CLI
 endif ()
-# Urho3D - commented out RENDER_D3D as an option to avoid potential conflict with our URHO3D_OPENGL and URHO3D_D3D11 build options on Windows platform
+# Urho3D - commented out RENDER_D3D as an option to avoid potential conflict with our ATOMIC_OPENGL and ATOMIC_D3D11 build options on Windows platform
 #          Instead just initialize the variable according to our build options; Urho3D also by default disables the SDL renderer subsystem
 if (WINDOWS)
-  if (URHO3D_OPENGL)
+  if (ATOMIC_OPENGL)
     set (RENDER_D3D FALSE)
   else ()
     set (RENDER_D3D TRUE)
@@ -435,7 +435,7 @@ if(ASSEMBLY)
 
     # Urho3D - commented out the HAVE_SSEMATH variable as it is not being used anywhere currently; furthermore compiler already emits __SSE_MATH__ or __SSE2_MATH__ as necessary on x86_64 ABI only; so instead of using HAVE_SSEMATH variable, we should actually use the __SSE_MATH__ or __SSE2_MATH__ compiler define if that is the original intention of having this variable
 
-    if(URHO3D_ALTIVEC)
+    if(ATOMIC_ALTIVEC)
       set(SDL_ALTIVEC_BLITTERS 1)
     endif()
   elseif(MSVC_VERSION GREATER 1500)
@@ -979,7 +979,7 @@ elseif(UNIX)    # Urho3D - at this point both UNIX and UNIX_SYS should be equiva
     # Urho3D - bug fix - dbus/dbus.h is installed under path suffix 'dbus-1.0', so the following find_path() is needed even when not cross-compiling
     find_path (DBUS_H_INCLUDE_DIRS NAMES dbus/dbus.h PATH_SUFFIXES dbus-1.0)
     # Cater for both multilib and multiarch, native and cross-compiling build
-    if (URHO3D_64BIT)
+    if (ATOMIC_64BIT)
       set (DBUS_INC_SEARCH_PATH /usr/lib64/dbus-1.0/include)
     else ()
       set (DBUS_INC_SEARCH_PATH /usr/lib/dbus-1.0/include)

+ 1 - 1
Source/ThirdParty/STB/CMakeLists.txt

@@ -24,7 +24,7 @@
 set (TARGET_NAME STB)
 
 # Define source files
-define_source_files (GLOB_CPP_PATTERNS *.c *.h)
+define_source_files (GLOB_CPP_PATTERNS *.c *.cpp *.h)
 
 # Setup target
 setup_library ()

+ 2 - 2
Source/ThirdParty/STB/stb_image_write.c → Source/ThirdParty/STB/stb_image_write.cpp

@@ -1,5 +1,5 @@
 #include "stb_image_write.h"
-
+#include "../../Atomic/Container/Str.h"
 #define STB_IMAGE_WRITE_IMPLEMENTATION
 
 #ifdef STB_IMAGE_WRITE_IMPLEMENTATION
@@ -79,7 +79,7 @@ static int stbi__start_write_file(stbi__write_context *s, const char *filename)
 #ifndef _WIN32
    FILE *f = fopen(filename, "wb");
 #else
-    Urho3D::WString wstr(filename);
+    Atomic::WString wstr(filename);
     FILE *f = _wfopen(wstr.CString(), L"wb");
 #endif
    stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f);

+ 2 - 2
Source/ToolCore/Build/BuildBase.cpp

@@ -73,7 +73,7 @@ bool BuildBase::BuildClean(const String& path)
 {
     if (buildFailed_)
     {
-        LOGERRORF("BuildBase::BuildClean - Attempt to clean directory of failed build, %s", path.CString());
+        ATOMIC_LOGERRORF("BuildBase::BuildClean - Attempt to clean directory of failed build, %s", path.CString());
         return false;
     }
 
@@ -107,7 +107,7 @@ bool BuildBase::BuildClean(const String& path)
         }
         else
         {
-            LOGWARNINGF("BuildBase::BuildClean - temp build folder exists, removing: %s", newPath.CString());
+            ATOMIC_LOGWARNINGF("BuildBase::BuildClean - temp build folder exists, removing: %s", newPath.CString());
             fileSystem->RemoveDir(newPath, true);
         }
 

+ 1 - 1
Source/ToolCore/Build/BuildWindows.cpp

@@ -142,7 +142,7 @@ void BuildWindows::BuildManaged(const String& buildPath)
             return;
 
     }
-    if (!BuildCopyFile(project->GetResourcePath() + "/AtomicProject.dll", buildPath_ + "/AtomicProject.dll"));
+    if (!BuildCopyFile(project->GetResourcePath() + "/AtomicProject.dll", buildPath_ + "/AtomicProject.dll"))
         return;
 
    

+ 1 - 0
Source/ToolCore/JSBind/JSBModule.cpp

@@ -491,6 +491,7 @@ bool JSBModule::Load(const String& jsonFilename)
     if (name_ == "Graphics")
     {
 #ifdef _MSC_VER
+        JSBind* jsbind = GetSubsystem<JSBind>();
         if (jsbind->GetPlatform() == "ANDROID" || jsbind->GetPlatform() == "WEB")
         {
             sourceDirs_.Push("Source/Atomic/Graphics/OpenGL");

+ 9 - 9
Source/ToolCore/NETTools/NETProjectSystem.cpp

@@ -169,7 +169,7 @@ namespace ToolCore
 
             if (build)
             {
-                build->SubscribeToEvent(E_NETBUILDRESULT, HANDLER(NETProjectSystem, HandleNETBuildResult));
+                build->SubscribeToEvent(E_NETBUILDRESULT, ATOMIC_HANDLER(NETProjectSystem, HandleNETBuildResult));
             }
 
         }
@@ -297,18 +297,18 @@ namespace ToolCore
 
 #ifdef ATOMIC_PLATFORM_WINDOWS
 
-        SubscribeToEvent(E_UPDATE, HANDLER(NETProjectSystem, HandleUpdate));
+        SubscribeToEvent(E_UPDATE, ATOMIC_HANDLER(NETProjectSystem, HandleUpdate));
 
-        SubscribeToEvent(E_PROJECTLOADED, HANDLER(NETProjectSystem, HandleProjectLoaded));
-        SubscribeToEvent(E_PROJECTUNLOADED, HANDLER(NETProjectSystem, HandleProjectUnloaded));
+        SubscribeToEvent(E_PROJECTLOADED, ATOMIC_HANDLER(NETProjectSystem, HandleProjectLoaded));
+        SubscribeToEvent(E_PROJECTUNLOADED, ATOMIC_HANDLER(NETProjectSystem, HandleProjectUnloaded));
 
-        SubscribeToEvent(E_FILECHANGED, HANDLER(NETProjectSystem, HandleFileChanged));
+        SubscribeToEvent(E_FILECHANGED, ATOMIC_HANDLER(NETProjectSystem, HandleFileChanged));
 
-        SubscribeToEvent(E_RESOURCEADDED, HANDLER(NETProjectSystem, HandleResourceAdded));
-        SubscribeToEvent(E_RESOURCEREMOVED, HANDLER(NETProjectSystem, HandleResourceRemoved));
+        SubscribeToEvent(E_RESOURCEADDED, ATOMIC_HANDLER(NETProjectSystem, HandleResourceAdded));
+        SubscribeToEvent(E_RESOURCEREMOVED, ATOMIC_HANDLER(NETProjectSystem, HandleResourceRemoved));
 
-        SubscribeToEvent(E_ASSETRENAMED, HANDLER(NETProjectSystem, HandleAssetRenamed));
-        SubscribeToEvent(E_ASSETMOVED, HANDLER(NETProjectSystem, HandleAssetMoved));
+        SubscribeToEvent(E_ASSETRENAMED, ATOMIC_HANDLER(NETProjectSystem, HandleAssetRenamed));
+        SubscribeToEvent(E_ASSETMOVED, ATOMIC_HANDLER(NETProjectSystem, HandleAssetMoved));
 
         FileSystem* fileSystem = GetSubsystem<FileSystem>();