Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standalone formspec renderer #9188

Closed

Conversation

rubenwardy
Copy link
Member

@rubenwardy rubenwardy commented Dec 11, 2019

The aim of this PR is to introduce a new way to create formspec screenshots, for use in automated testing. This is done by adding a new formspec environment called StandaloneFormspecRenderer, and command line options to use it

To do

  • Implement destructor
  • Improve CLI arguments

How to test

echo "size[3,3]button[1,1;2,2;btn;Button]" > /tmp/button.fs
./bin/minetest --render-formspec --file /tmp/button.fs --o /tmp/formspec.png
xdg-open /tmp/formspec.png

@rubenwardy rubenwardy added Code quality Feature ✨ PRs that add or enhance a feature Formspec Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements labels Dec 11, 2019
src/main.cpp Outdated Show resolved Hide resolved
@nerzhul
Copy link
Member

nerzhul commented May 5, 2020

This is an interesting option for debugging. Can you provide a video of it in action ?

@rubenwardy
Copy link
Member Author

There's nothing to show in a video - it renders a single frame to a file and exits

Co-authored-by: Thomas--S <Thomas--S@users.noreply.github.com>
#pragma once

#ifdef __ANDROID__
#error formspectestexecutor.h should not be included on Android
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#error formspectestexecutor.h should not be included on Android
#error StandaloneFormspecRenderer.h should not be included on Android

ISimpleTextureSource *m_texture_source;
FormspecFormSource *m_formspecgui;
TextDest *m_buttonhandler;
IMenuManager *menuManager;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use unique_ptr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And irr_ptr for the things below. ↓

@Desour
Copy link
Member

Desour commented May 5, 2020

Tested, works. 👍
(Your cat in the How to test example should probably be an echo btw..)

@rubenwardy rubenwardy closed this Aug 8, 2020
@rubenwardy rubenwardy moved this from PRs to Done in Testing and Quality Control Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality Feature ✨ PRs that add or enhance a feature Formspec Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants