diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/canvas_modulate.cpp | 2 | ||||
-rw-r--r-- | scene/2d/canvas_modulate.h | 2 | ||||
-rw-r--r-- | scene/2d/path_2d.cpp | 2 | ||||
-rw-r--r-- | scene/2d/sprite.cpp | 2 | ||||
-rw-r--r-- | scene/2d/visibility_notifier_2d.cpp | 4 | ||||
-rw-r--r-- | scene/3d/vehicle_body.cpp | 8 | ||||
-rw-r--r-- | scene/3d/vehicle_body.h | 1 | ||||
-rw-r--r-- | scene/animation/animation_player.cpp | 2 | ||||
-rw-r--r-- | scene/main/http_request.cpp | 2 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 6 | ||||
-rw-r--r-- | scene/resources/curve.cpp | 2 | ||||
-rw-r--r-- | scene/resources/stb_truetype.h | 44 | ||||
-rw-r--r-- | scene/resources/theme.cpp | 2 |
13 files changed, 43 insertions, 36 deletions
diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index cc0db2da77..6a74cb1d91 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -62,7 +62,7 @@ String CanvasModulate::get_configuration_warning() const { get_tree()->get_nodes_in_group("_canvas_modulate_"+itos(get_canvas().get_id()),&nodes); if (nodes.size()>1) { - return TTR("Only one visible CanvasModulate is allowed per scene (or set of instanced scenes). The first one created will work, while the rest will be ignored."); + return TTR("Only one visible CanvasModulate is allowed per scene (or set of instanced scenes). The first created one will work, while the rest will be ignored."); } return String(); diff --git a/scene/2d/canvas_modulate.h b/scene/2d/canvas_modulate.h index 73f920d5c7..0445db27af 100644 --- a/scene/2d/canvas_modulate.h +++ b/scene/2d/canvas_modulate.h @@ -16,7 +16,7 @@ public: void set_color(const Color& p_color); Color get_color() const; - String CanvasModulate::get_configuration_warning() const; + String get_configuration_warning() const; CanvasModulate(); ~CanvasModulate(); diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index dee67a829f..41ca7b1d0f 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -243,7 +243,7 @@ String PathFollow2D::get_configuration_warning() const { return String(); if (!get_parent() || !get_parent()->cast_to<Path2D>()) { - return TTR("PathFolow2D only works when set as a child of a Path2D node."); + return TTR("PathFollow2D only works when set as a child of a Path2D node."); } return String(); diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index aebb9a4c28..3e6384ea2c 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -540,7 +540,7 @@ String ViewportSprite::get_configuration_warning() const { Viewport *vp = n->cast_to<Viewport>(); if (!vp->is_set_as_render_target()) { - return TTR("The Viewport set in the path property must be set as 'render taget' in order for this sprite to work"); + return TTR("The Viewport set in the path property must be set as 'render target' in order for this sprite to work."); } } } diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 2a5108c627..12524a2192 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -347,11 +347,11 @@ void VisibilityEnabler2D::_node_removed(Node* p_node) { } String VisibilityEnabler2D::get_configuration_warning() const { - +#ifdef TOOLS_ENABLED if (is_inside_tree() && get_parent() && (get_parent()->get_filename()==String() && get_parent()!=get_tree()->get_edited_scene_root())) { return TTR("VisibilityEnable2D works best when used with the edited scene root directly as parent."); } - +#endif return String(); } diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index ba30c118f0..e35ba11e84 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -936,7 +936,7 @@ void VehicleBody::_direct_state_changed(Object *p_state) { wheel.m_deltaRotation *= real_t(0.99);//damping of rotation when not in contact } - + linear_velocity = s->get_linear_velocity(); } void VehicleBody::set_mass(real_t p_mass) { @@ -990,6 +990,10 @@ float VehicleBody::get_steering() const{ return m_steeringValue; } +Vector3 VehicleBody::get_linear_velocity() +{ + return linear_velocity; +} void VehicleBody::_bind_methods(){ @@ -1008,6 +1012,8 @@ void VehicleBody::_bind_methods(){ ObjectTypeDB::bind_method(_MD("set_steering","steering"),&VehicleBody::set_steering); ObjectTypeDB::bind_method(_MD("get_steering"),&VehicleBody::get_steering); + ObjectTypeDB::bind_method(_MD("get_linear_velocity"),&VehicleBody::get_linear_velocity); + ObjectTypeDB::bind_method(_MD("_direct_state_changed"),&VehicleBody::_direct_state_changed); ADD_PROPERTY( PropertyInfo(Variant::REAL,"motion/engine_force",PROPERTY_HINT_RANGE,"0.00,1024.0,0.01"),_SCS("set_engine_force"),_SCS("get_engine_force")); diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h index 285cca142d..b6ad88f15e 100644 --- a/scene/3d/vehicle_body.h +++ b/scene/3d/vehicle_body.h @@ -178,6 +178,7 @@ public: void set_steering(float p_steering); float get_steering() const; + Vector3 get_linear_velocity(); VehicleBody(); }; diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index cecdd2bc40..2399bee539 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1012,7 +1012,7 @@ void AnimationPlayer::play(const StringName& p_name, float p_custom_blend, float queued.clear(); _set_process(true); // always process when starting an animation playing = true; - + emit_signal(SceneStringNames::get_singleton()->animation_started, c.assigned); if (is_inside_tree() && get_tree()->is_editor_hint()) diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 90e3713799..328ad8fb26 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -494,7 +494,7 @@ HTTPRequest::HTTPRequest() max_redirects=8; body_len=-1; got_response=false; - validate_ssl=false; + validate_ssl=false; use_ssl=false; response_code=0; request_sent=false; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index c9f61beba7..5ce53194a1 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1842,6 +1842,8 @@ void Viewport::_gui_input_event(InputEvent p_event) { if (gui.mouse_over) gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_EXIT); + _gui_cancel_tooltip(); + if (over) over->notification(Control::NOTIFICATION_MOUSE_ENTER); @@ -1849,8 +1851,6 @@ void Viewport::_gui_input_event(InputEvent p_event) { gui.mouse_over=over; - _gui_cancel_tooltip(); - if (gui.drag_preview) { gui.drag_preview->set_pos(mpos); } @@ -2407,7 +2407,7 @@ String Viewport::get_configuration_warning() const { if (get_parent() && !get_parent()->cast_to<Control>() && !render_target) { - return TTR("This viewport is not set as render target. If you intend for it to display it's contents directly to the screen, make it a child of a Control so it can obtain a size. Otherwise, make it a RenderTarget and assign it's internal texture to some node for display."); + return TTR("This viewport is not set as render target. If you intend for it to display its contents directly to the screen, make it a child of a Control so it can obtain a size. Otherwise, make it a RenderTarget and assign its internal texture to some node for display."); } return String(); diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 516156c315..88ff09e961 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -544,7 +544,7 @@ void Curve2D::_bake() const { List<Vector2> pointlist; pointlist.push_back(pos); //start always from origin - + for(int i=0;i<points.size()-1;i++) { float step = 0.1; // at least 10 substeps ought to be enough? diff --git a/scene/resources/stb_truetype.h b/scene/resources/stb_truetype.h index d360d60920..016972785a 100644 --- a/scene/resources/stb_truetype.h +++ b/scene/resources/stb_truetype.h @@ -29,7 +29,7 @@ // "Zer" on mollyrocket (with fix) // Cass Everitt // stoiko (Haemimont Games) -// Brian Hook +// Brian Hook // Walter van Niftrik // David Gow // David Given @@ -218,7 +218,7 @@ // Curve tesselation 120 LOC \__ 550 LOC Bitmap creation // Bitmap management 100 LOC / // Baked bitmap interface 70 LOC / -// Font name matching & access 150 LOC ---- 150 +// Font name matching & access 150 LOC ---- 150 // C runtime library abstraction 60 LOC ---- 60 // // @@ -311,7 +311,7 @@ int main(int argc, char **argv) } return 0; } -#endif +#endif // // Output: // @@ -325,9 +325,9 @@ int main(int argc, char **argv) // :@@. M@M // @@@o@@@@ // :M@@V:@@. -// +// ////////////////////////////////////////////////////////////////////////////// -// +// // Complete program: print "Hello World!" banner, with bugs // #if 0 @@ -599,7 +599,7 @@ STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbt // Calling these functions in sequence is roughly equivalent to calling // stbtt_PackFontRanges(). If you more control over the packing of multiple // fonts, or if you want to pack custom data into a font texture, take a look -// at the source to of stbtt_PackFontRanges() and create a custom version +// at the source to of stbtt_PackFontRanges() and create a custom version // using these functions, e.g. call GatherRects multiple times, // building up a single array of rects, then call PackRects once, // then call RenderIntoRects repeatedly. This may result in a @@ -1350,7 +1350,7 @@ STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, s if (i != 0) num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - // now start the new one + // now start the new one start_off = !(flags & 1); if (start_off) { // if we start off with an off-curve point, then when we need to find a point on the curve @@ -1403,7 +1403,7 @@ STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, s int comp_num_verts = 0, i; stbtt_vertex *comp_verts = 0, *tmp = 0; float mtx[6] = {1,0,0,1,0,0}, m, n; - + flags = ttSHORT(comp); comp+=2; gidx = ttSHORT(comp); comp+=2; @@ -1433,7 +1433,7 @@ STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, s mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; } - + // Find transformation scales. m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); @@ -1691,7 +1691,7 @@ static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, i float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); STBTT_assert(z != NULL); if (!z) return z; - + // round dx down to avoid overshooting if (dxdy < 0) z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); @@ -1769,7 +1769,7 @@ static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__ac } } } - + e = e->next; } } @@ -2441,7 +2441,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info { int ix0,iy0,ix1,iy1; stbtt__bitmap gbm; - stbtt_vertex *vertices; + stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); if (scale_x == 0) scale_x = scale_y; @@ -2464,7 +2464,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info if (height) *height = gbm.h; if (xoff ) *xoff = ix0; if (yoff ) *yoff = iy0; - + if (gbm.w && gbm.h) { gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); if (gbm.pixels) { @@ -2475,7 +2475,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info } STBTT_free(vertices, info->userdata); return gbm.pixels; -} +} STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) { @@ -2487,7 +2487,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigne int ix0,iy0; stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - stbtt__bitmap gbm; + stbtt__bitmap gbm; stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); gbm.pixels = output; @@ -2509,7 +2509,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char * STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); -} +} STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) { @@ -2519,7 +2519,7 @@ STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, uns STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); -} +} STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) { @@ -2644,7 +2644,7 @@ static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *no con->y = 0; con->bottom_y = 0; STBTT__NOTUSED(nodes); - STBTT__NOTUSED(num_nodes); + STBTT__NOTUSED(num_nodes); } static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) @@ -2996,7 +2996,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontd n = 0; for (i=0; i < num_ranges; ++i) n += ranges[i].num_chars; - + rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); if (rects == NULL) return 0; @@ -3007,7 +3007,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontd n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); stbtt_PackFontRangesPackRects(spc, rects, n); - + return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); STBTT_free(rects, spc->user_allocator_context); @@ -3060,7 +3060,7 @@ STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, i // // check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string -static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 *s1, stbtt_int32 len1, const stbtt_uint8 *s2, stbtt_int32 len2) +static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 *s1, stbtt_int32 len1, const stbtt_uint8 *s2, stbtt_int32 len2) { stbtt_int32 i=0; @@ -3099,7 +3099,7 @@ static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 return i; } -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) +STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) { return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((const stbtt_uint8*) s1, len1, (const stbtt_uint8*) s2, len2); } diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 20405a57b2..8d0aedbf93 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -374,7 +374,7 @@ void Theme::get_stylebox_types(List<StringName> *p_list) const { const StringName *key=NULL; while((key=style_map.next(key))) { p_list->push_back(*key); - } + } } void Theme::set_font(const StringName& p_name,const StringName& p_type,const Ref<Font>& p_font) { |