Start working on dumping the world (to a JSON file) for debug purposes.
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
#ifndef DORAYME_CHECKERSPATTERN_H
|
||||
#define DORAYME_CHECKERSPATTERN_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
class CheckersPattern : public Pattern
|
||||
{
|
||||
public:
|
||||
@@ -20,6 +22,12 @@ public:
|
||||
|
||||
return (fmod(value, 2) == 0)?this->a:this->b;
|
||||
}
|
||||
|
||||
void dumpMe(FILE *fp) {
|
||||
fprintf(fp, "\"Type\": \"Checkers\",\n");
|
||||
Pattern::dumpMe(fp);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif /* DORAYME_CHECKERSPATTERN_H */
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define DORAYME_GRADIENTPATTERN_H
|
||||
|
||||
#include <pattern.h>
|
||||
#include <stdio.h>
|
||||
|
||||
class GradientPattern : public Pattern
|
||||
{
|
||||
@@ -25,6 +26,12 @@ public:
|
||||
|
||||
return Colour(ret.x, ret.y, ret.z);
|
||||
}
|
||||
|
||||
void dumpMe(FILE *fp) {
|
||||
fprintf(fp, "\"Type\": \"Gradient\",\n");
|
||||
Pattern::dumpMe(fp);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif /* DORAYME_GRADIENTPATTERN_H */
|
||||
|
||||
@@ -24,6 +24,11 @@ public:
|
||||
|
||||
return (fmod(value, 2) == 0)?this->a:this->b;
|
||||
}
|
||||
|
||||
void dumpMe(FILE *fp) {
|
||||
fprintf(fp, "\"Type\": \"Ring\"\n");
|
||||
Pattern::dumpMe(fp);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,11 @@ public:
|
||||
}
|
||||
return this->b;
|
||||
}
|
||||
|
||||
void dumpMe(FILE *fp) {
|
||||
fprintf(fp, "\"Type\": \"Strip\",\n");
|
||||
Pattern::dumpMe(fp);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* DORAYME_STRIPPATTERN_H */
|
||||
|
||||
@@ -22,6 +22,11 @@ public:
|
||||
{
|
||||
return Colour(point.x, point.y, point.z);
|
||||
}
|
||||
|
||||
void dumpMe(FILE *fp) {
|
||||
fprintf(fp, "\"Type\": \"Test\",\n");
|
||||
Pattern::dumpMe(fp);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* DORAYME_TESTPATTERN_H */
|
||||
|
||||
Reference in New Issue
Block a user