diff --git a/projects/kiwano.vcxproj b/projects/kiwano.vcxproj
index 6284642f..4cf344f9 100644
--- a/projects/kiwano.vcxproj
+++ b/projects/kiwano.vcxproj
@@ -29,7 +29,6 @@
-
diff --git a/projects/kiwano.vcxproj.filters b/projects/kiwano.vcxproj.filters
index 7dadb0ef..610fd3e5 100644
--- a/projects/kiwano.vcxproj.filters
+++ b/projects/kiwano.vcxproj.filters
@@ -51,9 +51,6 @@
2d
-
- 2d
-
2d
diff --git a/scripts/appveyor/clear_project_configuration.ps1 b/scripts/appveyor/clear_project_configuration.ps1
index 1bc7f59f..2cb25d9e 100644
--- a/scripts/appveyor/clear_project_configuration.ps1
+++ b/scripts/appveyor/clear_project_configuration.ps1
@@ -3,7 +3,13 @@ $replaceTo = "None"
Get-ChildItem -Path 'projects\' *.vcxproj | ForEach-Object {
$filePath = 'projects\' + $_
+
+ # Create a copy of .vcxproj file
Copy-Item -Path $filePath -Destination ($filePath + '.template')
+
+ # Overlay some configurations
Get-Content ($filePath + '.template') -Encoding UTF8 | ForEach-Object { $_ -replace $replace, $replaceTo } | Out-File $filePath -Encoding UTF8
+
+ # Delete the copy file
Remove-Item -Path ($filePath + '.template')
}
diff --git a/scripts/appveyor/coapp_make.ps1 b/scripts/appveyor/coapp_make.ps1
index c557453a..b5a57aa1 100644
--- a/scripts/appveyor/coapp_make.ps1
+++ b/scripts/appveyor/coapp_make.ps1
@@ -25,11 +25,17 @@ Write-Host "Start to build nupkg files"
# This is the CoApp .autopkg file to create.
$autopkgFile = "scripts\coapp\kiwano.autopkg"
+# Create a copy of ".autopkg" file
+Copy-Item -Path $autopkgFile -Destination ($autopkgFile + '.template')
+
# Get the ".autopkg.template" file, replace "@appveyor_version" with the Appveyor version number, then save to the ".autopkg" file.
-Get-Content ($autopkgFile + ".template") | ForEach-Object { $_ -replace "@appveyor_version", $env:appveyor_build_version } > $autopkgFile
+Get-Content ($autopkgFile + ".template") -Encoding UTF8 | ForEach-Object { $_ -replace "@appveyor_version", $env:appveyor_build_version } | Out-File $autopkgFile -Encoding UTF8
+
+# Delete the copy file
+Remove-Item -Path ($autopkgFile + '.template')
# Use the CoApp tools to create NuGet native packages from the .autopkg.
Write-NuGetPackage $autopkgFile
# Push all newly created .nupkg files as Appveyor artifacts for later deployment.
-Get-ChildItem .\*.nupkg | ForEach-Object { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
\ No newline at end of file
+Get-ChildItem .\*.nupkg | ForEach-Object { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
diff --git a/scripts/coapp/kiwano.autopkg.template b/scripts/coapp/kiwano.autopkg
similarity index 99%
rename from scripts/coapp/kiwano.autopkg.template
rename to scripts/coapp/kiwano.autopkg
index 3d9cc68e..8e763bcb 100644
--- a/scripts/coapp/kiwano.autopkg.template
+++ b/scripts/coapp/kiwano.autopkg
@@ -1,4 +1,4 @@
-#defines {
+#defines {
// Global variables may be added here.
// Variables on the "value" side of each definition will be processed at access time.
// GlobalVar1 = "";
diff --git a/src/kiwano/2d/DebugActor.cpp b/src/kiwano/2d/DebugActor.cpp
index a2242f93..6b86aa4c 100644
--- a/src/kiwano/2d/DebugActor.cpp
+++ b/src/kiwano/2d/DebugActor.cpp
@@ -21,13 +21,29 @@
#include "DebugActor.h"
#include "Text.h"
#include "../renderer/Renderer.h"
-#include
#include
#pragma comment(lib, "psapi.lib")
namespace kiwano
{
+ namespace
+ {
+ class comma_numpunct : public std::numpunct
+ {
+ protected:
+ virtual wchar_t do_thousands_sep() const override
+ {
+ return L',';
+ }
+
+ virtual std::string do_grouping() const override
+ {
+ return "\03";
+ }
+ };
+ }
+
DebugActor::DebugActor()
: background_color_(0.0f, 0.0f, 0.0f, 0.7f)
{
@@ -41,6 +57,7 @@ namespace kiwano
this->AddChild(debug_text_);
Font font;
+ font.family = L"Arial";
font.size = 16.f;
font.weight = FontWeight::Normal;
debug_text_->SetFont(font);
@@ -61,11 +78,7 @@ namespace kiwano
{
PrepareRender(renderer);
- renderer->GetSolidColorBrush()->SetColor(DX::ConvertToColorF(background_color_));
- renderer->GetD2DDeviceResources()->GetDeviceContext()->FillRoundedRectangle(
- D2D1::RoundedRect(DX::ConvertToRectF(GetBounds()), 5.f, 5.f),
- renderer->GetSolidColorBrush()
- );
+ renderer->FillRoundedRectangle(GetBounds(), Vec2{ 5.f, 5.f }, background_color_);
}
void DebugActor::OnUpdate(Duration dt)
@@ -77,8 +90,15 @@ namespace kiwano
{
frame_time_.erase(frame_time_.begin());
}
-
- std::wstringstream ss;
+
+ StringStream ss;
+
+ {
+ // For formatting integers with commas
+ static std::locale comma_locale(std::locale(), new comma_numpunct);
+ (void)ss.imbue(comma_locale);
+ }
+
ss << "Fps: " << frame_time_.size() << std::endl;
#if defined(KGE_DEBUG)
@@ -90,11 +110,21 @@ namespace kiwano
ss << "Render: " << Renderer::GetInstance()->GetStatus().duration.Milliseconds() << "ms" << std::endl;
- ss << "Primitives / sec: " << Renderer::GetInstance()->GetStatus().primitives * frame_time_.size() << std::endl;
+ ss << "Primitives / sec: " << std::fixed << Renderer::GetInstance()->GetStatus().primitives * frame_time_.size() << std::endl;
- PROCESS_MEMORY_COUNTERS_EX pmc;
- GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&pmc, sizeof(pmc));
- ss << "Memory: " << pmc.PrivateUsage / 1024 << "kb";
+ ss << "Memory: ";
+ {
+ PROCESS_MEMORY_COUNTERS_EX pmc;
+ GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&pmc, sizeof(pmc));
+
+ if (pmc.PrivateUsage > 1024 * 1024)
+ {
+ ss << pmc.PrivateUsage / (1024 * 1024) << "Mb ";
+ pmc.PrivateUsage %= (1024 * 1024);
+ }
+
+ ss << pmc.PrivateUsage / 1024 << "Kb";
+ }
debug_text_->SetText(ss.str());
SetSize(Size{ 20 + debug_text_->GetSize().x, 20 + debug_text_->GetSize().y });
diff --git a/src/kiwano/base/Logger.cpp b/src/kiwano/base/Logger.cpp
index 02cb9fed..5ec38c4d 100644
--- a/src/kiwano/base/Logger.cpp
+++ b/src/kiwano/base/Logger.cpp
@@ -279,7 +279,7 @@ namespace kiwano
{
static WChar temp_buffer[1024 * 3 + 1];
- std::wstringstream ss;
+ StringStream ss;
ss << Logger::OutPrefix;
if (prompt)
diff --git a/src/kiwano/base/Logger.h b/src/kiwano/base/Logger.h
index b4934b97..60159af5 100644
--- a/src/kiwano/base/Logger.h
+++ b/src/kiwano/base/Logger.h
@@ -263,7 +263,7 @@ namespace kiwano
template
std::wstring Logger::MakeOutputString(const WChar* prompt, _Args&& ... args) const
{
- std::wstringstream ss;
+ StringStream ss;
ss << Logger::OutPrefix;
if (prompt)
diff --git a/src/kiwano/core/core.h b/src/kiwano/core/core.h
index ea5f63d8..23ade2dd 100644
--- a/src/kiwano/core/core.h
+++ b/src/kiwano/core/core.h
@@ -33,6 +33,7 @@
#include
#include
#include
+#include
namespace kiwano
{
diff --git a/src/kiwano/renderer/Font.h b/src/kiwano/renderer/Font.h
index d9e01df1..c703c6d0 100644
--- a/src/kiwano/renderer/Font.h
+++ b/src/kiwano/renderer/Font.h
@@ -43,15 +43,15 @@ namespace kiwano
public:
String family; // ×ÖÌå×å
Float32 size; // ×ÖºÅ
- UInt32 weight; // ´Öϸֵ
+ UInt32 weight; // ´Öϸֵ
bool italic; // ÊÇ·ñбÌå
FontCollection collection; // ×ÖÌ弯
public:
Font(
const String& family = L"",
- Float32 size = 18,
- UInt32 weight = FontWeight::Normal,
+ Float32 size = 18,
+ UInt32 weight = FontWeight::Normal,
bool italic = false,
FontCollection collection = FontCollection()
);