summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp4
-rw-r--r--scene/resources/shader.cpp3
-rw-r--r--scene/resources/shader.h19
3 files changed, 18 insertions, 8 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 0c15f99509..c497bc5363 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3601,6 +3601,10 @@ TextEdit::TextEdit() {
set_focus_mode(FOCUS_ALL);
_update_caches();
cache.size=Size2(1,1);
+ cache.row_height=1;
+ cache.line_spacing=1;
+ cache.line_number_w=1;
+
tab_size=4;
text.set_tab_size(tab_size);
text.clear();
diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp
index 862669ecd8..90598ee789 100644
--- a/scene/resources/shader.cpp
+++ b/scene/resources/shader.cpp
@@ -36,7 +36,7 @@
Shader::Mode Shader::get_mode() const {
- return (Mode)VisualServer::get_singleton()->shader_get_mode(shader);
+ return mode;
}
void Shader::set_code( const String& p_vertex, const String& p_fragment, const String& p_light,int p_fragment_ofs,int p_light_ofs) {
@@ -203,6 +203,7 @@ void Shader::_bind_methods() {
Shader::Shader(Mode p_mode) {
+ mode=p_mode;
shader = VisualServer::get_singleton()->shader_create(VS::ShaderMode(p_mode));
params_cache_dirty=true;
}
diff --git a/scene/resources/shader.h b/scene/resources/shader.h
index c5ef3777f7..b805cbec96 100644
--- a/scene/resources/shader.h
+++ b/scene/resources/shader.h
@@ -37,8 +37,18 @@ class Shader : public Resource {
OBJ_TYPE(Shader,Resource);
OBJ_SAVE_TYPE( Shader );
RES_BASE_EXTENSION("shd");
- RID shader;
+public:
+ enum Mode {
+
+ MODE_MATERIAL,
+ MODE_CANVAS_ITEM,
+ MODE_POST_PROCESS,
+ MODE_MAX
+ };
+private:
+ RID shader;
+ Mode mode;
Dictionary _get_code();
void _set_code(const Dictionary& p_string);
@@ -55,15 +65,10 @@ class Shader : public Resource {
protected:
+
static void _bind_methods();
public:
- enum Mode {
- MODE_MATERIAL,
- MODE_CANVAS_ITEM,
- MODE_POST_PROCESS,
- MODE_MAX
- };
//void set_mode(Mode p_mode);
Mode get_mode() const;