HomeWildfire Games

Add missing CPos FromJSVal, ToJSVal following rP1540.

Description

Add missing CPos FromJSVal, ToJSVal following rP1540.

Details

Event Timeline

Can be tested by adding this in session.js init:

Engine.GetGUIObjectByName("placementTooltip").offset = new Vector2D(200, 0);

vladislavbelov added inline comments.
/ps/trunk/source/scriptinterface/ScriptConversions.cpp
350

Useless and looks strange.

elexis added inline comments.Jul 29 2019, 2:28 PM
/ps/trunk/source/scriptinterface/ScriptConversions.cpp
350

The reader assuming that every line is written because it has an effect on the codeflow is misled to believe that this line has one, indeed.
To me it seems good practice to always #define and #undef, but I suppose one can also take care to always undef for headers and take care to always avoid #undef in implementation files for macros that may be used throughout the implementation file.

vladislavbelov added inline comments.Jul 29 2019, 2:35 PM
/ps/trunk/source/scriptinterface/ScriptConversions.cpp
350

#undef inplace is ok. Implementation defines won't leak to any other file. For headers defines you need too many undef. For ex. LOGWARNING. I insist to remove/not add undef for non-inplace defines (except special places in headers).