The problem is that out_sdl2 refers to getx() and gety() without knowing if they are really calling the function of this shared library.
This results in scaled up matrices, but out_sdl2 only shows a part in the top left corner.
Every module must call its own functions like this:
module *this = NULL;
int init(int modno, char *argstr) {
// this cannot fail, no error parsing is required
// if this would fail something is seriously wrong
this = modules_get(modno);
// and so one
}
int getx(void) {
return MATRIX_X;
}
int set(int x, int y, RGB *color) {
if (x<0 || y<0)
return 1;
if (x >= this->getx() || y >= this->gety())
return 2;
// and so one
}
this->getx() is only getx() in the current version.
Furthermore asserts should be avoided as these will cause people writing animations reimplementing said behaviour of the function int set(...) over and over.
The problem is that out_sdl2 refers to getx() and gety() without knowing if they are really calling the function of this shared library. This results in scaled up matrices, but out_sdl2 only shows a part in the top left corner. Every module must call its own functions like this:
this->getx()
is onlygetx()
in the current version.Furthermore asserts should be avoided as these will cause people writing animations reimplementing said behaviour of the function
int set(...)
over and over.