mirror of https://github.com/AxioDL/metaforce.git
Windows build fixes and warning avoidance
This commit is contained in:
parent
83153386ed
commit
c3b0e8a241
|
@ -66,7 +66,6 @@ list(APPEND SPECTER_HEADERS
|
||||||
atdna(atdna_FontCache.cpp include/specter/FontCache.hpp)
|
atdna(atdna_FontCache.cpp include/specter/FontCache.hpp)
|
||||||
|
|
||||||
list(APPEND SPECTER_SOURCES
|
list(APPEND SPECTER_SOURCES
|
||||||
lib/specter.cpp
|
|
||||||
lib/ViewResources.cpp
|
lib/ViewResources.cpp
|
||||||
lib/View.cpp
|
lib/View.cpp
|
||||||
lib/RootView.cpp
|
lib/RootView.cpp
|
||||||
|
@ -80,15 +79,10 @@ list(APPEND SPECTER_SOURCES
|
||||||
lib/Space.cpp
|
lib/Space.cpp
|
||||||
lib/Toolbar.cpp
|
lib/Toolbar.cpp
|
||||||
lib/Table.cpp
|
lib/Table.cpp
|
||||||
lib/Outliner.cpp
|
|
||||||
lib/Panel.cpp
|
|
||||||
lib/Control.cpp
|
lib/Control.cpp
|
||||||
lib/Button.cpp
|
lib/Button.cpp
|
||||||
lib/TextField.cpp
|
lib/TextField.cpp
|
||||||
lib/NumericField.cpp
|
|
||||||
lib/Menu.cpp
|
lib/Menu.cpp
|
||||||
lib/Node.cpp
|
|
||||||
lib/NodeSocket.cpp
|
|
||||||
lib/PathButtons.cpp
|
lib/PathButtons.cpp
|
||||||
lib/FileBrowser.cpp
|
lib/FileBrowser.cpp
|
||||||
lib/Icon.cpp
|
lib/Icon.cpp
|
||||||
|
|
|
@ -47,7 +47,7 @@ class PathButtons : public ScrollView
|
||||||
int m_pathButtonPending = -1;
|
int m_pathButtonPending = -1;
|
||||||
IPathButtonsBinding& m_binding;
|
IPathButtonsBinding& m_binding;
|
||||||
bool m_fillContainer;
|
bool m_fillContainer;
|
||||||
struct PathButton : IButtonBinding
|
struct PathButton final : IButtonBinding
|
||||||
{
|
{
|
||||||
PathButtons& m_pb;
|
PathButtons& m_pb;
|
||||||
size_t m_idx;
|
size_t m_idx;
|
||||||
|
|
|
@ -118,6 +118,7 @@ public:
|
||||||
void destroyed();
|
void destroyed();
|
||||||
bool isDestroyed() const {return m_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 resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub);
|
||||||
void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods);
|
void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods);
|
||||||
void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods);
|
void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods);
|
||||||
|
|
|
@ -44,6 +44,7 @@ class Space : public View
|
||||||
void mouseLeave(const boo::SWindowCoord&);
|
void mouseLeave(const boo::SWindowCoord&);
|
||||||
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
||||||
void mouseUp(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 resized(const boo::SWindowRect& root, const boo::SWindowRect& sub, bool flip);
|
||||||
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
||||||
};
|
};
|
||||||
|
|
|
@ -96,7 +96,7 @@ public:
|
||||||
void init(boo::GLDataFactory::Context& ctx, FontCache* fcache);
|
void init(boo::GLDataFactory::Context& ctx, FontCache* fcache);
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
void init(boo::ID3DDataFactory::Context& ctx, FontCache* fcache);
|
void init(boo::D3DDataFactory::Context& ctx, FontCache* fcache);
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
void init(boo::MetalDataFactory::Context& ctx, FontCache* fcache);
|
void init(boo::MetalDataFactory::Context& ctx, FontCache* fcache);
|
||||||
|
|
|
@ -27,7 +27,6 @@ public:
|
||||||
Top
|
Top
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
Position m_tbPos;
|
|
||||||
unsigned m_units;
|
unsigned m_units;
|
||||||
std::vector<std::vector<ViewChild<View*>>> m_children;
|
std::vector<std::vector<ViewChild<View*>>> m_children;
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ public:
|
||||||
void init(boo::GLDataFactory::Context& ctx, const IThemeData& theme);
|
void init(boo::GLDataFactory::Context& ctx, const IThemeData& theme);
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
void init(boo::ID3DDataFactory::Context& ctx, const IThemeData& theme);
|
void init(boo::D3DDataFactory::Context& ctx, const IThemeData& theme);
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
void init(boo::MetalDataFactory::Context& ctx, const IThemeData& theme);
|
void init(boo::MetalDataFactory::Context& ctx, const IThemeData& theme);
|
||||||
|
|
|
@ -378,7 +378,7 @@ FontAtlas::FontAtlas(FT_Face face, uint32_t dpi,
|
||||||
g.m_leftPadding = face->glyph->metrics.horiBearingX >> 6;
|
g.m_leftPadding = face->glyph->metrics.horiBearingX >> 6;
|
||||||
g.m_advance = face->glyph->advance.x >> 6;
|
g.m_advance = face->glyph->advance.x >> 6;
|
||||||
g.m_verticalOffset = (face->glyph->metrics.horiBearingY - face->glyph->metrics.height) >> 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;
|
curLineWidth += width + 1;
|
||||||
charcode = FT_Get_Next_Char(face, charcode, &gindex);
|
charcode = FT_Get_Next_Char(face, charcode, &gindex);
|
||||||
}
|
}
|
||||||
|
@ -649,7 +649,7 @@ boo::ObjToken<boo::ITextureSA> FontAtlas::texture(boo::IGraphicsDataFactory* gf)
|
||||||
return {};
|
return {};
|
||||||
if (m_tex)
|
if (m_tex)
|
||||||
return m_tex;
|
return m_tex;
|
||||||
gf->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
|
gf->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
if (m_subpixel)
|
if (m_subpixel)
|
||||||
const_cast<boo::ObjToken<boo::ITextureSA>&>(m_tex) =
|
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());
|
m_texmap.data(), m_texmap.size());
|
||||||
const_cast<std::vector<uint8_t>&>(m_texmap) = std::vector<uint8_t>();
|
const_cast<std::vector<uint8_t>&>(m_texmap) = std::vector<uint8_t>();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
return m_tex;
|
return m_tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ IconView::IconView(ViewResources& res, View& parentView, Icon& icon)
|
||||||
void IconView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
|
void IconView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
|
||||||
{
|
{
|
||||||
m_viewVertBlock.setViewRect(root, sub);
|
m_viewVertBlock.setViewRect(root, sub);
|
||||||
float pf = rootView().viewRes().pixelFactor();
|
|
||||||
m_viewVertBlock.m_mv[0][0] *= sub.size[0];
|
m_viewVertBlock.m_mv[0][0] *= sub.size[0];
|
||||||
m_viewVertBlock.m_mv[1][1] *= sub.size[1];
|
m_viewVertBlock.m_mv[1][1] *= sub.size[1];
|
||||||
View::resized(m_viewVertBlock, sub);
|
View::resized(m_viewVertBlock, sub);
|
||||||
|
|
|
@ -292,13 +292,13 @@ ModalWindow::ModalWindow(ViewResources& res, View& parentView,
|
||||||
m_windowBgClear[3] = 0.0;
|
m_windowBgClear[3] = 0.0;
|
||||||
m_line2Clear[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);
|
buildResources(ctx, res);
|
||||||
m_viewBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory);
|
m_viewBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory);
|
||||||
m_vertsBinding.init(ctx, res, 38, m_viewBlockBuf);
|
m_vertsBinding.init(ctx, res, 38, m_viewBlockBuf);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
|
|
||||||
for (int i=0 ; i<4 ; ++i)
|
for (int i=0 ; i<4 ; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,9 +10,9 @@ static logvisor::Module Log("specter::SplitView");
|
||||||
|
|
||||||
static const zeus::RGBA32 Tex[3] =
|
static const zeus::RGBA32 Tex[3] =
|
||||||
{
|
{
|
||||||
{0,0,0,64},
|
{{0,0,0,64}},
|
||||||
{0,0,0,255},
|
{{0,0,0,255}},
|
||||||
{255,255,255,64}
|
{{255,255,255,64}}
|
||||||
};
|
};
|
||||||
|
|
||||||
void SplitView::Resources::init(boo::IGraphicsDataFactory::Context& ctx, const IThemeData& theme)
|
void SplitView::Resources::init(boo::IGraphicsDataFactory::Context& ctx, const IThemeData& theme)
|
||||||
|
|
|
@ -90,7 +90,7 @@ void TextView::Resources::init(boo::GLDataFactory::Context& ctx, FontCache* fcac
|
||||||
|
|
||||||
#if _WIN32
|
#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;
|
m_fcache = fcache;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ void Toolbar::Resources::init(boo::IGraphicsDataFactory::Context& ctx, const ITh
|
||||||
}
|
}
|
||||||
|
|
||||||
Toolbar::Toolbar(ViewResources& res, View& parentView, Position tbPos, unsigned units)
|
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_nomGauge(res.pixelFactor() * SPECTER_TOOLBAR_GAUGE * units),
|
||||||
m_padding(res.pixelFactor() * TOOLBAR_PADDING)
|
m_padding(res.pixelFactor() * TOOLBAR_PADDING)
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,7 +94,7 @@ void View::Resources::init(boo::GLDataFactory::Context& ctx, const IThemeData& t
|
||||||
|
|
||||||
#if _WIN32
|
#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 =
|
static const char* SolidVS =
|
||||||
"struct VertData\n"
|
"struct VertData\n"
|
||||||
|
@ -374,7 +374,7 @@ void View::draw(boo::IGraphicsCommandQueue* gfxQ)
|
||||||
|
|
||||||
void View::commitResources(ViewResources& res, const boo::FactoryCommitFunc& commitFunc)
|
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,
|
void View::VertexBufferBindingSolid::init(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
|
|
|
@ -16,7 +16,7 @@ void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
|
||||||
|
|
||||||
m_curveFont = fcache->prepCurvesFont(AllCharFilter, false, 8.f, dpi);
|
m_curveFont = fcache->prepCurvesFont(AllCharFilter, false, 8.f, dpi);
|
||||||
|
|
||||||
factory->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) {
|
factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) {
|
||||||
switch (ctx.platform())
|
switch (ctx.platform())
|
||||||
{
|
{
|
||||||
#if BOO_HAS_GL
|
#if BOO_HAS_GL
|
||||||
|
@ -26,8 +26,7 @@ void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
init<boo::D3DDataFactory::Context>(static_cast<boo::D3DDataFactory::Context&>(ctx), *theme, fcache);
|
||||||
init<boo::ID3DDataFactory::Context>(static_cast<boo::ID3DDataFactory::Context&>(ctx), *theme, fcache);
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#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());
|
Log.report(logvisor::Fatal, _S("unable to init view system for %s"), ctx.platformName());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewResources::destroyResData()
|
void ViewResources::destroyResData()
|
||||||
|
@ -86,7 +85,7 @@ void ViewResources::prepFontCacheSync()
|
||||||
void ViewResources::prepFontCacheAsync(boo::IWindow* window)
|
void ViewResources::prepFontCacheAsync(boo::IWindow* window)
|
||||||
{
|
{
|
||||||
m_fcacheReady = false;
|
m_fcacheReady = false;
|
||||||
m_fcacheThread = std::thread([this, window]() { prepFontCacheSync(); });
|
m_fcacheThread = std::thread([this]() { prepFontCacheSync(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewResources::resetPixelFactor(float pf)
|
void ViewResources::resetPixelFactor(float pf)
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#include "logvisor/logvisor.hpp"
|
|
||||||
|
|
||||||
namespace specter
|
|
||||||
{
|
|
||||||
static logvisor::Module Log("Specter");
|
|
||||||
}
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d135dee556590fee0d5569c0ad7db426274ef1a4
|
Subproject commit b1b4903cb133b4f03b216760e32004f7d33adc7a
|
Loading…
Reference in New Issue