summaryrefslogtreecommitdiff
path: root/scene/2d/camera_2d.cpp
AgeCommit message (Collapse)Author
2020-07-11Revert "Merge pull request #38341 from verdog/camera-bounds-fix"Rémi Verschelde
This reverts commit 08bbb3f161bfb4860d7574fa77b947872d344e7e.
2020-07-10Merge pull request #38341 from verdog/camera-bounds-fixRémi Verschelde
Fix Camera2D incorrect preview bounds
2020-06-15Fix bad position in Camera2D offset and camera rotation if smothing enabled.Ranoller
Fix https://github.com/godotengine/godot/issues/16323 in master. Apply same solution of https://github.com/godotengine/godot/issues/2074 in rotation and offset.
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-04-30fixed camera2D showing incorrect bounds in editorJosh Chandler
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-27Renaming of servers for coherency.Juan Linietsky
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
2020-02-29Fix inverted use of Camera2D.offset_vEevee
The code above for horizontal movement uses the right margin (_positive_ x direction) when the offset is negative, but vertical movement uses the top margin (_negative_ y direction) when the offset is negative. The resulting problem is easily seen in the editor — set the drag margins to be asymmetrical, turn on drawing the drag margins, and slide the offsets from -1 to 1 and back. The horizontal offset moves the camera's center between the left and right margins, but the vertical offset gets them backwards and will move the camera outside the margins entirely.
2020-02-25Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky
- Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
2020-02-12ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky
32 bits.
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-08-06Tweaks related to Camera2D drag marginsTomasz Chabora
2019-07-05Camera2D's offset now ignores the limit propertyLikeLakers2
2019-06-12Cleanup some unecessary editor/ includes in scene/Rémi Verschelde
Part of #29730, handles false positives.
2019-06-03Small fixes to unrechable code, possibly overflows, using NULL pointersqarmin
2019-01-06Add process_mode property to Camera2DTimo Schwarzer
This allows the user to choose if the camera should update in _process or _physics_process.
2019-01-01Fix viewport not updating with make_current() for Camera2DBrody Eller
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-11-08-Moved EditorDefaultValue to ClassDB, made it coreJuan Linietsky
-Removed one and zero hints for properties, replaced by default value
2018-10-04fix enum cast warnings on clangkarroffel
2018-05-16Fix Camera2D drag margin property is affected by zoom property #18912Anthony Rey
2018-01-27Fix inverted RIGHT/LEFT TOP/BOTTOM Camera2D drag margin in runtime (editor ↵robfram
works fine). Fix #16095.
2018-01-12Bind many more properties to scriptsBojidar Marinov
Notable potentially breaking changes: - PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL - Some properties were renamed, and sometimes even shadowed by new ones - New getter methods (some virtual) were added
2018-01-08Update Camera2D scroll using NOTIFICATION_INTERNAL_PROCESSBernhard Liebl
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2017-10-26Overhauled the ParallaxBackground system so that it works properly ↵Sofox
regardless of the zoom of the camera.
2017-10-22Bind unbound enums, rearrange some by valuePoommetee Ketson
2017-09-30Renamed fixed_process to physics_processAndreaCatania
2017-09-20Rename pos to position in user facing methods and variablesletheed
Rename user facing methods and variables as well as the corresponding C++ methods according to the folloming changes: * pos -> position * rot -> rotation * loc -> location C++ variables are left as is.
2017-08-27Use HTTPS URL for Godot's website in the headersRémi Verschelde
2017-08-24Convert Object::cast_to() to the static versionHein-Pieter van Braam
Currently we rely on some undefined behavior when Object->cast_to() gets called with a Null pointer. This used to work fine with GCC < 6 but newer versions of GCC remove all codepaths in which the this pointer is Null. However, the non-static cast_to() was supposed to be null safe. This patch makes cast_to() Null safe and removes the now redundant Null checks where they existed. It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-21Merge pull request #10351 from neikeq/enums-are-for-the-weakJuan Linietsky
ClassDB: Provide the enum name of integer constants
2017-08-20ClassDB: Provide the enum name of integer constantsIgnacio Etcheverry
2017-08-20Merge pull request #10319 from neikeq/pr-engine-editor-hintJuan Linietsky
Adds Engine::is_editor_hint() method
2017-08-19Removes editor_hint from SceneTreeIgnacio Etcheverry
2017-08-16Synchronize parameter names in definition and declarationTwistedTwigleg
Fixes #10244.
2017-08-10Removes type information from method bindsIgnacio Etcheverry
2017-08-07Makes all Godot API's methods Lower CaseIndah Sylvia
2017-06-25Added some editor enhancements to Camera2D. Added the option to draw ↵TwistedTwigleg
Camera2Ds bounds and drag margins. Added options to toggle the drawing of Camera2Ds lines in the editor. When a Camera2D is marked as current, its lines become a little less transparent.
2017-06-04renamed all Rect2.pos to Rect2.positionalexholly
2017-04-08Add "Godot Engine contributors" copyright lineRémi Verschelde
2017-03-05A Whole New World (clang-format edition)Rémi Verschelde
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
2017-02-13Rename the _MD macro to D_METHODHein-Pieter van Braam
This new name also makes its purpose a little clearer This is a step towards fixing #56
2017-02-13Remove use of _SCS from ADD_METHODHein-Pieter van Braam
This saves typing and is a step towards fixing #56
2017-01-14removed duplicated functions in class hierarchy that were bound more than onceJuan Linietsky
added a check to detect this case in the future
2017-01-14Style: Fix whole-line commented codeRémi Verschelde
They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
2017-01-14Renamed call_group to call_group_flags, made call_group without flags the ↵Juan Linietsky
default