2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-21 16:19:12 +00:00

Rendering tweaks/bug-fixes

This commit is contained in:
Jack Andersen
2015-12-17 17:26:10 -10:00
parent cb205304b6
commit e8449f3fdb
11 changed files with 44 additions and 28 deletions

View File

@@ -34,6 +34,12 @@ struct IIntBinding : IControlBinding
virtual void changed(int val)=0;
};
struct IStringBinding : IControlBinding
{
virtual std::string getDefault() const {return "";}
virtual void changed(const std::string& val)=0;
};
struct CVarControlBinding : IControlBinding
{
HECL::CVar* m_cvar;

View File

@@ -35,6 +35,16 @@ class FileBrowser : public ModalWindow
std::vector<PathButton> m_pathButtons;
Specter::ViewChild<Specter::TextField> m_fileField;
struct FileFieldBind : Specter::IStringBinding
{
FileBrowser& m_browser;
FileFieldBind(FileBrowser& browser) : m_browser(browser) {}
const char* name() const {return "File Name";}
void changed(const std::string& val)
{
}
} m_fileFieldBind;
Specter::ViewChild<Specter::ScrollView> m_fileScroll;
Specter::ViewChild<Specter::Table> m_fileListing;

View File

@@ -59,7 +59,7 @@ class FontAtlas
friend class FontCache;
FT_Face m_face;
boo::ITextureSA* m_tex = nullptr;
boo::IGraphicsDataToken m_token;
boo::GraphicsDataToken m_token;
uint32_t m_dpi;
FT_Fixed m_ftXscale;
FT_UShort m_ftXPpem;

View File

@@ -48,7 +48,7 @@ class ModalWindow : public View
boo::IVertexFormat* m_vertsVtxFmt; /* OpenGL only */
boo::IShaderDataBinding* m_vertsShaderBinding;
boo::IGraphicsDataToken m_windowGfxData;
boo::GraphicsDataToken m_windowGfxData;
std::unique_ptr<TextView> m_cornersOutline[4];
std::unique_ptr<TextView> m_cornersFilled[4];

View File

@@ -1,13 +1,13 @@
#ifndef SPECTER_TEXTFIELD_HPP
#define SPECTER_TEXTFIELD_HPP
#include "View.hpp"
#include "Control.hpp"
#include "TextView.hpp"
namespace Specter
{
class TextField : public View
class TextField : public Control
{
std::string m_textStr;
std::unique_ptr<TextView> m_text;
@@ -25,7 +25,7 @@ class TextField : public View
void setDisabled();
public:
TextField(ViewResources& res, View& parentView);
TextField(ViewResources& res, View& parentView, IStringBinding* strBind);
void setText(const std::string& str);

View File

@@ -39,7 +39,7 @@ private:
boo::IVertexFormat* m_bgVtxFmt = nullptr; /* OpenGL only */
boo::IShaderDataBinding* m_bgShaderBinding;
SolidShaderVert m_bgRect[4];
boo::IGraphicsDataToken m_gfxData;
boo::GraphicsDataToken m_gfxData;
friend class RootView;
void buildResources(ViewResources& res);

View File

@@ -15,8 +15,8 @@ class ThemeData
Zeus::CColor m_uiText = Zeus::CColor::skWhite;
Zeus::CColor m_fieldText = Zeus::CColor::skBlack;
Zeus::CColor m_vpBg = {0.2,0.2,0.2,1.0};
Zeus::CColor m_tbBg = {0.4,0.4,0.4,1.0};
Zeus::CColor m_vpBg = {0.2, 0.2, 0.2, 1.0};
Zeus::CColor m_tbBg = {0.4, 0.4, 0.4, 1.0};
Zeus::CColor m_tooltipBg = {0.0, 0.0, 0.0, 0.65};
Zeus::CColor m_splashBg = {0.1, 0.1, 0.1, 0.65};
@@ -33,11 +33,11 @@ class ThemeData
Zeus::CColor m_button2Disabled = {0.1725, 0.1725, 0.1725, 0.5};
Zeus::CColor m_textfield2Inactive = {0.7823, 0.7823, 0.7823, 1.0};
Zeus::CColor m_textfield1Inactive = {0.4725, 0.4725, 0.4725, 1.0};
Zeus::CColor m_textfield1Inactive = {0.5725, 0.5725, 0.5725, 1.0};
Zeus::CColor m_textfield2Hover = {0.8523, 0.8523, 0.8523, 1.0};
Zeus::CColor m_textfield1Hover = {0.5425, 0.5425, 0.5425, 1.0};
Zeus::CColor m_textfield1Hover = {0.6425, 0.6425, 0.6425, 1.0};
Zeus::CColor m_textfield2Disabled = {0.7823, 0.7823, 0.7823, 0.5};
Zeus::CColor m_textfield1Disabled = {0.4725, 0.4725, 0.4725, 0.5};
Zeus::CColor m_textfield1Disabled = {0.5725, 0.5725, 0.5725, 0.5};
public:
virtual const Zeus::CColor& uiText() const {return m_uiText;}
@@ -88,7 +88,7 @@ public:
SplitView::Resources m_splitRes;
Toolbar::Resources m_toolbarRes;
Button::Resources m_buttonRes;
boo::IGraphicsDataToken m_resData;
boo::GraphicsDataToken m_resData;
Specter::FontTag m_mainFont;
Specter::FontTag m_monoFont;