Skip to content

oppai 3 roadmap

Franc[e]sco edited this page Nov 12, 2018 · 5 revisions

I'm planning some major api-breaking changes for the next iteration of oppai so I can improve the interface and make the code neater

I want to move as much of the implementation details as possible out of the interface, for example the parser would be a completely opaque handle, memory management facilities (array and arena_t) would be hidden and only available internally, etc. this will remove a lot of useless stuff from the top of oppai.c which is supposed to be a simple, concise self documenting interface.

the interface (when not using the ezpp interface) would be something like

#define OPPAI_IMPLEMENTATION
#include "../oppai.c"

int main() {
  /* these are opaque handles defined as void* */
  parser_t parser = p_new();
  diff_calc_t diff = d_new();

  /* these structs are purely input/output data, no internals */
  beatmap_t map;
  stars_t stars;
  pp_t pp;

  p_map(parser, &map, stdin);
  d_calc(diff, &map, MODS_DT, &stars);
  printf("%g stars\n", stars.total);

  b_ppv2(&map, &pp, stars.aim, stars.speed, mods);
  printf("%gpp\n", pp.total);

  return 0;
}

the void* handles could be forward declarations to the struct when OPPAI_IMPLEMENTATION is defined except the definition is internal so it doesn't clutter the header

... or i could only expose ezpp and make it more flexible

Clone this wiki locally