18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 18:05:01 +01:00

wasm display support

This commit is contained in:
2026-11-10 00:57:37 +01:00
parent 685258d787
commit 18c333b089
25 changed files with 2521 additions and 23 deletions

View File

@@ -22,8 +22,12 @@ http://mozilla.org/MPL/2.0/.
#include "audio/sound.h"
#include "world/Spring.h"
#include "vehicle/mirrors.h"
#include "scripting/wasmscreenrules.h"
#include <vector>
#include <memory>
class wasm_screen; // scripting/wasmscreens.h
#define EU07_SOUND_BOGIESOUNDS
@@ -251,6 +255,9 @@ public:
int update_rate { 0 }; // -1: per stop, 0: none, >0: fps // TBD, TODO: implement?
std::string instancing; // potential method to generate more than one texture per timetable
std::string parameters; // potential extra parameters supplied by mmd file
wasm_screens::screen_config wasm; // potential WebAssembly sign (wasmdestinationsign:), used in place of the python one while wasm screens are on
std::shared_ptr<wasm_screen> wasm_sign; // the wasm screen drawing the current destination
std::string wasm_request; // its input: the key=value pairs a python sign gets for its texture
// methods
void deserialize( cParser &Input );
private:
@@ -726,6 +733,8 @@ private:
void update_load_offset();
void shuffle_load_order();
void update_destinations();
// feeds the wasm destination sign with fresh data, when it is shown and due
void update_wasm_destination();
bool Update(double dt, double dt1);
bool FastUpdate(double dt);
void Move(double fDistance);
@@ -849,6 +858,10 @@ private:
// blanks electronic destination sign at the end of the service; physical signs stay until changed
void DestinationClear();
material_handle DestinationFind( std::string Destination );
// the name of a generated destination sign texture: the script, the timetable, the instancing and the parameters
std::string destination_request( std::string const &Script, std::string const &Instancing, std::string const &Parameters ) const;
// makes the destination sign a wasm screen, when the vehicle has one and the wasm screens are on. returns true when it did
bool destination_set_wasm( std::string const &Numer );
void OverheadTrack(float o);
glm::dvec3 get_future_movement() const;
void move_set(double distance);