It looks like you're new here. If you want to get involved, click one of these buttons!
[Lists]
MyBigList = A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #
... etc to 2518 items and no more...
orxConfig_PushSection("Lists");
orxS32 count = orxConfig_GetListCounter("MyBigList");
orxLOG("Total in the list: %d", count);
[15:51:56] [CONFIG] [orxConfig.c:orxConfig_Load():2771] [game.ini]: Begins th
e processing of included file @../game.ini@.
[15:51:56] [CONFIG] [orxConfig.c:orxConfig_Load():2944] Key <#T #> has no value,
assign character '=' not found.
[15:51:56] [CONFIG] [orxConfig.c:orxConfig_Load():2944] Key <A #B #C #D #E #F #G
#H #I #J #K #L #M #N #O #P #Q #R > has no value, assign character '=' not found
.
[15:51:56] [CONFIG] [orxConfig.c:orxConfig_Load():2777] [game.ini]: Ends the
processing of included file @../game.ini@.
[15:51:56] [LOG] Total in the list: 0
Comments
I can of course increase the buffer size, but that will only push the problem further.
Even if we could end up with large enough buffers, the problem will then become performances.
For example, every time you need to access an item at index with orxConfig_GetList*(), unless you reuse the same index as last call, we need to go through the whole list from the beginning till we find the matching index, and this is probably already pretty expensive with a list that contains 2500 items! (Config values are simply char arrays in memory, there's no hashing/indexing.)
I'd advise either breaking down your list in a more hierarchical structure or just use your own data structure at that point.
I'll update the map exporter to do the same.
I'll think about doing some indexing if it turns out to be a problem for some people, but that'll come with an extra load with dynamic memory allocations.