Windows build fixes and warning avoidance

This commit is contained in:
Jack Andersen 2018-05-24 20:39:09 -10:00
parent 83153386ed
commit c3b0e8a241
22 changed files with 22 additions and 35 deletions

View File

@ -66,7 +66,6 @@ list(APPEND SPECTER_HEADERS
atdna(atdna_FontCache.cpp include/specter/FontCache.hpp)
list(APPEND SPECTER_SOURCES
lib/specter.cpp
lib/ViewResources.cpp
lib/View.cpp
lib/RootView.cpp
@ -80,15 +79,10 @@ list(APPEND SPECTER_SOURCES
lib/Space.cpp
lib/Toolbar.cpp
lib/Table.cpp
lib/Outliner.cpp
lib/Panel.cpp
lib/Control.cpp
lib/Button.cpp
lib/TextField.cpp
lib/NumericField.cpp
lib/Menu.cpp
lib/Node.cpp
lib/NodeSocket.cpp
lib/PathButtons.cpp
lib/FileBrowser.cpp
lib/Icon.cpp

View File

@ -47,7 +47,7 @@ class PathButtons : public ScrollView
int m_pathButtonPending = -1;
IPathButtonsBinding& m_binding;
bool m_fillContainer;
struct PathButton : IButtonBinding
struct PathButton final : IButtonBinding
{
PathButtons& m_pb;
size_t m_idx;

View File

@ -118,6 +118,7 @@ public:
void destroyed();
bool isDestroyed() const {return m_destroyed;}
void resized(const boo::SWindowRect& rect, bool) { resized(rect, rect); }
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub);
void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods);
void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods);

View File

@ -44,6 +44,7 @@ class Space : public View
void mouseLeave(const boo::SWindowCoord&);
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
using View::resized;
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, bool flip);
void draw(boo::IGraphicsCommandQueue* gfxQ);
};

View File

@ -96,7 +96,7 @@ public:
void init(boo::GLDataFactory::Context& ctx, FontCache* fcache);
#endif
#if _WIN32
void init(boo::ID3DDataFactory::Context& ctx, FontCache* fcache);
void init(boo::D3DDataFactory::Context& ctx, FontCache* fcache);
#endif
#if BOO_HAS_METAL
void init(boo::MetalDataFactory::Context& ctx, FontCache* fcache);

View File

@ -27,7 +27,6 @@ public:
Top
};
private:
Position m_tbPos;
unsigned m_units;
std::vector<std::vector<ViewChild<View*>>> m_children;

View File

@ -209,7 +209,7 @@ public:
void init(boo::GLDataFactory::Context& ctx, const IThemeData& theme);
#endif
#if _WIN32
void init(boo::ID3DDataFactory::Context& ctx, const IThemeData& theme);
void init(boo::D3DDataFactory::Context& ctx, const IThemeData& theme);
#endif
#if BOO_HAS_METAL
void init(boo::MetalDataFactory::Context& ctx, const IThemeData& theme);

View File

@ -378,7 +378,7 @@ FontAtlas::FontAtlas(FT_Face face, uint32_t dpi,
g.m_leftPadding = face->glyph->metrics.horiBearingX >> 6;
g.m_advance = face->glyph->advance.x >> 6;
g.m_verticalOffset = (face->glyph->metrics.horiBearingY - face->glyph->metrics.height) >> 6;
MemcpyRect(m_texmap.data(), &face->glyph->bitmap, m_fullTexmapLayers, curLineWidth, totalHeight);
MemcpyRect((RgbaPixel*)m_texmap.data(), &face->glyph->bitmap, m_fullTexmapLayers, curLineWidth, totalHeight);
curLineWidth += width + 1;
charcode = FT_Get_Next_Char(face, charcode, &gindex);
}
@ -649,7 +649,7 @@ boo::ObjToken<boo::ITextureSA> FontAtlas::texture(boo::IGraphicsDataFactory* gf)
return {};
if (m_tex)
return m_tex;
gf->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
gf->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
{
if (m_subpixel)
const_cast<boo::ObjToken<boo::ITextureSA>&>(m_tex) =
@ -663,7 +663,7 @@ boo::ObjToken<boo::ITextureSA> FontAtlas::texture(boo::IGraphicsDataFactory* gf)
m_texmap.data(), m_texmap.size());
const_cast<std::vector<uint8_t>&>(m_texmap) = std::vector<uint8_t>();
return true;
});
} BooTrace);
return m_tex;
}

View File

