Add print_line for compatibility with engine modules#1653
Add print_line for compatibility with engine modules#1653dsnopek merged 1 commit intogodotengine:masterfrom
print_line for compatibility with engine modules#1653Conversation
|
Overall, I think this is the right approach to getting module compatibility for these functions. My one concern is if this could lead to more things being |
|
I had that concern too, but I don't see a way around it, so long as we want these to be lightweight wrappers around the functions in UtilityFunctions. Anyway, it's not really even a bad thing to have The dependencies of |
|
I can confirm utility_functions isn't part of any common include yet - any time i need to debug print i currently have to include it explicitly. Including it "by default" would actually reduce friction (in my workflow anyway). |
dsnopek
left a comment
There was a problem hiding this comment.
Ok, thanks, that makes sense!
|
Cherry-picked for 4.3 in PR #1695 |
Fixes #1596. This PR adds most of the function signatures from the engine's
print_string.hand places them in a file calledprint_string.hpp. The implementation from the engine is not copied, instead these wrap around the functions inUtilityFunctions. Personally I only need the non-varargprint_linebut I've included the rest for parity.print_string.hppis included inclass_db.hppjust like in the engine'sclass_db.h, which means these functions are available for anywhere that includesclass_db.hpp. For the verbose function, I had to put the OS call into a separate file sinceos.hppdepends onclass_db.hppso there was a circular dependency if I did not. Also, the templates need to exist in the header, so I kept them and most of the functions in the header for simplicity.Reference: https://github.com/godotengine/godot/blob/master/core/string/print_string.h