neikeq / GodotSharp

Moved to the Godot repo: https://github.com/godotengine/godot/tree/master/modules/mono
MIT License
60 stars 8 forks source link

InputEvent contains garbage #12

Closed karroffel closed 7 years ago

karroffel commented 7 years ago

When using void _input(InputEvent ev) the InputEvent contains no useful information. The .type is counting up (ID ?) and sometimes contains huuuge numbers.

I think there might be problems with the marshalling.

InputTest.zip

neikeq commented 7 years ago

Ah right, I forgot to test InputEvent. For now you can pass yolo_copy=yes when running scons to just use type casting.

karroffel commented 7 years ago

If I compile with yolo_copy=yes then I get tons of errors like

modules/mono/bindings_generator.cpp:1220:21: error: 'Vector2' does not refer to
      a value
        INSERT_STRUCT_TYPE(Vector2, "real_t*")
                           ^
core/math/math_2d.h:65:8: note: declared here
struct Vector2 {
       ^

So yolo_copy doesn't do it for me. ^^

neikeq commented 7 years ago

Fixing both then :laughing:

neikeq commented 7 years ago

I introduced some fixes in 7ff3a68. I tested InputEventKey which is working fine now. Could you test the other types?

karroffel commented 7 years ago

So it should work without yolo_copy now? I'll try the other InputEvent types too. (Or do you have other types in mind?)

I'll do my godot jam game with this module, so I'll test it in production to maybe find other unexpected things.

neikeq commented 7 years ago

Just InputEvent types. The marshalling of the other types is simple. What needs to be tested for other types (like Vector2, Matrix3, etc) are methods which were manually converted to C# (example). Also some of these methods may need to be replaced with an internal call to C++ if they are too slow.

karroffel commented 7 years ago

When creating many MOUSE_MOTION events the .type of these events is 32514 95% of the time.

neikeq commented 7 years ago

I forgot out marshalling. Also there was something wrong with fields offsets, but now they are manually specified. You can try again with b934031.

neikeq commented 7 years ago

Closing as it's working fine now. Feel free to let me know if there is something else wrong.