Page MenuHomeWildfire Games

Implement unordered_map C++ <-> JS conversion.
AbandonedPublic

Authored by Freagarach on Aug 6 2020, 8:23 PM.

Details

Reviewers
wraitii
Itms
Summary

Courtesy of @wraitii.

Test Plan

Compile the game, check code corectness.

Event Timeline

Freagarach created this revision.Aug 6 2020, 8:23 PM
ModIo.cpp
../../../source/ps/ModIo.cpp:575:0: warning: "FAIL" redefined
 #define FAIL(...) STMT(err = fmt::sprintf(__VA_ARGS__); CLEANUP(); return false;)
 
In file included from ../../../source/ps/ModIo.cpp:38:0:
../../../source/scriptinterface/ScriptConversions.h:112:0: note: this is the location of the previous definition
 #define FAIL(msg) STMT(JS_ReportError(cx, msg); return false)

All of this diff is magic to me, so please @Itms or @wraitii (or anyone knowledgeable) commandeer ^^'

Vulcan added a comment.Aug 6 2020, 8:36 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2933/display/redirect

Freagarach requested review of this revision.Aug 6 2020, 8:51 PM
Silier added a subscriber: Silier.Aug 6 2020, 9:00 PM
Silier added inline comments.
source/scriptinterface/ScriptConversions.h
138
Freagarach marked an inline comment as done.Aug 6 2020, 9:11 PM
Freagarach added inline comments.
source/scriptinterface/ScriptConversions.h
138

I can do that :)

Freagarach updated this revision to Diff 13121.Aug 6 2020, 9:11 PM
Freagarach marked an inline comment as done.

FAIL.

Vulcan added a comment.Aug 6 2020, 9:21 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2935/display/redirect

I don't see any strong reason to use std::unordered_map on the C++ side. It costs memory, some performance. The patch seems overhead, you might pass turrets through a list.

I don't see any strong reason to use std::unordered_map on the C++ side. It costs memory, some performance. The patch seems overhead, you might pass turrets through a list.

I use the map for D2814 too. That being said, you might argue that a vector of something is better for performance... Might be correct.

I don't see any strong reason to use std::unordered_map on the C++ side. It costs memory, some performance. The patch seems overhead, you might pass turrets through a list.

I use the map for D2814 too. That being said, you might argue that a vector of something is better for performance... Might be correct.

I haven't reviewed your patch precisely. But about turrets it's overhead. Nobody uses search in that map.

Freagarach abandoned this revision.Aug 13 2020, 11:13 AM