@ -27,7 +27,6 @@ IconView::IconView(ViewResources& res, View& parentView, Icon& icon)
void IconView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
{
m_viewVertBlock.setViewRect(root, sub);
float pf = rootView().viewRes().pixelFactor();
m_viewVertBlock.m_mv[0][0] *= sub.size[0];
m_viewVertBlock.m_mv[1][1] *= sub.size[1];
View::resized(m_viewVertBlock, sub);

View File

@ -292,13 +292,13 @@ ModalWindow::ModalWindow(ViewResources& res, View& parentView,
m_windowBgClear[3] = 0.0;
m_line2Clear[3] = 0.0;
res.m_factory->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
res.m_factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
{
buildResources(ctx, res);
m_viewBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory);
m_vertsBinding.init(ctx, res, 38, m_viewBlockBuf);
return true;
});
} BooTrace);
for (int i=0 ; i<4 ; ++i)
{

View File

View File

View File

@ -10,9 +10,9 @@ static logvisor::Module Log("specter::SplitView");
static const zeus::RGBA32 Tex[3] =
{
{0,0,0,64},
{0,0,0,255},
{255,255,255,64}
{{0,0,0,64}},
{{0,0,0,255}},
{{255,255,255,64}}
};
void SplitView::Resources::init(boo::IGraphicsDataFactory::Context& ctx, const IThemeData& theme)

View File

@ -90,7 +90,7 @@ void TextView::Resources::init(boo::GLDataFactory::Context& ctx, FontCache* fcac
#if _WIN32
void TextView::Resources::init(boo::ID3DDataFactory::Context& ctx, FontCache* fcache)
void TextView::Resources::init(boo::D3DDataFactory::Context& ctx, FontCache* fcache)
{
m_fcache = fcache;

View File

@ -23,7 +23,7 @@ void Toolbar::Resources::init(boo::IGraphicsDataFactory::Context& ctx, const ITh
}
Toolbar::Toolbar(ViewResources& res, View& parentView, Position tbPos, unsigned units)
: View(res, parentView), m_tbPos(tbPos), m_units(units),
: View(res, parentView), m_units(units),
m_nomGauge(res.pixelFactor() * SPECTER_TOOLBAR_GAUGE * units),
m_padding(res.pixelFactor() * TOOLBAR_PADDING)
{

View File

@ -94,7 +94,7 @@ void View::Resources::init(boo::GLDataFactory::Context& ctx, const IThemeData& t
#if _WIN32
void View::Resources::init(boo::ID3DDataFactory::Context& ctx, const IThemeData& theme)
void View::Resources::init(boo::D3DDataFactory::Context& ctx, const IThemeData& theme)
{
static const char* SolidVS =
"struct VertData\n"
@ -374,7 +374,7 @@ void View::draw(boo::IGraphicsCommandQueue* gfxQ)
void View::commitResources(ViewResources& res, const boo::FactoryCommitFunc& commitFunc)
{
res.m_factory->BooCommitTransaction(commitFunc);
res.m_factory->commitTransaction(commitFunc BooTrace);
}
void View::VertexBufferBindingSolid::init(boo::IGraphicsDataFactory::Context& ctx,

View File

@ -16,7 +16,7 @@ void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
m_curveFont = fcache->prepCurvesFont(AllCharFilter, false, 8.f, dpi);
factory->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) {
factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) {
switch (ctx.platform())
{
#if BOO_HAS_GL
@ -26,8 +26,7 @@ void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
#endif
#if _WIN32
case boo::IGraphicsDataFactory::Platform::D3D11:
case boo::IGraphicsDataFactory::Platform::D3D12:
init<boo::ID3DDataFactory::Context>(static_cast<boo::ID3DDataFactory::Context&>(ctx), *theme, fcache);
init<boo::D3DDataFactory::Context>(static_cast<boo::D3DDataFactory::Context&>(ctx), *theme, fcache);
break;
#endif
#if BOO_HAS_METAL
@ -44,7 +43,7 @@ void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
Log.report(logvisor::Fatal, _S("unable to init view system for %s"), ctx.platformName());
}
return true;
});
} BooTrace);
}
void ViewResources::destroyResData()
@ -86,7 +85,7 @@ void ViewResources::prepFontCacheSync()
void ViewResources::prepFontCacheAsync(boo::IWindow* window)
{
m_fcacheReady = false;
m_fcacheThread = std::thread([this, window]() { prepFontCacheSync(); });
m_fcacheThread = std::thread([this]() { prepFontCacheSync(); });
}
void ViewResources::resetPixelFactor(float pf)

View File

@ -1,6 +0,0 @@
#include "logvisor/logvisor.hpp"
namespace specter
{
static logvisor::Module Log("Specter");
}

@ -1 +1 @@
Subproject commit d135dee556590fee0d5569c0ad7db426274ef1a4
Subproject commit b1b4903cb133b4f03b216760e32004f7d33adc7a