Monthly Log 2016. 5.

### May 2016

#### 2016-05-29 Multithreading improvements, Material hot reloading, Shader sharing etc...
* Engine
  * Core Layer
    * FBCommonHeaders
      * ValidCStringLength() function's name changed to ValidCString() and
      optimized not to check all the length of the string.
      * Added template class LockQueue. Since smart pointers cannot be used
      with LockFreeQueue, LockQueue is needed.
      * For LockFreeQueue the template type T muse have
      * a copy constructor
      * a trivial assignment operator
      * a trivial destructor
      * LockQueue doesn't have these restrictions.
      * Fixed a bug in GenericListener destructor
      * Added template class QuadNode
      * Added RAII type guard for SpinLock, struct EnterSpinLock

      * FBDebugLib
        * Logger now can take any length of string and multithread safe.

    * FBStringLib
      * Added functions
      * std::wstring AnsiToWideMT(const char* source) : Safe for
      * std::string ToUpperCase(const char* sz)
      * bool EndsWith(const std::string& str, const char* pattern, bool
      * Split(...) now generate empty strings for consecutive delimiters.
      Split("aa,,,aa") -> {"aa", "", "", "aa"}
      * int StringConverter::ParseInt(const TString& val, int defaultValue)
      now can parse hexa value. It should start with '0x'

    * FBFileSystem
      * Supports resource paths - for more detail, refer to (It's Korean.)
      * File::IsAbsolute() is added
      * File::LoadBinary() is removed. Instead File::ReadBinary() is added and
      it uses FileSystem::ReadBinaryFile() internally
      * FileSystem::Exists() now handles exception cases for example
      'permission denied'.
      * Added funcions(Resource path related functions are not included)
      * FileSystem::RemoveAll() : remove all files in a folder recursively.
      * FileSystem::bool WriteTextFile(const char* path, const char* data,
      size_t length) : Write ascii file
      * std::string GetFirstDirectory(const char* path) : Return the first
      starting directory. ex) myfolder/anotherfolder/myfile.txt -> myfolder
      * FileSystem::File::Reset(const char* path, const char* mode) : Close
      the current file and reopen another one.

    * FBMathLib
      * Color ramp interpolation method has changed to put some gradient area
      between color bars.
      * Frustum
      * Frustum now support orthogonal.
      * void Frustum::_Validate() : Debug function to validte the Frustum
      * std::vector<Vec3> Frustum::ToPoints() const : Getting 8 corner points
      * GeomUtils::CreateSphere(Real radius, int nRings, int nSegments,
      Vec3::Array& pos, std::vector<unsigned short>& index) now generate
      triangle strip indexed mesh.
      * Added template class InterpolateWrap and class InterpolateWrapManager
      * InterpolateWrap wraps a value(like Real or Vec3 etc...) and
      interpolates to the dest value with a given duration.
      * Good example for using this class is for smooth moving of camera.
      * Added class NoiseGen : Generate 1d and 3d noise for now. 2d is going
      to be added.
      * Vec3 Plane::ProjectPoint(const Vec3& p) const is added.
      * Serialization method for math classes is changed.
      * Previous : Vec3().write(std::stream&)
      * Now : write(std::stream&, const Vec3&)
      * Added functions in class Transformation
      * Frustum Transformation::ApplyForward(const Frustum& f) const
      * Plane Transformation::ApplyInverse(const Plane& inputPlane) const
      * Frustum Transformation::ApplyInverse(const Frustum& f) const
      * Added class Vec3d : internal data type is double.

    * FBNetwork
      * const ByteArray& Connection::GetStringBuffer() function added : This
      function will append null character at the end of the retrieved data.

    * FBFileMonitor
      * Support codes for resource paths

    * FBThread
      * This month the Task system(Task Scheduler) is intensively tested and
      fixed most bugs. Now it seems stable.
      * FBThread now became a dll project. Previously it was a library. Name
      is also changed to 'FBThread' from 'FBThreadLib'.
      * This modification is for sharing the same task scheduler across all
      other binary projects. Calling TaskScheduler::GetInstance() will give
      you the main TaskScheduler.
      * You can still create several TaskScheduler if you need to do. In this
      case you need to keep the TaskScheduler pointer from the factory
      function TaskScheduler::Create(...)
      * Fixed bugs on FB_READ_WRITE_CS
      * Added class Invoker
      * This object can be used for invoking a functor(or lambda expression)
      in the main thread after a task in another thread is done.
      * Invoker::InvokeAtStart(functor or lambda)
      * Registered functors will be executed in the main thread at the end of
      the frame.
      * TaskScheduler improvements
      * Removed unnecessary calls for SliceSchedule()
      * Task Queue is now using LockQueue. Previously it was using
      LockFreeQueue but crash occured rarely because the usage condition for
      LockFreeQueue was not met.
      * Added functions
      * bool TaskScheduler::IsFull() const;
      * bool TaskScheduler::IsHalfFull() const;

    * FBTimer
      * Now Timer::GetFrame() is thread safe.
      * Added Timer::GetPosixTime() const

  * Engine Layer

    * FBRenderer
      * Now supports compute shaders. Cache name: *.cscache
      * Shader::RunComputeShader(...)
      * Shader::QueueRunComputeShader(...)
      * Added seperated shader generation function : CreateVertexShader(),
      CreateGeometryShader(), CreatePixelShader() etc...
      * This is to support fine grained shader sharing: one vertex shader can
      be used with two different pixel shaders.
      * Still supporting integrated shader generation : CreateShader()
      * Shader hot reloading when the include files are changed. Previously
      only changing in main shader file only trigger the reloading.
      Include information is cached in *.includes files.
      * Now supports Material hot-reloading.
      * <MaterialParamter> tag for .material files changed name to
      * Now renderer resource paths should consider case. Not ignoring case
      * Renderer::CreateTexture(filepath, ...) now recieve the parameter
      'struct TextureCreationOption'
      * Renderer::CreateTexture(data, ...) now recieve the number of LOD for
      the data.
      * enum BINDING_SHADER name changed to enum SHADER_TYPE
      * Camera
      * Camera::Clone() is added for cloning a camera.
      * Camera::SetProportionalMove(bool) is added. If true, camera will move
      slower at the short distance from the camera target.
      * Smooth camera movement using class InterpolateWrap
      * Added camera frustum rendering. Use console command : r_renderFrustum
      * Added GeometryBuffer for creating simple meshes : now only supports
      * GeometryBuffer has only three data memebers : a vertex buffer, a index
      buffer and a topology type.
      * Added drawing functions
      * void Renderer::DrawFrustum(const Frustum& frustum);
      * void Renderer::DrawLine(const Vec3& start, const Vec3& end, const
      Color& color0, const Color& color1);
      * void Renderer::DrawBox(const Vec3::Array& corners, const Color&
      * void Renderer::DrawPoints(const Vec3::Array& points, const Color&
      * Rendering current axis: use r_renderAxis console command
      * Render state stack : make a snapshot of the current render
      states(Rasterizer, Blend, DepthStencil)
      * void Renderer::PushRenderStates();
      * void Renderer::PopRenderStates();
      * Added TextureCreationFlag
      * TEXTURE_TYPE_1D : generating 1d texture. The height should be 1.
      * TEXTURE_TYPE_SECOND_DEVICE : If the texture will be bound to the
      second device(now second device is for compute shaders), should specify
      this flag.
    * FBRendererD3D11
      * Added compute shader supports. Cache name: *.cscache
      * Shader hot reloading when the include files are changed. Previously
      only changing in main shader file only trigger the reloading.
      Include information is cached in *.includes files.

  * Facade Layer

    * FBEngineFacade
      * Added support codes for Invokers
      * Added support codes for Resource paths
      * Before you quit your application you need to call
      EngineFacade::PrepareQuit(). This function will clean multi threading
      garbages in TaskScheduler or Invoker etc...

    * FBUI
      * Added lua interface
      * int SetEnableUIRenderTarget(lua_State* L)

  * Tests

    * EngineTest
      * Added test for compute shaders.
      * Added test for Task and TaskScheduler.
      * Added test for Noise generation.

  * 390 files changed, 12387 insertions(+), 6889 deletions(-)

#### 2016-05-30
* Game
  * Item quality
  * Globe integration
  * 506 files changed, 4491 insertions(+), 19840 deletions(-)
#### 2016-05-31
* Game
  * Weapon items became actors to support item quality.
  * 49 files changed, 1250 insertions(+), 913 deletions(-)