|
|
@@ -19,8 +19,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
#include <raylib.h>
|
|
|
#include <string.h>
|
|
|
+#include <stdio.h>
|
|
|
|
|
|
-#include "parser.h"
|
|
|
+#include "vnrs_parser.h"
|
|
|
+
|
|
|
+#define MAIN_ENGINE 1
|
|
|
+#define MAIN_PARSER 2
|
|
|
+#define MAIN MAIN_ENGINE
|
|
|
|
|
|
typedef struct {
|
|
|
Texture2D img;
|
|
|
@@ -43,6 +48,7 @@ typedef struct {
|
|
|
|
|
|
int main(void)
|
|
|
{
|
|
|
+#if MAIN == MAIN_ENGINE
|
|
|
const int screenWidth = 1920;
|
|
|
const int screenHeight = 1080;
|
|
|
|
|
|
@@ -68,6 +74,8 @@ int main(void)
|
|
|
cur_state.layers[1].pos = (Vector2){0.5, 0.5};
|
|
|
cur_state.layers_count += 2;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
while (!WindowShouldClose())
|
|
|
{
|
|
|
BeginDrawing();
|
|
|
@@ -99,5 +107,18 @@ int main(void)
|
|
|
|
|
|
CloseWindow();
|
|
|
|
|
|
+#elif MAIN == MAIN_PARSER
|
|
|
+ FILE *f;
|
|
|
+ printf("Parser...\n");
|
|
|
+ f = fopen("assets/test.vnrs", "r");
|
|
|
+ if (!f) {
|
|
|
+ perror("assets/test.vnrs");
|
|
|
+ return 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ parse_vnrs(f, stdout);
|
|
|
+
|
|
|
+ fclose(f);
|
|
|
+#endif
|
|
|
return 0;
|
|
|
}
|