aboutsummaryrefslogtreecommitdiff
path: root/advtrains
Commit message (Expand)AuthorAge
...
* Fix player_to_train_mapping (H#74)orwell962018-12-16
* Fix 144e1fc4e01741f8cdd5a579ae84cde85c420d78 (there's no self in one of the i...orwell962018-12-10
* Fix crashes:orwell962018-12-10
* Change get_inventory_formspec API - add invname parameterorwell962018-12-10
* Shunt signals (not exactly Ks), along with fixes in other components that tho...orwell962018-12-08
* Apply speed restriction 0.5 indexes later, do not cap tarvelocity by speed_re...orwell962018-12-04
* Added on_train_approach callback, non-permanent external LZB brakepoints and ...orwell962018-11-29
* Implement new position encoding function and benchmark itorwell962018-11-29
* Fix discouple positioning when wagon was just loadedorwell962018-11-20
* Remove superfluous "tarvelocity" assignmentsorwell962018-11-20
* Make "Line" property accessible from OBC and gettable via LATC, change subway...orwell962018-11-20
* Remove debug printorwell962018-11-20
* Fix protection regarding tracks (track_builder and railway_operator) and docu...orwell962018-11-12
* Increase savefile version to 2orwell962018-11-10
* Remove "couple locks" and apply protection to the actual coupling process, an...orwell962018-11-10
* No static_save for discouple entitiesorwell962018-10-30
* Document fix 0a982b6356b2f4b6a28e74f9f90c4f584169a96dorwell962018-10-29
* Actually set last_connid to 1, to prevent warningorwell962018-10-29
* Handle the case that a train is not initialized (train_ensure_init returns ni...orwell962018-10-29
* atdump() to treat certain values specialorwell962018-10-29
* Small fixes which do not have any effectorwell962018-10-29
* Complete Ks Main signalsorwell962018-10-26
* Fix node database ATC rail bugorwell962018-10-17
* Prevent any user control except "Brake" when an ATC override is presentorwell962018-10-17
* Improve ATC-LZB-User control interaction, smoothen LZB control operationsorwell962018-10-17
* Address H#60, H#17, M#18 and M#7orwell962018-10-17
* Fix H#69orwell962018-10-17
* Fix H#66 (Hemiptera 66) crash on missing double_conn matchorwell962018-10-17
* Actually allow what manual promises (setting IP on non-assigned signals)orwell962018-10-17
* Properly handle speed restrictionsorwell962018-10-10
* Remote Routesetting from Onboard Computerorwell962018-10-10
* Properly implement invalidate_all_paths, recheck lzb on aspect changeorwell962018-10-10
* Add signal safety control override, restructure control systemorwell962018-10-10
* Make signal influence point (~halt point) specifiableorwell962018-10-09
* Improve route programming:orwell962018-10-07
* Add interlocking guide/manual, silence debug outputsorwell962018-09-14
* Move passive API to the advtrains coreorwell962018-08-16
* Fix various bugs found while testingorwell962018-08-13
* Teleport player to their train every 2 seconds instead of just on_joinplayerorwell962018-08-12
* Fix some incompatibility crash for old worldsorwell962018-08-12
* onboard computer fixh-v-smacker2018-08-12
* Remove redundant digtron.lua fileGabriel Pérez-Cerezo2018-08-12
* Make digtron able to build tracks.Gabriel Pérez-Cerezo2018-08-12
* Fix ATC rail reversingorwell962018-08-12
* Signal aspect handling, make default signals compatible, fix signal diggingorwell962018-08-12
* Add routesetting callbacks.orwell962018-08-12
* Implement routesettingorwell962018-07-21
* Signal assignment and route programming procedureorwell962018-07-04
* Add off-track train flag, fixes wagon object property reset on reversingorwell962018-07-04
* Implement trains blocking sectionsorwell962018-06-29
">// default is rail-like fixed(-BS/2, -BS/2, -BS/2, BS/2, -BS/2+BS/16., BS/2), // default is sign/ladder-like wall_top(-BS/2, BS/2-BS/16., -BS/2, BS/2, BS/2, BS/2), wall_bottom(-BS/2, -BS/2, -BS/2, BS/2, -BS/2+BS/16., BS/2), wall_side(-BS/2, -BS/2, -BS/2, -BS/2+BS/16., BS/2, BS/2) {} void serialize(std::ostream &os) const; void deSerialize(std::istream &is); }; struct MapNode; class NodeMetadata; struct MaterialSpec { std::string tname; bool backface_culling; MaterialSpec(const std::string &tname_="", bool backface_culling_=true): tname(tname_), backface_culling(backface_culling_) {} void serialize(std::ostream &os) const; void deSerialize(std::istream &is); }; enum NodeDrawType { NDT_NORMAL, // A basic solid block NDT_AIRLIKE, // Nothing is drawn NDT_LIQUID, // Do not draw face towards same kind of flowing/source liquid NDT_FLOWINGLIQUID, // A very special kind of thing NDT_GLASSLIKE, // Glass-like, don't draw faces towards other glass NDT_ALLFACES, // Leaves-like, draw all faces no matter what NDT_ALLFACES_OPTIONAL, // Fancy -> allfaces, fast -> normal NDT_TORCHLIKE, NDT_SIGNLIKE, NDT_PLANTLIKE, NDT_FENCELIKE, NDT_RAILLIKE, }; #define CF_SPECIAL_COUNT 2 struct ContentFeatures { /* Cached stuff */ #ifndef SERVER // 0 1 2 3 4 5 // up down right left back front TileSpec tiles[6]; // Special tiles // - Currently used for flowing liquids TileSpec special_tiles[CF_SPECIAL_COUNT]; u8 solidness; // Used when choosing which face is drawn u8 visual_solidness; // When solidness=0, this tells how it looks like bool backface_culling; #endif // Server-side cached callback existence for fast skipping bool has_on_construct; bool has_on_destruct; bool has_after_destruct; /* Actual data */ std::string name; // "" = undefined node ItemGroupList groups; // Same as in itemdef // Visual definition enum NodeDrawType drawtype; float visual_scale; // Misc. scale parameter std::string tname_tiles[6]; MaterialSpec mspec_special[CF_SPECIAL_COUNT]; // Use setter methods u8 alpha; // Post effect color, drawn when the camera is inside the node. video::SColor post_effect_color; // Type of MapNode::param1 ContentParamType param_type; // Type of MapNode::param2 ContentParamType2 param_type_2; // True for all ground-like things like stone and mud, false for eg. trees bool is_ground_content; bool light_propagates; bool sunlight_propagates; // This is used for collision detection. // Also for general solidness queries. bool walkable; // Player can point to these bool pointable; // Player can dig these bool diggable; // Player can climb these bool climbable; // Player can build on these bool buildable_to; // Whether the node is non-liquid, source liquid or flowing liquid enum LiquidType liquid_type; // If the content is liquid, this is the flowing version of the liquid. std::string liquid_alternative_flowing; // If the content is liquid, this is the source version of the liquid. std::string liquid_alternative_source; // Viscosity for fluid flow, ranging from 1 to 7, with // 1 giving almost instantaneous propagation and 7 being // the slowest possible u8 liquid_viscosity; // Amount of light the node emits u8 light_source; u32 damage_per_second; NodeBox selection_box; // Compatibility with old maps // Set to true if paramtype used to be 'facedir_simple' bool legacy_facedir_simple; // Set to true if wall_mounted used to be set to true bool legacy_wallmounted; // Sound properties SimpleSoundSpec sound_footstep; SimpleSoundSpec sound_dig; SimpleSoundSpec sound_dug; /* Methods */ ContentFeatures(); ~ContentFeatures(); void reset(); void serialize(std::ostream &os); void deSerialize(std::istream &is); /* Some handy methods */ bool isLiquid() const{ return (liquid_type != LIQUID_NONE); } bool sameLiquid(const ContentFeatures &f) const{ if(!isLiquid() || !f.isLiquid()) return false; return (liquid_alternative_flowing == f.liquid_alternative_flowing); } }; class INodeDefManager { public: INodeDefManager(){} virtual ~INodeDefManager(){} // Get node definition virtual const ContentFeatures& get(content_t c) const=0; virtual const ContentFeatures& get(const MapNode &n) const=0; virtual bool getId(const std::string &name, content_t &result) const=0; virtual content_t getId(const std::string &name) const=0; // Allows "group:name" in addition to regular node names virtual void getIds(const std::string &name, std::set<content_t> &result) const=0; virtual const ContentFeatures& get(const std::string &name) const=0; virtual void serialize(std::ostream &os)=0; }; class IWritableNodeDefManager : public INodeDefManager { public: IWritableNodeDefManager(){} virtual ~IWritableNodeDefManager(){} virtual IWritableNodeDefManager* clone()=0; // Get node definition virtual const ContentFeatures& get(content_t c) const=0; virtual const ContentFeatures& get(const MapNode &n) const=0; virtual bool getId(const std::string &name, content_t &result) const=0; virtual content_t getId(const std::string &name) const=0; // Allows "group:name" in addition to regular node names virtual void getIds(const std::string &name, std::set<content_t> &result) const=0; // If not found, returns the features of CONTENT_IGNORE virtual const ContentFeatures& get(const std::string &name) const=0; // Register node definition virtual void set(content_t c, const ContentFeatures &def)=0; // Register node definition by name (allocate an id) // If returns CONTENT_IGNORE, could not allocate id virtual content_t set(const std::string &name, const ContentFeatures &def)=0; // If returns CONTENT_IGNORE, could not allocate id virtual content_t allocateDummy(const std::string &name)=0; /* Update item alias mapping. Call after updating item definitions. */ virtual void updateAliases(IItemDefManager *idef)=0; /* Update tile textures to latest return values of TextueSource. Call after updating the texture atlas of a TextureSource. */ virtual void updateTextures(ITextureSource *tsrc)=0; virtual void serialize(std::ostream &os)=0; virtual void deSerialize(std::istream &is)=0; };