From 83f480997944a67f5919cb9d612e1a1dbdf7ba61 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 5 Jan 2024 15:24:13 +0100 Subject: [PATCH] Also commit amalgamated test setup. --- tools/merger/test/compile_linux.sh | 9 + tools/merger/test/game_application.h | 21 ++ tools/merger/test/game_scene.cpp | 320 +++++++++++++++++++++++++++ tools/merger/test/game_scene.h | 50 +++++ tools/merger/test/icon.png | Bin 0 -> 12259 bytes tools/merger/test/main.cpp | 21 ++ 6 files changed, 421 insertions(+) create mode 100755 tools/merger/test/compile_linux.sh create mode 100644 tools/merger/test/game_application.h create mode 100644 tools/merger/test/game_scene.cpp create mode 100644 tools/merger/test/game_scene.h create mode 100644 tools/merger/test/icon.png create mode 100644 tools/merger/test/main.cpp diff --git a/tools/merger/test/compile_linux.sh b/tools/merger/test/compile_linux.sh new file mode 100755 index 0000000..c87417b --- /dev/null +++ b/tools/merger/test/compile_linux.sh @@ -0,0 +1,9 @@ + +ccache g++ -Wall -D_REENTRANT -g -Isfw -c sfw.cpp -o sfw.o + +ccache g++ -Wall -D_REENTRANT -g -Isfw -c game_scene.cpp -o game_scene.o +ccache g++ -Wall -D_REENTRANT -g -Isfw -c main.cpp -o main.o + + +ccache g++ -Wall -lm -ldl -lpthread -lX11 -D_REENTRANT -g sfw.o game_scene.o main.o -o game + diff --git a/tools/merger/test/game_application.h b/tools/merger/test/game_application.h new file mode 100644 index 0000000..f5d44e9 --- /dev/null +++ b/tools/merger/test/game_application.h @@ -0,0 +1,21 @@ +#ifndef GAME_APPLICATION_H +#define GAME_APPLICATION_H + +#include "sfw.h" + +#include "game_scene.h" + +class GameApplication : public Application { + SFW_OBJECT(GameApplication, Application); + +public: + GameApplication() { + scene = Ref(memnew(GameScene())); + } + + ~GameApplication() { + scene.unref(); + } +}; + +#endif // GAME_APPLICATION_H diff --git a/tools/merger/test/game_scene.cpp b/tools/merger/test/game_scene.cpp new file mode 100644 index 0000000..97b5883 --- /dev/null +++ b/tools/merger/test/game_scene.cpp @@ -0,0 +1,320 @@ +#include "game_scene.h" + +void GameScene::input_event(const Ref &event) { + //ERR_PRINT(event->as_text()); + + Ref k = event; + + if (k.is_valid()) { + if (k->is_echo()) { + return; + } + + uint32_t scancode = k->get_scancode(); + bool pressed = k->is_pressed(); + + if (scancode == KEY_W) { + up = pressed; + } else if (scancode == KEY_A) { + left = pressed; + } else if (scancode == KEY_S) { + down = pressed; + } else if (scancode == KEY_D) { + right = pressed; + } + + return; + } + + Ref mm = event; + + if (mm.is_valid()) { + if (mm->get_button_mask() & BUTTON_MASK_LEFT) { + tile_map->transform.translate(mm->get_relative()); + } + } +} + +void GameScene::update(float delta) { + Vector2 trn; + + if (up) { + trn.y -= delta * 30.0; + } + + if (down) { + trn.y += delta * 30.0; + } + + if (left) { + trn.x -= delta * 30.0; + } + + if (right) { + trn.x += delta * 30.0; + } + + if (up || down || left || right) { + sprite->transform.translate(trn); + } +} + +void GameScene::render() { + //render_obj(); + render_immediate(); +} +void GameScene::render_immediate() { + Renderer *r = Renderer::get_singleton(); + + //r->camera_2d_reset(); + + r->clear_screen(Color()); + + r->draw_point(Vector2(15, 15)); + r->draw_point(Vector2(18, 18), Color(1, 1, 0)); + + r->draw_line(Vector2(20, 20), Vector2(80, 20)); + r->draw_line(Vector2(20, 20), Vector2(80, 40)); + r->draw_line(Vector2(20, 30), Vector2(80, 30), Color(1, 1, 0)); + r->draw_line(Vector2(20, 40), Vector2(80, 40), Color(1, 1, 0), 4); + r->draw_line(Vector2(20, 40), Vector2(80, 60), Color(1, 1, 0), 4); + + r->draw_line_rect(Rect2(100, 100, 40, 40)); + r->draw_line_rect(Rect2(150, 100, 40, 40), Color(1, 1, 0)); + r->draw_line_rect(Rect2(200, 100, 40, 40), Color(1, 1, 1), 4); + + r->draw_rect(Rect2(100, 150, 40, 40)); + r->draw_rect(Rect2(150, 150, 40, 40), Color(1, 1, 0)); + + r->draw_texture(texture, Rect2(100, 200, 40, 40)); + r->draw_texture(texture, Rect2(150, 200, 40, 40), Color(1, 0, 0)); + + r->draw_texture_clipped(texture, Rect2(20, 20, 30, 30), Rect2(100, 250, 40, 40)); + r->draw_texture_clipped(texture, Rect2(20, 20, 30, 30), Rect2(150, 250, 40, 40), Color(1, 0, 0)); + + Transform2D t = Transform2D().rotated(Math_PI / 26.0); + + r->draw_texture_tr(t, texture, Rect2(100, 300, 40, 40)); + r->draw_texture_tr(t, texture, Rect2(150, 300, 40, 40), Color(1, 0, 0)); + + r->draw_texture_clipped_tr(t, texture, Rect2(20, 20, 30, 30), Rect2(100, 350, 40, 40)); + r->draw_texture_clipped_tr(t, texture, Rect2(20, 20, 30, 30), Rect2(150, 350, 40, 40), Color(1, 0, 0)); + + //r->draw_mesh_2d(sprite->mesh_instance->mesh, texture, Vector2(1000, 500)); + //r->draw_mesh_2d_tr(sprite->mesh_instance->mesh, texture, Transform2D().rotated(Math_PI / 26.0).translated(Vector2(1000, 500))); + //r->draw_mesh_2d_mat(sprite->mesh_instance->mesh, material, Vector2(1000, 500)); + //r->draw_mesh_2d_mat_tr(sprite->mesh_instance->mesh, material, Transform2D().rotated(Math_PI / 26.0).translated(Vector2(1000, 600))); + + r->draw_text_2d("draw_text_2d1", _font, Vector2(700, 100)); + r->draw_text_2d("draw_text_2d2", _font, Vector2(800, 100), Color(1, 1, 0)); + + r->draw_text_2d_tf("draw_text_2d_tf1", _font, Transform2D().rotated(Math_PI / 26.0).translated(Vector2(1000, 500))); + r->draw_text_2d_tf("draw_text_2d_tf2", _font, Transform2D().rotated(Math_PI / 26.0).translated(Vector2(1200, 500)), Color(0, 1, 0)); + + r->draw_text_2d_tf_material("draw_text_2d_tf_material1", _font, _font_test_mat, Transform2D().rotated(Math_PI / 26.0).translated(Vector2(1000, 800))); + r->draw_text_2d_tf_material("draw_text_2d_tf_material2", _font, _font_test_mat, Transform2D().rotated(Math_PI / 26.0).translated(Vector2(1200, 800)), Color(1, 0, 0)); +} + +void GameScene::render_obj() { + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + static float rot = 0; + Transform t = camera->get_camera_transform(); + t.basis = Basis(Vector3(0, 1, 0), rot); + camera->set_camera_transform(t); + rot += 0.01; + + Ref d = texture->get_data(); + texture->create_from_image(d); + + camera->bind(); + + static float rotmi = 0; + mi->transform.basis = Basis(Vector3(1, 0, 0), rotmi); + rotmi += 0.01; + mi->render(); + + camera_2d->bind(); + sprite->render(); + tile_map->render(); + _font_test_sprite->render(); + _font_test_mi->render(); + + _text_2d->render(); + + //TextRenderer::get_singleton()->font_init(); + //TextRenderer::get_singleton()->font_print("test"); +} + +GameScene::GameScene() { + left = false; + right = false; + up = false; + down = false; + + //int w; + //int h; + //SDL_GetWindowSize(Application::get_singleton()->window, &w, &h); + + //float ar = static_cast(w) / static_cast(h); + //camera->width = camera->height * ar; + + _font.instance(); + _font->load_default(31.5); + + _font_test_sprite = memnew(Sprite); + + _font_test_mat.instance(); + _font_test_mat->texture = _font->get_texture(); + _font_test_sprite->mesh_instance->material = _font_test_mat; + _font_test_sprite->width = _font->get_atlas_width(); + _font_test_sprite->height = _font->get_atlas_height(); + _font_test_sprite->transform.set_origin(Vector2(1000, 100)); + _font_test_sprite->update_mesh(); + + _font_test_mesh.instance(); + _font_test_mesh->vertex_dimesions = 2; + + _font_test_mi = memnew(MeshInstance2D()); + _font_test_mi->material = _font_test_mat; + _font_test_mi->mesh = _font_test_mesh; + //_font_test_mi->transform.scale(Vector2(10, 10)); + _font_test_mi->transform.set_origin(Vector2(1000, 400)); + + _font->generate_mesh("asdfgh\nasdfvb", _font_test_mesh, Color(1, 1, 0)); + _font_test_mesh->upload(); + + image.instance(); + image->load_from_file("icon.png"); + //image->bumpmap_to_normalmap(); + + texture.instance(); + //texture->load_image("icon.png"); + texture->create_from_image(image); + //ha a textúrának van alpha csatornája: + //texture->load_image("download.bmp", GL_RGBA, GL_RGBA); + + material.instance(); + material->texture = texture; + + sprite = new Sprite(); + sprite->mesh_instance->material = material; + sprite->width = 500; + sprite->height = 500; + sprite->transform.set_origin(Vector2(250, 250)); + //sprite->region_x = 7.0 * (1.0 / 16.0); + //sprite->region_y = 7.0 * (1.0 / 16.0); + //sprite->region_width = 1.0 / 16.0; + //sprite->region_height = 1.0 / 16.0; + sprite->update_mesh(); + + tile_map = new TileMap(); + tile_map->material = material; + tile_map->atlas_size_x = 2; + tile_map->atlas_size_y = 2; + + tile_map->allocate_data(); + + for (int x = 0; x < tile_map->size_x; ++x) { + for (int y = 0; y < tile_map->size_y; ++y) { + if (x == 0 || y == 0 || x == tile_map->size_x - 1 || y == tile_map->size_y - 1) { + tile_map->set_data(x, y, 2); + } else { + tile_map->set_data(x, y, 1); + } + } + } + + tile_map->build_mesh(); + + tile_map->transform.scale(Vector2(32, 32)); + tile_map->transform.set_origin(Vector2(500, 500)); + + camera = new PerspectiveCamera(); + Transform t = camera->get_camera_transform(); + //camera->width = 2; + //camera->height = 2; + //camera->position.x = 0; + //camera->position.y = 0; + //camera->position.z = -2; + t.origin.z -= 2; + camera->set_camera_transform(t); + + camera->screen_aspect_ratio = 1920.0 / 1080.0; + + camera_2d = memnew(Camera2D); + camera_2d->size = Vector2(1920, 1080); + + mesh = Ref(memnew(Mesh())); + //cmaterial = memnew(ColoredMaterial()); + //cmaterial->color = glm::vec4(1, 1, 0, 1); + color_material.instance(); + + //mesh->clear(); + + MeshUtils::create_cone(mesh); + mesh->upload(); + + mi = memnew(MeshInstance3D()); + mi->material = color_material; + mi->mesh = mesh; + + mi2 = memnew(MeshInstance3D()); + mi2->material = color_material; + mi2->mesh = mesh; + mi2->transform.origin.x = 1; + + mi->children.push_back(mi2); + + //float width = 1; + //float height = 1; + + //float region_x = 0; + //float region_y = 0; + //float region_width = 1; + //float region_height = 1; + + //float w2 = width / 2.0; + //float h2 = height / 2.0; + + //mesh->add_uv(region_x, region_y); + //mesh->add_vertex2(-w2, h2); + + //mesh->add_uv(region_x + region_width, region_y + region_height); + //mesh->add_vertex2(w2, -h2); + + //mesh->add_uv(region_x, region_y + region_height); + //mesh->add_vertex2(-w2, -h2); + + //mesh->add_uv(region_x + region_width, region_y); + //mesh->add_vertex2(w2, h2); + + /* + mesh->add_vertex2(0, 0.5); + mesh->add_vertex2(-0.5, -0.5); + mesh->add_vertex2(0.5, -0.5); + + mesh->add_triangle(0, 1, 2); + //mesh->add_triangle(0, 1, 3); + + mesh->upload(); + */ + + _text_2d = memnew(Text2D); + _text_2d->set_font(_font); + _text_2d->set_text("Test Text2D.\n Newline."); + _text_2d->set_text_color(Color(1, 1, 0)); + _text_2d->update(); + _text_2d->transform.set_origin(Vector2(1200, 250)); + + Renderer::initialize(); +} + +GameScene::~GameScene() { + Renderer::destroy(); + + memdelete(tile_map); + memdelete(camera); + memdelete(sprite); +} diff --git a/tools/merger/test/game_scene.h b/tools/merger/test/game_scene.h new file mode 100644 index 0000000..05c7eed --- /dev/null +++ b/tools/merger/test/game_scene.h @@ -0,0 +1,50 @@ +#ifndef GAME_SCENE_H +#define GAME_SCENE_H + +#include "sfw.h" + +class GameScene : public Scene { + SFW_OBJECT(GameScene, Scene); + +public: + virtual void input_event(const Ref &event); + virtual void update(float delta); + virtual void render(); + virtual void render_immediate(); + virtual void render_obj(); + + GameScene(); + ~GameScene(); + + bool left; + bool right; + bool up; + bool down; + + Ref image; + Ref texture; + Ref material; + + Ref _font; + Sprite *_font_test_sprite; + Ref _font_test_mat; + + Ref _font_test_mesh; + MeshInstance2D *_font_test_mi; + + Camera2D *camera_2d; + TileMap *tile_map; + Sprite *sprite; + + Camera3D *camera; + Ref mesh; + MeshInstance3D *mi; + MeshInstance3D *mi2; + Ref color_material; + + Text2D *_text_2d; + + //ColoredMaterial *cmaterial; +}; + +#endif \ No newline at end of file diff --git a/tools/merger/test/icon.png b/tools/merger/test/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a263d7572781d43daccb5cf0171afde14093cf83 GIT binary patch literal 12259 zcmZ{KWmFwauL#9Ah-pGaB#N-cXti$?|k>Ze{a3D zX4cH~R9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O=hpsAx`fV*uCy0JUAC>NwlyZnd%UdyNhJjsG3( zao-}wpkQpis1k$`?%^waA$y~_8w(Jh*A}#RGJydwz4@j3!<~RGJ|qvm9B@l`jN|)u z@;Tk50|R5;f{$>|K3Jv=u4602aXUd}__0B91#unyme38bVUs8mUrF`7{|M`<;@LP! nV{DrP3`ilA|DR(D^+lZ8YsE0@DWxAu&<7M`RHdswn1=ix_DE9( literal 0 HcmV?d00001 diff --git a/tools/merger/test/main.cpp b/tools/merger/test/main.cpp new file mode 100644 index 0000000..684c929 --- /dev/null +++ b/tools/merger/test/main.cpp @@ -0,0 +1,21 @@ +#ifdef __EMSCRIPTEN__ +#include +#endif // __EMSCRIPTEN__ + +#include "game_application.h" + +int main(int argc, char **argv) { + Application *application = memnew(GameApplication()); + +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(&Application::main_loop_static, 0, 1); +#else + while (application->running) { + application->main_loop(); + } +#endif // __EMSCRIPTEN__ + + memdelete(application); + + return 0; +}