mirror of https://git.sr.ht/~kikoodx/sle
41 lines
872 B
C
41 lines
872 B
C
/* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
/* Copyright (C) 2021 KikooDX */
|
|
|
|
#include "conf.h"
|
|
#include "shared_data.h"
|
|
#include "tile_picker/draw.h"
|
|
#include <raylib.h>
|
|
#include <stdlib.h>
|
|
|
|
int tile_picker_main(int argc, char **argv,
|
|
struct SharedData *shared_data)
|
|
{
|
|
/* initialize raylib */
|
|
InitWindow(picker_window_width, picker_window_height,
|
|
"SLE secondary window");
|
|
SetTargetFPS(picker_target_fps);
|
|
/* load textures */
|
|
const Texture2D tileset = LoadTexture(argv[1]);
|
|
|
|
/* only proceed if tileset is well loaded */
|
|
if (tileset.width > 0) {
|
|
while (!shared_data->end_child) {
|
|
/* draw */
|
|
BeginDrawing();
|
|
|
|
ClearBackground(BLACK);
|
|
tileset_draw(tileset,
|
|
shared_data->selected_tile);
|
|
|
|
EndDrawing();
|
|
}
|
|
}
|
|
|
|
/* unload textures */
|
|
UnloadTexture(tileset);
|
|
|
|
CloseWindow();
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|