diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 35795f84fb..8317b7ee6e 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -7,10 +7,99 @@ objects = { /* Begin PBXBuildFile section */ - C61FAAE21CD1643A0010C9D8 /* paint_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = C61FAAE01CD1643A0010C9D8 /* paint_surface.c */; }; C650B2191CCABBDD00B4D91C /* S4Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C650B2151CCABBDD00B4D91C /* S4Importer.cpp */; }; C650B21A1CCABBDD00B4D91C /* tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C650B2171CCABBDD00B4D91C /* tables.cpp */; }; C650B21C1CCABC4400B4D91C /* ConvertCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C650B21B1CCABC4400B4D91C /* ConvertCommand.cpp */; }; + C686F8AC1CDBC37E009F9BFC /* banner.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8981CDBC37E009F9BFC /* banner.c */; }; + C686F8AD1CDBC37E009F9BFC /* entrance.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8991CDBC37E009F9BFC /* entrance.c */; }; + C686F8AE1CDBC37E009F9BFC /* fence.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F89A1CDBC37E009F9BFC /* fence.c */; }; + C686F8AF1CDBC37E009F9BFC /* map_element.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F89B1CDBC37E009F9BFC /* map_element.c */; }; + C686F8B01CDBC37E009F9BFC /* path.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F89D1CDBC37E009F9BFC /* path.c */; }; + C686F8B11CDBC37E009F9BFC /* scenery.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F89E1CDBC37E009F9BFC /* scenery.c */; }; + C686F8B21CDBC37E009F9BFC /* scenery_multiple.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F89F1CDBC37E009F9BFC /* scenery_multiple.c */; }; + C686F8B31CDBC37E009F9BFC /* surface.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8A01CDBC37E009F9BFC /* surface.c */; }; + C686F8B41CDBC37E009F9BFC /* paint.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8A21CDBC37E009F9BFC /* paint.c */; }; + C686F8B51CDBC37E009F9BFC /* litter.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8A51CDBC37E009F9BFC /* litter.c */; }; + C686F8B61CDBC37E009F9BFC /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8A61CDBC37E009F9BFC /* misc.c */; }; + C686F8B71CDBC37E009F9BFC /* peep.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8A71CDBC37E009F9BFC /* peep.c */; }; + C686F8B81CDBC37E009F9BFC /* sprite.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8A81CDBC37E009F9BFC /* sprite.c */; }; + C686F8B91CDBC37E009F9BFC /* supports.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8AA1CDBC37E009F9BFC /* supports.c */; }; + C686F90B1CDBC3B7009F9BFC /* air_powered_vertical_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8BB1CDBC3B7009F9BFC /* air_powered_vertical_coaster.c */; }; + C686F90C1CDBC3B7009F9BFC /* bobsleigh_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8BC1CDBC3B7009F9BFC /* bobsleigh_coaster.c */; }; + C686F90D1CDBC3B7009F9BFC /* compact_inverted_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8BD1CDBC3B7009F9BFC /* compact_inverted_coaster.c */; }; + C686F90E1CDBC3B7009F9BFC /* corkscrew_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8BE1CDBC3B7009F9BFC /* corkscrew_roller_coaster.c */; }; + C686F90F1CDBC3B7009F9BFC /* flying_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8BF1CDBC3B7009F9BFC /* flying_roller_coaster.c */; }; + C686F9101CDBC3B7009F9BFC /* giga_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C01CDBC3B7009F9BFC /* giga_coaster.c */; }; + C686F9111CDBC3B7009F9BFC /* heartline_twister_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C11CDBC3B7009F9BFC /* heartline_twister_coaster.c */; }; + C686F9121CDBC3B7009F9BFC /* inverted_hairpin_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C21CDBC3B7009F9BFC /* inverted_hairpin_coaster.c */; }; + C686F9131CDBC3B7009F9BFC /* inverted_impulse_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C31CDBC3B7009F9BFC /* inverted_impulse_coaster.c */; }; + C686F9141CDBC3B7009F9BFC /* inverted_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C41CDBC3B7009F9BFC /* inverted_roller_coaster.c */; }; + C686F9151CDBC3B7009F9BFC /* junior_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C51CDBC3B7009F9BFC /* junior_roller_coaster.c */; }; + C686F9161CDBC3B7009F9BFC /* lay_down_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C61CDBC3B7009F9BFC /* lay_down_roller_coaster.c */; }; + C686F9171CDBC3B7009F9BFC /* lim_launched_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C71CDBC3B7009F9BFC /* lim_launched_roller_coaster.c */; }; + C686F9181CDBC3B7009F9BFC /* looping_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C81CDBC3B7009F9BFC /* looping_roller_coaster.c */; }; + C686F9191CDBC3B7009F9BFC /* mine_ride.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8C91CDBC3B7009F9BFC /* mine_ride.c */; }; + C686F91A1CDBC3B7009F9BFC /* mine_train_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8CA1CDBC3B7009F9BFC /* mine_train_coaster.c */; }; + C686F91B1CDBC3B7009F9BFC /* mini_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8CB1CDBC3B7009F9BFC /* mini_roller_coaster.c */; }; + C686F91C1CDBC3B7009F9BFC /* mini_suspended_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8CC1CDBC3B7009F9BFC /* mini_suspended_coaster.c */; }; + C686F91D1CDBC3B7009F9BFC /* multi_dimension_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8CD1CDBC3B7009F9BFC /* multi_dimension_roller_coaster.c */; }; + C686F91E1CDBC3B7009F9BFC /* reverse_freefall_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8CE1CDBC3B7009F9BFC /* reverse_freefall_coaster.c */; }; + C686F91F1CDBC3B7009F9BFC /* reverser_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8CF1CDBC3B7009F9BFC /* reverser_roller_coaster.c */; }; + C686F9201CDBC3B7009F9BFC /* side_friction_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D01CDBC3B7009F9BFC /* side_friction_roller_coaster.c */; }; + C686F9211CDBC3B7009F9BFC /* spiral_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D11CDBC3B7009F9BFC /* spiral_roller_coaster.c */; }; + C686F9221CDBC3B7009F9BFC /* stand_up_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D21CDBC3B7009F9BFC /* stand_up_roller_coaster.c */; }; + C686F9231CDBC3B7009F9BFC /* steeplechase.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D31CDBC3B7009F9BFC /* steeplechase.c */; }; + C686F9241CDBC3B7009F9BFC /* suspended_swinging_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D41CDBC3B7009F9BFC /* suspended_swinging_coaster.c */; }; + C686F9251CDBC3B7009F9BFC /* twister_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D51CDBC3B7009F9BFC /* twister_roller_coaster.c */; }; + C686F9261CDBC3B7009F9BFC /* vertical_drop_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D61CDBC3B7009F9BFC /* vertical_drop_roller_coaster.c */; }; + C686F9271CDBC3B7009F9BFC /* virginia_reel.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D71CDBC3B7009F9BFC /* virginia_reel.c */; }; + C686F9281CDBC3B7009F9BFC /* wild_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D81CDBC3B7009F9BFC /* wild_mouse.c */; }; + C686F9291CDBC3B7009F9BFC /* wooden_roller_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8D91CDBC3B7009F9BFC /* wooden_roller_coaster.c */; }; + C686F92A1CDBC3B7009F9BFC /* wooden_wild_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8DA1CDBC3B7009F9BFC /* wooden_wild_mouse.c */; }; + C686F92B1CDBC3B7009F9BFC /* car_ride.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8DC1CDBC3B7009F9BFC /* car_ride.c */; }; + C686F92C1CDBC3B7009F9BFC /* circus_show.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8DD1CDBC3B7009F9BFC /* circus_show.c */; }; + C686F92D1CDBC3B7009F9BFC /* crooked_house.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8DE1CDBC3B7009F9BFC /* crooked_house.c */; }; + C686F92E1CDBC3B7009F9BFC /* dodgems.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8DF1CDBC3B7009F9BFC /* dodgems.c */; }; + C686F92F1CDBC3B7009F9BFC /* ferris_wheel.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E01CDBC3B7009F9BFC /* ferris_wheel.c */; }; + C686F9301CDBC3B7009F9BFC /* flying_saucers.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E11CDBC3B7009F9BFC /* flying_saucers.c */; }; + C686F9311CDBC3B7009F9BFC /* ghost_train.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E21CDBC3B7009F9BFC /* ghost_train.c */; }; + C686F9321CDBC3B7009F9BFC /* haunted_house.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E31CDBC3B7009F9BFC /* haunted_house.c */; }; + C686F9331CDBC3B7009F9BFC /* maze.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E41CDBC3B7009F9BFC /* maze.c */; }; + C686F9341CDBC3B7009F9BFC /* merry_go_round.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E51CDBC3B7009F9BFC /* merry_go_round.c */; }; + C686F9351CDBC3B7009F9BFC /* mini_golf.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E61CDBC3B7009F9BFC /* mini_golf.c */; }; + C686F9361CDBC3B7009F9BFC /* mini_helicopters.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E71CDBC3B7009F9BFC /* mini_helicopters.c */; }; + C686F9371CDBC3B7009F9BFC /* monorail_cycles.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E81CDBC3B7009F9BFC /* monorail_cycles.c */; }; + C686F9381CDBC3B7009F9BFC /* observation_tower.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8E91CDBC3B7009F9BFC /* observation_tower.c */; }; + C686F9391CDBC3B7009F9BFC /* space_rings.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8EA1CDBC3B7009F9BFC /* space_rings.c */; }; + C686F93A1CDBC3B7009F9BFC /* spiral_slide.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8EB1CDBC3B7009F9BFC /* spiral_slide.c */; }; + C686F93B1CDBC3B7009F9BFC /* facility.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8ED1CDBC3B7009F9BFC /* facility.c */; }; + C686F93C1CDBC3B7009F9BFC /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8EE1CDBC3B7009F9BFC /* misc.c */; }; + C686F93D1CDBC3B7009F9BFC /* shop.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8EF1CDBC3B7009F9BFC /* shop.c */; }; + C686F93E1CDBC3B7009F9BFC /* 3d_cinema.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F11CDBC3B7009F9BFC /* 3d_cinema.c */; }; + C686F93F1CDBC3B7009F9BFC /* enterprise.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F21CDBC3B7009F9BFC /* enterprise.c */; }; + C686F9401CDBC3B7009F9BFC /* go_karts.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F31CDBC3B7009F9BFC /* go_karts.c */; }; + C686F9411CDBC3B7009F9BFC /* launched_freefall.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F41CDBC3B7009F9BFC /* launched_freefall.c */; }; + C686F9421CDBC3B7009F9BFC /* magic_carpet.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F51CDBC3B7009F9BFC /* magic_carpet.c */; }; + C686F9431CDBC3B7009F9BFC /* motion_simulator.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F61CDBC3B7009F9BFC /* motion_simulator.c */; }; + C686F9441CDBC3B7009F9BFC /* pirate_ship.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F71CDBC3B7009F9BFC /* pirate_ship.c */; }; + C686F9451CDBC3B7009F9BFC /* roto_drop.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F81CDBC3B7009F9BFC /* roto_drop.c */; }; + C686F9461CDBC3B7009F9BFC /* swinging_inverter_ship.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8F91CDBC3B7009F9BFC /* swinging_inverter_ship.c */; }; + C686F9471CDBC3B7009F9BFC /* top_spin.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8FA1CDBC3B7009F9BFC /* top_spin.c */; }; + C686F9481CDBC3B7009F9BFC /* twist.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8FB1CDBC3B7009F9BFC /* twist.c */; }; + C686F9491CDBC3B7009F9BFC /* chairlift.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8FD1CDBC3B7009F9BFC /* chairlift.c */; }; + C686F94A1CDBC3B7009F9BFC /* lift.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8FE1CDBC3B7009F9BFC /* lift.c */; }; + C686F94B1CDBC3B7009F9BFC /* minature_railway.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F8FF1CDBC3B7009F9BFC /* minature_railway.c */; }; + C686F94C1CDBC3B7009F9BFC /* monorail.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9001CDBC3B7009F9BFC /* monorail.c */; }; + C686F94D1CDBC3B7009F9BFC /* suspended_monorail.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9011CDBC3B7009F9BFC /* suspended_monorail.c */; }; + C686F94E1CDBC3B7009F9BFC /* boat_ride.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9031CDBC3B7009F9BFC /* boat_ride.c */; }; + C686F94F1CDBC3B7009F9BFC /* dingy_slide.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9041CDBC3B7009F9BFC /* dingy_slide.c */; }; + C686F9501CDBC3B7009F9BFC /* log_flume.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9051CDBC3B7009F9BFC /* log_flume.c */; }; + C686F9511CDBC3B7009F9BFC /* river_rafts.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9061CDBC3B7009F9BFC /* river_rafts.c */; }; + C686F9521CDBC3B7009F9BFC /* river_rapids.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9071CDBC3B7009F9BFC /* river_rapids.c */; }; + C686F9531CDBC3B7009F9BFC /* splash_boats.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9081CDBC3B7009F9BFC /* splash_boats.c */; }; + C686F9541CDBC3B7009F9BFC /* submarine_ride.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9091CDBC3B7009F9BFC /* submarine_ride.c */; }; + C686F9551CDBC3B7009F9BFC /* water_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F90A1CDBC3B7009F9BFC /* water_coaster.c */; }; + C686F9581CDBC4C7009F9BFC /* vehicle_paint.c in Sources */ = {isa = PBXBuildFile; fileRef = C686F9561CDBC4C7009F9BFC /* vehicle_paint.c */; }; D41B73EF1C2101890080A7B9 /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B73EE1C2101890080A7B9 /* libcurl.tbd */; }; D41B73F11C21018C0080A7B9 /* libssl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B73F01C21018C0080A7B9 /* libssl.tbd */; }; D41B741D1C210A7A0080A7B9 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B741C1C210A7A0080A7B9 /* libiconv.tbd */; }; @@ -46,7 +135,6 @@ D442720F1CC81B3200D84D28 /* scrolling_text.c in Sources */ = {isa = PBXBuildFile; fileRef = D44271091CC81B3200D84D28 /* scrolling_text.c */; }; D44272101CC81B3200D84D28 /* sprite.c in Sources */ = {isa = PBXBuildFile; fileRef = D442710A1CC81B3200D84D28 /* sprite.c */; }; D44272111CC81B3200D84D28 /* string.c in Sources */ = {isa = PBXBuildFile; fileRef = D442710B1CC81B3200D84D28 /* string.c */; }; - D44272121CC81B3200D84D28 /* supports.c in Sources */ = {isa = PBXBuildFile; fileRef = D442710C1CC81B3200D84D28 /* supports.c */; }; D44272131CC81B3200D84D28 /* editor.c in Sources */ = {isa = PBXBuildFile; fileRef = D442710E1CC81B3200D84D28 /* editor.c */; }; D44272141CC81B3200D84D28 /* game.c in Sources */ = {isa = PBXBuildFile; fileRef = D44271101CC81B3200D84D28 /* game.c */; }; D44272151CC81B3200D84D28 /* hook.c in Sources */ = {isa = PBXBuildFile; fileRef = D44271121CC81B3200D84D28 /* hook.c */; }; @@ -230,13 +318,107 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C61FAAE01CD1643A0010C9D8 /* paint_surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = paint_surface.c; sourceTree = ""; }; - C61FAAE11CD1643A0010C9D8 /* paint_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = paint_surface.h; sourceTree = ""; }; C650B2151CCABBDD00B4D91C /* S4Importer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = S4Importer.cpp; sourceTree = ""; }; C650B2161CCABBDD00B4D91C /* S4Importer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = S4Importer.h; sourceTree = ""; }; C650B2171CCABBDD00B4D91C /* tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tables.cpp; sourceTree = ""; }; C650B2181CCABBDD00B4D91C /* Tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tables.h; sourceTree = ""; }; C650B21B1CCABC4400B4D91C /* ConvertCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConvertCommand.cpp; sourceTree = ""; }; + C686F8981CDBC37E009F9BFC /* banner.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = banner.c; sourceTree = ""; }; + C686F8991CDBC37E009F9BFC /* entrance.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = entrance.c; sourceTree = ""; }; + C686F89A1CDBC37E009F9BFC /* fence.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fence.c; sourceTree = ""; }; + C686F89B1CDBC37E009F9BFC /* map_element.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = map_element.c; sourceTree = ""; }; + C686F89C1CDBC37E009F9BFC /* map_element.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = map_element.h; sourceTree = ""; }; + C686F89D1CDBC37E009F9BFC /* path.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = path.c; sourceTree = ""; }; + C686F89E1CDBC37E009F9BFC /* scenery.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scenery.c; sourceTree = ""; }; + C686F89F1CDBC37E009F9BFC /* scenery_multiple.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scenery_multiple.c; sourceTree = ""; }; + C686F8A01CDBC37E009F9BFC /* surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = surface.c; sourceTree = ""; }; + C686F8A11CDBC37E009F9BFC /* surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = surface.h; sourceTree = ""; }; + C686F8A21CDBC37E009F9BFC /* paint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = paint.c; sourceTree = ""; }; + C686F8A31CDBC37E009F9BFC /* paint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = paint.h; sourceTree = ""; }; + C686F8A51CDBC37E009F9BFC /* litter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = litter.c; sourceTree = ""; }; + C686F8A61CDBC37E009F9BFC /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; + C686F8A71CDBC37E009F9BFC /* peep.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = peep.c; sourceTree = ""; }; + C686F8A81CDBC37E009F9BFC /* sprite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sprite.c; sourceTree = ""; }; + C686F8A91CDBC37E009F9BFC /* sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sprite.h; sourceTree = ""; }; + C686F8AA1CDBC37E009F9BFC /* supports.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = supports.c; sourceTree = ""; }; + C686F8AB1CDBC37E009F9BFC /* supports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = supports.h; sourceTree = ""; }; + C686F8BB1CDBC3B7009F9BFC /* air_powered_vertical_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = air_powered_vertical_coaster.c; sourceTree = ""; }; + C686F8BC1CDBC3B7009F9BFC /* bobsleigh_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bobsleigh_coaster.c; sourceTree = ""; }; + C686F8BD1CDBC3B7009F9BFC /* compact_inverted_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = compact_inverted_coaster.c; sourceTree = ""; }; + C686F8BE1CDBC3B7009F9BFC /* corkscrew_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = corkscrew_roller_coaster.c; sourceTree = ""; }; + C686F8BF1CDBC3B7009F9BFC /* flying_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = flying_roller_coaster.c; sourceTree = ""; }; + C686F8C01CDBC3B7009F9BFC /* giga_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = giga_coaster.c; sourceTree = ""; }; + C686F8C11CDBC3B7009F9BFC /* heartline_twister_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = heartline_twister_coaster.c; sourceTree = ""; }; + C686F8C21CDBC3B7009F9BFC /* inverted_hairpin_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inverted_hairpin_coaster.c; sourceTree = ""; }; + C686F8C31CDBC3B7009F9BFC /* inverted_impulse_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inverted_impulse_coaster.c; sourceTree = ""; }; + C686F8C41CDBC3B7009F9BFC /* inverted_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inverted_roller_coaster.c; sourceTree = ""; }; + C686F8C51CDBC3B7009F9BFC /* junior_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = junior_roller_coaster.c; sourceTree = ""; }; + C686F8C61CDBC3B7009F9BFC /* lay_down_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lay_down_roller_coaster.c; sourceTree = ""; }; + C686F8C71CDBC3B7009F9BFC /* lim_launched_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lim_launched_roller_coaster.c; sourceTree = ""; }; + C686F8C81CDBC3B7009F9BFC /* looping_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = looping_roller_coaster.c; sourceTree = ""; }; + C686F8C91CDBC3B7009F9BFC /* mine_ride.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mine_ride.c; sourceTree = ""; }; + C686F8CA1CDBC3B7009F9BFC /* mine_train_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mine_train_coaster.c; sourceTree = ""; }; + C686F8CB1CDBC3B7009F9BFC /* mini_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mini_roller_coaster.c; sourceTree = ""; }; + C686F8CC1CDBC3B7009F9BFC /* mini_suspended_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mini_suspended_coaster.c; sourceTree = ""; }; + C686F8CD1CDBC3B7009F9BFC /* multi_dimension_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = multi_dimension_roller_coaster.c; sourceTree = ""; }; + C686F8CE1CDBC3B7009F9BFC /* reverse_freefall_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = reverse_freefall_coaster.c; sourceTree = ""; }; + C686F8CF1CDBC3B7009F9BFC /* reverser_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = reverser_roller_coaster.c; sourceTree = ""; }; + C686F8D01CDBC3B7009F9BFC /* side_friction_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = side_friction_roller_coaster.c; sourceTree = ""; }; + C686F8D11CDBC3B7009F9BFC /* spiral_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = spiral_roller_coaster.c; sourceTree = ""; }; + C686F8D21CDBC3B7009F9BFC /* stand_up_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stand_up_roller_coaster.c; sourceTree = ""; }; + C686F8D31CDBC3B7009F9BFC /* steeplechase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = steeplechase.c; sourceTree = ""; }; + C686F8D41CDBC3B7009F9BFC /* suspended_swinging_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = suspended_swinging_coaster.c; sourceTree = ""; }; + C686F8D51CDBC3B7009F9BFC /* twister_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = twister_roller_coaster.c; sourceTree = ""; }; + C686F8D61CDBC3B7009F9BFC /* vertical_drop_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vertical_drop_roller_coaster.c; sourceTree = ""; }; + C686F8D71CDBC3B7009F9BFC /* virginia_reel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = virginia_reel.c; sourceTree = ""; }; + C686F8D81CDBC3B7009F9BFC /* wild_mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wild_mouse.c; sourceTree = ""; }; + C686F8D91CDBC3B7009F9BFC /* wooden_roller_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wooden_roller_coaster.c; sourceTree = ""; }; + C686F8DA1CDBC3B7009F9BFC /* wooden_wild_mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wooden_wild_mouse.c; sourceTree = ""; }; + C686F8DC1CDBC3B7009F9BFC /* car_ride.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = car_ride.c; sourceTree = ""; }; + C686F8DD1CDBC3B7009F9BFC /* circus_show.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = circus_show.c; sourceTree = ""; }; + C686F8DE1CDBC3B7009F9BFC /* crooked_house.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crooked_house.c; sourceTree = ""; }; + C686F8DF1CDBC3B7009F9BFC /* dodgems.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dodgems.c; sourceTree = ""; }; + C686F8E01CDBC3B7009F9BFC /* ferris_wheel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ferris_wheel.c; sourceTree = ""; }; + C686F8E11CDBC3B7009F9BFC /* flying_saucers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = flying_saucers.c; sourceTree = ""; }; + C686F8E21CDBC3B7009F9BFC /* ghost_train.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ghost_train.c; sourceTree = ""; }; + C686F8E31CDBC3B7009F9BFC /* haunted_house.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = haunted_house.c; sourceTree = ""; }; + C686F8E41CDBC3B7009F9BFC /* maze.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = maze.c; sourceTree = ""; }; + C686F8E51CDBC3B7009F9BFC /* merry_go_round.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = merry_go_round.c; sourceTree = ""; }; + C686F8E61CDBC3B7009F9BFC /* mini_golf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mini_golf.c; sourceTree = ""; }; + C686F8E71CDBC3B7009F9BFC /* mini_helicopters.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mini_helicopters.c; sourceTree = ""; }; + C686F8E81CDBC3B7009F9BFC /* monorail_cycles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = monorail_cycles.c; sourceTree = ""; }; + C686F8E91CDBC3B7009F9BFC /* observation_tower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = observation_tower.c; sourceTree = ""; }; + C686F8EA1CDBC3B7009F9BFC /* space_rings.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = space_rings.c; sourceTree = ""; }; + C686F8EB1CDBC3B7009F9BFC /* spiral_slide.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = spiral_slide.c; sourceTree = ""; }; + C686F8ED1CDBC3B7009F9BFC /* facility.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = facility.c; sourceTree = ""; }; + C686F8EE1CDBC3B7009F9BFC /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; + C686F8EF1CDBC3B7009F9BFC /* shop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = shop.c; sourceTree = ""; }; + C686F8F11CDBC3B7009F9BFC /* 3d_cinema.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = 3d_cinema.c; sourceTree = ""; }; + C686F8F21CDBC3B7009F9BFC /* enterprise.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = enterprise.c; sourceTree = ""; }; + C686F8F31CDBC3B7009F9BFC /* go_karts.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = go_karts.c; sourceTree = ""; }; + C686F8F41CDBC3B7009F9BFC /* launched_freefall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = launched_freefall.c; sourceTree = ""; }; + C686F8F51CDBC3B7009F9BFC /* magic_carpet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = magic_carpet.c; sourceTree = ""; }; + C686F8F61CDBC3B7009F9BFC /* motion_simulator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = motion_simulator.c; sourceTree = ""; }; + C686F8F71CDBC3B7009F9BFC /* pirate_ship.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pirate_ship.c; sourceTree = ""; }; + C686F8F81CDBC3B7009F9BFC /* roto_drop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = roto_drop.c; sourceTree = ""; }; + C686F8F91CDBC3B7009F9BFC /* swinging_inverter_ship.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = swinging_inverter_ship.c; sourceTree = ""; }; + C686F8FA1CDBC3B7009F9BFC /* top_spin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = top_spin.c; sourceTree = ""; }; + C686F8FB1CDBC3B7009F9BFC /* twist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = twist.c; sourceTree = ""; }; + C686F8FD1CDBC3B7009F9BFC /* chairlift.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chairlift.c; sourceTree = ""; }; + C686F8FE1CDBC3B7009F9BFC /* lift.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lift.c; sourceTree = ""; }; + C686F8FF1CDBC3B7009F9BFC /* minature_railway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = minature_railway.c; sourceTree = ""; }; + C686F9001CDBC3B7009F9BFC /* monorail.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = monorail.c; sourceTree = ""; }; + C686F9011CDBC3B7009F9BFC /* suspended_monorail.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = suspended_monorail.c; sourceTree = ""; }; + C686F9031CDBC3B7009F9BFC /* boat_ride.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = boat_ride.c; sourceTree = ""; }; + C686F9041CDBC3B7009F9BFC /* dingy_slide.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dingy_slide.c; sourceTree = ""; }; + C686F9051CDBC3B7009F9BFC /* log_flume.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = log_flume.c; sourceTree = ""; }; + C686F9061CDBC3B7009F9BFC /* river_rafts.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = river_rafts.c; sourceTree = ""; }; + C686F9071CDBC3B7009F9BFC /* river_rapids.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = river_rapids.c; sourceTree = ""; }; + C686F9081CDBC3B7009F9BFC /* splash_boats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = splash_boats.c; sourceTree = ""; }; + C686F9091CDBC3B7009F9BFC /* submarine_ride.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = submarine_ride.c; sourceTree = ""; }; + C686F90A1CDBC3B7009F9BFC /* water_coaster.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = water_coaster.c; sourceTree = ""; }; + C686F9561CDBC4C7009F9BFC /* vehicle_paint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vehicle_paint.c; sourceTree = ""; }; + C686F9571CDBC4C7009F9BFC /* vehicle_paint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vehicle_paint.h; sourceTree = ""; }; D41B73EE1C2101890080A7B9 /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; }; D41B73F01C21018C0080A7B9 /* libssl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libssl.tbd; path = usr/lib/libssl.tbd; sourceTree = SDKROOT; }; D41B741C1C210A7A0080A7B9 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; }; @@ -301,8 +483,6 @@ D44271091CC81B3200D84D28 /* scrolling_text.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scrolling_text.c; sourceTree = ""; }; D442710A1CC81B3200D84D28 /* sprite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sprite.c; sourceTree = ""; }; D442710B1CC81B3200D84D28 /* string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = string.c; sourceTree = ""; }; - D442710C1CC81B3200D84D28 /* supports.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = supports.c; sourceTree = ""; }; - D442710D1CC81B3200D84D28 /* supports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = supports.h; sourceTree = ""; }; D442710E1CC81B3200D84D28 /* editor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = editor.c; path = src/editor.c; sourceTree = ""; }; D442710F1CC81B3200D84D28 /* editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = editor.h; path = src/editor.h; sourceTree = ""; }; D44271101CC81B3200D84D28 /* game.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = game.c; path = src/game.c; sourceTree = ""; }; @@ -631,6 +811,166 @@ path = src/rct1; sourceTree = SOURCE_ROOT; }; + C686F8961CDBC37E009F9BFC /* paint */ = { + isa = PBXGroup; + children = ( + C686F8971CDBC37E009F9BFC /* map_element */, + C686F8A21CDBC37E009F9BFC /* paint.c */, + C686F8A31CDBC37E009F9BFC /* paint.h */, + C686F8A41CDBC37E009F9BFC /* sprite */, + C686F8AA1CDBC37E009F9BFC /* supports.c */, + C686F8AB1CDBC37E009F9BFC /* supports.h */, + ); + name = paint; + path = src/paint; + sourceTree = SOURCE_ROOT; + }; + C686F8971CDBC37E009F9BFC /* map_element */ = { + isa = PBXGroup; + children = ( + C686F8981CDBC37E009F9BFC /* banner.c */, + C686F8991CDBC37E009F9BFC /* entrance.c */, + C686F89A1CDBC37E009F9BFC /* fence.c */, + C686F89B1CDBC37E009F9BFC /* map_element.c */, + C686F89C1CDBC37E009F9BFC /* map_element.h */, + C686F89D1CDBC37E009F9BFC /* path.c */, + C686F89E1CDBC37E009F9BFC /* scenery.c */, + C686F89F1CDBC37E009F9BFC /* scenery_multiple.c */, + C686F8A01CDBC37E009F9BFC /* surface.c */, + C686F8A11CDBC37E009F9BFC /* surface.h */, + ); + path = map_element; + sourceTree = ""; + }; + C686F8A41CDBC37E009F9BFC /* sprite */ = { + isa = PBXGroup; + children = ( + C686F8A51CDBC37E009F9BFC /* litter.c */, + C686F8A61CDBC37E009F9BFC /* misc.c */, + C686F8A71CDBC37E009F9BFC /* peep.c */, + C686F8A81CDBC37E009F9BFC /* sprite.c */, + C686F8A91CDBC37E009F9BFC /* sprite.h */, + ); + path = sprite; + sourceTree = ""; + }; + C686F8BA1CDBC3B7009F9BFC /* coaster */ = { + isa = PBXGroup; + children = ( + C686F8BB1CDBC3B7009F9BFC /* air_powered_vertical_coaster.c */, + C686F8BC1CDBC3B7009F9BFC /* bobsleigh_coaster.c */, + C686F8BD1CDBC3B7009F9BFC /* compact_inverted_coaster.c */, + C686F8BE1CDBC3B7009F9BFC /* corkscrew_roller_coaster.c */, + C686F8BF1CDBC3B7009F9BFC /* flying_roller_coaster.c */, + C686F8C01CDBC3B7009F9BFC /* giga_coaster.c */, + C686F8C11CDBC3B7009F9BFC /* heartline_twister_coaster.c */, + C686F8C21CDBC3B7009F9BFC /* inverted_hairpin_coaster.c */, + C686F8C31CDBC3B7009F9BFC /* inverted_impulse_coaster.c */, + C686F8C41CDBC3B7009F9BFC /* inverted_roller_coaster.c */, + C686F8C51CDBC3B7009F9BFC /* junior_roller_coaster.c */, + C686F8C61CDBC3B7009F9BFC /* lay_down_roller_coaster.c */, + C686F8C71CDBC3B7009F9BFC /* lim_launched_roller_coaster.c */, + C686F8C81CDBC3B7009F9BFC /* looping_roller_coaster.c */, + C686F8C91CDBC3B7009F9BFC /* mine_ride.c */, + C686F8CA1CDBC3B7009F9BFC /* mine_train_coaster.c */, + C686F8CB1CDBC3B7009F9BFC /* mini_roller_coaster.c */, + C686F8CC1CDBC3B7009F9BFC /* mini_suspended_coaster.c */, + C686F8CD1CDBC3B7009F9BFC /* multi_dimension_roller_coaster.c */, + C686F8CE1CDBC3B7009F9BFC /* reverse_freefall_coaster.c */, + C686F8CF1CDBC3B7009F9BFC /* reverser_roller_coaster.c */, + C686F8D01CDBC3B7009F9BFC /* side_friction_roller_coaster.c */, + C686F8D11CDBC3B7009F9BFC /* spiral_roller_coaster.c */, + C686F8D21CDBC3B7009F9BFC /* stand_up_roller_coaster.c */, + C686F8D31CDBC3B7009F9BFC /* steeplechase.c */, + C686F8D41CDBC3B7009F9BFC /* suspended_swinging_coaster.c */, + C686F8D51CDBC3B7009F9BFC /* twister_roller_coaster.c */, + C686F8D61CDBC3B7009F9BFC /* vertical_drop_roller_coaster.c */, + C686F8D71CDBC3B7009F9BFC /* virginia_reel.c */, + C686F8D81CDBC3B7009F9BFC /* wild_mouse.c */, + C686F8D91CDBC3B7009F9BFC /* wooden_roller_coaster.c */, + C686F8DA1CDBC3B7009F9BFC /* wooden_wild_mouse.c */, + ); + path = coaster; + sourceTree = ""; + }; + C686F8DB1CDBC3B7009F9BFC /* gentle */ = { + isa = PBXGroup; + children = ( + C686F8DC1CDBC3B7009F9BFC /* car_ride.c */, + C686F8DD1CDBC3B7009F9BFC /* circus_show.c */, + C686F8DE1CDBC3B7009F9BFC /* crooked_house.c */, + C686F8DF1CDBC3B7009F9BFC /* dodgems.c */, + C686F8E01CDBC3B7009F9BFC /* ferris_wheel.c */, + C686F8E11CDBC3B7009F9BFC /* flying_saucers.c */, + C686F8E21CDBC3B7009F9BFC /* ghost_train.c */, + C686F8E31CDBC3B7009F9BFC /* haunted_house.c */, + C686F8E41CDBC3B7009F9BFC /* maze.c */, + C686F8E51CDBC3B7009F9BFC /* merry_go_round.c */, + C686F8E61CDBC3B7009F9BFC /* mini_golf.c */, + C686F8E71CDBC3B7009F9BFC /* mini_helicopters.c */, + C686F8E81CDBC3B7009F9BFC /* monorail_cycles.c */, + C686F8E91CDBC3B7009F9BFC /* observation_tower.c */, + C686F8EA1CDBC3B7009F9BFC /* space_rings.c */, + C686F8EB1CDBC3B7009F9BFC /* spiral_slide.c */, + ); + path = gentle; + sourceTree = ""; + }; + C686F8EC1CDBC3B7009F9BFC /* shops */ = { + isa = PBXGroup; + children = ( + C686F8ED1CDBC3B7009F9BFC /* facility.c */, + C686F8EE1CDBC3B7009F9BFC /* misc.c */, + C686F8EF1CDBC3B7009F9BFC /* shop.c */, + ); + path = shops; + sourceTree = ""; + }; + C686F8F01CDBC3B7009F9BFC /* thrill */ = { + isa = PBXGroup; + children = ( + C686F8F11CDBC3B7009F9BFC /* 3d_cinema.c */, + C686F8F21CDBC3B7009F9BFC /* enterprise.c */, + C686F8F31CDBC3B7009F9BFC /* go_karts.c */, + C686F8F41CDBC3B7009F9BFC /* launched_freefall.c */, + C686F8F51CDBC3B7009F9BFC /* magic_carpet.c */, + C686F8F61CDBC3B7009F9BFC /* motion_simulator.c */, + C686F8F71CDBC3B7009F9BFC /* pirate_ship.c */, + C686F8F81CDBC3B7009F9BFC /* roto_drop.c */, + C686F8F91CDBC3B7009F9BFC /* swinging_inverter_ship.c */, + C686F8FA1CDBC3B7009F9BFC /* top_spin.c */, + C686F8FB1CDBC3B7009F9BFC /* twist.c */, + ); + path = thrill; + sourceTree = ""; + }; + C686F8FC1CDBC3B7009F9BFC /* transport */ = { + isa = PBXGroup; + children = ( + C686F8FD1CDBC3B7009F9BFC /* chairlift.c */, + C686F8FE1CDBC3B7009F9BFC /* lift.c */, + C686F8FF1CDBC3B7009F9BFC /* minature_railway.c */, + C686F9001CDBC3B7009F9BFC /* monorail.c */, + C686F9011CDBC3B7009F9BFC /* suspended_monorail.c */, + ); + path = transport; + sourceTree = ""; + }; + C686F9021CDBC3B7009F9BFC /* water */ = { + isa = PBXGroup; + children = ( + C686F9031CDBC3B7009F9BFC /* boat_ride.c */, + C686F9041CDBC3B7009F9BFC /* dingy_slide.c */, + C686F9051CDBC3B7009F9BFC /* log_flume.c */, + C686F9061CDBC3B7009F9BFC /* river_rafts.c */, + C686F9071CDBC3B7009F9BFC /* river_rapids.c */, + C686F9081CDBC3B7009F9BFC /* splash_boats.c */, + C686F9091CDBC3B7009F9BFC /* submarine_ride.c */, + C686F90A1CDBC3B7009F9BFC /* water_coaster.c */, + ); + path = water; + sourceTree = ""; + }; D41B72431C21015A0080A7B9 /* Sources */ = { isa = PBXGroup; children = ( @@ -642,6 +982,7 @@ D44271321CC81B3200D84D28 /* localisation */, D44271441CC81B3200D84D28 /* management */, D442714F1CC81B3200D84D28 /* network */, + C686F8961CDBC37E009F9BFC /* paint */, D442715B1CC81B3200D84D28 /* peep */, D44271601CC81B3200D84D28 /* platform */, C650B2141CCABBDD00B4D91C /* rct1 */, @@ -779,8 +1120,6 @@ D44271091CC81B3200D84D28 /* scrolling_text.c */, D442710A1CC81B3200D84D28 /* sprite.c */, D442710B1CC81B3200D84D28 /* string.c */, - D442710C1CC81B3200D84D28 /* supports.c */, - D442710D1CC81B3200D84D28 /* supports.h */, ); name = drawing; path = src/drawing; @@ -799,8 +1138,6 @@ D44271201CC81B3200D84D28 /* graph.h */, D44271211CC81B3200D84D28 /* keyboard_shortcut.c */, D44271221CC81B3200D84D28 /* keyboard_shortcut.h */, - C61FAAE01CD1643A0010C9D8 /* paint_surface.c */, - C61FAAE11CD1643A0010C9D8 /* paint_surface.h */, D44271231CC81B3200D84D28 /* screenshot.c */, D44271241CC81B3200D84D28 /* screenshot.h */, D44271251CC81B3200D84D28 /* Theme.cpp */, @@ -907,22 +1244,30 @@ D442716E1CC81B3200D84D28 /* ride */ = { isa = PBXGroup; children = ( + C686F8BA1CDBC3B7009F9BFC /* coaster */, + C686F8DB1CDBC3B7009F9BFC /* gentle */, + C686F8EC1CDBC3B7009F9BFC /* shops */, + C686F8F01CDBC3B7009F9BFC /* thrill */, + C686F8FC1CDBC3B7009F9BFC /* transport */, + C686F9021CDBC3B7009F9BFC /* water */, D442716F1CC81B3200D84D28 /* cable_lift.c */, D44271701CC81B3200D84D28 /* cable_lift.h */, - D44271711CC81B3200D84D28 /* ride.c */, - D44271721CC81B3200D84D28 /* ride.h */, D44271731CC81B3200D84D28 /* ride_data.c */, D44271741CC81B3200D84D28 /* ride_data.h */, D44271751CC81B3200D84D28 /* ride_ratings.c */, D44271761CC81B3200D84D28 /* ride_ratings.h */, + D44271711CC81B3200D84D28 /* ride.c */, + D44271721CC81B3200D84D28 /* ride.h */, D44271771CC81B3200D84D28 /* station.c */, D44271781CC81B3200D84D28 /* station.h */, - D44271791CC81B3200D84D28 /* track.c */, - D442717A1CC81B3200D84D28 /* track.h */, D442717B1CC81B3200D84D28 /* track_data.c */, D442717C1CC81B3200D84D28 /* track_data.h */, D442717D1CC81B3200D84D28 /* track_paint.c */, D442717E1CC81B3200D84D28 /* track_paint.h */, + D44271791CC81B3200D84D28 /* track.c */, + D442717A1CC81B3200D84D28 /* track.h */, + C686F9561CDBC4C7009F9BFC /* vehicle_paint.c */, + C686F9571CDBC4C7009F9BFC /* vehicle_paint.h */, D442717F1CC81B3200D84D28 /* vehicle.c */, D44271801CC81B3200D84D28 /* vehicle.h */, ); @@ -1377,95 +1722,150 @@ buildActionMask = 2147483647; files = ( D44272491CC81B3200D84D28 /* track.c in Sources */, + C686F9201CDBC3B7009F9BFC /* side_friction_roller_coaster.c in Sources */, D44272561CC81B3200D84D28 /* cheats.c in Sources */, D442722B1CC81B3200D84D28 /* real_names.c in Sources */, D442721C1CC81B3200D84D28 /* keyboard_shortcut.c in Sources */, D442728F1CC81B3200D84D28 /* title_menu.c in Sources */, + C686F9381CDBC3B7009F9BFC /* observation_tower.c in Sources */, D44272A41CC81B3200D84D28 /* park.c in Sources */, + C686F9391CDBC3B7009F9BFC /* space_rings.c in Sources */, + C686F9371CDBC3B7009F9BFC /* monorail_cycles.c in Sources */, D44272441CC81B3200D84D28 /* cable_lift.c in Sources */, D442729C1CC81B3200D84D28 /* duck.c in Sources */, + C686F91D1CDBC3B7009F9BFC /* multi_dimension_roller_coaster.c in Sources */, + C686F8B31CDBC37E009F9BFC /* surface.c in Sources */, D442724E1CC81B3200D84D28 /* scenario_sources.c in Sources */, D442729A1CC81B3200D84D28 /* banner.c in Sources */, C650B21C1CCABC4400B4D91C /* ConvertCommand.cpp in Sources */, D44272211CC81B3200D84D28 /* viewport_interaction.c in Sources */, D442721B1CC81B3200D84D28 /* graph.c in Sources */, + C686F9581CDBC4C7009F9BFC /* vehicle_paint.c in Sources */, D44272101CC81B3200D84D28 /* sprite.c in Sources */, D442721F1CC81B3200D84D28 /* title_sequences.c in Sources */, + C686F8AE1CDBC37E009F9BFC /* fence.c in Sources */, + C686F8AC1CDBC37E009F9BFC /* banner.c in Sources */, D44272671CC81B3200D84D28 /* land.c in Sources */, D442726D1CC81B3200D84D28 /* mapgen.c in Sources */, + C686F9211CDBC3B7009F9BFC /* spiral_roller_coaster.c in Sources */, + C686F9291CDBC3B7009F9BFC /* wooden_roller_coaster.c in Sources */, D44272A71CC81B3200D84D28 /* sprite.c in Sources */, D44272941CC81B3200D84D28 /* track_list.c in Sources */, D44272711CC81B3200D84D28 /* network_status.c in Sources */, + C686F9481CDBC3B7009F9BFC /* twist.c in Sources */, D44272651CC81B3200D84D28 /* guest_list.c in Sources */, D442724F1CC81B3200D84D28 /* scenario.c in Sources */, D442723F1CC81B3200D84D28 /* shared.c in Sources */, D442727E1CC81B3200D84D28 /* save_prompt.c in Sources */, D442726A1CC81B3200D84D28 /* main.c in Sources */, + C686F9341CDBC3B7009F9BFC /* merry_go_round.c in Sources */, + C686F8B81CDBC37E009F9BFC /* sprite.c in Sources */, + C686F9221CDBC3B7009F9BFC /* stand_up_roller_coaster.c in Sources */, + C686F94F1CDBC3B7009F9BFC /* dingy_slide.c in Sources */, D44272341CC81B3200D84D28 /* network.cpp in Sources */, + C686F9151CDBC3B7009F9BFC /* junior_roller_coaster.c in Sources */, + C686F9131CDBC3B7009F9BFC /* inverted_impulse_coaster.c in Sources */, D44272001CC81B3200D84D28 /* Diagnostics.cpp in Sources */, D44272471CC81B3200D84D28 /* ride_ratings.c in Sources */, D44272721CC81B3200D84D28 /* new_campaign.c in Sources */, + C686F93A1CDBC3B7009F9BFC /* spiral_slide.c in Sources */, + C686F9421CDBC3B7009F9BFC /* magic_carpet.c in Sources */, D44272021CC81B3200D84D28 /* Json.cpp in Sources */, D44272591CC81B3200D84D28 /* dropdown.c in Sources */, + C686F8AF1CDBC37E009F9BFC /* map_element.c in Sources */, D44272081CC81B3200D84D28 /* diagnostic.c in Sources */, D44272A51CC81B3200D84D28 /* particle.c in Sources */, D44272811CC81B3200D84D28 /* server_start.c in Sources */, D44272611CC81B3200D84D28 /* finances.c in Sources */, D442722D1CC81B3200D84D28 /* utf8.c in Sources */, + C686F9461CDBC3B7009F9BFC /* swinging_inverter_ship.c in Sources */, D442720B1CC81B3200D84D28 /* font.c in Sources */, + C686F90D1CDBC3B7009F9BFC /* compact_inverted_coaster.c in Sources */, + C686F8B01CDBC37E009F9BFC /* path.c in Sources */, D44272361CC81B3200D84D28 /* object_list.c in Sources */, D44272581CC81B3200D84D28 /* demolish_ride_prompt.c in Sources */, D442723E1CC81B3200D84D28 /* posix.c in Sources */, D44271F91CC81B3200D84D28 /* CommandLine.cpp in Sources */, + C686F90B1CDBC3B7009F9BFC /* air_powered_vertical_coaster.c in Sources */, D44272051CC81B3200D84D28 /* String.cpp in Sources */, D442725A1CC81B3200D84D28 /* editor_bottom_toolbar.c in Sources */, D442729D1CC81B3200D84D28 /* footpath.c in Sources */, D44272501CC81B3200D84D28 /* title.c in Sources */, D442721D1CC81B3200D84D28 /* screenshot.c in Sources */, D44272381CC81B3200D84D28 /* openrct2.c in Sources */, + C686F92C1CDBC3B7009F9BFC /* circus_show.c in Sources */, D44271FD1CC81B3200D84D28 /* cmdline_sprite.c in Sources */, D442720C1CC81B3200D84D28 /* line.c in Sources */, + C686F9321CDBC3B7009F9BFC /* haunted_house.c in Sources */, D442720A1CC81B3200D84D28 /* drawing_fast.cpp in Sources */, + C686F9521CDBC3B7009F9BFC /* river_rapids.c in Sources */, D44272191CC81B3200D84D28 /* colour.c in Sources */, D442724C1CC81B3200D84D28 /* vehicle.c in Sources */, D44272261CC81B3200D84D28 /* currency.c in Sources */, + C686F92B1CDBC3B7009F9BFC /* car_ride.c in Sources */, D44272921CC81B3200D84D28 /* tooltip.c in Sources */, + C686F91C1CDBC3B7009F9BFC /* mini_suspended_coaster.c in Sources */, D44271FA1CC81B3200D84D28 /* RootCommands.cpp in Sources */, D442726B1CC81B3200D84D28 /* map.c in Sources */, D442721E1CC81B3200D84D28 /* Theme.cpp in Sources */, + C686F9271CDBC3B7009F9BFC /* virginia_reel.c in Sources */, D44272271CC81B3200D84D28 /* date.c in Sources */, D44272371CC81B3200D84D28 /* object.c in Sources */, D44272971CC81B3200D84D28 /* viewport.c in Sources */, + C686F90F1CDBC3B7009F9BFC /* flying_roller_coaster.c in Sources */, D44272661CC81B3200D84D28 /* install_track.c in Sources */, + C686F9331CDBC3B7009F9BFC /* maze.c in Sources */, + C686F9241CDBC3B7009F9BFC /* suspended_swinging_coaster.c in Sources */, + C686F92D1CDBC3B7009F9BFC /* crooked_house.c in Sources */, D442727F1CC81B3200D84D28 /* scenery.c in Sources */, + C686F93C1CDBC3B7009F9BFC /* misc.c in Sources */, D442723A1CC81B3200D84D28 /* staff.c in Sources */, D44272931CC81B3200D84D28 /* top_toolbar.c in Sources */, D44271F61CC81B3200D84D28 /* audio.c in Sources */, D442728A1CC81B3200D84D28 /* tile_inspector.c in Sources */, + C686F9411CDBC3B7009F9BFC /* launched_freefall.c in Sources */, D44272571CC81B3200D84D28 /* clear_scenery.c in Sources */, D442727D1CC81B3200D84D28 /* ride_list.c in Sources */, + C686F94E1CDBC3B7009F9BFC /* boat_ride.c in Sources */, D44272891CC81B3200D84D28 /* themes.c in Sources */, + C686F9531CDBC3B7009F9BFC /* splash_boats.c in Sources */, + C686F9441CDBC3B7009F9BFC /* pirate_ship.c in Sources */, D44272791CC81B3200D84D28 /* publisher_credits.c in Sources */, + C686F91E1CDBC3B7009F9BFC /* reverse_freefall_coaster.c in Sources */, D442723B1CC81B3200D84D28 /* crash.cpp in Sources */, C650B21A1CCABBDD00B4D91C /* tables.cpp in Sources */, D44272291CC81B3200D84D28 /* LanguagePack.cpp in Sources */, D44272901CC81B3200D84D28 /* title_options.c in Sources */, + C686F94A1CDBC3B7009F9BFC /* lift.c in Sources */, D44272A01CC81B3200D84D28 /* map_animation.c in Sources */, + C686F92A1CDBC3B7009F9BFC /* wooden_wild_mouse.c in Sources */, + C686F90C1CDBC3B7009F9BFC /* bobsleigh_coaster.c in Sources */, + C686F9541CDBC3B7009F9BFC /* submarine_ride.c in Sources */, D44271F81CC81B3200D84D28 /* cheats.c in Sources */, + C686F9181CDBC3B7009F9BFC /* looping_roller_coaster.c in Sources */, D44271FC1CC81B3200D84D28 /* SpriteCommands.cpp in Sources */, + C686F92E1CDBC3B7009F9BFC /* dodgems.c in Sources */, D442728B1CC81B3200D84D28 /* title_command_editor.c in Sources */, + C686F9451CDBC3B7009F9BFC /* roto_drop.c in Sources */, + C686F9121CDBC3B7009F9BFC /* inverted_hairpin_coaster.c in Sources */, D44272231CC81B3200D84D28 /* window.c in Sources */, D44272451CC81B3200D84D28 /* ride.c in Sources */, + C686F8B91CDBC37E009F9BFC /* supports.c in Sources */, D442726E1CC81B3200D84D28 /* maze_construction.c in Sources */, D44272751CC81B3200D84D28 /* news_options.c in Sources */, D44272551CC81B3200D84D28 /* changelog.c in Sources */, + C686F9471CDBC3B7009F9BFC /* top_spin.c in Sources */, D442720E1CC81B3200D84D28 /* rect.c in Sources */, + C686F9171CDBC3B7009F9BFC /* lim_launched_roller_coaster.c in Sources */, + C686F9101CDBC3B7009F9BFC /* giga_coaster.c in Sources */, D44272351CC81B3200D84D28 /* twitch.cpp in Sources */, D44272691CC81B3200D84D28 /* loadsave.c in Sources */, D44272061CC81B3200D84D28 /* textinputbuffer.c in Sources */, + C686F9191CDBC3B7009F9BFC /* mine_ride.c in Sources */, C650B2191CCABBDD00B4D91C /* S4Importer.cpp in Sources */, D44272801CC81B3200D84D28 /* server_list.c in Sources */, D44272911CC81B3200D84D28 /* title_scenarioselect.c in Sources */, + C686F8B61CDBC37E009F9BFC /* misc.c in Sources */, D44272411CC81B3200D84D28 /* rct1.c in Sources */, D44272621CC81B3200D84D28 /* footpath.c in Sources */, D44272521CC81B3200D84D28 /* util.c in Sources */, @@ -1475,11 +1875,15 @@ D44272201CC81B3200D84D28 /* viewport.c in Sources */, D442722F1CC81B3200D84D28 /* finance.c in Sources */, D44272831CC81B3200D84D28 /* shortcut_keys.c in Sources */, + C686F9401CDBC3B7009F9BFC /* go_karts.c in Sources */, + C686F8B51CDBC37E009F9BFC /* litter.c in Sources */, D44272141CC81B3200D84D28 /* game.c in Sources */, + C686F91A1CDBC3B7009F9BFC /* mine_train_coaster.c in Sources */, D44272A11CC81B3200D84D28 /* map_helpers.c in Sources */, + C686F9431CDBC3B7009F9BFC /* motion_simulator.c in Sources */, D44272281CC81B3200D84D28 /* language.cpp in Sources */, D442729B1CC81B3200D84D28 /* climate.c in Sources */, - D44272121CC81B3200D84D28 /* supports.c in Sources */, + C686F9261CDBC3B7009F9BFC /* vertical_drop_roller_coaster.c in Sources */, D442726F1CC81B3200D84D28 /* multiplayer.c in Sources */, D442725B1CC81B3200D84D28 /* editor_inventions_list.c in Sources */, D44272311CC81B3200D84D28 /* news_item.c in Sources */, @@ -1492,42 +1896,60 @@ D44272841CC81B3200D84D28 /* sign.c in Sources */, D44272481CC81B3200D84D28 /* station.c in Sources */, D44272511CC81B3200D84D28 /* sawyercoding.c in Sources */, + C686F91F1CDBC3B7009F9BFC /* reverser_roller_coaster.c in Sources */, D442728C1CC81B3200D84D28 /* title_editor.c in Sources */, D44272161CC81B3200D84D28 /* image_io.c in Sources */, D44272171CC81B3200D84D28 /* input.c in Sources */, D44272741CC81B3200D84D28 /* news.c in Sources */, D442723C1CC81B3200D84D28 /* linux.c in Sources */, D44272421CC81B3200D84D28 /* rct2.c in Sources */, + C686F8B71CDBC37E009F9BFC /* peep.c in Sources */, + C686F8B11CDBC37E009F9BFC /* scenery.c in Sources */, + C686F9251CDBC3B7009F9BFC /* twister_roller_coaster.c in Sources */, D44272251CC81B3200D84D28 /* convert.c in Sources */, D442727B1CC81B3200D84D28 /* ride.c in Sources */, D44272031CC81B3200D84D28 /* Path.cpp in Sources */, + C686F9301CDBC3B7009F9BFC /* flying_saucers.c in Sources */, D44272401CC81B3200D84D28 /* windows.c in Sources */, D44272881CC81B3200D84D28 /* text_input.c in Sources */, D442720F1CC81B3200D84D28 /* scrolling_text.c in Sources */, - C61FAAE21CD1643A0010C9D8 /* paint_surface.c in Sources */, D44271F51CC81B3200D84D28 /* addresses.c in Sources */, D44272041CC81B3200D84D28 /* Stopwatch.cpp in Sources */, + C686F9491CDBC3B7009F9BFC /* chairlift.c in Sources */, + C686F9501CDBC3B7009F9BFC /* log_flume.c in Sources */, D44272241CC81B3200D84D28 /* intro.c in Sources */, D44272631CC81B3200D84D28 /* game_bottom_toolbar.c in Sources */, D44272091CC81B3200D84D28 /* drawing.c in Sources */, + C686F94C1CDBC3B7009F9BFC /* monorail.c in Sources */, D442728E1CC81B3200D84D28 /* title_logo.c in Sources */, + C686F8B21CDBC37E009F9BFC /* scenery_multiple.c in Sources */, D442725E1CC81B3200D84D28 /* editor_objective_options.c in Sources */, D44272531CC81B3200D84D28 /* about.c in Sources */, + C686F9311CDBC3B7009F9BFC /* ghost_train.c in Sources */, D44272821CC81B3200D84D28 /* shortcut_key_change.c in Sources */, D442722A1CC81B3200D84D28 /* localisation.c in Sources */, D44272731CC81B3200D84D28 /* new_ride.c in Sources */, D442721A1CC81B3200D84D28 /* console.c in Sources */, D44271FB1CC81B3200D84D28 /* ScreenshotCommands.cpp in Sources */, D442729E1CC81B3200D84D28 /* fountain.c in Sources */, + C686F94B1CDBC3B7009F9BFC /* minature_railway.c in Sources */, + C686F94D1CDBC3B7009F9BFC /* suspended_monorail.c in Sources */, D44272131CC81B3200D84D28 /* editor.c in Sources */, D442729F1CC81B3200D84D28 /* map.c in Sources */, + C686F9351CDBC3B7009F9BFC /* mini_golf.c in Sources */, D44272541CC81B3200D84D28 /* banner.c in Sources */, D44272A31CC81B3200D84D28 /* money_effect.c in Sources */, D44272761CC81B3200D84D28 /* options.c in Sources */, + C686F93D1CDBC3B7009F9BFC /* shop.c in Sources */, + C686F8AD1CDBC37E009F9BFC /* entrance.c in Sources */, D44272111CC81B3200D84D28 /* string.c in Sources */, + C686F93E1CDBC3B7009F9BFC /* 3d_cinema.c in Sources */, D44272771CC81B3200D84D28 /* park.c in Sources */, + C686F9141CDBC3B7009F9BFC /* inverted_roller_coaster.c in Sources */, + C686F9551CDBC3B7009F9BFC /* water_coaster.c in Sources */, D44272461CC81B3200D84D28 /* ride_data.c in Sources */, D44272181CC81B3200D84D28 /* chat.c in Sources */, + C686F93B1CDBC3B7009F9BFC /* facility.c in Sources */, D442724B1CC81B3200D84D28 /* track_paint.c in Sources */, D44272641CC81B3200D84D28 /* guest.c in Sources */, D44272961CC81B3200D84D28 /* track_place.c in Sources */, @@ -1539,23 +1961,34 @@ D442723D1CC81B3200D84D28 /* osx.m in Sources */, D44271FF1CC81B3200D84D28 /* Console.cpp in Sources */, D44272781CC81B3200D84D28 /* player.c in Sources */, + C686F9161CDBC3B7009F9BFC /* lay_down_roller_coaster.c in Sources */, D44272991CC81B3200D84D28 /* balloon.c in Sources */, D442727C1CC81B3200D84D28 /* ride_construction.c in Sources */, D442724A1CC81B3200D84D28 /* track_data.c in Sources */, D442725C1CC81B3200D84D28 /* editor_main.c in Sources */, D44272151CC81B3200D84D28 /* hook.c in Sources */, + C686F9361CDBC3B7009F9BFC /* mini_helicopters.c in Sources */, + C686F93F1CDBC3B7009F9BFC /* enterprise.c in Sources */, + C686F91B1CDBC3B7009F9BFC /* mini_roller_coaster.c in Sources */, D44272391CC81B3200D84D28 /* peep.c in Sources */, D44272681CC81B3200D84D28 /* land_rights.c in Sources */, D44272601CC81B3200D84D28 /* error.c in Sources */, + C686F8B41CDBC37E009F9BFC /* paint.c in Sources */, D442728D1CC81B3200D84D28 /* title_exit.c in Sources */, D442722C1CC81B3200D84D28 /* user.c in Sources */, + C686F92F1CDBC3B7009F9BFC /* ferris_wheel.c in Sources */, D44272301CC81B3200D84D28 /* marketing.c in Sources */, D44272321CC81B3200D84D28 /* research.c in Sources */, D442725D1CC81B3200D84D28 /* editor_object_selection.c in Sources */, D44272981CC81B3200D84D28 /* water.c in Sources */, D442726C1CC81B3200D84D28 /* map_tooltip.c in Sources */, + C686F9281CDBC3B7009F9BFC /* wild_mouse.c in Sources */, D44272701CC81B3200D84D28 /* music_credits.c in Sources */, + C686F9511CDBC3B7009F9BFC /* river_rafts.c in Sources */, + C686F90E1CDBC3B7009F9BFC /* corkscrew_roller_coaster.c in Sources */, D44272A61CC81B3200D84D28 /* scenery.c in Sources */, + C686F9111CDBC3B7009F9BFC /* heartline_twister_coaster.c in Sources */, + C686F9231CDBC3B7009F9BFC /* steeplechase.c in Sources */, D44271FE1CC81B3200D84D28 /* config.c in Sources */, D44272871CC81B3200D84D28 /* staff_list.c in Sources */, ); diff --git a/openrct2.vcxproj b/openrct2.vcxproj index 34619f5f82..53dad229d7 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -49,7 +49,6 @@ - @@ -57,7 +56,6 @@ - @@ -89,6 +87,20 @@ + + + + + + + + + + + + + + @@ -101,14 +113,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -232,7 +320,6 @@ - @@ -240,7 +327,6 @@ - @@ -268,6 +354,11 @@ + + + + + @@ -285,6 +376,7 @@ + diff --git a/openrct2.vcxproj.filters b/openrct2.vcxproj.filters index b6340ec900..8a5673ba04 100644 --- a/openrct2.vcxproj.filters +++ b/openrct2.vcxproj.filters @@ -1,939 +1,396 @@  - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {4c8348c7-dfe9-4368-9d87-29733fe5950a} - - - {8e15cd5b-d7a7-4bda-a58a-e1158ad6ffb4} - - - {8a9b8831-4ba9-4104-b13f-949981e10c22} - - - {97950d17-f655-49bb-85f4-309feb332b02} - - - {9ac1caf2-4edc-4237-b441-16cc8923d9e3} - - - {7f7d04b9-188e-4086-a2a2-5b7b2eb2310b} - - - {22415bda-c4d8-425c-bd06-4c5bbdffe6d7} - - - {3af99868-3e47-4832-bf01-409aec0b08e7} - - - {2f881d9d-1f7e-40bf-ad3d-92db3a31ce90} - - - {6c8e1ad1-9d13-41f8-a9db-64501ad65503} - - - {81716f5d-b396-4a82-a450-76fee56d982b} - - - {51e38783-5334-464c-8f90-61d725dc8013} - - - {ae88ed08-902b-4167-a78c-9b521ce67749} - - - {28a808eb-9017-44cc-939b-f828fd1e2e7d} - - - {4bf369d2-3df8-40c9-a878-f484b0a0afd3} - - - {f59cd7d6-b58d-4a6f-9118-34f94de84766} - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - Resource Files - - - Resource Files - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - Source\Management - - - Source\Management - - - Source\Management - - - Source\Management - - - Source\Audio - - - Source\Audio - - - Source\Interface - - - Source\Interface - - - Source\Interface - - - Source\Interface - - - Source\Interface - - - Source\World - - - Source\World - - - Source\World - - - Source\World - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Localisation - - - Source\Ride - - - Source\Ride - - - Source\Ride - - - Source\Ride - - - Source\Ride - - - Source\Util - - - Source\Util - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source\Localisation - - - Source\Drawing - - - Source\Drawing - - - Source\Drawing - - - Source\Drawing - - - Source\Drawing - - - Source\Localisation - - - Source\Platform - - - Source\Platform - - - Source\Platform - - - Source\Localisation - - - Source\Peep - - - Source\Peep - - - Source\Management - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Drawing - - - Source - - - Source\World - - - Source\World - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Ride - - - Source\Windows - - - Source\Interface - - - Source\Interface - - - Source\World - - - Source - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Localisation - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\World - - - Source\World - - - Source\Windows - - - Source\Windows - - - Source\Ride - - - Source - - - Source\Windows - - - Source - - - Source\Windows - - - Source\World - - - Source\World - - - Source - - - Source\Windows - - - Source - - - Source\Windows - - - Source\Interface - - - Source\Network - - - Source\Network - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Interface - - - Source\Windows - - - Source\Windows - - - Source - - - Source\Localisation - - - Source\Drawing - - - Source\Drawing - - - Source\Localisation - - - Source\Network - - - Source\Windows - - - Source\Interface - - - Source\Windows - - - Source\World - - - Source\World - - - Source\World - - - Source\World - - - Source\Localisation - - - Source\Localisation - - - Source\Ride - - - Source\Platform - - - Source\Windows - - - Source\Interface - - - Source - - - Source\Ride - - - Source\Drawing - - - Source\Windows - - - Source - - - Source - - - Source\Core - - - Source\CommandLine - - - Source\CommandLine - - - Source\CommandLine - - - Source\CommandLine - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Windows - - - Source\Windows - - - Source\Interface - - - Source\Drawing - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Platform - - - Source\Core - - - Source\Windows - - - Source\RCT1 - - - Source\RCT1 - - - Source\CommandLine - - + - - Source\Management - - - Source\Management - - - Source\Management - - - Source\Management - - - Source\Audio - - - Source\Audio - - - Source\Interface - - - Source\Interface - - - Source\Interface - - - Source\Interface - - - Source\Interface - - - Source\World - - - Source\World - - - Source\World - - - Source\World - - - Source\World - - - Source\Windows - - - Source\Windows - - - Source\Windows - - - Source\Localisation - - - Source\Localisation - - - Source\Localisation - - - Source\Ride - - - Source\Ride - - - Source\Ride - - - Source\Ride - - - Source\Ride - - - Source\Util - - - Source\Util - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source\Localisation - - - Source\Drawing - - - Source - - - Source\Localisation - - - Source\Platform - - - Source\Localisation - - - Source\Peep - - - Source\Peep - - - Source\Management - - - Source - - - Source\World - - - Source\Ride - - - Source\Interface - - - Source\World - - - Source - - - Source - - - Source\World - - - Source\World - - - Source\Ride - - - Source\World - - - Source\World - - - Source\World - - - Source\World - - - Source\Interface - - - Source\Network - - - Source\Network - - - Source\Interface - - - Source\Interface - - - Source - - - Source\Drawing - - - Source\Network - - - Source\Interface - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Localisation - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Ride - - - Source\Interface - - - Source\Ride - - - Source\Core - - - Source\Drawing - - - Source - - - Source\Core - - - Source - - - Source\Core - - - Source\Core - - - Source\CommandLine - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Platform - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\Core - - - Source\RCT1 - - - Resource Files - - - Source\RCT1 - - + - - Resource Files - - - - - Resource Files - + + \ No newline at end of file diff --git a/src/interface/viewport.c b/src/interface/viewport.c index bee073b8e0..26b5fec266 100644 --- a/src/interface/viewport.c +++ b/src/interface/viewport.c @@ -17,7 +17,7 @@ #include "../addresses.h" #include "../config.h" #include "../drawing/drawing.h" -#include "../drawing/supports.h" +#include "../paint/supports.h" #include "../game.h" #include "../input.h" #include "../localisation/localisation.h" @@ -31,7 +31,10 @@ #include "../world/entrance.h" #include "../world/footpath.h" #include "../world/scenery.h" -#include "paint_surface.h" +#include "colour.h" +#include "../paint/paint.h" +#include "viewport.h" +#include "window.h" //#define DEBUG_SHOW_DIRTY_BOX @@ -693,1854 +696,6 @@ void viewport_render(rct_drawpixelinfo *dpi, rct_viewport *viewport, int left, i #endif } -/** -* -* rct2: 0x0068615B -*/ -void painter_setup(){ - RCT2_GLOBAL(0xEE7888, uint32) = 0x00EE788C; - RCT2_GLOBAL(0xF1AD28, uint32) = 0; - RCT2_GLOBAL(0xF1AD2C, uint32) = 0; - uint8* edi = RCT2_ADDRESS(0xF1A50C, uint8); - memset(edi, 0, 2048); - RCT2_GLOBAL(0xF1AD0C, sint32) = -1; - RCT2_GLOBAL(0xF1AD10, uint32) = 0; - RCT2_GLOBAL(0xF1AD20, uint32) = 0; - RCT2_GLOBAL(0xF1AD24, uint32) = 0; -} - -/** - * - * rct2: 0x00688596 - * Part of 0x688485 - */ -void paint_attached_ps(paint_struct* ps, paint_struct* attached_ps, rct_drawpixelinfo* dpi){ - for (; attached_ps; attached_ps = attached_ps->next_attached_ps){ - sint16 x = attached_ps->attached_x + ps->x; - sint16 y = attached_ps->attached_y + ps->y; - - int image_id = attached_ps->image_id; - if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_RIDES) { - if (ps->sprite_type == 3){ - if (image_id & 0x40000000){ - image_id &= 0x7FFFF; - image_id |= 0x41880000; - } - } - } - - if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_SCENERY) { - if (ps->sprite_type == 5){ - if (image_id & 0x40000000){ - image_id &= 0x7FFFF; - image_id |= 0x41880000; - } - } - } - - if (attached_ps->var_0C & 1) { - gfx_draw_sprite_raw_masked(dpi, x, y, image_id, attached_ps->var_04); - } else { - gfx_draw_sprite(dpi, image_id, x, y, ps->var_04); - } - } -} - -void sub_688485(){ - rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - paint_struct* ps = RCT2_GLOBAL(0xEE7884, paint_struct*); - paint_struct* previous_ps = ps->next_quadrant_ps; - - for (ps = ps->next_quadrant_ps; ps;){ - sint16 x = ps->x; - sint16 y = ps->y; - if (ps->sprite_type == 2){ - if (dpi->zoom_level >= 1){ - x &= 0xFFFE; - y &= 0xFFFE; - if (dpi->zoom_level >= 2){ - x &= 0xFFFC; - y &= 0xFFFC; - } - } - } - int image_id = ps->image_id; - if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_RIDES) { - if (ps->sprite_type == 3){ - if (!(image_id & 0x40000000)){ - image_id &= 0x7FFFF; - image_id |= 0x41880000; - } - } - } - if (gCurrentViewportFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) { - if (ps->sprite_type == 9){ - if (!(image_id & 0x40000000)){ - image_id &= 0x7FFFF; - image_id |= 0x41880000; - } - } - } - if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_SCENERY) { - if (ps->sprite_type == 10 || ps->sprite_type == 12 || ps->sprite_type == 9 || ps->sprite_type == 5){ - if (!(image_id & 0x40000000)){ - image_id &= 0x7FFFF; - image_id |= 0x41880000; - } - } - } - - if (ps->var_1A & 1) - gfx_draw_sprite_raw_masked(dpi, x, y, image_id, ps->var_04); - else - gfx_draw_sprite(dpi, image_id, x, y, ps->var_04); - - if (ps->var_20 != 0){ - ps = ps->var_20; - continue; - } - - paint_attached_ps(ps, ps->attached_ps, dpi); - ps = previous_ps->next_quadrant_ps; - previous_ps = ps; - } - -} - -/** - * - * rct2: 0x006874B0, 0x00687618, 0x0068778C, 0x00687902, 0x0098199C - * - * @param image_id (ebx) - * @param x_offset (al) - * @param y_offset (cl) - * @param bound_box_length_x (di) - * @param bound_box_length_y (si) - * @param bound_box_length_z (ah) - * @param z_offset (dx) - * @param bound_box_offset_x (0x009DEA52) - * @param bound_box_offset_y (0x009DEA54) - * @param bound_box_offset_z (0x009DEA56) - * @param rotation (ebp) - * @return (!CF) success - */ -bool sub_98199C( - uint32 image_id, - sint8 x_offset, sint8 y_offset, - sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, - uint16 z_offset, - sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, - uint32 rotation -) { - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_X, uint16) = bound_box_offset_x; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Y, uint16) = bound_box_offset_y; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Z, uint16) = bound_box_offset_z; - - int flags = RCT2_CALLPROC_X(RCT2_ADDRESS(0x98199C, uint32_t)[rotation], - x_offset | (bound_box_length_z << 8), - image_id, - y_offset, - z_offset, - bound_box_length_y, - bound_box_length_x, - rotation); - - return !(flags & (1 << 8)); -} - -/** - * rct2: 0x006861AC, 0x00686337, 0x006864D0, 0x0068666B, 0x0098196C - * - * @param image_id (ebx) - * @param x_offset (al) - * @param y_offset (cl) - * @param bound_box_length_x (di) - * @param bound_box_length_y (si) - * @param bound_box_length_z (ah) - * @param z_offset (dx) - * @param rotation (ebp) - * @return (!CF) success - */ -bool sub_98196C( - uint32 image_id, - sint8 x_offset, sint8 y_offset, - sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, - uint16 z_offset, - uint32 rotation -) { - int flags = RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098196C, uint32)[rotation], - x_offset | (bound_box_length_z << 8), - image_id, - y_offset, - z_offset, - bound_box_length_y, - bound_box_length_x, - rotation - ); - - return !(flags & (1 << 8)); -} - -/** - * rct2: 0x00686806, 0x006869B2, 0x00686B6F, 0x00686D31, 0x0098197C - * - * @param image_id (ebx) - * @param x_offset (al) - * @param y_offset (cl) - * @param bound_box_length_x (di) - * @param bound_box_length_y (si) - * @param bound_box_length_z (ah) - * @param z_offset (dx) - * @param bound_box_offset_x (0x009DEA52) - * @param bound_box_offset_y (0x009DEA54) - * @param bound_box_offset_z (0x009DEA56) - * @param rotation (ebp) - * @return (!CF) success - */ -bool sub_98197C( - uint32 image_id, - sint8 x_offset, sint8 y_offset, - sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, - uint16 z_offset, - sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, - uint32 rotation -) { - int ebp = bound_box_length_z + bound_box_offset_z; - - RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0; - RCT2_GLOBAL(0xF1AD2C, uint32) = 0; - - //Not a paint struct but something similar - paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*); - - if ((uint32)ps >= RCT2_GLOBAL(0xEE7880, uint32))return false; - - ps->image_id = image_id; - - uint32 image_element = image_id & 0x7FFFF; - rct_g1_element *g1Element = gfx_get_g1_element(image_element); - - rct_xyz16 coord_3d = { - .x = x_offset, - .y = y_offset, - .z = z_offset - }; - - switch (rotation) { - case 0: - rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 0); - break; - case 1: - rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 3); - break; - case 2: - rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 2); - break; - case 3: - rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 1); - break; - } - coord_3d.x += RCT2_GLOBAL(0x9DE568, sint16); - coord_3d.y += RCT2_GLOBAL(0x9DE56C, sint16); - - rct_xy16 map = coordinate_3d_to_2d(&coord_3d, rotation); - - ps->x = map.x; - ps->y = map.y; - - int left = map.x + g1Element->x_offset; - int bottom = map.y + g1Element->y_offset; - - int right = left + g1Element->width; - int top = bottom + g1Element->height; - - RCT2_GLOBAL(0xF1AD1C, uint16) = left; - RCT2_GLOBAL(0xF1AD1E, uint16) = bottom; - - rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - - if (right <= dpi->x)return false; - if (top <= dpi->y)return false; - if (left > dpi->x + dpi->width)return false; - if (bottom > dpi->y + dpi->height)return false; - - rct_xy16 boundBox = { - .x = bound_box_length_x, - .y = bound_box_length_y - }; - - rct_xy16 boundBoxOffset = { - .x = bound_box_offset_x, - .y = bound_box_offset_y - }; - - // Unsure why rots 1 and 3 need to swap - switch (rotation){ - case 0: - boundBox.x--; - boundBox.y--; - rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 0); - rotate_map_coordinates(&boundBox.x, &boundBox.y, 0); - break; - case 1: - boundBox.x--; - rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 3); - rotate_map_coordinates(&boundBox.x, &boundBox.y, 3); - break; - case 2: - rotate_map_coordinates(&boundBox.x, &boundBox.y, 2); - rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 2); - break; - case 3: - boundBox.y--; - rotate_map_coordinates(&boundBox.x, &boundBox.y, 1); - rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 1); - break; - } - - ps->attached_x_end = boundBox.x + boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16); - ps->attached_z = bound_box_offset_z; - ps->attached_z_end = ebp; - ps->attached_y_end = boundBox.y + boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16); - ps->var_1A = 0; - ps->attached_x = boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16); - ps->attached_y = boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16); - ps->attached_ps = NULL; - ps->var_20 = NULL; - ps->sprite_type = RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8); - ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8); - ps->map_x = RCT2_GLOBAL(0x9DE574, uint16); - ps->map_y = RCT2_GLOBAL(0x9DE576, uint16); - ps->mapElement = RCT2_GLOBAL(0x9DE578, rct_map_element*); - - RCT2_GLOBAL(0xF1AD28, paint_struct*) = ps; - - rct_xy16 attach = { - .x = ps->attached_x, - .y = ps->attached_y - }; - - rotate_map_coordinates(&attach.x, &attach.y, rotation); - switch (rotation){ - case 0: - break; - case 1: - case 3: - attach.x += 0x2000; - break; - case 2: - attach.x += 0x4000; - break; - } - - sint16 di = attach.x + attach.y; - - if (di < 0) - di = 0; - - di /= 32; - if (di > 511) - di = 511; - - ps->var_18 = di; - paint_struct* old_ps = RCT2_ADDRESS(0x00F1A50C, paint_struct*)[di]; - RCT2_ADDRESS(0x00F1A50C, paint_struct*)[di] = ps; - ps->next_quadrant_ps = old_ps; - - if ((uint16)di < RCT2_GLOBAL(0x00F1AD0C, uint32)){ - RCT2_GLOBAL(0x00F1AD0C, uint32) = di; - } - - if ((uint16)di > RCT2_GLOBAL(0x00F1AD10, uint32)){ - RCT2_GLOBAL(0x00F1AD10, uint32) = di; - } - - RCT2_GLOBAL(0xEE7888, paint_struct*) += 1; - return true; -} - -/** - * - * rct2: 0x006D5FAB - */ -static void vehicle_visual_launched_freefall(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) -{ - int image_id; - int baseImage_id = vehicleEntry->base_image_id + ((vehicle->restraints_position / 64) * 2); - - // Draw back: - image_id = (baseImage_id + 2) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; - sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, get_current_rotation()); - - // Draw front: - image_id = (baseImage_id + 1) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; - sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); - - // Draw peeps: - if (RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*)->zoom_level < 2) { - if (vehicle->num_peeps > 0) { - baseImage_id = vehicleEntry->base_image_id + 9; - if ((vehicle->restraints_position / 64) == 3) { - baseImage_id += 2; // Draw peeps sitting without transparent area between them for restraints - } - image_id = (baseImage_id + ((((imageDirection / 8) + 0) & 3) * 3)) | (vehicle->peep_tshirt_colours[0] << 19) | (vehicle->peep_tshirt_colours[1] << 24) | 0xA0000000; - sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); - if (vehicle->num_peeps > 2) { - image_id = (baseImage_id + ((((imageDirection / 8) + 1) & 3) * 3)) | (vehicle->peep_tshirt_colours[2] << 19) | (vehicle->peep_tshirt_colours[3] << 24) | 0xA0000000; - sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); - } - if (vehicle->num_peeps > 4) { - image_id = (baseImage_id + ((((imageDirection / 8) + 2) & 3) * 3)) | (vehicle->peep_tshirt_colours[4] << 19) | (vehicle->peep_tshirt_colours[5] << 24) | 0xA0000000; - sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); - } - if (vehicle->num_peeps > 6) { - image_id = (baseImage_id + ((((imageDirection / 8) + 3) & 3) * 3)) | (vehicle->peep_tshirt_colours[6] << 19) | (vehicle->peep_tshirt_colours[7] << 24) | 0xA0000000; - sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); - } - } - } - - assert(vehicleEntry->pad_5E == 1); -} - -/** - * - * rct2: 0x006D6258 - */ -static void vehicle_visual_observation_tower(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) -{ - int image_id; - int baseImage_id = (vehicle->restraints_position / 64); - if (vehicle->restraints_position >= 64) { - if ((imageDirection / 8) && (imageDirection / 8) != 3) { - baseImage_id *= 2; - baseImage_id += vehicleEntry->base_image_id + 28; - if ((imageDirection / 8) != 1) { - baseImage_id -= 6; - } - } else { - baseImage_id = vehicleEntry->base_image_id + 8; - } - } else { - baseImage_id = (vehicle->var_C5 * 2) + vehicleEntry->base_image_id + 8; - } - - image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0x80000000; - if (sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, get_current_rotation())) { - paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original - ps->var_04 = vehicle->colours_extended; - } - - image_id++; - if (sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation())) { - paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original - ps->var_04 = vehicle->colours_extended; - } - - assert(vehicleEntry->pad_5E == 1); -} - -/** - * - * rct2: 0x006D5DA9 - */ -static void vehicle_visual_roto_drop(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) -{ - int image_id; - int baseImage_id = (vehicleEntry->base_image_id + 4) + ((vehicle->var_C5 / 4) & 0x3); - if (vehicle->restraints_position >= 64) { - baseImage_id += 7; - baseImage_id += (vehicle->restraints_position / 64); - } - - // Draw back: - image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; - sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, get_current_rotation()); - - // Draw front: - image_id = (baseImage_id + 4) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; - sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); - - uint8 riding_peep_sprites[64]; - memset(riding_peep_sprites, 0xFF, sizeof(riding_peep_sprites)); - for (int i = 0; i < vehicle->num_peeps; i++) { - uint8 cl = (i & 3) * 16; - cl += (i & 0xFC); - cl += vehicle->var_C5 / 4; - cl += (imageDirection / 8) * 16; - cl &= 0x3F; - riding_peep_sprites[cl] = vehicle->peep_tshirt_colours[i]; - } - - // Draw riding peep sprites in back to front order: - for (int j = 0; j <= 48; j++) { - int i = (j % 2) ? (48 - (j / 2)) : (j / 2); - if (riding_peep_sprites[i] != 0xFF) { - baseImage_id = vehicleEntry->base_image_id + 20 + i; - if (vehicle->restraints_position >= 64) { - baseImage_id += 64; - baseImage_id += vehicle->restraints_position / 64; - } - image_id = baseImage_id | (riding_peep_sprites[i] << 19) | 0x20000000; - sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); - } - }; - - assert(vehicleEntry->pad_5E == 1); - // 0x5E is treated as another car_visual paint setup jump table like in viewport_vehicle_paint_setup - // in the original code right here but appears to only ever be 1 which goes to a nullsub so it was taken out. -} - -/** - * - * rct2: 0x006D5B48 - */ -static void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) -{ - int image_id; - int baseImage_id = imageDirection; - int ecx = ((vehicle->var_BA / 8) + (get_current_rotation() * 8)) & 31; - int j = 0; - if (vehicle->vehicle_sprite_type == 0) { - baseImage_id = ecx & 7; - } else { - if (vehicle->vehicle_sprite_type == 1 || vehicle->vehicle_sprite_type == 5) { - if (vehicle->vehicle_sprite_type == 5){ - baseImage_id = imageDirection ^ 16; - } - baseImage_id &= 24; - j = (baseImage_id / 8) + 1; - baseImage_id += (ecx & 7); - baseImage_id += 8; - } else - if (vehicle->vehicle_sprite_type == 2 || vehicle->vehicle_sprite_type == 6) { - if (vehicle->vehicle_sprite_type == 6){ - baseImage_id = imageDirection ^ 16; - } - baseImage_id &= 24; - j = (baseImage_id / 8) + 5; - baseImage_id += (ecx & 7); - baseImage_id += 40; - } else { - baseImage_id = ecx & 7; - } - } - baseImage_id += vehicleEntry->base_image_id; - - sint16 bbo_x = RCT2_ADDRESS(0x009927E6, sint8)[j * 8]; - sint16 bbo_y = RCT2_ADDRESS(0x009927E7, sint8)[j * 8]; - sint16 bbo_z = RCT2_ADDRESS(0x009927E8, sint8)[j * 8] + z; - uint16 bbl_x = RCT2_ADDRESS(0x009927E9, uint8)[j * 8]; - uint16 bbl_y = RCT2_ADDRESS(0x009927EA, uint8)[j * 8]; - uint8 bbl_z = RCT2_ADDRESS(0x009927EB, uint8)[j * 8]; - image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; - sub_98197C(image_id, 0, 0, bbl_x, bbl_y, bbl_z, z, bbo_x, bbo_y, bbo_z, get_current_rotation()); - - if (RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*)->zoom_level < 2 && vehicle->num_peeps > 0) { - uint8 riding_peep_sprites[4] = {0xFF, 0xFF, 0xFF, 0xFF}; - for (int i = 0; i < vehicle->num_peeps; i++) { - riding_peep_sprites[((ecx / 8) + i) & 3] = vehicle->peep_tshirt_colours[i]; - } - int draw_order[4] = {0, 1, 3, 2}; - for (int i = 0; i < countof(draw_order); i++) { - if (riding_peep_sprites[draw_order[i]] != 0xFF) { - image_id = (baseImage_id + ((draw_order[i] + 1) * 72)) | (riding_peep_sprites[draw_order[i]] << 19) | 0x20000000; - sub_98199C(image_id, 0, 0, bbl_x, bbl_y, bbl_z, z, bbo_x, bbo_y, bbo_z, get_current_rotation()); - } - } - } - - assert(vehicleEntry->pad_5E == 1); -} - -/** - * - * rct2: 0x00686EF0, 0x00687056, 0x006871C8, 0x0068733C, 0x0098198C - * - * @param image_id (ebx) - * @param x_offset (al) - * @param y_offset (cl) - * @param bound_box_length_x (di) - * @param bound_box_length_y (si) - * @param bound_box_length_z (ah) - * @param z_offset (dx) - * @param bound_box_offset_x (0x009DEA52) - * @param bound_box_offset_y (0x009DEA54) - * @param bound_box_offset_z (0x009DEA56) - * @param rotation - * @return (!CF) success - */ -bool sub_98198C( - uint32 image_id, - sint8 x_offset, sint8 y_offset, - sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, - uint16 z_offset, - sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, - uint32 rotation -) { - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_X, uint16) = bound_box_offset_x; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Y, uint16) = bound_box_offset_y; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Z, uint16) = bound_box_offset_z; - - int flags = RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098198C, uint32)[rotation], - x_offset | (bound_box_length_z << 8), - image_id, - y_offset, - z_offset, - bound_box_length_y, - bound_box_length_x, - rotation - ); - - return !(flags & (1 << 8)); -} - -/** - * rct2: 68818E - * - * @param image_id (ebx) - * @param x (ax) - * @param y (cx) - * @param[out] paint (ebp) - * @return (!CF) success - */ -bool sub_68818E(uint32 image_id, uint16 x, uint16 y, paint_struct ** paint) -{ - - //Not a paint struct but something similar - paint_struct * ps = RCT2_GLOBAL(0xEE7888, paint_struct *); - - if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) { - return false; - } - - ps->image_id = image_id; - ps->attached_x = x; - ps->attached_y = y; - ps->var_0C = 0; - - paint_struct * ebx2 = RCT2_GLOBAL(0xF1AD28, paint_struct *); - if (ebx2 == NULL) { - return false; - } - - RCT2_GLOBAL(0x00EE7888, uint32) += 0x12; - - paint_struct * edi = ebx2->attached_ps; - ebx2->attached_ps = ps; - - ps->next_attached_ps = edi; - - RCT2_GLOBAL(0xF1AD2C, paint_struct *) = ps; - - if (paint != NULL) { - *paint = ps; - } - - return true; -} - -/** - * - * rct2: 0x006D4244 - */ -void viewport_vehicle_paint_setup(rct_vehicle *vehicle, int imageDirection) -{ - rct_ride_entry *rideEntry; - const rct_ride_entry_vehicle *vehicleEntry; - - int x = vehicle->x; - int y = vehicle->y; - int z = vehicle->z; - - if (vehicle->flags & SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE) { - uint32 ebx = 22965 + vehicle->var_C5; - sub_98197C(ebx, 0, 0, 1, 1, 0, z, 0, 0, z + 2, get_current_rotation()); - return; - } - - if (vehicle->ride_subtype == 0xFF) { - vehicleEntry = &CableLiftVehicle; - } else { - rideEntry = get_ride_entry(vehicle->ride_subtype); - vehicleEntry = &rideEntry->vehicles[vehicle->vehicle_type]; - - if (vehicle->update_flags & VEHICLE_UPDATE_FLAG_11) { - vehicleEntry++; - z += 16; - } - } - - uint32 rct2VehiclePtrFormat = ((uint32)vehicleEntry) - offsetof(rct_ride_entry, vehicles); - RCT2_GLOBAL(0x00F64DFC, uint32) = rct2VehiclePtrFormat; - switch (vehicleEntry->car_visual) { - case VEHICLE_VISUAL_DEFAULT: RCT2_CALLPROC_X(0x006D45F8, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case VEHICLE_VISUAL_LAUNCHED_FREEFALL: vehicle_visual_launched_freefall(x, imageDirection, y, z, vehicle, vehicleEntry); break; - case VEHICLE_VISUAL_OBSERVATION_TOWER: vehicle_visual_observation_tower(x, imageDirection, y, z, vehicle, vehicleEntry); break; - case VEHICLE_VISUAL_RIVER_RAPIDS: RCT2_CALLPROC_X(0x006D5889, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case VEHICLE_VISUAL_MINI_GOLF_PLAYER: RCT2_CALLPROC_X(0x006D42F0, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case VEHICLE_VISUAL_MINI_GOLF_BALL: RCT2_CALLPROC_X(0x006D43C6, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case VEHICLE_VISUAL_REVERSER: RCT2_CALLPROC_X(0x006D4453, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case VEHICLE_VISUAL_SPLASH_BOATS_OR_WATER_COASTER: RCT2_CALLPROC_X(0x006D4295, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case VEHICLE_VISUAL_ROTO_DROP: vehicle_visual_roto_drop(x, imageDirection, y, z, vehicle, vehicleEntry); break; - case 10: RCT2_CALLPROC_X(0x006D5600, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case 11: RCT2_CALLPROC_X(0x006D5696, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case 12: RCT2_CALLPROC_X(0x006D57EE, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case 13: RCT2_CALLPROC_X(0x006D5783, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case 14: RCT2_CALLPROC_X(0x006D5701, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case VEHICLE_VISUAL_VIRGINIA_REEL: vehicle_visual_virginia_reel(x, imageDirection, y, z, vehicle, vehicleEntry); break; - case VEHICLE_VISUAL_SUBMARINE: RCT2_CALLPROC_X(0x006D44D5, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - } -} - -/** - * rct2: 0x0068F0FB - */ -void viewport_peep_paint_setup(rct_peep * peep, int imageDirection) -{ - rct_drawpixelinfo * dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - if (dpi->zoom_level > 2) { - return; - } - - if (gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_PEEPS) { - return; - } - - rct_sprite_entry sprite = g_sprite_entries[peep->sprite_type]; - - uint8 spriteType = peep->action_sprite_type; - uint8 imageOffset = peep->action_sprite_image_offset; - - if (peep->action == PEEP_ACTION_NONE_1) { - spriteType = peep->next_action_sprite_type; - imageOffset = 0; - } - - uint32 baseImageId = (imageDirection >> 3) + sprite.sprite_image[spriteType].base_image + imageOffset * 4; - uint32 imageId = baseImageId | peep->tshirt_colour << 19 | peep->trousers_colour << 24 | 0xA0000000; - sub_98197C(imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 3, get_current_rotation()); - - if (baseImageId >= 10717 && baseImageId < 10749) { - imageId = baseImageId + 32 | peep->hat_colour << 19 | 0x20000000; - sub_98199C(imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 3, get_current_rotation()); - return; - } - - if (baseImageId >= 10781 && baseImageId < 10813) { - imageId = baseImageId + 32 | peep->balloon_colour << 19 | 0x20000000; - sub_98199C(imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 3, get_current_rotation()); - return; - } - - if (baseImageId >= 11197 && baseImageId < 11229) { - imageId = baseImageId + 32 | peep->umbrella_colour << 19 | 0x20000000; - sub_98199C(imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 3, get_current_rotation()); - return; - } -} -/** - * - * rct2: 0x00672AC9 - */ -void viewport_misc_paint_setup(rct_sprite *misc, int imageDirection) -{ - RCT2_CALLPROC_X(0x00672AC9, misc->unknown.x, imageDirection, misc->unknown.y, misc->unknown.z, (int)misc, 0, 0); -} - -/** -* Litter Paint Setup -* rct2: 0x006736FC -*/ -void viewport_litter_paint_setup(rct_litter *litter, int imageDirection) -{ - rct_drawpixelinfo *dpi; - - dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - if (dpi->zoom_level != 0) return; // If zoomed at all no litter drawn - - // litter has no sprite direction so remove that - imageDirection >>= 3; - // Some litter types have only 1 direction so remove - // anything that isn't required. - imageDirection &= RCT2_ADDRESS(0x97EF6C, uint32)[litter->type * 2 + 1]; - - uint32 image_id = imageDirection + RCT2_ADDRESS(0x97EF6C, uint32)[litter->type * 2]; - - sub_98197C(image_id, 0, 0, 4, 4, -1, litter->z, -4, -4, litter->z + 2, get_current_rotation()); -} - - -/** -* Paint Quadrant -* rct2: 0x0069E8B0 -*/ -void sprite_paint_setup(const uint16 eax, const uint16 ecx){ - rct_drawpixelinfo* dpi; - - if ((eax & 0xe000) | (ecx & 0xe000)) return; - - const int idx = ((eax << 3) & 0xff00) | (ecx >> 5); - int sprite_idx = RCT2_ADDRESS(0xF1EF60, uint16)[idx]; - if (sprite_idx == SPRITE_INDEX_NULL) return; - - if (RCT2_GLOBAL(0x9DEA6F, uint8) & 1) return; - - - if (gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES) return; - - dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - if (dpi->zoom_level > 2) return; - - - for (rct_sprite* spr = &g_sprite_list[sprite_idx]; sprite_idx != SPRITE_INDEX_NULL; sprite_idx = spr->unknown.next_in_quadrant){ - spr = &g_sprite_list[sprite_idx]; - dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - - if (dpi->y + dpi->height <= spr->unknown.sprite_top) continue; - if (spr->unknown.sprite_bottom <= dpi->y)continue; - if (dpi->x + dpi->width <= spr->unknown.sprite_left)continue; - if (spr->unknown.sprite_right <= dpi->x)continue; - - int image_direction = get_current_rotation(); - image_direction <<= 3; - image_direction += spr->unknown.sprite_direction; - image_direction &= 0x1F; - - RCT2_GLOBAL(0x9DE578, uint32) = (uint32)spr; - - RCT2_GLOBAL(0x9DE568, sint16) = spr->unknown.x; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_SPRITE; - RCT2_GLOBAL(0x9DE56C, sint16) = spr->unknown.y; - - switch (spr->unknown.sprite_identifier){ - case SPRITE_IDENTIFIER_VEHICLE: - viewport_vehicle_paint_setup((rct_vehicle*)spr, image_direction); - break; - case SPRITE_IDENTIFIER_PEEP: - viewport_peep_paint_setup((rct_peep*)spr, image_direction); - break; - case SPRITE_IDENTIFIER_MISC: - viewport_misc_paint_setup(spr, image_direction); - break; - case SPRITE_IDENTIFIER_LITTER: - viewport_litter_paint_setup((rct_litter*)spr, image_direction); - break; - default: - assert(false); - break; - } - } -} - -/** - * - * rct2: 0x0066508C, 0x00665540 - */ -void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_map_element* map_element) -{ - rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - uint8 is_exit = map_element->properties.entrance.type == ENTRANCE_TYPE_RIDE_EXIT; - - if (RCT2_GLOBAL(0x9DEA6F, uint8_t) & 1){ - if (map_element->properties.entrance.ride_index != RCT2_GLOBAL(0x00F64DE8, uint8)) - return; - } - - rct_ride* ride = get_ride(map_element->properties.entrance.ride_index); - if (ride->entrance_style == RIDE_ENTRANCE_STYLE_NONE) return; - - const rct_ride_entrance_definition *style = &RideEntranceDefinitions[ride->entrance_style]; - - uint8 colour_1, colour_2; - uint32 transparant_image_id = 0, image_id = 0; - if (style->flags & (1 << 30)) { - colour_1 = ride->track_colour_main[0] + 0x70; - transparant_image_id = (colour_1 << 19) | 0x40000000; - } - - colour_1 = ride->track_colour_main[0]; - colour_2 = ride->track_colour_additional[0]; - image_id = (colour_1 << 19) | (colour_2 << 24) | 0xA0000000; - - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_RIDE; - RCT2_GLOBAL(0x009E32BC, uint32) = 0; - - if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){ - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; - image_id = RCT2_ADDRESS(0x993CC4, uint32_t)[gConfigGeneral.construction_marker_colour]; - RCT2_GLOBAL(0x009E32BC, uint32) = image_id; - if (transparant_image_id) - transparant_image_id = image_id; - } - - if (is_exit){ - image_id |= style->sprite_index + direction + 8; - } - else{ - image_id |= style->sprite_index + direction; - } - // Format modifed to stop repeated code - - // Each entrance is split into 2 images for drawing - // Certain entrance styles have another 2 images to draw for coloured windows - - sint8 ah = is_exit ? 0x23 : 0x33; - - sint16 lengthY = (direction & 1) ? 28 : 2; - sint16 lengthX = (direction & 1) ? 2 : 28; - - sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height, get_current_rotation()); - - if (transparant_image_id){ - if (is_exit){ - transparant_image_id |= style->sprite_index + direction + 24; - } - else{ - transparant_image_id |= style->sprite_index + direction + 16; - } - - sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height, get_current_rotation()); - } - - image_id += 4; - - sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height, get_current_rotation()); - - if (transparant_image_id){ - transparant_image_id += 4; - sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height, get_current_rotation()); - } - - uint32 eax = 0xFFFF0600 | ((height / 16) & 0xFF); - if (direction & 1){ - RCT2_ADDRESS(0x009E30B6, uint32)[RCT2_GLOBAL(0x141F56B, uint8) / 2] = eax; - RCT2_GLOBAL(0x141F56B, uint8)++; - } - else{ - RCT2_ADDRESS(0x009E3138, uint32)[RCT2_GLOBAL(0x141F56A, uint8) / 2] = eax; - RCT2_GLOBAL(0x141F56A, uint8)++; - } - - if (!is_exit && - !(map_element->flags & MAP_ELEMENT_FLAG_GHOST) && - map_element->properties.entrance.ride_index != 0xFF){ - - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = 0; - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 4, uint32) = 0; - - rct_string_id string_id = STR_RIDE_ENTRANCE_CLOSED; - - if (ride->status == RIDE_STATUS_OPEN && - !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)){ - - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, rct_string_id) = ride->name; - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = ride->name_arguments; - - string_id = STR_RIDE_ENTRANCE_NAME; - } - - utf8 entrance_string[MAX_PATH]; - if (gConfigGeneral.upper_case_banners) { - format_string_to_upper(entrance_string, string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); - } else { - format_string(entrance_string, string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); - } - - gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; - - uint16 string_width = gfx_get_string_width(entrance_string); - uint16 scroll = (gCurrentTicks / 2) % string_width; - - sub_98199C(scrolling_text_setup(string_id, scroll, style->scrolling_mode), 0, 0, 0x1C, 0x1C, 0x33, height + style->height, 2, 2, height + style->height, get_current_rotation()); - } - - image_id = RCT2_GLOBAL(0x009E32BC, uint32); - if (image_id == 0) { - image_id = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_SATURATED_BROWN); - } - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += is_exit ? 40 : 56; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height){ - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x006658ED - */ -void viewport_park_entrance_paint_setup(uint8 direction, int height, rct_map_element* map_element){ - if (RCT2_GLOBAL(0x9DEA6F, uint8_t) & 1) - return; - - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_PARK; - RCT2_GLOBAL(0x009E32BC, uint32) = 0; - uint32 image_id, ghost_id = 0; - if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){ - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; - ghost_id = RCT2_ADDRESS(0x993CC4, uint32)[gConfigGeneral.construction_marker_colour]; - RCT2_GLOBAL(0x009E32BC, uint32) = ghost_id; - } - - rct_path_type* path_entry = g_pathTypeEntries[map_element->properties.entrance.path_type]; - - // Index to which part of the entrance - // Middle, left, right - uint8 part_index = map_element->properties.entrance.index & 0xF; - rct_entrance_type* entrance; - uint8 di = (direction / 2 + part_index / 2) & 1 ? 0x1A : 0x20; - - switch (part_index){ - case 0: - image_id = (path_entry->image + 5 * (1 + (direction & 1))) | ghost_id; - sub_98197C(image_id, 0, 0, 32, 0x1C, 0, height, 0, 2, height, get_current_rotation()); - - entrance = (rct_entrance_type*)object_entry_groups[OBJECT_TYPE_PARK_ENTRANCE].chunks[0]; - image_id = (entrance->image_id + direction * 3) | ghost_id; - sub_98197C(image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, 2, 2, height + 32, get_current_rotation()); - - if ((direction + 1) & (1 << 1)) - break; - if (ghost_id != 0) - break; - - rct_string_id park_text_id = 1730; - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = 0; - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 4, uint32) = 0; - - if (gParkFlags & PARK_FLAGS_PARK_OPEN){ - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, rct_string_id) = gParkName; - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = gParkNameArgs; - - park_text_id = 1731; - } - - utf8 park_name[MAX_PATH]; - if (gConfigGeneral.upper_case_banners) { - format_string_to_upper(park_name, park_text_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); - } else { - format_string(park_name, park_text_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); - } - - gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; - uint16 string_width = gfx_get_string_width(park_name); - uint16 scroll = (gCurrentTicks / 2) % string_width; - - if (entrance->scrolling_mode == 0xFF) - break; - - sub_98199C(scrolling_text_setup(park_text_id, scroll, entrance->scrolling_mode + direction / 2), 0, 0, 0x1C, 0x1C, 0x2F, height + entrance->text_height, 2, 2, height + entrance->text_height, get_current_rotation()); - break; - case 1: - case 2: - entrance = (rct_entrance_type*)object_entry_groups[OBJECT_TYPE_PARK_ENTRANCE].chunks[0]; - image_id = (entrance->image_id + part_index + direction * 3) | ghost_id; - sub_98197C(image_id, 0, 0, 0x1A, di, 0x4F, height, 3, 3, height, get_current_rotation()); - break; - } - - image_id = ghost_id; - if (image_id == 0) { - image_id = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_SATURATED_BROWN); - } - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += 80; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height){ - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x006C4794 - */ -void viewport_track_paint_setup(uint8 direction, int height, rct_map_element *mapElement) -{ - rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); - rct_ride *ride; - int rideIndex, trackType, trackColourScheme, trackSequence; - - rideIndex = mapElement->properties.track.ride_index; - ride = get_ride(rideIndex); - if (ride->type == RIDE_TYPE_NULL) { - log_error("Attempted to paint invalid ride: %d", rideIndex); - return; - } - - // HACK Set entrance style to plain if none to stop glitch until entrance track piece is implemented - bool isEntranceStyleNone = false; - if (ride->entrance_style == RIDE_ENTRANCE_STYLE_NONE) { - isEntranceStyleNone = true; - ride->entrance_style = RIDE_ENTRANCE_STYLE_PLAIN; - } - - if (!(RCT2_GLOBAL(0x009DEA6F, uint8) & 1) || rideIndex == RCT2_GLOBAL(0x00F64DE8, uint8)) { - trackType = mapElement->properties.track.type; - trackSequence = mapElement->properties.track.sequence & 0x0F; - trackColourScheme = mapElement->properties.track.colour & 3; - - if ((gCurrentViewportFlags & VIEWPORT_FLAG_TRACK_HEIGHTS) && dpi->zoom_level == 0) { - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 0; - if (RCT2_ADDRESS(0x00999694, uint32)[trackType] & (1 << trackSequence)) { - uint16 ax = RideData5[ride->type].z_offset; - uint32 ebx = 0x20381689 + (height + 8) / 16; - ebx += get_height_marker_offset(); - ebx -= RCT2_GLOBAL(0x01359208, uint16); - sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, 1000, 1000, 2047, get_current_rotation()); - } - } - - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 3; - RCT2_GLOBAL(0x00F44198, uint32) = (ride->track_colour_main[trackColourScheme] << 19) | (ride->track_colour_additional[trackColourScheme] << 24) | 0xA0000000; - RCT2_GLOBAL(0x00F441A0, uint32) = 0x20000000; - RCT2_GLOBAL(0x00F441A4, uint32) = 0x20C00000; - RCT2_GLOBAL(0x00F4419C, uint32) = (ride->track_colour_supports[trackColourScheme] << 19) | 0x20000000; - if (mapElement->type & 0x40) { - RCT2_GLOBAL(0x00F44198, uint32) = 0x21600000; - RCT2_GLOBAL(0x00F4419C, uint32) = 0x21600000; - RCT2_GLOBAL(0x00F441A0, uint32) = 0x21600000; - RCT2_GLOBAL(0x00F441A4, uint32) = 0x21600000; - } - if (mapElement->flags & MAP_ELEMENT_FLAG_GHOST) { - uint32 ghost_id = RCT2_ADDRESS(0x00993CC4, uint32)[gConfigGeneral.construction_marker_colour]; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 0; - RCT2_GLOBAL(0x00F44198, uint32) = ghost_id; - RCT2_GLOBAL(0x00F4419C, uint32) = ghost_id; - RCT2_GLOBAL(0x00F441A0, uint32) = ghost_id; - RCT2_GLOBAL(0x00F441A4, uint32) = ghost_id; - } - - int rideType = ride->type; - if (rideType == RIDE_TYPE_JUNIOR_ROLLER_COASTER) { - switch (trackType) { - case TRACK_ELEM_60_DEG_UP: - case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: - case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: - case TRACK_ELEM_60_DEG_DOWN: - case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: - case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: - rideType = RIDE_TYPE_WATER_COASTER; - break; - - case TRACK_ELEM_FLAT_TO_60_DEG_UP: - case TRACK_ELEM_60_DEG_UP_TO_FLAT: - case TRACK_ELEM_FLAT_TO_60_DEG_DOWN: - case TRACK_ELEM_60_DEG_DOWN_TO_FLAT: - return; - } - } - - TRACK_PAINT_FUNCTION **trackTypeList = (TRACK_PAINT_FUNCTION**)RideTypeTrackPaintFunctionsOld[rideType]; - if (trackTypeList == NULL) { - TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = RideTypeTrackPaintFunctions[rideType]; - TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType, direction); - if (paintFunction != NULL) { - paintFunction(rideIndex, trackSequence, direction, height, mapElement); - } - } - else { - uint32 *trackDirectionList = (uint32*)trackTypeList[trackType]; - - // Have to call from this point as it pushes esi and expects callee to pop it - RCT2_CALLPROC_X( - 0x006C4934, - rideType, - (int)trackDirectionList, - direction, - height, - (int)mapElement, - rideIndex * sizeof(rct_ride), - trackSequence - ); - } - } - - if (isEntranceStyleNone) { - ride->entrance_style = RIDE_ENTRANCE_STYLE_NONE; - } -} - -/** - * - * rct2: 0x00664FD4 - */ -void viewport_entrance_paint_setup(uint8 direction, int height, rct_map_element* map_element){ - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_LABEL; - - rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - - if (gCurrentViewportFlags & VIEWPORT_FLAG_PATH_HEIGHTS && - dpi->zoom_level == 0){ - uint32 ebx = - (map_element->properties.entrance.type << 4) | - (map_element->properties.entrance.index & 0xF); - - if (RCT2_ADDRESS(0x0097B974, uint8)[ebx] & 0xF){ - - int z = map_element->base_height * 8 + 3; - uint32 image_id = - z / 16 + - get_height_marker_offset() + - 0x20101689; - - image_id -= RCT2_GLOBAL(0x01359208, sint16); - - sub_98197C(image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64, get_current_rotation()); - } - } - - switch (map_element->properties.entrance.type){ - case ENTRANCE_TYPE_RIDE_ENTRANCE: - case ENTRANCE_TYPE_RIDE_EXIT: - viewport_ride_entrance_exit_paint_setup(direction, height, map_element); - break; - case ENTRANCE_TYPE_PARK_ENTRANCE: - viewport_park_entrance_paint_setup(direction, height, map_element); - break; - } -} - -/** - * - * rct2: 0x006B9CC4 - */ -void viewport_banner_paint_setup(uint8 direction, int height, rct_map_element* map_element) -{ - uint16 boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ; - rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_BANNER; - - if (dpi->zoom_level > 1 || RCT2_GLOBAL(0x9DEA6F, uint8_t) & 1) return; - - height -= 16; - - rct_scenery_entry* banner_scenery = g_bannerSceneryEntries[gBanners[map_element->properties.banner.index].type]; - - direction += map_element->properties.banner.position; - direction &= 3; - - boundBoxOffsetX = RCT2_ADDRESS(0x98D884, uint16)[direction * 4]; - boundBoxOffsetY = RCT2_ADDRESS(0x98D884 + 2, uint16)[direction * 4]; - boundBoxOffsetZ = height + 2; - - uint32 base_id = (direction << 1) + banner_scenery->image; - uint32 image_id = base_id; - - if (map_element->flags & MAP_ELEMENT_FLAG_GHOST)//if being placed - { - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_NONE; - image_id |= RCT2_ADDRESS(0x993CC4, uint32_t)[gConfigGeneral.construction_marker_colour]; - } - else{ - image_id |= - (gBanners[map_element->properties.banner.index].colour << 19) | - 0x20000000; - } - - sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); - boundBoxOffsetX = RCT2_ADDRESS(0x98D888, uint16)[direction * 4]; - boundBoxOffsetY = RCT2_ADDRESS(0x98D888 + 2, uint16)[direction * 4]; - - image_id++; - sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); - - // Opposite direction - direction ^= 2; - direction--; - // If text not showing / ghost - if (direction >= 2 || (map_element->flags & MAP_ELEMENT_FLAG_GHOST)) return; - - uint16 scrollingMode = banner_scenery->banner.scrolling_mode; - scrollingMode += direction; - - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = 0; - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 4, uint32_t) = 0; - - rct_string_id string_id = STR_NO_ENTRY; - if (!(gBanners[map_element->properties.banner.index].flags & BANNER_FLAG_NO_ENTRY)) - { - RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint16) = gBanners[map_element->properties.banner.index].string_idx; - string_id = STR_BANNER_TEXT; - } - if (gConfigGeneral.upper_case_banners) { - format_string_to_upper(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char), string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); - } else { - format_string(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char), string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); - } - - gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; - - uint16 string_width = gfx_get_string_width(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char)); - uint16 scroll = (gCurrentTicks / 2) % string_width; - - sub_98199C(scrolling_text_setup(string_id, scroll, scrollingMode), 0, 0, 1, 1, 0x15, height + 22, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); -} - -/** - * - * rct2: 0x0068B3FB - */ -static void sub_68B3FB(int x, int y) -{ - rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); - - RCT2_GLOBAL(0x141F56A, uint16_t) = 0; - RCT2_GLOBAL(0x9E3138, uint8_t) = 0xFF; - RCT2_GLOBAL(0x9E30B6, uint8_t) = 0xFF; - RCT2_GLOBAL(0x9E323C, uint8_t) = 0xFF; - RCT2_GLOBAL(0x9DE56A, uint16_t) = x; - RCT2_GLOBAL(0x9DE56E, uint16_t) = y; - RCT2_GLOBAL(0x9DE574, uint16_t) = x; - RCT2_GLOBAL(0x9DE576, uint16_t) = y; - - rct_map_element* map_element = map_get_first_element_at(x >> 5, y >> 5); - uint8 rotation = get_current_rotation(); - - int dx = 0; - switch (rotation) { - case 0: - dx = x + y; - break; - case 1: - x += 32; - dx = y - x; - break; - case 2: - x += 32; - y += 32; - dx = -(x + y); - break; - case 3: - y += 32; - dx = x - y; - break; - } - dx >>= 1; - // Display little yellow arrow when building footpaths? - if ((RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) & 4) && - RCT2_GLOBAL(0x9DE56A, uint16) == RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_X, uint16) && - RCT2_GLOBAL(0x9DE56E, uint16) == RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Y, uint16)){ - uint8 arrowRotation = - (rotation - + (RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8) & 3)) & 3; - - uint32 imageId = - arrowRotation + - (RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8) & 0xFC) + - 0x20900C27; - int arrowZ = RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Z, uint16); - - RCT2_GLOBAL(0x9DE568, sint16) = x; - RCT2_GLOBAL(0x9DE56C, sint16) = y; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; - - sub_98197C(imageId, 0, 0, 32, 32, 0xFF, arrowZ, 0, 0, arrowZ + 18, rotation); - } - int bx = dx + 52; - - if (bx <= dpi->y) - return; - - const rct_map_element* element = map_element;//push map_element - - sint16 max_height = 0; - do{ - max_height = max(max_height, element->clearance_height); - } while (!map_element_is_last_for_tile(element++)); - - element--; - - if (map_element_get_type(element) == MAP_ELEMENT_TYPE_SURFACE && - (element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) != 0){ - max_height = (element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) << 1; - } - - max_height *= 8; - - dx -= max_height + 32; - - element = map_element;//pop map_element - dx -= dpi->height; - if (dx >= dpi->y) - return; - - RCT2_GLOBAL(0x9DE568, sint16) = x; - RCT2_GLOBAL(0x9DE56C, sint16) = y; - RCT2_GLOBAL(0x9DE57C, uint16) = 0; - do { - int direction = (map_element->type + rotation) & MAP_ELEMENT_DIRECTION_MASK; - int height = map_element->base_height * 8; - - uint32_t dword_9DE574 = RCT2_GLOBAL(0x9DE574, uint32_t); - RCT2_GLOBAL(0x9DE578, rct_map_element*) = map_element; - //setup the painting of for example: the underground, signs, rides, scenery, etc. - switch (map_element_get_type(map_element)) - { - case MAP_ELEMENT_TYPE_SURFACE: - viewport_surface_paint_setup(direction, height, map_element); - break; - case MAP_ELEMENT_TYPE_PATH: - RCT2_CALLPROC_X(0x6A3590, 0, 0, direction, height, (int)map_element, 0, 0); - break; - case MAP_ELEMENT_TYPE_TRACK: - viewport_track_paint_setup(direction, height, map_element); - break; - case MAP_ELEMENT_TYPE_SCENERY: - RCT2_CALLPROC_X(0x6DFF47, 0, 0, direction, height, (int)map_element, 0, 0); - break; - case MAP_ELEMENT_TYPE_ENTRANCE: - viewport_entrance_paint_setup(direction, height, map_element); - break; - case MAP_ELEMENT_TYPE_FENCE: - RCT2_CALLPROC_X(0x6E44B0, 0, 0, direction, height, (int)map_element, 0, 0); - break; - case MAP_ELEMENT_TYPE_SCENERY_MULTIPLE: - RCT2_CALLPROC_X(0x6B7F0C, 0, 0, direction, height, (int)map_element, 0, 0); - break; - case MAP_ELEMENT_TYPE_BANNER: - viewport_banner_paint_setup(direction, height, map_element); - break; - // A corrupt element inserted by OpenRCT2 itself, which skips the drawing of the next element only. - case MAP_ELEMENT_TYPE_CORRUPT: - if (map_element_is_last_for_tile(map_element)) - return; - map_element++; - break; - default: - // An undefined map element is most likely a corrupt element inserted by 8 cars' MOM feature to skip drawing of all elements after it. - return; - } - RCT2_GLOBAL(0x9DE574, uint32_t) = dword_9DE574; - } while (!map_element_is_last_for_tile(map_element++)); -} - -/** - * - * rct2: 0x0068B60E - */ -static void viewport_blank_tiles_paint_setup(int x, int y) -{ - rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); - - int dx; - switch (get_current_rotation()) { - case 0: - dx = x + y; - break; - case 1: - x += 32; - dx = y - x; - break; - case 2: - x += 32; - y += 32; - dx = -(x + y); - break; - case 3: - y += 32; - dx = x - y; - break; - } - dx /= 2; - dx -= 16; - int bx = dx + 32; - if (bx <= dpi->y) return; - dx -= 20; - dx -= dpi->height; - if (dx >= dpi->y) return; - RCT2_GLOBAL(0x9DE568, sint16) = x; - RCT2_GLOBAL(0x9DE56C, sint16) = y; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_NONE; - RCT2_CALLPROC_X( - (int)RCT2_ADDRESS(0x98196C, uint32_t*)[get_current_rotation()], - 0xFF00, - 3123, - y & 0xFF00, - 16, - 32, - 32, - get_current_rotation() - ); -} - -/** - * - * rct2: 0x0068B2B7 - */ -void sub_68B2B7(int x, int y) -{ - if ( - x < gMapSizeUnits && - y < gMapSizeUnits && - x >= 32 && - y >= 32 - ) { - RCT2_GLOBAL(0x0141E9B4, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9B8, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9BC, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C0, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C4, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C8, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9CC, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9D0, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9D4, uint32) = 0xFFFF; - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = -1; - RCT2_GLOBAL(0x0141E9DA, uint16) = 0; - RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9DB, uint8) |= 2; - - sub_68B3FB(x, y); - } else { - viewport_blank_tiles_paint_setup(x, y); - } -} - -/** - * - * rct2: 0x0068B35F - */ -void map_element_paint_setup(int x, int y) -{ - rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); - if ( - x < gMapSizeUnits && - y < gMapSizeUnits && - x >= 32 && - y >= 32 - ) { - RCT2_GLOBAL(0x0141E9B4, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9B8, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9BC, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C0, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C4, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C8, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9CC, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9D0, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9D4, uint32) = 0xFFFF; - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = -1; - RCT2_GLOBAL(0x0141E9DA, sint16) = 0; - RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF; - - sub_68B3FB(x, y); - } else { - viewport_blank_tiles_paint_setup(x, y); - } -} - -/** -* -* rct2: 0x0068B6C2 -*/ -void viewport_paint_setup() -{ - rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - - rct_xy16 mapTile = { - .x = dpi->x & 0xFFE0, - .y = (dpi->y - 16) & 0xFFE0 - }; - - sint16 half_x = mapTile.x >> 1; - - uint16 num_vertical_quadrants = (dpi->height + 2128) >> 5; - - switch (get_current_rotation()){ - case 0: - mapTile.x = mapTile.y - half_x; - mapTile.y = mapTile.y + half_x; - - mapTile.x &= 0xFFE0; - mapTile.y &= 0xFFE0; - - for (; num_vertical_quadrants > 0; --num_vertical_quadrants){ - map_element_paint_setup(mapTile.x, mapTile.y); - sprite_paint_setup(mapTile.x, mapTile.y); - - sprite_paint_setup(mapTile.x - 32, mapTile.y + 32); - - map_element_paint_setup(mapTile.x, mapTile.y + 32); - sprite_paint_setup(mapTile.x, mapTile.y + 32); - - mapTile.x += 32; - sprite_paint_setup(mapTile.x, mapTile.y); - - mapTile.y += 32; - } - break; - case 1: - mapTile.x = -mapTile.y - half_x; - mapTile.y = mapTile.y - half_x - 16; - - mapTile.x &= 0xFFE0; - mapTile.y &= 0xFFE0; - - for (; num_vertical_quadrants > 0; --num_vertical_quadrants){ - map_element_paint_setup(mapTile.x, mapTile.y); - sprite_paint_setup(mapTile.x, mapTile.y); - - sprite_paint_setup(mapTile.x - 32, mapTile.y - 32); - - map_element_paint_setup(mapTile.x - 32, mapTile.y); - sprite_paint_setup(mapTile.x - 32, mapTile.y); - - mapTile.y += 32; - sprite_paint_setup(mapTile.x, mapTile.y); - - mapTile.x -= 32; - } - break; - case 2: - mapTile.x = -mapTile.y + half_x; - mapTile.y = -mapTile.y - half_x; - - mapTile.x &= 0xFFE0; - mapTile.y &= 0xFFE0; - - for (; num_vertical_quadrants > 0; --num_vertical_quadrants){ - map_element_paint_setup(mapTile.x, mapTile.y); - sprite_paint_setup(mapTile.x, mapTile.y); - - sprite_paint_setup(mapTile.x + 32, mapTile.y - 32); - - map_element_paint_setup(mapTile.x, mapTile.y - 32); - sprite_paint_setup(mapTile.x, mapTile.y - 32); - - mapTile.x -= 32; - - sprite_paint_setup(mapTile.x, mapTile.y); - - mapTile.y -= 32; - } - break; - case 3: - mapTile.x = mapTile.y + half_x; - mapTile.y = -mapTile.y + half_x - 16; - - mapTile.x &= 0xFFE0; - mapTile.y &= 0xFFE0; - - for (; num_vertical_quadrants > 0; --num_vertical_quadrants){ - map_element_paint_setup(mapTile.x, mapTile.y); - sprite_paint_setup(mapTile.x, mapTile.y); - - sprite_paint_setup(mapTile.x + 32, mapTile.y + 32); - - map_element_paint_setup(mapTile.x + 32, mapTile.y); - sprite_paint_setup(mapTile.x + 32, mapTile.y); - - mapTile.y -= 32; - - sprite_paint_setup(mapTile.x, mapTile.y); - - mapTile.x += 32; - } - break; - } -} - -void sub_688217_helper(uint16 ax, uint8 flag) -{ - paint_struct *ps, *ps_temp; - paint_struct *ps_next = RCT2_GLOBAL(0x00EE7884, paint_struct*); - - do { - ps = ps_next; - ps_next = ps_next->next_quadrant_ps; - if (ps_next == NULL) return; - } while (ax > ps_next->var_18); - - ps_temp = ps; - - do { - ps = ps->next_quadrant_ps; - if (ps == NULL) break; - - if (ps->var_18 > ax + 1) { - ps->var_1B = 1 << 7; - } else if (ps->var_18 == ax + 1) { - ps->var_1B = (1 << 1) | (1 << 0); - } else if (ps->var_18 == ax) { - ps->var_1B = flag | (1 << 0); - } - } while (ps->var_18 <= ax + 1); - - ps = ps_temp; - - uint8 rotation = get_current_rotation(); - while (true) { - while (true) { - ps_next = ps->next_quadrant_ps; - if (ps_next == NULL) return; - if (ps_next->var_1B & (1 << 7)) return; - if (ps_next->var_1B & (1 << 0)) break; - ps = ps_next; - } - - ps_next->var_1B &= ~(1 << 0); - ps_temp = ps; - - uint16 my_attached_x = ps_next->attached_x; - uint16 my_attached_y = ps_next->attached_y; - uint16 my_some_x = ps_next->attached_z; - uint16 my_some_y = ps_next->attached_z_end; - uint16 my_other_x = ps_next->attached_x_end; - uint16 my_other_y = ps_next->attached_y_end; - - while (true) { - ps = ps_next; - ps_next = ps_next->next_quadrant_ps; - if (ps_next == NULL) break; - if (ps_next->var_1B & (1 << 7)) break; - if (!(ps_next->var_1B & (1 << 1))) continue; - - int yes = 0; - switch (rotation) { - case 0: - if (my_some_y >= ps_next->attached_z && my_other_y >= ps_next->attached_y && my_other_x >= ps_next->attached_x - && !(my_some_x < ps_next->attached_z_end && my_attached_y < ps_next->attached_y_end && my_attached_x < ps_next->attached_x_end)) - yes = 1; - break; - case 1: - if (my_some_y >= ps_next->attached_z && my_other_y >= ps_next->attached_y && my_other_x < ps_next->attached_x - && !(my_some_x < ps_next->attached_z_end && my_attached_y < ps_next->attached_y_end && my_attached_x >= ps_next->attached_x_end)) - yes = 1; - break; - case 2: - if (my_some_y >= ps_next->attached_z && my_other_y < ps_next->attached_y && my_other_x < ps_next->attached_x - && !(my_some_x < ps_next->attached_z_end && my_attached_y >= ps_next->attached_y_end && my_attached_x >= ps_next->attached_x_end)) - yes = 1; - break; - case 3: - if (my_some_y >= ps_next->attached_z && my_other_y < ps_next->attached_y && my_other_x >= ps_next->attached_x - && !(my_some_x < ps_next->attached_z_end && my_attached_y >= ps_next->attached_y_end && my_attached_x < ps_next->attached_x_end)) - yes = 1; - break; - } - - if (yes) { - ps->next_quadrant_ps = ps_next->next_quadrant_ps; - paint_struct *ps_temp2 = ps_temp->next_quadrant_ps; - ps_temp->next_quadrant_ps = ps_next; - ps_next->next_quadrant_ps = ps_temp2; - ps_next = ps; - } - } - - ps = ps_temp; - } -} - -/** -* -* rct2: 0x00688217 -*/ -void sub_688217() -{ - paint_struct *ps = RCT2_GLOBAL(0x00EE7888, paint_struct*); - paint_struct *ps_next; - RCT2_GLOBAL(0x00EE7888, uint32) += 0x34; // 0x34 is size of paint_struct? - RCT2_GLOBAL(0x00EE7884, paint_struct*) = ps; - ps->next_quadrant_ps = NULL; - uint32 edi = RCT2_GLOBAL(0x00F1AD0C, uint32); - if (edi == -1) - return; - - do { - ps_next = RCT2_GLOBAL(0x00F1A50C + 4 * edi, paint_struct*); - if (ps_next != NULL) { - ps->next_quadrant_ps = ps_next; - do { - ps = ps_next; - ps_next = ps_next->next_quadrant_ps; - } while (ps_next != NULL); - } - } while (++edi <= RCT2_GLOBAL(0x00F1AD10, uint32)); - - uint32 eax = RCT2_GLOBAL(0x00F1AD0C, uint32); - - sub_688217_helper(eax & 0xFFFF, 1 << 1); - - eax = RCT2_GLOBAL(0x00F1AD0C, uint32); - - while (++eax < RCT2_GLOBAL(0x00F1AD10, uint32)) - sub_688217_helper(eax & 0xFFFF, 0); -} - -typedef struct paint_string_struct paint_string_struct; -struct paint_string_struct { - rct_string_id string_id; // 0x00 - paint_string_struct *next; // 0x02 - uint16 x; // 0x06 - uint16 y; // 0x08 - uint8 args[16]; // 0x0A - uint8 *y_offsets; // 0x1A -}; - -static void draw_pixel_info_crop_by_zoom(rct_drawpixelinfo *dpi) -{ - int zoom = dpi->zoom_level; - dpi->zoom_level = 0; - dpi->x >>= zoom; - dpi->y >>= zoom; - dpi->width >>= zoom; - dpi->height >>= zoom; -} - -/** - * - * rct2: 0x006860C3 - */ -static void viewport_draw_money_effects() -{ - utf8 buffer[256]; - - paint_string_struct *ps = RCT2_GLOBAL(0x00F1AD20, paint_string_struct*); - if (ps == NULL) - return; - - rct_drawpixelinfo dpi = *(RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*)); - draw_pixel_info_crop_by_zoom(&dpi); - - do { - format_string(buffer, ps->string_id, &ps->args); - gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM; - - bool forceSpriteFont = false; - const currency_descriptor *currencyDesc = &CurrencyDescriptors[gConfigGeneral.currency_format]; - if (gUseTrueTypeFont && font_supports_string_sprite(currencyDesc->symbol_unicode)) { - forceSpriteFont = true; - } - - gfx_draw_string_with_y_offsets(&dpi, buffer, 0, ps->x, ps->y, (sint8 *)ps->y_offsets, forceSpriteFont); - } while ((ps = ps->next) != NULL); -} - /** * * rct2: 0x00685CBF @@ -2632,7 +787,7 @@ void viewport_paint(rct_viewport* viewport, rct_drawpixelinfo* dpi, int left, in painter_setup(); viewport_paint_setup(); sub_688217(); - sub_688485(); + paint_quadrant_ps(); int weather_colour = RCT2_ADDRESS(0x98195C, uint32)[gClimateCurrentWeatherGloom]; if ((weather_colour != -1) && (!(gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES)) && (!(RCT2_GLOBAL(0x9DEA6F, uint8) & 1))){ @@ -3214,7 +1369,8 @@ void sub_679023(rct_drawpixelinfo *dpi, int imageId, int x, int y) void sub_68862C() { rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); - paint_struct *ps = RCT2_GLOBAL(0x00EE7884, paint_struct*), *old_ps, *next_ps, *attached_ps; + paint_struct *ps = RCT2_GLOBAL(0x00EE7884, paint_struct*), *old_ps, *next_ps; + attached_paint_struct* attached_ps; while ((ps = ps->next_quadrant_ps) != NULL) { old_ps = ps; @@ -3228,17 +1384,14 @@ void sub_68862C() next_ps = ps->var_20; } - attached_ps = ps->attached_ps; - while (attached_ps != NULL) { + for (attached_ps = ps->attached_ps; attached_ps != NULL; attached_ps = attached_ps->next) { sub_679023( dpi, attached_ps->image_id, - (attached_ps->attached_x + ps->x) & 0xFFFF, - (attached_ps->attached_y + ps->y) & 0xFFFF + (attached_ps->x + ps->x) & 0xFFFF, + (attached_ps->y + ps->y) & 0xFFFF ); store_interaction_info(ps); - - attached_ps = attached_ps->next_attached_ps; } ps = old_ps; diff --git a/src/interface/viewport.h b/src/interface/viewport.h index 0bfc845b36..6a9dc679de 100644 --- a/src/interface/viewport.h +++ b/src/interface/viewport.h @@ -72,43 +72,6 @@ enum { VIEWPORT_INTERACTION_MASK_BANNER = ~(1 << (VIEWPORT_INTERACTION_ITEM_BANNER - 2)), // Note the -2 for BANNER }; -typedef struct paint_struct paint_struct; - -struct paint_struct{ - uint32 image_id; // 0x00 - uint32 var_04; - uint16 attached_x; // 0x08 - uint16 attached_y; // 0x0A - union { - struct { - uint8 var_0C; - uint8 pad_0D; - paint_struct* next_attached_ps; //0x0E - uint16 pad_12; - }; - struct { - uint16 attached_z; // 0x0C - uint16 attached_z_end; // 0x0E - uint16 attached_x_end; // 0x10 - uint16 attached_y_end; // 0x12 - }; - }; - uint16 x; // 0x14 - uint16 y; // 0x16 - uint16 var_18; - uint8 var_1A; - uint8 var_1B; - paint_struct* attached_ps; //0x1C - paint_struct* var_20; - paint_struct* next_quadrant_ps; // 0x24 - uint8 sprite_type; //0x28 - uint8 var_29; - uint16 pad_2A; - uint16 map_x; // 0x2C - uint16 map_y; // 0x2E - rct_map_element *mapElement; // 0x30 (or sprite pointer) -}; - typedef struct { int type; int x; @@ -170,15 +133,9 @@ void viewport_interaction_remove_park_entrance(rct_map_element *mapElement, int void sub_68B2B7(int x, int y); void painter_setup(); -void sub_688485(); +void paint_quadrant_ps(); void sub_688217(); -bool sub_98196C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, uint32 rotation); -bool sub_98197C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); -bool sub_98198C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); -bool sub_98199C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); -bool sub_68818E(uint32 image_id, uint16 x_offset, uint16 y_offset, paint_struct ** paint); - void viewport_invalidate(rct_viewport *viewport, int left, int top, int right, int bottom); void screen_get_map_xy(int screenX, int screenY, sint16 *x, sint16 *y, rct_viewport **viewport); diff --git a/src/paint/map_element/banner.c b/src/paint/map_element/banner.c new file mode 100644 index 0000000000..4224e2bc2d --- /dev/null +++ b/src/paint/map_element/banner.c @@ -0,0 +1,101 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../paint.h" +#include "../../addresses.h" +#include "../../config.h" +#include "../../game.h" +#include "../../interface/viewport.h" +#include "../../localisation/localisation.h" +#include "../../world/banner.h" +#include "../../world/scenery.h" + +/** + * + * rct2: 0x006B9CC4 + */ +void banner_paint(uint8 direction, int height, rct_map_element* map_element) +{ + uint16 boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ; + rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_BANNER; + + if (dpi->zoom_level > 1 || RCT2_GLOBAL(0x9DEA6F, uint8_t) & 1) return; + + height -= 16; + + rct_scenery_entry* banner_scenery = g_bannerSceneryEntries[gBanners[map_element->properties.banner.index].type]; + + direction += map_element->properties.banner.position; + direction &= 3; + + boundBoxOffsetX = RCT2_ADDRESS(0x98D884, uint16)[direction * 4]; + boundBoxOffsetY = RCT2_ADDRESS(0x98D884 + 2, uint16)[direction * 4]; + boundBoxOffsetZ = height + 2; + + uint32 base_id = (direction << 1) + banner_scenery->image; + uint32 image_id = base_id; + + if (map_element->flags & MAP_ELEMENT_FLAG_GHOST)//if being placed + { + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_NONE; + image_id |= RCT2_ADDRESS(0x993CC4, uint32_t)[gConfigGeneral.construction_marker_colour]; + } + else{ + image_id |= + (gBanners[map_element->properties.banner.index].colour << 19) | + 0x20000000; + } + + sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + boundBoxOffsetX = RCT2_ADDRESS(0x98D888, uint16)[direction * 4]; + boundBoxOffsetY = RCT2_ADDRESS(0x98D888 + 2, uint16)[direction * 4]; + + image_id++; + sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + + // Opposite direction + direction ^= 2; + direction--; + // If text not showing / ghost + if (direction >= 2 || (map_element->flags & MAP_ELEMENT_FLAG_GHOST)) return; + + uint16 scrollingMode = banner_scenery->banner.scrolling_mode; + scrollingMode += direction; + + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 4, uint32_t) = 0; + + rct_string_id string_id = STR_NO_ENTRY; + if (!(gBanners[map_element->properties.banner.index].flags & BANNER_FLAG_NO_ENTRY)) + { + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint16) = gBanners[map_element->properties.banner.index].string_idx; + string_id = STR_BANNER_TEXT; + } + if (gConfigGeneral.upper_case_banners) { + format_string_to_upper(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char), string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); + } else { + format_string(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char), string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); + } + + gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; + + uint16 string_width = gfx_get_string_width(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char)); + uint16 scroll = (gCurrentTicks / 2) % string_width; + + sub_98199C(scrolling_text_setup(string_id, scroll, scrollingMode), 0, 0, 1, 1, 0x15, height + 22, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); +} diff --git a/src/paint/map_element/entrance.c b/src/paint/map_element/entrance.c new file mode 100644 index 0000000000..e888ebd19b --- /dev/null +++ b/src/paint/map_element/entrance.c @@ -0,0 +1,308 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../paint.h" +#include "../../addresses.h" +#include "../../config.h" +#include "../../game.h" +#include "../../interface/viewport.h" +#include "../../localisation/localisation.h" +#include "../supports.h" +#include "../../ride/ride_data.h" +#include "../../world/entrance.h" +#include "../../world/footpath.h" + +/** + * + * rct2: 0x0066508C, 0x00665540 + */ +void ride_entrance_exit_paint(uint8 direction, int height, rct_map_element* map_element) +{ + rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + uint8 is_exit = map_element->properties.entrance.type == ENTRANCE_TYPE_RIDE_EXIT; + + if (RCT2_GLOBAL(0x9DEA6F, uint8_t) & 1){ + if (map_element->properties.entrance.ride_index != RCT2_GLOBAL(0x00F64DE8, uint8)) + return; + } + + rct_ride* ride = get_ride(map_element->properties.entrance.ride_index); + if (ride->entrance_style == RIDE_ENTRANCE_STYLE_NONE) return; + + const rct_ride_entrance_definition *style = &RideEntranceDefinitions[ride->entrance_style]; + + uint8 colour_1, colour_2; + uint32 transparant_image_id = 0, image_id = 0; + if (style->flags & (1 << 30)) { + colour_1 = ride->track_colour_main[0] + 0x70; + transparant_image_id = (colour_1 << 19) | 0x40000000; + } + + colour_1 = ride->track_colour_main[0]; + colour_2 = ride->track_colour_additional[0]; + image_id = (colour_1 << 19) | (colour_2 << 24) | 0xA0000000; + + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_RIDE; + RCT2_GLOBAL(0x009E32BC, uint32) = 0; + + if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){ + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; + image_id = RCT2_ADDRESS(0x993CC4, uint32_t)[gConfigGeneral.construction_marker_colour]; + RCT2_GLOBAL(0x009E32BC, uint32) = image_id; + if (transparant_image_id) + transparant_image_id = image_id; + } + + if (is_exit){ + image_id |= style->sprite_index + direction + 8; + } + else{ + image_id |= style->sprite_index + direction; + } + // Format modifed to stop repeated code + + // Each entrance is split into 2 images for drawing + // Certain entrance styles have another 2 images to draw for coloured windows + + sint8 ah = is_exit ? 0x23 : 0x33; + + sint16 lengthY = (direction & 1) ? 28 : 2; + sint16 lengthX = (direction & 1) ? 2 : 28; + + sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height, get_current_rotation()); + + if (transparant_image_id){ + if (is_exit){ + transparant_image_id |= style->sprite_index + direction + 24; + } + else{ + transparant_image_id |= style->sprite_index + direction + 16; + } + + sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height, get_current_rotation()); + } + + image_id += 4; + + sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height, get_current_rotation()); + + if (transparant_image_id){ + transparant_image_id += 4; + sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height, get_current_rotation()); + } + + uint32 eax = 0xFFFF0600 | ((height / 16) & 0xFF); + if (direction & 1){ + RCT2_ADDRESS(0x009E30B6, uint32)[RCT2_GLOBAL(0x141F56B, uint8) / 2] = eax; + RCT2_GLOBAL(0x141F56B, uint8)++; + } + else{ + RCT2_ADDRESS(0x009E3138, uint32)[RCT2_GLOBAL(0x141F56A, uint8) / 2] = eax; + RCT2_GLOBAL(0x141F56A, uint8)++; + } + + if (!is_exit && + !(map_element->flags & MAP_ELEMENT_FLAG_GHOST) && + map_element->properties.entrance.ride_index != 0xFF){ + + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 4, uint32) = 0; + + rct_string_id string_id = STR_RIDE_ENTRANCE_CLOSED; + + if (ride->status == RIDE_STATUS_OPEN && + !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)){ + + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, rct_string_id) = ride->name; + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = ride->name_arguments; + + string_id = STR_RIDE_ENTRANCE_NAME; + } + + utf8 entrance_string[MAX_PATH]; + if (gConfigGeneral.upper_case_banners) { + format_string_to_upper(entrance_string, string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); + } else { + format_string(entrance_string, string_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); + } + + gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; + + uint16 string_width = gfx_get_string_width(entrance_string); + uint16 scroll = (gCurrentTicks / 2) % string_width; + + sub_98199C(scrolling_text_setup(string_id, scroll, style->scrolling_mode), 0, 0, 0x1C, 0x1C, 0x33, height + style->height, 2, 2, height + style->height, get_current_rotation()); + } + + image_id = RCT2_GLOBAL(0x009E32BC, uint32); + if (image_id == 0) { + image_id = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_SATURATED_BROWN); + } + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += is_exit ? 40 : 56; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height){ + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x006658ED + */ +void park_entrance_paint(uint8 direction, int height, rct_map_element* map_element){ + if (RCT2_GLOBAL(0x9DEA6F, uint8_t) & 1) + return; + + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_PARK; + RCT2_GLOBAL(0x009E32BC, uint32) = 0; + uint32 image_id, ghost_id = 0; + if (map_element->flags & MAP_ELEMENT_FLAG_GHOST){ + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; + ghost_id = RCT2_ADDRESS(0x993CC4, uint32)[gConfigGeneral.construction_marker_colour]; + RCT2_GLOBAL(0x009E32BC, uint32) = ghost_id; + } + + rct_path_type* path_entry = g_pathTypeEntries[map_element->properties.entrance.path_type]; + + // Index to which part of the entrance + // Middle, left, right + uint8 part_index = map_element->properties.entrance.index & 0xF; + rct_entrance_type* entrance; + uint8 di = (direction / 2 + part_index / 2) & 1 ? 0x1A : 0x20; + + switch (part_index){ + case 0: + image_id = (path_entry->image + 5 * (1 + (direction & 1))) | ghost_id; + sub_98197C(image_id, 0, 0, 32, 0x1C, 0, height, 0, 2, height, get_current_rotation()); + + entrance = (rct_entrance_type*)object_entry_groups[OBJECT_TYPE_PARK_ENTRANCE].chunks[0]; + image_id = (entrance->image_id + direction * 3) | ghost_id; + sub_98197C(image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, 2, 2, height + 32, get_current_rotation()); + + if ((direction + 1) & (1 << 1)) + break; + if (ghost_id != 0) + break; + + rct_string_id park_text_id = 1730; + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 4, uint32) = 0; + + if (gParkFlags & PARK_FLAGS_PARK_OPEN){ + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, rct_string_id) = gParkName; + RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = gParkNameArgs; + + park_text_id = 1731; + } + + utf8 park_name[MAX_PATH]; + if (gConfigGeneral.upper_case_banners) { + format_string_to_upper(park_name, park_text_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); + } else { + format_string(park_name, park_text_id, RCT2_ADDRESS(RCT2_ADDRESS_COMMON_FORMAT_ARGS, void)); + } + + gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; + uint16 string_width = gfx_get_string_width(park_name); + uint16 scroll = (gCurrentTicks / 2) % string_width; + + if (entrance->scrolling_mode == 0xFF) + break; + + sub_98199C(scrolling_text_setup(park_text_id, scroll, entrance->scrolling_mode + direction / 2), 0, 0, 0x1C, 0x1C, 0x2F, height + entrance->text_height, 2, 2, height + entrance->text_height, get_current_rotation()); + break; + case 1: + case 2: + entrance = (rct_entrance_type*)object_entry_groups[OBJECT_TYPE_PARK_ENTRANCE].chunks[0]; + image_id = (entrance->image_id + part_index + direction * 3) | ghost_id; + sub_98197C(image_id, 0, 0, 0x1A, di, 0x4F, height, 3, 3, height, get_current_rotation()); + break; + } + + image_id = ghost_id; + if (image_id == 0) { + image_id = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_SATURATED_BROWN); + } + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 80; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height){ + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x00664FD4 + */ +void entrance_paint(uint8 direction, int height, rct_map_element* map_element){ + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_LABEL; + + rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + + if (gCurrentViewportFlags & VIEWPORT_FLAG_PATH_HEIGHTS && + dpi->zoom_level == 0){ + uint32 ebx = + (map_element->properties.entrance.type << 4) | + (map_element->properties.entrance.index & 0xF); + + if (RCT2_ADDRESS(0x0097B974, uint8)[ebx] & 0xF){ + + int z = map_element->base_height * 8 + 3; + uint32 image_id = + z / 16 + + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS,sint16) + + 0x20101689; + + image_id -= RCT2_GLOBAL(0x01359208, sint16); + + sub_98197C(image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64, get_current_rotation()); + } + } + + switch (map_element->properties.entrance.type){ + case ENTRANCE_TYPE_RIDE_ENTRANCE: + case ENTRANCE_TYPE_RIDE_EXIT: + ride_entrance_exit_paint(direction, height, map_element); + break; + case ENTRANCE_TYPE_PARK_ENTRANCE: + park_entrance_paint(direction, height, map_element); + break; + } +} diff --git a/src/paint/map_element/fence.c b/src/paint/map_element/fence.c new file mode 100644 index 0000000000..41ed39aa9b --- /dev/null +++ b/src/paint/map_element/fence.c @@ -0,0 +1,23 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "map_element.h" +#include "../../addresses.h" +#include "../../world/map.h" + +void fence_paint(uint8 direction, int height, rct_map_element* mapElement) { + RCT2_CALLPROC_X(0x6E44B0, 0, 0, direction, height, (int)mapElement, 0, 0); +} diff --git a/src/paint/map_element/map_element.c b/src/paint/map_element/map_element.c new file mode 100644 index 0000000000..48f993e7dc --- /dev/null +++ b/src/paint/map_element/map_element.c @@ -0,0 +1,288 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../paint.h" +#include "../../interface/viewport.h" +#include "../../addresses.h" +#include "map_element.h" +#include "../../drawing/drawing.h" +#include "../../ride/ride_data.h" +#include "../../ride/track_data.h" +#include "../../ride/track_paint.h" +#include "../../config.h" +#include "../../world/sprite.h" +#include "../../world/banner.h" +#include "../../world/entrance.h" +#include "../../world/footpath.h" +#include "../../world/scenery.h" +#include "../../sprites.h" +#include "../../localisation/localisation.h" +#include "../../game.h" +#include "../supports.h" + +static void blank_tiles_paint(int x, int y); +static void sub_68B3FB(int x, int y); + +/** + * + * rct2: 0x0068B35F + */ +void map_element_paint_setup(int x, int y) +{ + rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); + if ( + x < gMapSizeUnits && + y < gMapSizeUnits && + x >= 32 && + y >= 32 + ) { + RCT2_GLOBAL(0x0141E9B4, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9B8, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9BC, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C0, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C4, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C8, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9CC, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9D0, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9D4, uint32) = 0xFFFF; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = -1; + RCT2_GLOBAL(0x0141E9DA, sint16) = 0; + RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF; + + sub_68B3FB(x, y); + } else { + blank_tiles_paint(x, y); + } +} + +/** + * + * rct2: 0x0068B2B7 + */ +void sub_68B2B7(int x, int y) +{ + if ( + x < gMapSizeUnits && + y < gMapSizeUnits && + x >= 32 && + y >= 32 + ) { + RCT2_GLOBAL(0x0141E9B4, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9B8, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9BC, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C0, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C4, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C8, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9CC, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9D0, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9D4, uint32) = 0xFFFF; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = -1; + RCT2_GLOBAL(0x0141E9DA, uint16) = 0; + RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF; + RCT2_GLOBAL(0x0141E9DB, uint8) |= 2; + + sub_68B3FB(x, y); + } else { + blank_tiles_paint(x, y); + } +} + +/** + * + * rct2: 0x0068B60E + */ +static void blank_tiles_paint(int x, int y) +{ + rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); + + int dx; + switch (get_current_rotation()) { + case 0: + dx = x + y; + break; + case 1: + x += 32; + dx = y - x; + break; + case 2: + x += 32; + y += 32; + dx = -(x + y); + break; + case 3: + y += 32; + dx = x - y; + break; + } + dx /= 2; + dx -= 16; + int bx = dx + 32; + if (bx <= dpi->y) return; + dx -= 20; + dx -= dpi->height; + if (dx >= dpi->y) return; + RCT2_GLOBAL(0x9DE568, sint16) = x; + RCT2_GLOBAL(0x9DE56C, sint16) = y; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_NONE; + RCT2_CALLPROC_X( + (int)RCT2_ADDRESS(0x98196C, uint32_t*)[get_current_rotation()], + 0xFF00, + 3123, + y & 0xFF00, + 16, + 32, + 32, + get_current_rotation() + ); +} + +/** + * + * rct2: 0x0068B3FB + */ +static void sub_68B3FB(int x, int y) +{ + rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); + + RCT2_GLOBAL(0x141F56A, uint16_t) = 0; + RCT2_GLOBAL(0x9E3138, uint8_t) = 0xFF; + RCT2_GLOBAL(0x9E30B6, uint8_t) = 0xFF; + RCT2_GLOBAL(0x9E323C, uint8_t) = 0xFF; + RCT2_GLOBAL(0x9DE56A, uint16_t) = x; + RCT2_GLOBAL(0x9DE56E, uint16_t) = y; + RCT2_GLOBAL(0x9DE574, uint16_t) = x; + RCT2_GLOBAL(0x9DE576, uint16_t) = y; + + rct_map_element* map_element = map_get_first_element_at(x >> 5, y >> 5); + uint8 rotation = get_current_rotation(); + + int dx = 0; + switch (rotation) { + case 0: + dx = x + y; + break; + case 1: + x += 32; + dx = y - x; + break; + case 2: + x += 32; + y += 32; + dx = -(x + y); + break; + case 3: + y += 32; + dx = x - y; + break; + } + dx >>= 1; + // Display little yellow arrow when building footpaths? + if ((RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) & 4) && + RCT2_GLOBAL(0x9DE56A, uint16) == RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_X, uint16) && + RCT2_GLOBAL(0x9DE56E, uint16) == RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Y, uint16)){ + uint8 arrowRotation = + (rotation + + (RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8) & 3)) & 3; + + uint32 imageId = + arrowRotation + + (RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8) & 0xFC) + + 0x20900C27; + int arrowZ = RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Z, uint16); + + RCT2_GLOBAL(0x9DE568, sint16) = x; + RCT2_GLOBAL(0x9DE56C, sint16) = y; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; + + sub_98197C(imageId, 0, 0, 32, 32, 0xFF, arrowZ, 0, 0, arrowZ + 18, rotation); + } + int bx = dx + 52; + + if (bx <= dpi->y) + return; + + const rct_map_element* element = map_element;//push map_element + + sint16 max_height = 0; + do{ + max_height = max(max_height, element->clearance_height); + } while (!map_element_is_last_for_tile(element++)); + + element--; + + if (map_element_get_type(element) == MAP_ELEMENT_TYPE_SURFACE && + (element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) != 0){ + max_height = (element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) << 1; + } + + max_height *= 8; + + dx -= max_height + 32; + + element = map_element;//pop map_element + dx -= dpi->height; + if (dx >= dpi->y) + return; + + RCT2_GLOBAL(0x9DE568, sint16) = x; + RCT2_GLOBAL(0x9DE56C, sint16) = y; + RCT2_GLOBAL(0x9DE57C, uint16) = 0; + do { + int direction = (map_element->type + rotation) & MAP_ELEMENT_DIRECTION_MASK; + int height = map_element->base_height * 8; + + uint32_t dword_9DE574 = RCT2_GLOBAL(0x9DE574, uint32_t); + RCT2_GLOBAL(0x9DE578, rct_map_element*) = map_element; + //setup the painting of for example: the underground, signs, rides, scenery, etc. + switch (map_element_get_type(map_element)) + { + case MAP_ELEMENT_TYPE_SURFACE: + surface_paint(direction, height, map_element); + break; + case MAP_ELEMENT_TYPE_PATH: + path_paint(direction, height, map_element); + break; + case MAP_ELEMENT_TYPE_TRACK: + track_paint(direction, height, map_element); + break; + case MAP_ELEMENT_TYPE_SCENERY: + scenery_paint(direction, height, map_element); + break; + case MAP_ELEMENT_TYPE_ENTRANCE: + entrance_paint(direction, height, map_element); + break; + case MAP_ELEMENT_TYPE_FENCE: + fence_paint(direction, height, map_element); + break; + case MAP_ELEMENT_TYPE_SCENERY_MULTIPLE: + scenery_multiple_paint(direction, height, map_element); + break; + case MAP_ELEMENT_TYPE_BANNER: + banner_paint(direction, height, map_element); + break; + // A corrupt element inserted by OpenRCT2 itself, which skips the drawing of the next element only. + case MAP_ELEMENT_TYPE_CORRUPT: + if (map_element_is_last_for_tile(map_element)) + return; + map_element++; + break; + default: + // An undefined map element is most likely a corrupt element inserted by 8 cars' MOM feature to skip drawing of all elements after it. + return; + } + RCT2_GLOBAL(0x9DE574, uint32_t) = dword_9DE574; + } while (!map_element_is_last_for_tile(map_element++)); +} diff --git a/src/paint/map_element/map_element.h b/src/paint/map_element/map_element.h new file mode 100644 index 0000000000..1cf1a1c07b --- /dev/null +++ b/src/paint/map_element/map_element.h @@ -0,0 +1,34 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#ifndef _PAINT_MAP_ELEMENT_H +#define _PAINT_MAP_ELEMENT_H + +#include "../../common.h" +#include "../../world/map.h" + +void map_element_paint_setup(int x, int y); + +void entrance_paint(uint8 direction, int height, rct_map_element* map_element); +void banner_paint(uint8 direction, int height, rct_map_element* map_element); +void surface_paint(uint8 direction, uint16 height, rct_map_element *mapElement); +void path_paint(uint8 direction, uint16 height, rct_map_element *mapElement); +void scenery_paint(uint8 direction, int height, rct_map_element* mapElement); +void fence_paint(uint8 direction, int height, rct_map_element* mapElement); +void scenery_multiple_paint(uint8 direction, uint16 height, rct_map_element *mapElement); +void track_paint(uint8 direction, int height, rct_map_element *mapElement); + +#endif diff --git a/src/paint/map_element/path.c b/src/paint/map_element/path.c new file mode 100644 index 0000000000..43e91d5ec5 --- /dev/null +++ b/src/paint/map_element/path.c @@ -0,0 +1,23 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "map_element.h" +#include "../../addresses.h" +#include "../../world/map.h" + +void path_paint(uint8 direction, uint16 height, rct_map_element *mapElement) { + RCT2_CALLPROC_X(0x6A3590, 0, 0, direction, height, (int)mapElement, 0, 0); +} diff --git a/src/paint/map_element/scenery.c b/src/paint/map_element/scenery.c new file mode 100644 index 0000000000..74afd2b868 --- /dev/null +++ b/src/paint/map_element/scenery.c @@ -0,0 +1,23 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "map_element.h" +#include "../../addresses.h" +#include "../../world/map.h" + +void scenery_paint(uint8 direction, int height, rct_map_element* mapElement) { + RCT2_CALLPROC_X(0x6DFF47, 0, 0, direction, height, (int)mapElement, 0, 0); +} diff --git a/src/paint/map_element/scenery_multiple.c b/src/paint/map_element/scenery_multiple.c new file mode 100644 index 0000000000..45653506d3 --- /dev/null +++ b/src/paint/map_element/scenery_multiple.c @@ -0,0 +1,23 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "map_element.h" +#include "../../addresses.h" +#include "../../world/map.h" + +void scenery_multiple_paint(uint8 direction, uint16 height, rct_map_element *mapElement) { + RCT2_CALLPROC_X(0x6B7F0C, 0, 0, direction, height, (int)mapElement, 0, 0); +} diff --git a/src/interface/paint_surface.c b/src/paint/map_element/surface.c similarity index 98% rename from src/interface/paint_surface.c rename to src/paint/map_element/surface.c index f6b3a4e33e..35e2e081bb 100644 --- a/src/interface/paint_surface.c +++ b/src/paint/map_element/surface.c @@ -14,12 +14,13 @@ *****************************************************************************/ #pragma endregion -#include "../common.h" -#include "paint_surface.h" -#include "viewport.h" -#include "../config.h" -#include "../peep/staff.h" -#include "../world/map.h" +#include "../../common.h" +#include "surface.h" +#include "../../interface/viewport.h" +#include "../paint.h" +#include "../../config.h" +#include "../../peep/staff.h" +#include "../../world/map.h" const uint8 byte_97B444[] = { 0, 2, 1, 3, 8, 10, 9, 11, 4, 6, @@ -467,11 +468,12 @@ void viewport_surface_smoothen_edge(enum edge edge, struct tile_descriptor self, uint32 image_id = maskImageBase + byte_97B444[self.slope]; - paint_struct * out; - if (sub_68818E(image_id, 0, 0, &out)) { + attached_paint_struct * out; + if (paint_attach_to_previous_ps(image_id, 0, 0)) { + out = RCT2_GLOBAL(0xF1AD2C, attached_paint_struct *); // set content and enable masking - out->var_04 = dword_97B804[neighbour.terrain] + cl; - out->var_0C |= 1; + out->colour_image_id = dword_97B804[neighbour.terrain] + cl; + out->flags |= PAINT_STRUCT_FLAG_IS_MASKED; } } @@ -529,7 +531,7 @@ void viewport_surface_draw_land_side_top(enum edge edge, uint8 height, uint8 ter uint32 image_id = stru_97B5C0[terrain][3] + (edge == EDGE_TOPLEFT ? 3 : 0) + incline; // var_c; sint16 y = (regs.dl - regs.al) * 16; - sub_68818E(image_id, 0, y, NULL); + paint_attach_to_previous_ps(image_id, 0, y); return; } @@ -1002,7 +1004,7 @@ void viewport_surface_draw_water_side_bottom(enum edge edge, uint8 height, uint8 * @param height (dx) * @param map_element (esi) */ -void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_element * mapElement) +void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement) { rct_drawpixelinfo * dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_TERRAIN; @@ -1184,7 +1186,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen image_id |= SPR_TERRAIN_SELECTION_PATROL_AREA + byte_97B444[surfaceShape]; image_id |= patrolColour << 19; - sub_68818E(image_id, 0, 0, NULL); + paint_attach_to_previous_ps(image_id, 0, 0); } } @@ -1212,7 +1214,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen if (mapElement->properties.surface.ownership & OWNERSHIP_OWNED) { assert(surfaceShape < countof(byte_97B444)); // TODO: SPR_TERRAIN_SELECTION_SQUARE? - sub_68818E(2625 + byte_97B444[surfaceShape], 0, 0, NULL); + paint_attach_to_previous_ps(2625 + byte_97B444[surfaceShape], 0, 0); } else if (mapElement->properties.surface.ownership & OWNERSHIP_AVAILABLE) { rct_xy16 pos = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)}; paint_struct * backup = RCT2_GLOBAL(0xF1AD28, paint_struct*); @@ -1227,7 +1229,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen if (mapElement->properties.surface.ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) { assert(surfaceShape < countof(byte_97B444)); // TODO: SPR_TERRAIN_SELECTION_DOTTED ??? - sub_68818E(2644 + byte_97B444[surfaceShape], 0, 0, NULL); + paint_attach_to_previous_ps(2644 + byte_97B444[surfaceShape], 0, 0); } else if (mapElement->properties.surface.ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) { paint_struct * backup = RCT2_GLOBAL(0xF1AD28, paint_struct*); rct_xy16 pos = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)}; @@ -1255,13 +1257,13 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen // loc_661089: uint32 eax = ((((mapSelectionType - 9) + get_current_rotation()) & 3) + 0x21) << 19; uint32 image_id = (SPR_TERRAIN_SELECTION_EDGE + byte_97B444[surfaceShape]) | eax | 0x20000000; - sub_68818E(image_id, 0, 0, NULL); + paint_attach_to_previous_ps(image_id, 0, 0); } else if (mapSelectionType >= 6) { // loc_661051:(no jump) // Selection split into four quarter segments uint32 eax = ((((mapSelectionType - 6) + get_current_rotation()) & 3) + 0x27) << 19; uint32 image_id = (SPR_TERRAIN_SELECTION_QUARTER + byte_97B444[surfaceShape]) | eax | 0x20000000; - sub_68818E(image_id, 0, 0, NULL); + paint_attach_to_previous_ps(image_id, 0, 0); } else if (mapSelectionType <= 4) { // Corners uint32 eax = mapSelectionType; @@ -1271,7 +1273,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen eax = (eax + 0x21) << 19; uint32 image_id = (SPR_TERRAIN_SELECTION_CORNER + byte_97B444[surfaceShape]) | eax | 0x20000000; - sub_68818E(image_id, 0, 0, NULL); + paint_attach_to_previous_ps(image_id, 0, 0); } else { int local_surfaceShape = surfaceShape; int local_height = height; @@ -1319,7 +1321,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen } uint32 image_id = (SPR_TERRAIN_SELECTION_CORNER + byte_97B444[surfaceShape]) | colours | 0x20000000; - sub_68818E(image_id, 0, 0, NULL); + paint_attach_to_previous_ps(image_id, 0, 0); break; } } @@ -1346,7 +1348,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen base_image = byte_97B84A[terrain_type]; } uint32 image_id = dword_97B7C8[base_image] + image_offset; - sub_68818E(image_id, 0, 0, NULL); + paint_attach_to_previous_ps(image_id, 0, 0); } if (!(gCurrentViewportFlags & VIEWPORT_FLAG_HIDE_VERTICAL)) { @@ -1391,7 +1393,7 @@ void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_elemen int image_id = (SPR_WATER_MASK + image_offset) | 0x61000000; sub_98196C(image_id, 0, 0, 32, 32, -1, waterHeight, get_current_rotation()); - sub_68818E(SPR_WATER_OVERLAY + image_offset, 0, 0, NULL); + paint_attach_to_previous_ps(SPR_WATER_OVERLAY + image_offset, 0, 0); for (int i = 0; i <= 0x7C; i += 4) { RCT2_GLOBAL(0x009E3138 + i, uint32) = RCT2_GLOBAL(0x009E2F30 + i, uint32); diff --git a/src/interface/paint_surface.h b/src/paint/map_element/surface.h similarity index 96% rename from src/interface/paint_surface.h rename to src/paint/map_element/surface.h index 4ccd5deb54..ebdd9d30b7 100644 --- a/src/interface/paint_surface.h +++ b/src/paint/map_element/surface.h @@ -17,8 +17,8 @@ #ifndef _PAINT_SURFACE_H #define _PAINT_SURFACE_H -#include "../common.h" -#include "../world/map.h" +#include "../../common.h" +#include "../../world/map.h" enum { @@ -100,6 +100,6 @@ enum SPR_TERRAIN_PATTERN_ICE = 29007, }; -void viewport_surface_paint_setup(uint8 direction, uint16 height, rct_map_element *mapElement); + #endif //_PAINT_SURFACE_H diff --git a/src/paint/paint.c b/src/paint/paint.c new file mode 100644 index 0000000000..8e80cd6abf --- /dev/null +++ b/src/paint/paint.c @@ -0,0 +1,846 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "paint.h" +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" +#include "../config.h" +#include "../interface/viewport.h" +#include "map_element/map_element.h" +#include "sprite/sprite.h" +#include "../addresses.h" + +/** + * + * rct2: 0x0068615B + */ +void painter_setup() { + RCT2_GLOBAL(0xEE7888, uint32) = 0x00EE788C; + RCT2_GLOBAL(0xF1AD28, uint32) = 0; + RCT2_GLOBAL(0xF1AD2C, uint32) = 0; + uint8* edi = RCT2_ADDRESS(0xF1A50C, uint8); + memset(edi, 0, 2048); + RCT2_GLOBAL(0xF1AD0C, sint32) = -1; + RCT2_GLOBAL(0xF1AD10, uint32) = 0; + RCT2_GLOBAL(0xF1AD20, uint32) = 0; + RCT2_GLOBAL(0xF1AD24, uint32) = 0; +} + +/** + * rct2: 0x006861AC, 0x00686337, 0x006864D0, 0x0068666B, 0x0098196C + * + * @param image_id (ebx) + * @param x_offset (al) + * @param y_offset (cl) + * @param bound_box_length_x (di) + * @param bound_box_length_y (si) + * @param bound_box_length_z (ah) + * @param z_offset (dx) + * @param rotation (ebp) + * @return (!CF) success + */ +bool sub_98196C( + uint32 image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + uint16 z_offset, + uint32 rotation +) { + int flags = RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098196C, uint32)[rotation], + x_offset | (bound_box_length_z << 8), + image_id, + y_offset, + z_offset, + bound_box_length_y, + bound_box_length_x, + rotation + ); + + return !(flags & (1 << 8)); +} + +/** + * rct2: 0x00686806, 0x006869B2, 0x00686B6F, 0x00686D31, 0x0098197C + * + * @param image_id (ebx) + * @param x_offset (al) + * @param y_offset (cl) + * @param bound_box_length_x (di) + * @param bound_box_length_y (si) + * @param bound_box_length_z (ah) + * @param z_offset (dx) + * @param bound_box_offset_x (0x009DEA52) + * @param bound_box_offset_y (0x009DEA54) + * @param bound_box_offset_z (0x009DEA56) + * @param rotation (ebp) + * @return (!CF) success + */ +bool sub_98197C( + uint32 image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + uint16 z_offset, + sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, + uint32 rotation +) { + + RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0; + RCT2_GLOBAL(0xF1AD2C, uint32) = 0; + + //Not a paint struct but something similar + paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*); + + if ((uint32)ps >= RCT2_GLOBAL(0xEE7880, uint32))return false; + + ps->image_id = image_id; + + uint32 image_element = image_id & 0x7FFFF; + rct_g1_element *g1Element = gfx_get_g1_element(image_element); + + rct_xyz16 coord_3d = { + .x = x_offset, + .y = y_offset, + .z = z_offset + }; + + switch (rotation) { + case 0: + rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 0); + break; + case 1: + rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 3); + break; + case 2: + rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 2); + break; + case 3: + rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 1); + break; + } + coord_3d.x += RCT2_GLOBAL(0x9DE568, sint16); + coord_3d.y += RCT2_GLOBAL(0x9DE56C, sint16); + + rct_xy16 map = coordinate_3d_to_2d(&coord_3d, rotation); + + ps->x = map.x; + ps->y = map.y; + + int left = map.x + g1Element->x_offset; + int bottom = map.y + g1Element->y_offset; + + int right = left + g1Element->width; + int top = bottom + g1Element->height; + + RCT2_GLOBAL(0xF1AD1C, uint16) = left; + RCT2_GLOBAL(0xF1AD1E, uint16) = bottom; + + rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + + if (right <= dpi->x)return false; + if (top <= dpi->y)return false; + if (left > dpi->x + dpi->width)return false; + if (bottom > dpi->y + dpi->height)return false; + + rct_xy16 boundBox = { + .x = bound_box_length_x, + .y = bound_box_length_y + }; + + rct_xy16 boundBoxOffset = { + .x = bound_box_offset_x, + .y = bound_box_offset_y + }; + + // Unsure why rots 1 and 3 need to swap + switch (rotation) { + case 0: + boundBox.x--; + boundBox.y--; + rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 0); + rotate_map_coordinates(&boundBox.x, &boundBox.y, 0); + break; + case 1: + boundBox.x--; + rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 3); + rotate_map_coordinates(&boundBox.x, &boundBox.y, 3); + break; + case 2: + rotate_map_coordinates(&boundBox.x, &boundBox.y, 2); + rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 2); + break; + case 3: + boundBox.y--; + rotate_map_coordinates(&boundBox.x, &boundBox.y, 1); + rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 1); + break; + } + + ps->bound_box_x_end = boundBox.x + boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16); + ps->bound_box_z = bound_box_offset_z; + int boundBoxZEnd = bound_box_length_z + bound_box_offset_z; + ps->bound_box_z_end = boundBoxZEnd; + ps->bound_box_y_end = boundBox.y + boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16); + ps->flags = 0; + ps->bound_box_x = boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16); + ps->bound_box_y = boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16); + ps->attached_ps = NULL; + ps->var_20 = NULL; + ps->sprite_type = RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8); + ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8); + ps->map_x = RCT2_GLOBAL(0x9DE574, uint16); + ps->map_y = RCT2_GLOBAL(0x9DE576, uint16); + ps->mapElement = RCT2_GLOBAL(0x9DE578, rct_map_element*); + + RCT2_GLOBAL(0xF1AD28, paint_struct*) = ps; + + rct_xy16 attach = { + .x = ps->bound_box_x, + .y = ps->bound_box_y + }; + + rotate_map_coordinates(&attach.x, &attach.y, rotation); + switch (rotation) { + case 0: + break; + case 1: + case 3: + attach.x += 0x2000; + break; + case 2: + attach.x += 0x4000; + break; + } + + sint16 di = attach.x + attach.y; + + if (di < 0) + di = 0; + + di /= 32; + if (di > 511) + di = 511; + + ps->var_18 = di; + paint_struct* old_ps = RCT2_ADDRESS(0x00F1A50C, paint_struct*)[di]; + RCT2_ADDRESS(0x00F1A50C, paint_struct*)[di] = ps; + ps->next_quadrant_ps = old_ps; + + if ((uint16)di < RCT2_GLOBAL(0x00F1AD0C, uint32)) { + RCT2_GLOBAL(0x00F1AD0C, uint32) = di; + } + + if ((uint16)di > RCT2_GLOBAL(0x00F1AD10, uint32)) { + RCT2_GLOBAL(0x00F1AD10, uint32) = di; + } + + RCT2_GLOBAL(0xEE7888, paint_struct*)++; + return true; +} + +/** + * + * rct2: 0x00686EF0, 0x00687056, 0x006871C8, 0x0068733C, 0x0098198C + * + * @param image_id (ebx) + * @param x_offset (al) + * @param y_offset (cl) + * @param bound_box_length_x (di) + * @param bound_box_length_y (si) + * @param bound_box_length_z (ah) + * @param z_offset (dx) + * @param bound_box_offset_x (0x009DEA52) + * @param bound_box_offset_y (0x009DEA54) + * @param bound_box_offset_z (0x009DEA56) + * @param rotation + * @return (!CF) success + */ +bool sub_98198C( + uint32 image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + uint16 z_offset, + sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, + uint32 rotation +) { + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_X, uint16) = bound_box_offset_x; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Y, uint16) = bound_box_offset_y; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Z, uint16) = bound_box_offset_z; + + int flags = RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098198C, uint32)[rotation], + x_offset | (bound_box_length_z << 8), + image_id, + y_offset, + z_offset, + bound_box_length_y, + bound_box_length_x, + rotation + ); + + return !(flags & (1 << 8)); +} + +/** + * + * rct2: 0x006874B0, 0x00687618, 0x0068778C, 0x00687902, 0x0098199C + * + * @param image_id (ebx) + * @param x_offset (al) + * @param y_offset (cl) + * @param bound_box_length_x (di) + * @param bound_box_length_y (si) + * @param bound_box_length_z (ah) + * @param z_offset (dx) + * @param bound_box_offset_x (0x009DEA52) + * @param bound_box_offset_y (0x009DEA54) + * @param bound_box_offset_z (0x009DEA56) + * @param rotation (ebp) + * @return (!CF) success + */ +bool sub_98199C( + uint32 image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + uint16 z_offset, + sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, + uint32 rotation +) { + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_X, uint16) = bound_box_offset_x; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Y, uint16) = bound_box_offset_y; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Z, uint16) = bound_box_offset_z; + + int flags = RCT2_CALLPROC_X(RCT2_ADDRESS(0x98199C, uint32_t)[rotation], + x_offset | (bound_box_length_z << 8), + image_id, + y_offset, + z_offset, + bound_box_length_y, + bound_box_length_x, + rotation); + + return !(flags & (1 << 8)); +} + +/** + * rct2: 0x006881D0 + * + * @param image_id (ebx) + * @param x (ax) + * @param y (cx) + * @return (!CF) success + */ +bool paint_attach_to_previous_attach(uint32 image_id, uint16 x, uint16 y) +{ + if (RCT2_GLOBAL(0xF1AD2C, uint32) == 0) { + return paint_attach_to_previous_ps(image_id, x, y); + } + + attached_paint_struct * ps = RCT2_GLOBAL(0xEE7888, attached_paint_struct *); + + if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) { + return false; + } + + ps->image_id = image_id; + ps->x = x; + ps->y = y; + ps->flags = 0; + + attached_paint_struct * ebx = RCT2_GLOBAL(0xF1AD2C, attached_paint_struct *); + + ps->next = NULL; + ebx->next = ps; + + RCT2_GLOBAL(0xF1AD2C, attached_paint_struct *) = ps; + + RCT2_GLOBAL(0xEE7888, attached_paint_struct *)++; + + return true; +} + +/** + * rct2: 0x0068818E + * + * @param image_id (ebx) + * @param x (ax) + * @param y (cx) + * @return (!CF) success + */ +bool paint_attach_to_previous_ps(uint32 image_id, uint16 x, uint16 y) +{ + attached_paint_struct * ps = RCT2_GLOBAL(0xEE7888, attached_paint_struct *); + + if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) { + return false; + } + + ps->image_id = image_id; + ps->x = x; + ps->y = y; + ps->flags = 0; + + paint_struct * masterPs = RCT2_GLOBAL(0xF1AD28, paint_struct *); + if (masterPs == NULL) { + return false; + } + + RCT2_GLOBAL(0x00EE7888, attached_paint_struct *)++; + + attached_paint_struct * oldFirstAttached = masterPs->attached_ps; + masterPs->attached_ps = ps; + + ps->next = oldFirstAttached; + + RCT2_GLOBAL(0xF1AD2C, attached_paint_struct *) = ps; + + return true; +} + +/** + * rct2: 0x00685EBC, 0x00686046, 0x00685FC8, 0x00685F4A, 0x00685ECC + * @param amount (eax) + * @param string_id (bx) + * @param y (cx) + * @param z (dx) + * @param offset_x (si) + * @param y_offsets (di) + * @param rotation (ebp) + */ +void sub_685EBC(money32 amount, uint16 string_id, sint16 y, sint16 z, sint8 y_offsets[], sint16 offset_x, uint32 rotation) +{ + paint_string_struct * ps = RCT2_GLOBAL(0xEE7888, paint_string_struct*); + + if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) { + return; + } + + ps->string_id = string_id; + ps->next = 0; + ps->args[0] = amount; + ps->args[4] = y; + ps->args[8] = y_offsets; + ps->args[12] = 0; + ps->y_offsets = y_offsets; + + rct_xyz16 position = {.x = RCT2_GLOBAL(0x9DE568, sint16), .y = RCT2_GLOBAL(0x9DE56C, sint16), .z = z}; + rct_xy16 coord = coordinate_3d_to_2d(&position, rotation); + + ps->x = coord.x + offset_x; + ps->y = coord.y; + + RCT2_GLOBAL(0xEE7888, uint32) += 0x1E; + + paint_string_struct * oldPs = RCT2_GLOBAL(0xF1AD24, paint_string_struct*); + + RCT2_GLOBAL(0xF1AD24, paint_string_struct*) = ps; + + if (oldPs == 0) { // 0 or NULL? + RCT2_GLOBAL(0xF1AD20, paint_string_struct *) = ps; + } else { + oldPs->next = ps; + } +} + +/** + * + * rct2: 0x0068B6C2 + */ +void viewport_paint_setup() +{ + rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + + rct_xy16 mapTile = { + .x = dpi->x & 0xFFE0, + .y = (dpi->y - 16) & 0xFFE0 + }; + + sint16 half_x = mapTile.x >> 1; + + uint16 num_vertical_quadrants = (dpi->height + 2128) >> 5; + + switch (get_current_rotation()){ + case 0: + mapTile.x = mapTile.y - half_x; + mapTile.y = mapTile.y + half_x; + + mapTile.x &= 0xFFE0; + mapTile.y &= 0xFFE0; + + for (; num_vertical_quadrants > 0; --num_vertical_quadrants){ + map_element_paint_setup(mapTile.x, mapTile.y); + sprite_paint_setup(mapTile.x, mapTile.y); + + sprite_paint_setup(mapTile.x - 32, mapTile.y + 32); + + map_element_paint_setup(mapTile.x, mapTile.y + 32); + sprite_paint_setup(mapTile.x, mapTile.y + 32); + + mapTile.x += 32; + sprite_paint_setup(mapTile.x, mapTile.y); + + mapTile.y += 32; + } + break; + case 1: + mapTile.x = -mapTile.y - half_x; + mapTile.y = mapTile.y - half_x - 16; + + mapTile.x &= 0xFFE0; + mapTile.y &= 0xFFE0; + + for (; num_vertical_quadrants > 0; --num_vertical_quadrants){ + map_element_paint_setup(mapTile.x, mapTile.y); + sprite_paint_setup(mapTile.x, mapTile.y); + + sprite_paint_setup(mapTile.x - 32, mapTile.y - 32); + + map_element_paint_setup(mapTile.x - 32, mapTile.y); + sprite_paint_setup(mapTile.x - 32, mapTile.y); + + mapTile.y += 32; + sprite_paint_setup(mapTile.x, mapTile.y); + + mapTile.x -= 32; + } + break; + case 2: + mapTile.x = -mapTile.y + half_x; + mapTile.y = -mapTile.y - half_x; + + mapTile.x &= 0xFFE0; + mapTile.y &= 0xFFE0; + + for (; num_vertical_quadrants > 0; --num_vertical_quadrants){ + map_element_paint_setup(mapTile.x, mapTile.y); + sprite_paint_setup(mapTile.x, mapTile.y); + + sprite_paint_setup(mapTile.x + 32, mapTile.y - 32); + + map_element_paint_setup(mapTile.x, mapTile.y - 32); + sprite_paint_setup(mapTile.x, mapTile.y - 32); + + mapTile.x -= 32; + + sprite_paint_setup(mapTile.x, mapTile.y); + + mapTile.y -= 32; + } + break; + case 3: + mapTile.x = mapTile.y + half_x; + mapTile.y = -mapTile.y + half_x - 16; + + mapTile.x &= 0xFFE0; + mapTile.y &= 0xFFE0; + + for (; num_vertical_quadrants > 0; --num_vertical_quadrants){ + map_element_paint_setup(mapTile.x, mapTile.y); + sprite_paint_setup(mapTile.x, mapTile.y); + + sprite_paint_setup(mapTile.x + 32, mapTile.y + 32); + + map_element_paint_setup(mapTile.x + 32, mapTile.y); + sprite_paint_setup(mapTile.x + 32, mapTile.y); + + mapTile.y -= 32; + + sprite_paint_setup(mapTile.x, mapTile.y); + + mapTile.x += 32; + } + break; + } +} + +void sub_688217_helper(uint16 ax, uint8 flag) +{ + paint_struct *ps, *ps_temp; + paint_struct *ps_next = RCT2_GLOBAL(0x00EE7884, paint_struct*); + + do { + ps = ps_next; + ps_next = ps_next->next_quadrant_ps; + if (ps_next == NULL) return; + } while (ax > ps_next->var_18); + + ps_temp = ps; + + do { + ps = ps->next_quadrant_ps; + if (ps == NULL) break; + + if (ps->var_18 > ax + 1) { + ps->var_1B = 1 << 7; + } + else if (ps->var_18 == ax + 1) { + ps->var_1B = (1 << 1) | (1 << 0); + } + else if (ps->var_18 == ax) { + ps->var_1B = flag | (1 << 0); + } + } while (ps->var_18 <= ax + 1); + + ps = ps_temp; + + uint8 rotation = get_current_rotation(); + while (true) { + while (true) { + ps_next = ps->next_quadrant_ps; + if (ps_next == NULL) return; + if (ps_next->var_1B & (1 << 7)) return; + if (ps_next->var_1B & (1 << 0)) break; + ps = ps_next; + } + + ps_next->var_1B &= ~(1 << 0); + ps_temp = ps; + + typedef struct bound_box { + uint16 x; + uint16 y; + uint16 z; + uint16 x_end; + uint16 y_end; + uint16 z_end; + } bound_box; + + bound_box initialBBox = { + .x = ps_next->bound_box_x, + .y = ps_next->bound_box_y, + .z = ps_next->bound_box_z, + .x_end = ps_next->bound_box_x_end, + .y_end = ps_next->bound_box_y_end, + .z_end = ps_next->bound_box_z_end + }; + + + while (true) { + ps = ps_next; + ps_next = ps_next->next_quadrant_ps; + if (ps_next == NULL) break; + if (ps_next->var_1B & (1 << 7)) break; + if (!(ps_next->var_1B & (1 << 1))) continue; + + int yes = 0; + switch (rotation) { + case 0: + if (initialBBox.z_end >= ps_next->bound_box_z && initialBBox.y_end >= ps_next->bound_box_y && initialBBox.x_end >= ps_next->bound_box_x + && !(initialBBox.z < ps_next->bound_box_z_end && initialBBox.y < ps_next->bound_box_y_end && initialBBox.x < ps_next->bound_box_x_end)) + yes = 1; + break; + case 1: + if (initialBBox.z_end >= ps_next->bound_box_z && initialBBox.y_end >= ps_next->bound_box_y && initialBBox.x_end < ps_next->bound_box_x + && !(initialBBox.z < ps_next->bound_box_z_end && initialBBox.y < ps_next->bound_box_y_end && initialBBox.x >= ps_next->bound_box_x_end)) + yes = 1; + break; + case 2: + if (initialBBox.z_end >= ps_next->bound_box_z && initialBBox.y_end < ps_next->bound_box_y && initialBBox.x_end < ps_next->bound_box_x + && !(initialBBox.z < ps_next->bound_box_z_end && initialBBox.y >= ps_next->bound_box_y_end && initialBBox.x >= ps_next->bound_box_x_end)) + yes = 1; + break; + case 3: + if (initialBBox.z_end >= ps_next->bound_box_z && initialBBox.y_end < ps_next->bound_box_y && initialBBox.x_end >= ps_next->bound_box_x + && !(initialBBox.z < ps_next->bound_box_z_end && initialBBox.y >= ps_next->bound_box_y_end && initialBBox.x < ps_next->bound_box_x_end)) + yes = 1; + break; + } + + if (yes) { + ps->next_quadrant_ps = ps_next->next_quadrant_ps; + paint_struct *ps_temp2 = ps_temp->next_quadrant_ps; + ps_temp->next_quadrant_ps = ps_next; + ps_next->next_quadrant_ps = ps_temp2; + ps_next = ps; + } + } + + ps = ps_temp; + } +} + +/** + * + * rct2: 0x00688217 + */ +void sub_688217() +{ + paint_struct *ps = RCT2_GLOBAL(0x00EE7888, paint_struct*); + paint_struct *ps_next; + RCT2_GLOBAL(0x00EE7888, paint_struct*)++; + RCT2_GLOBAL(0x00EE7884, paint_struct*) = ps; + ps->next_quadrant_ps = NULL; + uint32 edi = RCT2_GLOBAL(0x00F1AD0C, uint32); + if (edi == -1) + return; + + do { + ps_next = RCT2_GLOBAL(0x00F1A50C + 4 * edi, paint_struct*); + if (ps_next != NULL) { + ps->next_quadrant_ps = ps_next; + do { + ps = ps_next; + ps_next = ps_next->next_quadrant_ps; + } while (ps_next != NULL); + } + } while (++edi <= RCT2_GLOBAL(0x00F1AD10, uint32)); + + uint32 eax = RCT2_GLOBAL(0x00F1AD0C, uint32); + + sub_688217_helper(eax & 0xFFFF, 1 << 1); + + eax = RCT2_GLOBAL(0x00F1AD0C, uint32); + + while (++eax < RCT2_GLOBAL(0x00F1AD10, uint32)) + sub_688217_helper(eax & 0xFFFF, 0); +} + +/** + * + * rct2: 0x00688596 + * Part of 0x688485 + */ +void paint_attached_ps(paint_struct* ps, attached_paint_struct* attached_ps, rct_drawpixelinfo* dpi) { + for (; attached_ps; attached_ps = attached_ps->next) { + sint16 x = attached_ps->x + ps->x; + sint16 y = attached_ps->y + ps->y; + + int image_id = attached_ps->image_id; + if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_RIDES) { + if (ps->sprite_type == 3) { + if (image_id & 0x40000000) { + image_id &= 0x7FFFF; + image_id |= 0x41880000; + } + } + } + + if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_SCENERY) { + if (ps->sprite_type == 5) { + if (image_id & 0x40000000) { + image_id &= 0x7FFFF; + image_id |= 0x41880000; + } + } + } + + if (attached_ps->flags & PAINT_STRUCT_FLAG_IS_MASKED) { + gfx_draw_sprite_raw_masked(dpi, x, y, image_id, attached_ps->colour_image_id); + } + else { + gfx_draw_sprite(dpi, image_id, x, y, ps->tertiary_colour); + } + } +} + +/* rct2: 0x00688485 */ +void paint_quadrant_ps() { + rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + paint_struct* ps = RCT2_GLOBAL(0xEE7884, paint_struct*); + paint_struct* previous_ps = ps->next_quadrant_ps; + + for (ps = ps->next_quadrant_ps; ps;) { + sint16 x = ps->x; + sint16 y = ps->y; + if (ps->sprite_type == 2) { + if (dpi->zoom_level >= 1) { + x &= 0xFFFE; + y &= 0xFFFE; + if (dpi->zoom_level >= 2) { + x &= 0xFFFC; + y &= 0xFFFC; + } + } + } + int image_id = ps->image_id; + if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_RIDES) { + if (ps->sprite_type == 3) { + if (!(image_id & 0x40000000)) { + image_id &= 0x7FFFF; + image_id |= 0x41880000; + } + } + } + if (gCurrentViewportFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) { + if (ps->sprite_type == 9) { + if (!(image_id & 0x40000000)) { + image_id &= 0x7FFFF; + image_id |= 0x41880000; + } + } + } + if (gCurrentViewportFlags & VIEWPORT_FLAG_SEETHROUGH_SCENERY) { + if (ps->sprite_type == 10 || ps->sprite_type == 12 || ps->sprite_type == 9 || ps->sprite_type == 5) { + if (!(image_id & 0x40000000)) { + image_id &= 0x7FFFF; + image_id |= 0x41880000; + } + } + } + + if (ps->flags & PAINT_STRUCT_FLAG_IS_MASKED) + gfx_draw_sprite_raw_masked(dpi, x, y, image_id, ps->colour_image_id); + else + gfx_draw_sprite(dpi, image_id, x, y, ps->tertiary_colour); + + if (ps->var_20 != 0) { + ps = ps->var_20; + continue; + } + + paint_attached_ps(ps, ps->attached_ps, dpi); + ps = previous_ps->next_quadrant_ps; + previous_ps = ps; + } + +} + +static void draw_pixel_info_crop_by_zoom(rct_drawpixelinfo *dpi) +{ + int zoom = dpi->zoom_level; + dpi->zoom_level = 0; + dpi->x >>= zoom; + dpi->y >>= zoom; + dpi->width >>= zoom; + dpi->height >>= zoom; +} + +/** + * + * rct2: 0x006860C3 + */ +void viewport_draw_money_effects() +{ + utf8 buffer[256]; + + paint_string_struct *ps = RCT2_GLOBAL(0x00F1AD20, paint_string_struct*); + if (ps == NULL) + return; + + rct_drawpixelinfo dpi = *(RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*)); + draw_pixel_info_crop_by_zoom(&dpi); + + do { + format_string(buffer, ps->string_id, &ps->args); + gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM; + + bool forceSpriteFont = false; + const currency_descriptor *currencyDesc = &CurrencyDescriptors[gConfigGeneral.currency_format]; + if (gUseTrueTypeFont && font_supports_string_sprite(currencyDesc->symbol_unicode)) { + forceSpriteFont = true; + } + + gfx_draw_string_with_y_offsets(&dpi, buffer, 0, ps->x, ps->y, (sint8 *)ps->y_offsets, forceSpriteFont); + } while ((ps = ps->next) != NULL); +} diff --git a/src/paint/paint.h b/src/paint/paint.h new file mode 100644 index 0000000000..4aa19601f2 --- /dev/null +++ b/src/paint/paint.h @@ -0,0 +1,102 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#ifndef _PAINT_H +#define _PAINT_H + +#include "../common.h" +#include "../world/map.h" + +typedef struct attached_paint_struct attached_paint_struct; + +/* size 0x12 */ +struct attached_paint_struct { + uint32 image_id; // 0x00 + union { + uint32 tertiary_colour; + // If masked image_id is masked_id + uint32 colour_image_id; + }; + uint16 x; // 0x08 + uint16 y; // 0x0A + uint8 flags; // 0x0C + uint8 pad_0D; + attached_paint_struct* next; //0x0E +}; + +typedef struct paint_struct paint_struct; + +/* size 0x34 */ +struct paint_struct { + uint32 image_id; // 0x00 + union { + uint32 tertiary_colour; + // If masked image_id is masked_id + uint32 colour_image_id; + }; + uint16 bound_box_x; // 0x08 + uint16 bound_box_y; // 0x0A + uint16 bound_box_z; // 0x0C + uint16 bound_box_z_end; // 0x0E + uint16 bound_box_x_end; // 0x10 + uint16 bound_box_y_end; // 0x12 + uint16 x; // 0x14 + uint16 y; // 0x16 + uint16 var_18; + uint8 flags; + uint8 var_1B; + attached_paint_struct* attached_ps; //0x1C + paint_struct* var_20; + paint_struct* next_quadrant_ps; // 0x24 + uint8 sprite_type; //0x28 + uint8 var_29; + uint16 pad_2A; + uint16 map_x; // 0x2C + uint16 map_y; // 0x2E + rct_map_element *mapElement; // 0x30 (or sprite pointer) +}; + +typedef struct paint_string_struct paint_string_struct; + +/* size 0x1E */ +struct paint_string_struct { + rct_string_id string_id; // 0x00 + paint_string_struct *next; // 0x02 + uint16 x; // 0x06 + uint16 y; // 0x08 + uint8 args[16]; // 0x0A + uint8 *y_offsets; // 0x1A +}; + +enum PAINT_STRUCT_FLAGS { + PAINT_STRUCT_FLAG_IS_MASKED = (1 << 0) +}; + +void painter_setup(); + +bool sub_98196C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, uint32 rotation); +bool sub_98197C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); +bool sub_98198C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); +bool sub_98199C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); + +bool paint_attach_to_previous_attach(uint32 image_id, uint16 x, uint16 y); +bool paint_attach_to_previous_ps(uint32 image_id, uint16 x, uint16 y); +void sub_685EBC(money32 amount, uint16 string_id, sint16 y, sint16 z, sint8 y_offsets[], sint16 offset_x, uint32 rotation); + +void viewport_draw_money_effects(); +void viewport_paint_setup(); + +#endif diff --git a/src/paint/sprite/litter.c b/src/paint/sprite/litter.c new file mode 100644 index 0000000000..7052914723 --- /dev/null +++ b/src/paint/sprite/litter.c @@ -0,0 +1,42 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "sprite.h" +#include "../../world/sprite.h" +#include "../../interface/viewport.h" +#include "../paint.h" + +/** + * Litter Paint Setup + * rct2: 0x006736FC + */ +void litter_paint(rct_litter *litter, int imageDirection) +{ + rct_drawpixelinfo *dpi; + + dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + if (dpi->zoom_level != 0) return; // If zoomed at all no litter drawn + + // litter has no sprite direction so remove that + imageDirection >>= 3; + // Some litter types have only 1 direction so remove + // anything that isn't required. + imageDirection &= RCT2_ADDRESS(0x97EF6C, uint32)[litter->type * 2 + 1]; + + uint32 image_id = imageDirection + RCT2_ADDRESS(0x97EF6C, uint32)[litter->type * 2]; + + sub_98197C(image_id, 0, 0, 4, 4, -1, litter->z, -4, -4, litter->z + 2, get_current_rotation()); +} diff --git a/src/paint/sprite/misc.c b/src/paint/sprite/misc.c new file mode 100644 index 0000000000..c62b34f575 --- /dev/null +++ b/src/paint/sprite/misc.c @@ -0,0 +1,27 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../world/sprite.h" +#include "../../addresses.h" + +/** + * + * rct2: 0x00672AC9 + */ +void misc_paint(rct_sprite *misc, int imageDirection) +{ + RCT2_CALLPROC_X(0x00672AC9, misc->unknown.x, imageDirection, misc->unknown.y, misc->unknown.z, (int)misc, 0, 0); +} diff --git a/src/paint/sprite/peep.c b/src/paint/sprite/peep.c new file mode 100644 index 0000000000..5ce823c651 --- /dev/null +++ b/src/paint/sprite/peep.c @@ -0,0 +1,68 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../world/sprite.h" +#include "../../interface/viewport.h" +#include "../../peep/peep.h" +#include "../paint.h" + +/** + * + * rct2: 0x0068F0FB + */ +void peep_paint(rct_peep * peep, int imageDirection) +{ + rct_drawpixelinfo * dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + if (dpi->zoom_level > 2) { + return; + } + + if (gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_PEEPS) { + return; + } + + rct_sprite_entry sprite = g_sprite_entries[peep->sprite_type]; + + uint8 spriteType = peep->action_sprite_type; + uint8 imageOffset = peep->action_sprite_image_offset; + + if (peep->action == PEEP_ACTION_NONE_1) { + spriteType = peep->next_action_sprite_type; + imageOffset = 0; + } + + uint32 baseImageId = (imageDirection >> 3) + sprite.sprite_image[spriteType].base_image + imageOffset * 4; + uint32 imageId = baseImageId | peep->tshirt_colour << 19 | peep->trousers_colour << 24 | 0xA0000000; + sub_98197C(imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 3, get_current_rotation()); + + if (baseImageId >= 10717 && baseImageId < 10749) { + imageId = baseImageId + 32 | peep->hat_colour << 19 | 0x20000000; + sub_98199C(imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 3, get_current_rotation()); + return; + } + + if (baseImageId >= 10781 && baseImageId < 10813) { + imageId = baseImageId + 32 | peep->balloon_colour << 19 | 0x20000000; + sub_98199C(imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 3, get_current_rotation()); + return; + } + + if (baseImageId >= 11197 && baseImageId < 11229) { + imageId = baseImageId + 32 | peep->umbrella_colour << 19 | 0x20000000; + sub_98199C(imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 3, get_current_rotation()); + return; + } +} diff --git a/src/paint/sprite/sprite.c b/src/paint/sprite/sprite.c new file mode 100644 index 0000000000..8c5da24507 --- /dev/null +++ b/src/paint/sprite/sprite.c @@ -0,0 +1,85 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "sprite.h" +#include "../paint.h" +#include "../../drawing/drawing.h" +#include "../../world/sprite.h" +#include "../../ride/ride_data.h" +#include "../../interface/viewport.h" +#include "../../ride/vehicle_paint.h" + +/** + * Paint Quadrant + * rct2: 0x0069E8B0 + */ +void sprite_paint_setup(const uint16 eax, const uint16 ecx) { + rct_drawpixelinfo* dpi; + + if ((eax & 0xe000) | (ecx & 0xe000)) return; + + const int idx = ((eax << 3) & 0xff00) | (ecx >> 5); + int sprite_idx = RCT2_ADDRESS(0xF1EF60, uint16)[idx]; + if (sprite_idx == SPRITE_INDEX_NULL) return; + + if (RCT2_GLOBAL(0x9DEA6F, uint8) & 1) return; + + + if (gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES) return; + + dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + if (dpi->zoom_level > 2) return; + + + for (rct_sprite* spr = &g_sprite_list[sprite_idx]; sprite_idx != SPRITE_INDEX_NULL; sprite_idx = spr->unknown.next_in_quadrant) { + spr = &g_sprite_list[sprite_idx]; + dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + + if (dpi->y + dpi->height <= spr->unknown.sprite_top) continue; + if (spr->unknown.sprite_bottom <= dpi->y)continue; + if (dpi->x + dpi->width <= spr->unknown.sprite_left)continue; + if (spr->unknown.sprite_right <= dpi->x)continue; + + int image_direction = get_current_rotation(); + image_direction <<= 3; + image_direction += spr->unknown.sprite_direction; + image_direction &= 0x1F; + + RCT2_GLOBAL(0x9DE578, uint32) = (uint32)spr; + + RCT2_GLOBAL(0x9DE568, sint16) = spr->unknown.x; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_SPRITE; + RCT2_GLOBAL(0x9DE56C, sint16) = spr->unknown.y; + + switch (spr->unknown.sprite_identifier) { + case SPRITE_IDENTIFIER_VEHICLE: + vehicle_paint((rct_vehicle*)spr, image_direction); + break; + case SPRITE_IDENTIFIER_PEEP: + peep_paint((rct_peep*)spr, image_direction); + break; + case SPRITE_IDENTIFIER_MISC: + misc_paint(spr, image_direction); + break; + case SPRITE_IDENTIFIER_LITTER: + litter_paint((rct_litter*)spr, image_direction); + break; + default: + assert(false); + break; + } + } +} diff --git a/src/paint/sprite/sprite.h b/src/paint/sprite/sprite.h new file mode 100644 index 0000000000..8d638abc35 --- /dev/null +++ b/src/paint/sprite/sprite.h @@ -0,0 +1,30 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#ifndef _PAINT_SPRITE_H +#define _PAINT_SPRITE_H + +#include "../../common.h" +#include "../../world/sprite.h" + +void sprite_paint_setup(const uint16 eax, const uint16 ecx); + +void misc_paint(rct_sprite *misc, int imageDirection); +void litter_paint(rct_litter *litter, int imageDirection); +void peep_paint(rct_peep *peep, int imageDirection); +void vehicle_paint(rct_vehicle *vehicle, int imageDirection); + +#endif diff --git a/src/drawing/supports.c b/src/paint/supports.c similarity index 99% rename from src/drawing/supports.c rename to src/paint/supports.c index ab099fb554..1ff7e04c4a 100644 --- a/src/drawing/supports.c +++ b/src/paint/supports.c @@ -16,6 +16,7 @@ #include "../addresses.h" #include "../interface/viewport.h" +#include "../paint/paint.h" #include "supports.h" typedef struct { diff --git a/src/drawing/supports.h b/src/paint/supports.h similarity index 100% rename from src/drawing/supports.h rename to src/paint/supports.h diff --git a/src/ride/coaster/air_powered_vertical_coaster.c b/src/ride/coaster/air_powered_vertical_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/air_powered_vertical_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/bobsleigh_coaster.c b/src/ride/coaster/bobsleigh_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/bobsleigh_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/compact_inverted_coaster.c b/src/ride/coaster/compact_inverted_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/compact_inverted_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/corkscrew_roller_coaster.c b/src/ride/coaster/corkscrew_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/corkscrew_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/flying_roller_coaster.c b/src/ride/coaster/flying_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/flying_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/giga_coaster.c b/src/ride/coaster/giga_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/giga_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/heartline_twister_coaster.c b/src/ride/coaster/heartline_twister_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/heartline_twister_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/inverted_hairpin_coaster.c b/src/ride/coaster/inverted_hairpin_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/inverted_hairpin_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/inverted_impulse_coaster.c b/src/ride/coaster/inverted_impulse_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/inverted_impulse_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/inverted_roller_coaster.c b/src/ride/coaster/inverted_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/inverted_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/junior_roller_coaster.c b/src/ride/coaster/junior_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/junior_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/lay_down_roller_coaster.c b/src/ride/coaster/lay_down_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/lay_down_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/lim_launched_roller_coaster.c b/src/ride/coaster/lim_launched_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/lim_launched_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/looping_roller_coaster.c b/src/ride/coaster/looping_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/looping_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/mine_ride.c b/src/ride/coaster/mine_ride.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/mine_ride.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/mine_train_coaster.c b/src/ride/coaster/mine_train_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/mine_train_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/mini_roller_coaster.c b/src/ride/coaster/mini_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/mini_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/mini_suspended_coaster.c b/src/ride/coaster/mini_suspended_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/mini_suspended_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/multi_dimension_roller_coaster.c b/src/ride/coaster/multi_dimension_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/multi_dimension_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/reverse_freefall_coaster.c b/src/ride/coaster/reverse_freefall_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/reverse_freefall_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/reverser_roller_coaster.c b/src/ride/coaster/reverser_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/reverser_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/side_friction_roller_coaster.c b/src/ride/coaster/side_friction_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/side_friction_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/spiral_roller_coaster.c b/src/ride/coaster/spiral_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/spiral_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/stand_up_roller_coaster.c b/src/ride/coaster/stand_up_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/stand_up_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/steeplechase.c b/src/ride/coaster/steeplechase.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/steeplechase.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/suspended_swinging_coaster.c b/src/ride/coaster/suspended_swinging_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/suspended_swinging_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/twister_roller_coaster.c b/src/ride/coaster/twister_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/twister_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/vertical_drop_roller_coaster.c b/src/ride/coaster/vertical_drop_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/vertical_drop_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/virginia_reel.c b/src/ride/coaster/virginia_reel.c new file mode 100644 index 0000000000..0d93e75edd --- /dev/null +++ b/src/ride/coaster/virginia_reel.c @@ -0,0 +1,83 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../config.h" +#include "../../interface/viewport.h" +#include "../../world/sprite.h" +#include "../../paint/paint.h" + +/** + * + * rct2: 0x006D5B48 + */ +void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) +{ + int image_id; + int baseImage_id = imageDirection; + int ecx = ((vehicle->var_BA / 8) + (get_current_rotation() * 8)) & 31; + int j = 0; + if (vehicle->vehicle_sprite_type == 0) { + baseImage_id = ecx & 7; + } else { + if (vehicle->vehicle_sprite_type == 1 || vehicle->vehicle_sprite_type == 5) { + if (vehicle->vehicle_sprite_type == 5){ + baseImage_id = imageDirection ^ 16; + } + baseImage_id &= 24; + j = (baseImage_id / 8) + 1; + baseImage_id += (ecx & 7); + baseImage_id += 8; + } else + if (vehicle->vehicle_sprite_type == 2 || vehicle->vehicle_sprite_type == 6) { + if (vehicle->vehicle_sprite_type == 6){ + baseImage_id = imageDirection ^ 16; + } + baseImage_id &= 24; + j = (baseImage_id / 8) + 5; + baseImage_id += (ecx & 7); + baseImage_id += 40; + } else { + baseImage_id = ecx & 7; + } + } + baseImage_id += vehicleEntry->base_image_id; + + sint16 bbo_x = RCT2_ADDRESS(0x009927E6, sint8)[j * 8]; + sint16 bbo_y = RCT2_ADDRESS(0x009927E7, sint8)[j * 8]; + sint16 bbo_z = RCT2_ADDRESS(0x009927E8, sint8)[j * 8] + z; + uint16 bbl_x = RCT2_ADDRESS(0x009927E9, uint8)[j * 8]; + uint16 bbl_y = RCT2_ADDRESS(0x009927EA, uint8)[j * 8]; + uint8 bbl_z = RCT2_ADDRESS(0x009927EB, uint8)[j * 8]; + image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; + sub_98197C(image_id, 0, 0, bbl_x, bbl_y, bbl_z, z, bbo_x, bbo_y, bbo_z, get_current_rotation()); + + if (RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*)->zoom_level < 2 && vehicle->num_peeps > 0) { + uint8 riding_peep_sprites[4] = {0xFF, 0xFF, 0xFF, 0xFF}; + for (int i = 0; i < vehicle->num_peeps; i++) { + riding_peep_sprites[((ecx / 8) + i) & 3] = vehicle->peep_tshirt_colours[i]; + } + int draw_order[4] = {0, 1, 3, 2}; + for (int i = 0; i < countof(draw_order); i++) { + if (riding_peep_sprites[draw_order[i]] != 0xFF) { + image_id = (baseImage_id + ((draw_order[i] + 1) * 72)) | (riding_peep_sprites[draw_order[i]] << 19) | 0x20000000; + sub_98199C(image_id, 0, 0, bbl_x, bbl_y, bbl_z, z, bbo_x, bbo_y, bbo_z, get_current_rotation()); + } + } + } + + assert(vehicleEntry->pad_5E == 1); +} diff --git a/src/ride/coaster/wild_mouse.c b/src/ride/coaster/wild_mouse.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/wild_mouse.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/wooden_roller_coaster.c b/src/ride/coaster/wooden_roller_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/wooden_roller_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/coaster/wooden_wild_mouse.c b/src/ride/coaster/wooden_wild_mouse.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/coaster/wooden_wild_mouse.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/car_ride.c b/src/ride/gentle/car_ride.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/car_ride.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/circus_show.c b/src/ride/gentle/circus_show.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/circus_show.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/crooked_house.c b/src/ride/gentle/crooked_house.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/crooked_house.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/dodgems.c b/src/ride/gentle/dodgems.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/dodgems.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/ferris_wheel.c b/src/ride/gentle/ferris_wheel.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/ferris_wheel.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/flying_saucers.c b/src/ride/gentle/flying_saucers.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/flying_saucers.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/ghost_train.c b/src/ride/gentle/ghost_train.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/ghost_train.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/haunted_house.c b/src/ride/gentle/haunted_house.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/haunted_house.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/maze.c b/src/ride/gentle/maze.c new file mode 100644 index 0000000000..3de2e7153a --- /dev/null +++ b/src/ride/gentle/maze.c @@ -0,0 +1,196 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../track_paint.h" + +enum { + SPR_MAZE_BASE_HEDGE = 21938, + SPR_MAZE_BASE_BRICK = 21951, + SPR_MAZE_BASE_ICE = 21964, + SPR_MAZE_BASE_WOOD = 21977, +}; + +enum { + SPR_MAZE_OFFSET_WALL_CENTER = 0, + SPR_MAZE_OFFSET_WALL_INNER_NE_SW, + SPR_MAZE_OFFSET_WALL_INNER_NW_SE, + SPR_MAZE_OFFSET_WALL_TOP_LEFT, + SPR_MAZE_OFFSET_WALL_TOP_RIGHT, + SPR_MAZE_OFFSET_WALL_BOTTOM_RIGHT, + SPR_MAZE_OFFSET_WALL_BOTTOM_LEFT, + SPR_MAZE_OFFSET_COLUMN_CENTER, + SPR_MAZE_OFFSET_COLUMN_TOP_RIGHT, + SPR_MAZE_OFFSET_COLUMN_TOP_LEFT, + SPR_MAZE_OFFSET_COLUMN_BOTTOM_LEFT, + SPR_MAZE_OFFSET_COLUMN_BOTTOM_RIGHT, + SPR_MAZE_OFFSET_COLUMN_CORNER, +}; + +/** + * rct: 0x004ACF4A + */ +static void maze_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + uint16 maze_entry = mapElement->properties.track.maze_entry; + maze_entry = rol16(maze_entry, direction * 4); + + // draw ground + int image_id = 2485 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98196C(image_id, 0, 0, 32, 32, 0, height, get_current_rotation()); + + wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL); + + RCT2_GLOBAL(0x0141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9D4, uint16) = 0xFFFF; + + int base_image_id; + switch (get_ride(rideIndex)->track_colour_supports[0]) { + case 0: base_image_id = SPR_MAZE_BASE_BRICK; break; + case 1: base_image_id = SPR_MAZE_BASE_HEDGE; break; + case 2: base_image_id = SPR_MAZE_BASE_ICE; break; + case 3: base_image_id = SPR_MAZE_BASE_WOOD; break; + } + + base_image_id |= RCT2_GLOBAL(0x00F441A0, uint32); + + + image_id = base_image_id + SPR_MAZE_OFFSET_WALL_CENTER; + if (maze_entry & (1 << 3)) + sub_98197C(image_id, 2, 2, 10, 10, 9, height, 3, 3, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 7)) + sub_98197C(image_id, 2, 18, 10, 10, 9, height, 3, 19, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 11)) + sub_98197C(image_id, 18, 18, 10, 10, 9, height, 19, 19, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 15)) + sub_98197C(image_id, 18, 2, 10, 10, 9, height, 19, 3, height + 2, get_current_rotation()); + + + image_id = base_image_id + SPR_MAZE_OFFSET_WALL_TOP_LEFT; + if (maze_entry & (1 << 0)) + sub_98197C(image_id, 2, 0, 10, 1, 9, height, 3, 1, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 13)) + sub_98197C(image_id, 18, 0, 10, 1, 9, height, 19, 1, height + 2, get_current_rotation()); + + + image_id = base_image_id + SPR_MAZE_OFFSET_WALL_BOTTOM_RIGHT; + if (maze_entry & (1 << 5)) + sub_98197C(image_id, 2, 30, 10, 1, 9, height, 3, 30, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 8)) + sub_98197C(image_id, 18, 30, 10, 1, 9, height, 19, 30, height + 2, get_current_rotation()); + + + image_id = base_image_id + SPR_MAZE_OFFSET_WALL_TOP_RIGHT; + if (maze_entry & (1 << 1)) + sub_98197C(image_id, 0, 2, 1, 10, 9, height, 1, 3, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 4)) + sub_98197C(image_id, 0, 18, 1, 10, 9, height, 1, 19, height + 2, get_current_rotation()); + + + image_id = base_image_id + SPR_MAZE_OFFSET_WALL_BOTTOM_LEFT; + if (maze_entry & (1 << 12)) + sub_98197C(image_id, 30, 2, 1, 10, 9, height, 30, 3, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 9)) + sub_98197C(image_id, 30, 18, 1, 10, 9, height, 30, 19, height + 2, get_current_rotation()); + + + image_id = base_image_id + SPR_MAZE_OFFSET_WALL_INNER_NE_SW; + if (maze_entry & (1 << 2)) + sub_98197C(image_id, 2, 14, 10, 4, 9, height, 3, 14, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 10)) + sub_98197C(image_id, 18, 14, 10, 4, 9, height, 19, 14, height + 2, get_current_rotation()); + + + image_id = base_image_id + SPR_MAZE_OFFSET_WALL_INNER_NW_SE; + if (maze_entry & (1 << 14)) + sub_98197C(image_id, 14, 2, 4, 10, 9, height, 14, 3, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 6)) + sub_98197C(image_id, 14, 18, 4, 10, 9, height, 14, 19, height + 2, get_current_rotation()); + + + image_id = base_image_id + SPR_MAZE_OFFSET_COLUMN_CORNER; + if (maze_entry & (1 << 0 | 1 << 1)) + sub_98197C(image_id, 0, 0, 1, 1, 9, height, 1, 1, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 4 | 1 << 5)) + sub_98197C(image_id, 0, 30, 1, 1, 9, height, 1, 30, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 8 | 1 << 9)) + sub_98197C(image_id, 30, 30, 1, 1, 9, height, 30, 30, height + 2, get_current_rotation()); + + if (maze_entry & (1 << 12 | 1 << 13)) + sub_98197C(image_id, 30, 0, 1, 1, 9, height, 30, 1, height + 2, get_current_rotation()); + + + if (maze_entry & (1 << 0 | 1 << 13 | 1 << 14)) + sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_TOP_LEFT, 14, 0, 2, 1, 9, height, 15, 1, height + 2, get_current_rotation()); + + + if (maze_entry & (1 << 5 | 1 << 6 | 1 << 8)) + sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_BOTTOM_RIGHT, 14, 30, 2, 1, 9, height, 15, 30, height + 2, get_current_rotation()); + + + if (maze_entry & (1 << 1 | 1 << 2 | 1 << 4)) + sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_TOP_RIGHT, 0, 14, 1, 2, 9, height, 1, 15, height + 2, get_current_rotation()); + + + if (maze_entry & (1 << 9 | 1 << 10 | 1 << 12)) + sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_BOTTOM_LEFT, 30, 14, 1, 2, 9, height, 30, 15, height + 2, get_current_rotation()); + + + if (maze_entry & (1 << 2 | 1 << 6 | 1 << 10 | 1 << 14)) { + sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_CENTER, 14, 14, 2, 2, 8, height, 15, 15, height + 2, get_current_rotation()); + + RCT2_GLOBAL(0x141E9C4, uint16) = height + 12; + RCT2_GLOBAL(0x141E9C6, uint8) = 0x20; + } + + height += 32; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 0x20; + } +} + +/** + * rct2: 0x008A81E8 + */ +TRACK_PAINT_FUNCTION get_track_paint_function_maze(int trackType, int direction) { + if (trackType != 101) { + return NULL; + } + + return maze_paint_setup; +} diff --git a/src/ride/gentle/merry_go_round.c b/src/ride/gentle/merry_go_round.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/merry_go_round.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/mini_golf.c b/src/ride/gentle/mini_golf.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/mini_golf.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/mini_helicopters.c b/src/ride/gentle/mini_helicopters.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/mini_helicopters.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/monorail_cycles.c b/src/ride/gentle/monorail_cycles.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/monorail_cycles.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/observation_tower.c b/src/ride/gentle/observation_tower.c new file mode 100644 index 0000000000..02321ba689 --- /dev/null +++ b/src/ride/gentle/observation_tower.c @@ -0,0 +1,58 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../config.h" +#include "../../interface/viewport.h" +#include "../../world/sprite.h" +#include "../../paint/paint.h" + +/** + * + * rct2: 0x006D6258 + */ +void vehicle_visual_observation_tower(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) +{ + int image_id; + int baseImage_id = (vehicle->restraints_position / 64); + if (vehicle->restraints_position >= 64) { + if ((imageDirection / 8) && (imageDirection / 8) != 3) { + baseImage_id *= 2; + baseImage_id += vehicleEntry->base_image_id + 28; + if ((imageDirection / 8) != 1) { + baseImage_id -= 6; + } + } else { + baseImage_id = vehicleEntry->base_image_id + 8; + } + } else { + baseImage_id = (vehicle->var_C5 * 2) + vehicleEntry->base_image_id + 8; + } + + image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0x80000000; + if (sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, get_current_rotation())) { + paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original + ps->tertiary_colour = vehicle->colours_extended; + } + + image_id++; + if (sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation())) { + paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original + ps->tertiary_colour = vehicle->colours_extended; + } + + assert(vehicleEntry->pad_5E == 1); +} diff --git a/src/ride/gentle/space_rings.c b/src/ride/gentle/space_rings.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/space_rings.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/gentle/spiral_slide.c b/src/ride/gentle/spiral_slide.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/gentle/spiral_slide.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/shops/facility.c b/src/ride/shops/facility.c new file mode 100644 index 0000000000..8c9df4ff89 --- /dev/null +++ b/src/ride/shops/facility.c @@ -0,0 +1,93 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../track_paint.h" + +/** + * + * rct2: 0x00763234 + * rct2: 0x0076338C + * rct2: 0x00762F50 + * rct2: 0x007630DE + */ +static void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) +{ + bool hasSupports = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL); + + RCT2_GLOBAL(0x0141E9D0, sint16) = -1; + RCT2_GLOBAL(0x0141E9C4, sint16) = -1; + RCT2_GLOBAL(0x0141E9CC, sint16) = -1; + RCT2_GLOBAL(0x0141E9B8, sint16) = -1; + RCT2_GLOBAL(0x0141E9BC, sint16) = -1; + RCT2_GLOBAL(0x0141E9B4, sint16) = -1; + RCT2_GLOBAL(0x0141E9C0, sint16) = -1; + RCT2_GLOBAL(0x0141E9C8, sint16) = -1; + RCT2_GLOBAL(0x0141E9D4, sint16) = -1; + + rct_ride *ride = get_ride(rideIndex); + rct_ride_entry *rideEntry = get_ride_entry(ride->subtype); + rct_ride_entry_vehicle *firstVehicleEntry = &rideEntry->vehicles[0]; + + uint32 imageId = RCT2_GLOBAL(0x00F44198, uint32); + imageId |= firstVehicleEntry->base_image_id; + imageId += (direction + 2) & 3; + + sint16 height16 = (sint16)height; + int rotation = get_current_rotation(); + int lengthX = (direction & 1) == 0 ? 28 : 2; + int lengthY = (direction & 1) == 0 ? 2 : 28; + if (hasSupports) { + uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32); + foundationImageId |= 3395; + sub_98197C(foundationImageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); + + // Door image or base + sub_98199C(imageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); + } else { + // Door image or base + sub_98197C(imageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); + } + + // Base image if door was drawn + if (direction == 1) { + imageId += 2; + sub_98197C(imageId, 0, 0, 2, 28, 29, height, 28, 2, height16, rotation); + } else if (direction == 2) { + imageId += 4; + sub_98197C(imageId, 0, 0, 28, 2, 29, height, 2, 28, height16, rotation); + } + + height16 += 32; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height16) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height16; + RCT2_GLOBAL(0x00141E9DA, uint8) = 32; + } +} + +/* 0x00762D44 */ +TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction) +{ + switch (trackType) { + case 118: return facility_paint_setup; + } + return NULL; +} diff --git a/src/ride/shops/misc.c b/src/ride/shops/misc.c new file mode 100644 index 0000000000..06ad312ecd --- /dev/null +++ b/src/ride/shops/misc.c @@ -0,0 +1,78 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../track_paint.h" + +/** + * rct2: 0x00761378, 0x007614DB, 0x0076163F, 0x007617A5 + */ +static void ride_50_52_53_54_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + bool supportsDrawn = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL); + + RCT2_GLOBAL(0x0141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x0141E9D4, uint16) = 0xFFFF; + + rct_ride *ride = get_ride(rideIndex); + + rct_ride_entry *rideEntry = get_ride_entry(ride->subtype); + + uint32 image_id = RCT2_GLOBAL(0x00F44198, uint32); + if (image_id & 0x80000000) { + image_id &= 0x60FFFFFF; + } + + image_id += rideEntry->vehicles[0].base_image_id; + image_id += direction; + if (supportsDrawn) { + uint32 ebx = (direction & 1 ? 3396 : 3395) | RCT2_GLOBAL(0x00F441A4, uint32); + sub_98197C(ebx, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation()); + + sub_98199C(image_id, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation()); + } else { + sub_98197C(image_id, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation()); + } + + height += 48; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x00141E9DA, uint8) = 0x20; + } +} + +/** + * rct2: 0x00761160 + */ +TRACK_PAINT_FUNCTION get_track_paint_function_50_52_53_54(int trackType, int direction) { + switch (trackType) { + case 118: + case 121: + return ride_50_52_53_54_paint_setup; + } + return NULL; +} diff --git a/src/ride/shops/shop.c b/src/ride/shops/shop.c new file mode 100644 index 0000000000..bc52cb8e15 --- /dev/null +++ b/src/ride/shops/shop.c @@ -0,0 +1,84 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../track_paint.h" + +/** + * + * rct2: 0x00761378 + * rct2: 0x007614DB + * rct2: 0x0076163F + * rct2: 0x007617A5 + */ +static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) +{ + bool hasSupports = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL); + + RCT2_GLOBAL(0x0141E9D0, sint16) = -1; + RCT2_GLOBAL(0x0141E9C4, sint16) = -1; + RCT2_GLOBAL(0x0141E9CC, sint16) = -1; + RCT2_GLOBAL(0x0141E9B8, sint16) = -1; + RCT2_GLOBAL(0x0141E9BC, sint16) = -1; + RCT2_GLOBAL(0x0141E9B4, sint16) = -1; + RCT2_GLOBAL(0x0141E9C0, sint16) = -1; + RCT2_GLOBAL(0x0141E9C8, sint16) = -1; + RCT2_GLOBAL(0x0141E9D4, sint16) = -1; + + rct_ride *ride = get_ride(rideIndex); + rct_ride_entry *rideEntry = get_ride_entry(ride->subtype); + rct_ride_entry_vehicle *firstVehicleEntry = &rideEntry->vehicles[0]; + + uint32 imageId = RCT2_GLOBAL(0x00F44198, uint32); + if (imageId & 0x80000000) { + imageId &= 0x60FFFFFF; + } + imageId += firstVehicleEntry->base_image_id; + imageId += direction; + + sint16 height16 = (sint16)height; + int rotation = get_current_rotation(); + if (hasSupports) { + uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32); + foundationImageId |= 3395; + sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); + + sub_98199C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); + } else { + sub_98197C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); + } + + height16 += 48; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height16) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height16; + RCT2_GLOBAL(0x00141E9DA, uint8) = 32; + } +} + +/* 0x00761160 */ +TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction) +{ + switch (trackType) { + case 118: + case 121: return shop_paint_setup; + } + return NULL; +} diff --git a/src/ride/thrill/3d_cinema.c b/src/ride/thrill/3d_cinema.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/thrill/3d_cinema.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/thrill/enterprise.c b/src/ride/thrill/enterprise.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/thrill/enterprise.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/thrill/go_karts.c b/src/ride/thrill/go_karts.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/thrill/go_karts.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/thrill/launched_freefall.c b/src/ride/thrill/launched_freefall.c new file mode 100644 index 0000000000..c50ed61da6 --- /dev/null +++ b/src/ride/thrill/launched_freefall.c @@ -0,0 +1,65 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../config.h" +#include "../../interface/viewport.h" +#include "../../world/sprite.h" +#include "../../paint/paint.h" + +/** + * + * rct2: 0x006D5FAB + */ +void vehicle_visual_launched_freefall(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) +{ + int image_id; + int baseImage_id = vehicleEntry->base_image_id + ((vehicle->restraints_position / 64) * 2); + + // Draw back: + image_id = (baseImage_id + 2) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; + sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, get_current_rotation()); + + // Draw front: + image_id = (baseImage_id + 1) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; + sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); + + // Draw peeps: + if (RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*)->zoom_level < 2) { + if (vehicle->num_peeps > 0) { + baseImage_id = vehicleEntry->base_image_id + 9; + if ((vehicle->restraints_position / 64) == 3) { + baseImage_id += 2; // Draw peeps sitting without transparent area between them for restraints + } + image_id = (baseImage_id + ((((imageDirection / 8) + 0) & 3) * 3)) | (vehicle->peep_tshirt_colours[0] << 19) | (vehicle->peep_tshirt_colours[1] << 24) | 0xA0000000; + sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); + if (vehicle->num_peeps > 2) { + image_id = (baseImage_id + ((((imageDirection / 8) + 1) & 3) * 3)) | (vehicle->peep_tshirt_colours[2] << 19) | (vehicle->peep_tshirt_colours[3] << 24) | 0xA0000000; + sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); + } + if (vehicle->num_peeps > 4) { + image_id = (baseImage_id + ((((imageDirection / 8) + 2) & 3) * 3)) | (vehicle->peep_tshirt_colours[4] << 19) | (vehicle->peep_tshirt_colours[5] << 24) | 0xA0000000; + sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); + } + if (vehicle->num_peeps > 6) { + image_id = (baseImage_id + ((((imageDirection / 8) + 3) & 3) * 3)) | (vehicle->peep_tshirt_colours[6] << 19) | (vehicle->peep_tshirt_colours[7] << 24) | 0xA0000000; + sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); + } + } + } + + assert(vehicleEntry->pad_5E == 1); +} diff --git a/src/ride/thrill/magic_carpet.c b/src/ride/thrill/magic_carpet.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/thrill/magic_carpet.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/thrill/motion_simulator.c b/src/ride/thrill/motion_simulator.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/thrill/motion_simulator.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/thrill/pirate_ship.c b/src/ride/thrill/pirate_ship.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/thrill/pirate_ship.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/thrill/roto_drop.c b/src/ride/thrill/roto_drop.c new file mode 100644 index 0000000000..201b7f598b --- /dev/null +++ b/src/ride/thrill/roto_drop.c @@ -0,0 +1,72 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../config.h" +#include "../../interface/viewport.h" +#include "../../world/sprite.h" +#include "../../paint/paint.h" + +/** + * + * rct2: 0x006D5DA9 + */ +void vehicle_visual_roto_drop(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) +{ + int image_id; + int baseImage_id = (vehicleEntry->base_image_id + 4) + ((vehicle->var_C5 / 4) & 0x3); + if (vehicle->restraints_position >= 64) { + baseImage_id += 7; + baseImage_id += (vehicle->restraints_position / 64); + } + + // Draw back: + image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; + sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, get_current_rotation()); + + // Draw front: + image_id = (baseImage_id + 4) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; + sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); + + uint8 riding_peep_sprites[64]; + memset(riding_peep_sprites, 0xFF, sizeof(riding_peep_sprites)); + for (int i = 0; i < vehicle->num_peeps; i++) { + uint8 cl = (i & 3) * 16; + cl += (i & 0xFC); + cl += vehicle->var_C5 / 4; + cl += (imageDirection / 8) * 16; + cl &= 0x3F; + riding_peep_sprites[cl] = vehicle->peep_tshirt_colours[i]; + } + + // Draw riding peep sprites in back to front order: + for (int j = 0; j <= 48; j++) { + int i = (j % 2) ? (48 - (j / 2)) : (j / 2); + if (riding_peep_sprites[i] != 0xFF) { + baseImage_id = vehicleEntry->base_image_id + 20 + i; + if (vehicle->restraints_position >= 64) { + baseImage_id += 64; + baseImage_id += vehicle->restraints_position / 64; + } + image_id = baseImage_id | (riding_peep_sprites[i] << 19) | 0x20000000; + sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); + } + }; + + assert(vehicleEntry->pad_5E == 1); + // 0x5E is treated as another car_visual paint setup jump table like in viewport_vehicle_paint_setup + // in the original code right here but appears to only ever be 1 which goes to a nullsub so it was taken out. +} diff --git a/src/ride/thrill/swinging_inverter_ship.c b/src/ride/thrill/swinging_inverter_ship.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/thrill/swinging_inverter_ship.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/thrill/top_spin.c b/src/ride/thrill/top_spin.c new file mode 100644 index 0000000000..1e753d000e --- /dev/null +++ b/src/ride/thrill/top_spin.c @@ -0,0 +1,855 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../../addresses.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/paint.h" +#include "../../localisation/localisation.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +/** + * + * rct2: 0x0076687C + */ +static void top_spin_paint_tile_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 112; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/* rct2: 0x007667AE */ +static rct_xy16 loc_7667AE[] = { + { .x = 0, .y = -1 }, + { .x = 1, .y = 0 }, + { .x = 0, .y = 1}, + { .x = -1, .y = 0 }, +}; + +/* rct2: 0x007667AC */ +static rct_xy16 loc_7667AC[] = { + { .x = -1, .y = 0 }, + { .x = 0, .y = -1 }, + { .x = 1, .y = 0 }, + { .x = 0, .y = 1 }, +}; + +/** + * + * rct2: 0x0142811C + * Can be calculated as Rounddown(34*sin(x)+0.5) + * where x is in 7.5 deg segments. + */ +static sint8 TopSpinSeatPositionOffset[] = { + 0, 4, 9, 13, 17, 21, 24, 27, 29, 31, 33, 34, 34, 34, 33, 31, + 29, 27, 24, 21, 17, 13, 9, 4, 0, -3, -8, -12, -16, -20, -23, -26, + -28, -30, -32, -33, -33, -33, -32, -30, -28, -26, -23, -20, -16, -12, -8, -3, + 0 +}; + +/** + * + * rct2: 0x0076750D + */ +static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction, int height, rct_map_element* mapElement) { + uint16 boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ; + // As we will be drawing a vehicle we need to backup the mapElement that + // is assigned to the drawings. + rct_map_element* curMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*); + + height += 3; + + rct_ride* ride = get_ride(rideIndex); + rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); + rct_vehicle* vehicle = NULL; + + uint8 seatRotation = 0; + sint8 armRotation = 0; + + if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && + ride->vehicles[0] != SPRITE_INDEX_NULL) { + vehicle = GET_VEHICLE(ride->vehicles[0]); + + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_SPRITE; + RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle; + + armRotation = vehicle->vehicle_sprite_type; + seatRotation = vehicle->bank_rotation; + } + + boundBoxOffsetX = al + 16; + boundBoxOffsetY = cl + 16; + boundBoxOffsetZ = height; + + //di + uint8 lengthX = 24; + //si + uint8 lengthY = 24; + + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + if (image_id == 0x20000000) { + image_id = + 0xA0000000 | + (ride->track_colour_main[0] << 19) | + (ride->track_colour_supports[0] << 24); + } + + image_id += (direction & 1) << 1; + image_id += rideEntry->vehicles[0].base_image_id; + // Left back bottom support + image_id += 572; + sub_98197C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + + image_id = RCT2_GLOBAL(0x00F441A0, uint32); + if (image_id == 0x20000000) { + image_id = + 0xA0000000 | + (ride->track_colour_main[0] << 19) | + (ride->track_colour_additional[0] << 24); + } + + sint32 var_1F = armRotation; + if (direction & 2) { + var_1F = -var_1F; + if (var_1F != 0) + var_1F += 48; + } + image_id += var_1F; + image_id += (direction & 1) * 48; + image_id += rideEntry->vehicles[0].base_image_id; + // Left hand arm + image_id += 380; + + sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + + uint32 seatImageId; + + if (vehicle != NULL && vehicle->restraints_position >= 64) { + // Open Restraints + image_id = (vehicle->restraints_position - 64) >> 6; + image_id += direction * 3; + image_id += rideEntry->vehicles[0].base_image_id; + image_id += 64; + seatImageId = image_id; + } + else { + image_id = direction * 16; + // Var_20 Rotation of seats + image_id += seatRotation; + image_id += rideEntry->vehicles[0].base_image_id; + seatImageId = image_id; + } + + image_id = RCT2_GLOBAL(0x00F441A0, uint32); + if (image_id == 0x20000000) { + image_id = + 0xA0000000 | + (ride->vehicle_colours[0].body_colour << 19) | + (ride->vehicle_colours[0].trim_colour << 24); + } + image_id += seatImageId; + + rct_xyz16 seatCoords = { + .x = al, + .y = cl, + .z = height + }; + seatCoords.z += RCT2_ADDRESS(0x14280BC, sint16)[armRotation]; + + assert(armRotation < sizeof(TopSpinSeatPositionOffset)); + switch (direction) { + case 0: + seatCoords.x -= TopSpinSeatPositionOffset[armRotation]; + break; + case 1: + seatCoords.y += TopSpinSeatPositionOffset[armRotation]; + break; + case 2: + seatCoords.x += TopSpinSeatPositionOffset[armRotation]; + break; + case 3: + seatCoords.y -= TopSpinSeatPositionOffset[armRotation]; + break; + } + + RCT2_GLOBAL(0x014280B8, sint8) = (sint8)seatCoords.x; + RCT2_GLOBAL(0x014280B9, sint8) = (sint8)seatCoords.y; + RCT2_GLOBAL(0x014280BA, sint16) = seatCoords.z; + + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + + rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + if (dpi->zoom_level < 2 && vehicle != NULL && vehicle->num_peeps != 0) { + image_id = + (vehicle->peep_tshirt_colours[0] << 19) | + (vehicle->peep_tshirt_colours[1] << 24); + image_id += seatImageId; + image_id += 0xA0000000; + image_id += 76; + + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + + if (vehicle->num_peeps > 2) { + image_id = + (vehicle->peep_tshirt_colours[2] << 19) | + (vehicle->peep_tshirt_colours[3] << 24); + image_id += seatImageId; + image_id += 0xA0000000; + image_id += 152; + + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + } + + if (vehicle->num_peeps > 4) { + image_id = + (vehicle->peep_tshirt_colours[4] << 19) | + (vehicle->peep_tshirt_colours[5] << 24); + image_id += seatImageId; + image_id += 0xA0000000; + image_id += 228; + + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + } + + if (vehicle->num_peeps > 6) { + image_id = + (vehicle->peep_tshirt_colours[6] << 19) | + (vehicle->peep_tshirt_colours[7] << 24); + image_id += seatImageId; + image_id += 0xA0000000; + image_id += 304; + + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + } + } + + image_id = RCT2_GLOBAL(0x00F441A0, uint32); + if (image_id == 0x20000000) { + image_id = + 0xA0000000 | + (ride->track_colour_main[0] << 19) | + (ride->track_colour_additional[0] << 24); + } + + image_id += var_1F; + image_id += (direction & 1) * 48; + image_id += rideEntry->vehicles[0].base_image_id; + // Right hand arm + image_id += 476; + + sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + + image_id = RCT2_GLOBAL(0x00F441A0, uint32); + if (image_id == 0x20000000) { + image_id = + 0xA0000000 | + (ride->track_colour_main[0] << 19) | + (ride->track_colour_supports[0] << 24); + } + + image_id += (direction & 1) << 1; + image_id += rideEntry->vehicles[0].base_image_id; + // Right back bottom support + image_id += 573; + + sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + + RCT2_GLOBAL(0x009DE578, rct_map_element*) = curMapElement; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_RIDE; +} + +/** + * + * rct2: 0x0076693F + */ +static void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint16 entranceLoc = + ((x / 32) + loc_7667AE[get_current_rotation()].x) | + (((y / 32) + loc_7667AE[get_current_rotation()].y) << 8); + + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride* ride = get_ride(rideIndex); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation()); + } + + entranceLoc = + ((x / 32) + loc_7667AC[get_current_rotation()].x) | + (((y / 32) + loc_7667AC[get_current_rotation()].y) << 8); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0, 2, height + 2, get_current_rotation()); + } + + top_spin_paint_vehicle(32, 32, rideIndex, direction, height, mapElement); + + RCT2_GLOBAL(0x141E9B4, uint16) = height + 2; + RCT2_GLOBAL(0x141E9B6, uint16) = 32; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = height + 2; + RCT2_GLOBAL(0x141E9CA, uint16) = 32; + RCT2_GLOBAL(0x141E9CC, uint16) = height + 2; + RCT2_GLOBAL(0x141E9CE, uint16) = 32; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 110; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x00767033 + */ +static void top_spin_paint_tile_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint16 entranceLoc = + ((x / 32) + loc_7667AC[get_current_rotation()].x) | + (((y / 32) + loc_7667AC[get_current_rotation()].y) << 8); + + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride* ride = get_ride(rideIndex); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, get_current_rotation()); + } + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 110; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x0076718D + */ +static void top_spin_paint_tile_4(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint16 entranceLoc = + ((x / 32) + loc_7667AE[get_current_rotation()].x) | + (((y / 32) + loc_7667AE[get_current_rotation()].y) << 8); + + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride* ride = get_ride(rideIndex); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation()); + } + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 110; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x00766B4C + */ +static void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22136 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint16 entranceLoc = + ((x / 32) + loc_7667AC[get_current_rotation()].x) | + (((y / 32) + loc_7667AC[get_current_rotation()].y) << 8); + + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride* ride = get_ride(rideIndex); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, get_current_rotation()); + } + + entranceLoc = + ((x / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].x) | + (((y / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].y) << 8); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + + image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(image_id, 0, 0, 32, 1, 7, height, 0, 30, height + 2, get_current_rotation()); + } + + top_spin_paint_vehicle(32, -32, rideIndex, direction, height, mapElement); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = height + 2; + RCT2_GLOBAL(0x141E9BE, uint16) = 32; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = height + 2; + RCT2_GLOBAL(0x141E9CE, uint16) = 32; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = height + 2; + RCT2_GLOBAL(0x141E9D6, uint16) = 32; + + height += 110; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x007672E7 + */ +static void top_spin_paint_tile_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22136 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride* ride = get_ride(rideIndex); + + uint16 entranceLoc = + ((x / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].x) | + (((y / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].y) << 8); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(image_id, 0, 0, 32, 1, 7, height, 0, 30, height + 2, get_current_rotation()); + } + + top_spin_paint_vehicle(0, -32, rideIndex, direction, height, mapElement); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 112; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x00766D09 + */ +static void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22135 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint16 entranceLoc = + ((x / 32) + loc_7667AE[get_current_rotation()].x) | + (((y / 32) + loc_7667AE[get_current_rotation()].y) << 8); + + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride* ride = get_ride(rideIndex); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation()); + } + + entranceLoc = + ((x / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].x) | + (((y / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].y) << 8); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + + image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(image_id, 0, 0, 1, 32, 7, height, 30, 2, height + 2, get_current_rotation()); + } + + top_spin_paint_vehicle(-32, 32, rideIndex, direction, height, mapElement); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = height + 2; + RCT2_GLOBAL(0x141E9BA, uint16) = 32; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = height + 2; + RCT2_GLOBAL(0x141E9CA, uint16) = 32; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = height + 2; + RCT2_GLOBAL(0x141E9D2, uint16) = 32; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 110; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x00766EC6 + */ +static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22134 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride* ride = get_ride(rideIndex); + + uint16 entranceLoc = + ((x / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].x) | + (((y / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].y) << 8); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + + image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(image_id, 0, 0, 1, 28, 7, height, 29, 0, height + 3, get_current_rotation()); + } + + entranceLoc = + ((x / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].x) | + (((y / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].y) << 8); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + + image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(image_id, 0, 0, 28, 1, 7, height, 0, 29, height + 3, get_current_rotation()); + } + + top_spin_paint_vehicle(-32, -32, rideIndex, direction, height, mapElement); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = height + 2; + RCT2_GLOBAL(0x141E9C2, uint16) = 32; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = height + 2; + RCT2_GLOBAL(0x141E9D2, uint16) = 32; + RCT2_GLOBAL(0x141E9D4, uint16) = height + 2; + RCT2_GLOBAL(0x141E9D6, uint16) = 32; + + height += 110; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x007673FA + */ +static void top_spin_paint_tile_8(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + image_id = 22135 | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride* ride = get_ride(rideIndex); + + uint16 entranceLoc = + ((x / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].x) | + (((y / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].y) << 8); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + + image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(image_id, 0, 0, 1, 32, 7, height, 30, 0, height + 2, get_current_rotation()); + } + top_spin_paint_vehicle(-32, 0, rideIndex, direction, height, mapElement); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 112; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +/** + * + * rct2: 0x007667BC + */ +static void top_spin_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + switch (trackSequence) + { + case 0: + top_spin_paint_tile_0(rideIndex, trackSequence, direction, height, mapElement); + break; + case 1: + top_spin_paint_tile_1(rideIndex, trackSequence, direction, height, mapElement); + break; + case 2: + top_spin_paint_tile_2(rideIndex, trackSequence, direction, height, mapElement); + break; + case 3: + top_spin_paint_tile_3(rideIndex, trackSequence, direction, height, mapElement); + break; + case 4: + top_spin_paint_tile_4(rideIndex, trackSequence, direction, height, mapElement); + break; + case 5: + top_spin_paint_tile_5(rideIndex, trackSequence, direction, height, mapElement); + break; + case 6: + top_spin_paint_tile_6(rideIndex, trackSequence, direction, height, mapElement); + break; + case 7: + top_spin_paint_tile_7(rideIndex, trackSequence, direction, height, mapElement); + break; + case 8: + top_spin_paint_tile_8(rideIndex, trackSequence, direction, height, mapElement); + break; + } + return; +} + +/** + * + * rct2: 0x007667EC +*/ +static void top_spin_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + switch (trackSequence) + { + case 0: + top_spin_paint_tile_0(rideIndex, trackSequence, direction, height, mapElement); + break; + case 1: + top_spin_paint_tile_3(rideIndex, trackSequence, direction, height, mapElement); + break; + case 2: + top_spin_paint_tile_5(rideIndex, trackSequence, direction, height, mapElement); + break; + case 3: + top_spin_paint_tile_7(rideIndex, trackSequence, direction, height, mapElement); + break; + case 4: + top_spin_paint_tile_2(rideIndex, trackSequence, direction, height, mapElement); + break; + case 5: + top_spin_paint_tile_8(rideIndex, trackSequence, direction, height, mapElement); + break; + case 6: + top_spin_paint_tile_1(rideIndex, trackSequence, direction, height, mapElement); + break; + case 7: + top_spin_paint_tile_6(rideIndex, trackSequence, direction, height, mapElement); + break; + case 8: + top_spin_paint_tile_4(rideIndex, trackSequence, direction, height, mapElement); + break; + } + return; +} + +/** + * + * rct2: 0x0076681C +*/ +static void top_spin_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + switch (trackSequence) + { + case 0: + top_spin_paint_tile_0(rideIndex, trackSequence, direction, height, mapElement); + break; + case 1: + top_spin_paint_tile_7(rideIndex, trackSequence, direction, height, mapElement); + break; + case 2: + top_spin_paint_tile_8(rideIndex, trackSequence, direction, height, mapElement); + break; + case 3: + top_spin_paint_tile_6(rideIndex, trackSequence, direction, height, mapElement); + break; + case 4: + top_spin_paint_tile_5(rideIndex, trackSequence, direction, height, mapElement); + break; + case 5: + top_spin_paint_tile_4(rideIndex, trackSequence, direction, height, mapElement); + break; + case 6: + top_spin_paint_tile_3(rideIndex, trackSequence, direction, height, mapElement); + break; + case 7: + top_spin_paint_tile_1(rideIndex, trackSequence, direction, height, mapElement); + break; + case 8: + top_spin_paint_tile_2(rideIndex, trackSequence, direction, height, mapElement); + break; + } + return; +} + +/** + * + * rct2: 0x0076684C +*/ +static void top_spin_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { + switch (trackSequence) + { + case 0: + top_spin_paint_tile_0(rideIndex, trackSequence, direction, height, mapElement); + break; + case 1: + top_spin_paint_tile_6(rideIndex, trackSequence, direction, height, mapElement); + break; + case 2: + top_spin_paint_tile_4(rideIndex, trackSequence, direction, height, mapElement); + break; + case 3: + top_spin_paint_tile_1(rideIndex, trackSequence, direction, height, mapElement); + break; + case 4: + top_spin_paint_tile_8(rideIndex, trackSequence, direction, height, mapElement); + break; + case 5: + top_spin_paint_tile_2(rideIndex, trackSequence, direction, height, mapElement); + break; + case 6: + top_spin_paint_tile_7(rideIndex, trackSequence, direction, height, mapElement); + break; + case 7: + top_spin_paint_tile_3(rideIndex, trackSequence, direction, height, mapElement); + break; + case 8: + top_spin_paint_tile_5(rideIndex, trackSequence, direction, height, mapElement); + break; + } + return; +} + +/* 0x0076659C */ +TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction) +{ + switch (trackType) { + case 123: + switch (direction) { + case 0: return top_spin_paint_setup_rot_0; + case 1: return top_spin_paint_setup_rot_1; + case 2: return top_spin_paint_setup_rot_2; + case 3: return top_spin_paint_setup_rot_3; + } + break; + } + return NULL; +} diff --git a/src/ride/thrill/twist.c b/src/ride/thrill/twist.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/thrill/twist.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 54b1045235..6d5421ae3b 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -17,8 +17,9 @@ #include "../addresses.h" #include "../config.h" #include "../drawing/drawing.h" -#include "../drawing/supports.h" +#include "../paint/supports.h" #include "../interface/viewport.h" +#include "../paint/paint.h" #include "../interface/window.h" #include "../localisation/localisation.h" #include "../sprites.h" @@ -30,1187 +31,110 @@ /** * - * rct2: 0x0076687C + * rct2: 0x006C4794 */ -static void top_spin_paint_tile_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); +void track_paint(uint8 direction, int height, rct_map_element *mapElement) +{ + rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); + rct_ride *ride; + int rideIndex, trackType, trackColourScheme, trackSequence; - image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += 112; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/* rct2: 0x007667AE */ -static rct_xy16 loc_7667AE[] = { - { .x = 0, .y = -1 }, - { .x = 1, .y = 0 }, - { .x = 0, .y = 1}, - { .x = -1, .y = 0 }, -}; - -/* rct2: 0x007667AC */ -static rct_xy16 loc_7667AC[] = { - { .x = -1, .y = 0 }, - { .x = 0, .y = -1 }, - { .x = 1, .y = 0 }, - { .x = 0, .y = 1 }, -}; - -/** - * - * rct2: 0x0142811C - * Can be calculated as Rounddown(34*sin(x)+0.5) - * where x is in 7.5 deg segments. - */ -static sint8 TopSpinSeatPositionOffset[] = { - 0, 4, 9, 13, 17, 21, 24, 27, 29, 31, 33, 34, 34, 34, 33, 31, - 29, 27, 24, 21, 17, 13, 9, 4, 0, -3, -8, -12, -16, -20, -23, -26, - -28, -30, -32, -33, -33, -33, -32, -30, -28, -26, -23, -20, -16, -12, -8, -3, - 0 -}; - -/** - * - * rct2: 0x0076750D - */ -static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction, int height, rct_map_element* mapElement) { - uint16 boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ; - // As we will be drawing a vehicle we need to backup the mapElement that - // is assigned to the drawings. - rct_map_element* curMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*); - - height += 3; - - rct_ride* ride = get_ride(rideIndex); - rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); - rct_vehicle* vehicle = NULL; - - uint8 seatRotation = 0; - sint8 armRotation = 0; - - if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && - ride->vehicles[0] != SPRITE_INDEX_NULL) { - vehicle = GET_VEHICLE(ride->vehicles[0]); - - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_SPRITE; - RCT2_GLOBAL(0x009DE578, rct_vehicle*) = vehicle; - - armRotation = vehicle->vehicle_sprite_type; - seatRotation = vehicle->bank_rotation; + rideIndex = mapElement->properties.track.ride_index; + ride = get_ride(rideIndex); + if (ride->type == RIDE_TYPE_NULL) { + log_error("Attempted to paint invalid ride: %d", rideIndex); + return; } - boundBoxOffsetX = al + 16; - boundBoxOffsetY = cl + 16; - boundBoxOffsetZ = height; - - //di - uint8 lengthX = 24; - //si - uint8 lengthY = 24; - - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - if (image_id == 0x20000000) { - image_id = - 0xA0000000 | - (ride->track_colour_main[0] << 19) | - (ride->track_colour_supports[0] << 24); + // HACK Set entrance style to plain if none to stop glitch until entrance track piece is implemented + bool isEntranceStyleNone = false; + if (ride->entrance_style == RIDE_ENTRANCE_STYLE_NONE) { + isEntranceStyleNone = true; + ride->entrance_style = RIDE_ENTRANCE_STYLE_PLAIN; } - image_id += (direction & 1) << 1; - image_id += rideEntry->vehicles[0].base_image_id; - // Left back bottom support - image_id += 572; - sub_98197C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + if (!(RCT2_GLOBAL(0x009DEA6F, uint8) & 1) || rideIndex == RCT2_GLOBAL(0x00F64DE8, uint8)) { + trackType = mapElement->properties.track.type; + trackSequence = mapElement->properties.track.sequence & 0x0F; + trackColourScheme = mapElement->properties.track.colour & 3; - image_id = RCT2_GLOBAL(0x00F441A0, uint32); - if (image_id == 0x20000000) { - image_id = - 0xA0000000 | - (ride->track_colour_main[0] << 19) | - (ride->track_colour_additional[0] << 24); - } - - sint32 var_1F = armRotation; - if (direction & 2) { - var_1F = -var_1F; - if (var_1F != 0) - var_1F += 48; - } - image_id += var_1F; - image_id += (direction & 1) * 48; - image_id += rideEntry->vehicles[0].base_image_id; - // Left hand arm - image_id += 380; - - sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); - - uint32 seatImageId; - - if (vehicle != NULL && vehicle->restraints_position >= 64) { - // Open Restraints - image_id = (vehicle->restraints_position - 64) >> 6; - image_id += direction * 3; - image_id += rideEntry->vehicles[0].base_image_id; - image_id += 64; - seatImageId = image_id; - } - else { - image_id = direction * 16; - // Var_20 Rotation of seats - image_id += seatRotation; - image_id += rideEntry->vehicles[0].base_image_id; - seatImageId = image_id; - } - - image_id = RCT2_GLOBAL(0x00F441A0, uint32); - if (image_id == 0x20000000) { - image_id = - 0xA0000000 | - (ride->vehicle_colours[0].body_colour << 19) | - (ride->vehicle_colours[0].trim_colour << 24); - } - image_id += seatImageId; - - rct_xyz16 seatCoords = { - .x = al, - .y = cl, - .z = height - }; - seatCoords.z += RCT2_ADDRESS(0x14280BC, sint16)[armRotation]; - - assert(armRotation < sizeof(TopSpinSeatPositionOffset)); - switch (direction) { - case 0: - seatCoords.x -= TopSpinSeatPositionOffset[armRotation]; - break; - case 1: - seatCoords.y += TopSpinSeatPositionOffset[armRotation]; - break; - case 2: - seatCoords.x += TopSpinSeatPositionOffset[armRotation]; - break; - case 3: - seatCoords.y -= TopSpinSeatPositionOffset[armRotation]; - break; - } - - RCT2_GLOBAL(0x014280B8, sint8) = (sint8)seatCoords.x; - RCT2_GLOBAL(0x014280B9, sint8) = (sint8)seatCoords.y; - RCT2_GLOBAL(0x014280BA, sint16) = seatCoords.z; - - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); - - rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); - if (dpi->zoom_level < 2 && vehicle != NULL && vehicle->num_peeps != 0) { - image_id = - (vehicle->peep_tshirt_colours[0] << 19) | - (vehicle->peep_tshirt_colours[1] << 24); - image_id += seatImageId; - image_id += 0xA0000000; - image_id += 76; - - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); - - if (vehicle->num_peeps > 2) { - image_id = - (vehicle->peep_tshirt_colours[2] << 19) | - (vehicle->peep_tshirt_colours[3] << 24); - image_id += seatImageId; - image_id += 0xA0000000; - image_id += 152; - - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + if ((gCurrentViewportFlags & VIEWPORT_FLAG_TRACK_HEIGHTS) && dpi->zoom_level == 0) { + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 0; + if (RCT2_ADDRESS(0x00999694, uint32)[trackType] & (1 << trackSequence)) { + uint16 ax = RideData5[ride->type].z_offset; + uint32 ebx = 0x20381689 + (height + 8) / 16; + ebx += RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, uint16); + ebx -= RCT2_GLOBAL(0x01359208, uint16); + sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, 1000, 1000, 2047, get_current_rotation()); + } } - if (vehicle->num_peeps > 4) { - image_id = - (vehicle->peep_tshirt_colours[4] << 19) | - (vehicle->peep_tshirt_colours[5] << 24); - image_id += seatImageId; - image_id += 0xA0000000; - image_id += 228; - - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 3; + RCT2_GLOBAL(0x00F44198, uint32) = (ride->track_colour_main[trackColourScheme] << 19) | (ride->track_colour_additional[trackColourScheme] << 24) | 0xA0000000; + RCT2_GLOBAL(0x00F441A0, uint32) = 0x20000000; + RCT2_GLOBAL(0x00F441A4, uint32) = 0x20C00000; + RCT2_GLOBAL(0x00F4419C, uint32) = (ride->track_colour_supports[trackColourScheme] << 19) | 0x20000000; + if (mapElement->type & 0x40) { + RCT2_GLOBAL(0x00F44198, uint32) = 0x21600000; + RCT2_GLOBAL(0x00F4419C, uint32) = 0x21600000; + RCT2_GLOBAL(0x00F441A0, uint32) = 0x21600000; + RCT2_GLOBAL(0x00F441A4, uint32) = 0x21600000; + } + if (mapElement->flags & MAP_ELEMENT_FLAG_GHOST) { + uint32 ghost_id = RCT2_ADDRESS(0x00993CC4, uint32)[gConfigGeneral.construction_marker_colour]; + RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = 0; + RCT2_GLOBAL(0x00F44198, uint32) = ghost_id; + RCT2_GLOBAL(0x00F4419C, uint32) = ghost_id; + RCT2_GLOBAL(0x00F441A0, uint32) = ghost_id; + RCT2_GLOBAL(0x00F441A4, uint32) = ghost_id; } - if (vehicle->num_peeps > 6) { - image_id = - (vehicle->peep_tshirt_colours[6] << 19) | - (vehicle->peep_tshirt_colours[7] << 24); - image_id += seatImageId; - image_id += 0xA0000000; - image_id += 304; + int rideType = ride->type; + if (rideType == RIDE_TYPE_JUNIOR_ROLLER_COASTER) { + switch (trackType) { + case TRACK_ELEM_60_DEG_UP: + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + case TRACK_ELEM_60_DEG_DOWN: + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + rideType = RIDE_TYPE_WATER_COASTER; + break; - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); + case TRACK_ELEM_FLAT_TO_60_DEG_UP: + case TRACK_ELEM_60_DEG_UP_TO_FLAT: + case TRACK_ELEM_FLAT_TO_60_DEG_DOWN: + case TRACK_ELEM_60_DEG_DOWN_TO_FLAT: + return; + } + } + + TRACK_PAINT_FUNCTION **trackTypeList = (TRACK_PAINT_FUNCTION**)RideTypeTrackPaintFunctionsOld[rideType]; + if (trackTypeList == NULL) { + TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = RideTypeTrackPaintFunctions[rideType]; + TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType, direction); + if (paintFunction != NULL) { + paintFunction(rideIndex, trackSequence, direction, height, mapElement); + } + } + else { + uint32 *trackDirectionList = (uint32*)trackTypeList[trackType]; + + // Have to call from this point as it pushes esi and expects callee to pop it + RCT2_CALLPROC_X( + 0x006C4934, + rideType, + (int)trackDirectionList, + direction, + height, + (int)mapElement, + rideIndex * sizeof(rct_ride), + trackSequence + ); } } - image_id = RCT2_GLOBAL(0x00F441A0, uint32); - if (image_id == 0x20000000) { - image_id = - 0xA0000000 | - (ride->track_colour_main[0] << 19) | - (ride->track_colour_additional[0] << 24); - } - - image_id += var_1F; - image_id += (direction & 1) * 48; - image_id += rideEntry->vehicles[0].base_image_id; - // Right hand arm - image_id += 476; - - sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); - - image_id = RCT2_GLOBAL(0x00F441A0, uint32); - if (image_id == 0x20000000) { - image_id = - 0xA0000000 | - (ride->track_colour_main[0] << 19) | - (ride->track_colour_supports[0] << 24); - } - - image_id += (direction & 1) << 1; - image_id += rideEntry->vehicles[0].base_image_id; - // Right back bottom support - image_id += 573; - - sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation()); - - RCT2_GLOBAL(0x009DE578, rct_map_element*) = curMapElement; - RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_RIDE; -} - -/** - * - * rct2: 0x0076693F - */ -static void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); - uint16 entranceLoc = - ((x / 32) + loc_7667AE[get_current_rotation()].x) | - (((y / 32) + loc_7667AE[get_current_rotation()].y) << 8); - - uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; - rct_ride* ride = get_ride(rideIndex); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation()); - } - - entranceLoc = - ((x / 32) + loc_7667AC[get_current_rotation()].x) | - (((y / 32) + loc_7667AC[get_current_rotation()].y) << 8); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0, 2, height + 2, get_current_rotation()); - } - - top_spin_paint_vehicle(32, 32, rideIndex, direction, height, mapElement); - - RCT2_GLOBAL(0x141E9B4, uint16) = height + 2; - RCT2_GLOBAL(0x141E9B6, uint16) = 32; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = height + 2; - RCT2_GLOBAL(0x141E9CA, uint16) = 32; - RCT2_GLOBAL(0x141E9CC, uint16) = height + 2; - RCT2_GLOBAL(0x141E9CE, uint16) = 32; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += 110; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; + if (isEntranceStyleNone) { + ride->entrance_style = RIDE_ENTRANCE_STYLE_NONE; } } - -/** - * - * rct2: 0x00767033 - */ -static void top_spin_paint_tile_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); - uint16 entranceLoc = - ((x / 32) + loc_7667AC[get_current_rotation()].x) | - (((y / 32) + loc_7667AC[get_current_rotation()].y) << 8); - - uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; - rct_ride* ride = get_ride(rideIndex); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, get_current_rotation()); - } - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += 110; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x0076718D - */ -static void top_spin_paint_tile_4(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); - uint16 entranceLoc = - ((x / 32) + loc_7667AE[get_current_rotation()].x) | - (((y / 32) + loc_7667AE[get_current_rotation()].y) << 8); - - uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; - rct_ride* ride = get_ride(rideIndex); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation()); - } - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += 110; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x00766B4C - */ -static void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - image_id = 22136 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); - uint16 entranceLoc = - ((x / 32) + loc_7667AC[get_current_rotation()].x) | - (((y / 32) + loc_7667AC[get_current_rotation()].y) << 8); - - uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; - rct_ride* ride = get_ride(rideIndex); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, get_current_rotation()); - } - - entranceLoc = - ((x / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].x) | - (((y / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].y) << 8); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - - image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 32, 1, 7, height, 0, 30, height + 2, get_current_rotation()); - } - - top_spin_paint_vehicle(32, -32, rideIndex, direction, height, mapElement); - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = height + 2; - RCT2_GLOBAL(0x141E9BE, uint16) = 32; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = height + 2; - RCT2_GLOBAL(0x141E9CE, uint16) = 32; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = height + 2; - RCT2_GLOBAL(0x141E9D6, uint16) = 32; - - height += 110; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x007672E7 - */ -static void top_spin_paint_tile_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - image_id = 22136 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); - uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; - rct_ride* ride = get_ride(rideIndex); - - uint16 entranceLoc = - ((x / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].x) | - (((y / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].y) << 8); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 32, 1, 7, height, 0, 30, height + 2, get_current_rotation()); - } - - top_spin_paint_vehicle(0, -32, rideIndex, direction, height, mapElement); - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += 112; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x00766D09 - */ -static void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - image_id = 22135 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); - uint16 entranceLoc = - ((x / 32) + loc_7667AE[get_current_rotation()].x) | - (((y / 32) + loc_7667AE[get_current_rotation()].y) << 8); - - uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; - rct_ride* ride = get_ride(rideIndex); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation()); - } - - entranceLoc = - ((x / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].x) | - (((y / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].y) << 8); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - - image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 1, 32, 7, height, 30, 2, height + 2, get_current_rotation()); - } - - top_spin_paint_vehicle(-32, 32, rideIndex, direction, height, mapElement); - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = height + 2; - RCT2_GLOBAL(0x141E9BA, uint16) = 32; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = height + 2; - RCT2_GLOBAL(0x141E9CA, uint16) = 32; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = height + 2; - RCT2_GLOBAL(0x141E9D2, uint16) = 32; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += 110; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x00766EC6 - */ -static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - image_id = 22134 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); - uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; - rct_ride* ride = get_ride(rideIndex); - - uint16 entranceLoc = - ((x / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].x) | - (((y / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].y) << 8); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - - image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 1, 28, 7, height, 29, 0, height + 3, get_current_rotation()); - } - - entranceLoc = - ((x / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].x) | - (((y / 32) + loc_7667AC[(get_current_rotation() + 3) & 3].y) << 8); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - - image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 28, 1, 7, height, 0, 29, height + 3, get_current_rotation()); - } - - top_spin_paint_vehicle(-32, -32, rideIndex, direction, height, mapElement); - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = height + 2; - RCT2_GLOBAL(0x141E9C2, uint16) = 32; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = height + 2; - RCT2_GLOBAL(0x141E9D2, uint16) = 32; - RCT2_GLOBAL(0x141E9D4, uint16) = height + 2; - RCT2_GLOBAL(0x141E9D6, uint16) = 32; - - height += 110; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x007673FA - */ -static void top_spin_paint_tile_8(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); - wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); - - image_id = 22135 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); - - sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); - uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; - rct_ride* ride = get_ride(rideIndex); - - uint16 entranceLoc = - ((x / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].x) | - (((y / 32) + loc_7667AE[(get_current_rotation() + 1) & 3].y) << 8); - - if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { - - image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 1, 32, 7, height, 30, 0, height + 2, get_current_rotation()); - } - top_spin_paint_vehicle(-32, 0, rideIndex, direction, height, mapElement); - - RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; - - height += 112; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 32; - } -} - -/** - * - * rct2: 0x007667BC - */ -static void top_spin_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - switch (trackSequence) - { - case 0: - top_spin_paint_tile_0(rideIndex, trackSequence, direction, height, mapElement); - break; - case 1: - top_spin_paint_tile_1(rideIndex, trackSequence, direction, height, mapElement); - break; - case 2: - top_spin_paint_tile_2(rideIndex, trackSequence, direction, height, mapElement); - break; - case 3: - top_spin_paint_tile_3(rideIndex, trackSequence, direction, height, mapElement); - break; - case 4: - top_spin_paint_tile_4(rideIndex, trackSequence, direction, height, mapElement); - break; - case 5: - top_spin_paint_tile_5(rideIndex, trackSequence, direction, height, mapElement); - break; - case 6: - top_spin_paint_tile_6(rideIndex, trackSequence, direction, height, mapElement); - break; - case 7: - top_spin_paint_tile_7(rideIndex, trackSequence, direction, height, mapElement); - break; - case 8: - top_spin_paint_tile_8(rideIndex, trackSequence, direction, height, mapElement); - break; - } - return; -} - -/** - * - * rct2: 0x007667EC -*/ -static void top_spin_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - switch (trackSequence) - { - case 0: - top_spin_paint_tile_0(rideIndex, trackSequence, direction, height, mapElement); - break; - case 1: - top_spin_paint_tile_3(rideIndex, trackSequence, direction, height, mapElement); - break; - case 2: - top_spin_paint_tile_5(rideIndex, trackSequence, direction, height, mapElement); - break; - case 3: - top_spin_paint_tile_7(rideIndex, trackSequence, direction, height, mapElement); - break; - case 4: - top_spin_paint_tile_2(rideIndex, trackSequence, direction, height, mapElement); - break; - case 5: - top_spin_paint_tile_8(rideIndex, trackSequence, direction, height, mapElement); - break; - case 6: - top_spin_paint_tile_1(rideIndex, trackSequence, direction, height, mapElement); - break; - case 7: - top_spin_paint_tile_6(rideIndex, trackSequence, direction, height, mapElement); - break; - case 8: - top_spin_paint_tile_4(rideIndex, trackSequence, direction, height, mapElement); - break; - } - return; -} - -/** - * - * rct2: 0x0076681C -*/ -static void top_spin_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - switch (trackSequence) - { - case 0: - top_spin_paint_tile_0(rideIndex, trackSequence, direction, height, mapElement); - break; - case 1: - top_spin_paint_tile_7(rideIndex, trackSequence, direction, height, mapElement); - break; - case 2: - top_spin_paint_tile_8(rideIndex, trackSequence, direction, height, mapElement); - break; - case 3: - top_spin_paint_tile_6(rideIndex, trackSequence, direction, height, mapElement); - break; - case 4: - top_spin_paint_tile_5(rideIndex, trackSequence, direction, height, mapElement); - break; - case 5: - top_spin_paint_tile_4(rideIndex, trackSequence, direction, height, mapElement); - break; - case 6: - top_spin_paint_tile_3(rideIndex, trackSequence, direction, height, mapElement); - break; - case 7: - top_spin_paint_tile_1(rideIndex, trackSequence, direction, height, mapElement); - break; - case 8: - top_spin_paint_tile_2(rideIndex, trackSequence, direction, height, mapElement); - break; - } - return; -} - -/** - * - * rct2: 0x0076684C -*/ -static void top_spin_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { - switch (trackSequence) - { - case 0: - top_spin_paint_tile_0(rideIndex, trackSequence, direction, height, mapElement); - break; - case 1: - top_spin_paint_tile_6(rideIndex, trackSequence, direction, height, mapElement); - break; - case 2: - top_spin_paint_tile_4(rideIndex, trackSequence, direction, height, mapElement); - break; - case 3: - top_spin_paint_tile_1(rideIndex, trackSequence, direction, height, mapElement); - break; - case 4: - top_spin_paint_tile_8(rideIndex, trackSequence, direction, height, mapElement); - break; - case 5: - top_spin_paint_tile_2(rideIndex, trackSequence, direction, height, mapElement); - break; - case 6: - top_spin_paint_tile_7(rideIndex, trackSequence, direction, height, mapElement); - break; - case 7: - top_spin_paint_tile_3(rideIndex, trackSequence, direction, height, mapElement); - break; - case 8: - top_spin_paint_tile_5(rideIndex, trackSequence, direction, height, mapElement); - break; - } - return; -} - -/* 0x0076659C */ -TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction) -{ - switch (trackType) { - case 123: - switch (direction) { - case 0: return top_spin_paint_setup_rot_0; - case 1: return top_spin_paint_setup_rot_1; - case 2: return top_spin_paint_setup_rot_2; - case 3: return top_spin_paint_setup_rot_3; - } - break; - } - return NULL; -} - -enum { - SPR_MAZE_BASE_HEDGE = 21938, - SPR_MAZE_BASE_BRICK = 21951, - SPR_MAZE_BASE_ICE = 21964, - SPR_MAZE_BASE_WOOD = 21977, -}; - -enum { - SPR_MAZE_OFFSET_WALL_CENTER = 0, - SPR_MAZE_OFFSET_WALL_INNER_NE_SW, - SPR_MAZE_OFFSET_WALL_INNER_NW_SE, - SPR_MAZE_OFFSET_WALL_TOP_LEFT, - SPR_MAZE_OFFSET_WALL_TOP_RIGHT, - SPR_MAZE_OFFSET_WALL_BOTTOM_RIGHT, - SPR_MAZE_OFFSET_WALL_BOTTOM_LEFT, - SPR_MAZE_OFFSET_COLUMN_CENTER, - SPR_MAZE_OFFSET_COLUMN_TOP_RIGHT, - SPR_MAZE_OFFSET_COLUMN_TOP_LEFT, - SPR_MAZE_OFFSET_COLUMN_BOTTOM_LEFT, - SPR_MAZE_OFFSET_COLUMN_BOTTOM_RIGHT, - SPR_MAZE_OFFSET_COLUMN_CORNER, -}; - -/** - * rct: 0x004ACF4A - */ -static void maze_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { - uint16 maze_entry = mapElement->properties.track.maze_entry; - maze_entry = rol16(maze_entry, direction * 4); - - // draw ground - int image_id = 2485 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98196C(image_id, 0, 0, 32, 32, 0, height, get_current_rotation()); - - wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL); - - RCT2_GLOBAL(0x0141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9D4, uint16) = 0xFFFF; - - int base_image_id; - switch (get_ride(rideIndex)->track_colour_supports[0]) { - case 0: base_image_id = SPR_MAZE_BASE_BRICK; break; - case 1: base_image_id = SPR_MAZE_BASE_HEDGE; break; - case 2: base_image_id = SPR_MAZE_BASE_ICE; break; - case 3: base_image_id = SPR_MAZE_BASE_WOOD; break; - } - - base_image_id |= RCT2_GLOBAL(0x00F441A0, uint32); - - - image_id = base_image_id + SPR_MAZE_OFFSET_WALL_CENTER; - if (maze_entry & (1 << 3)) - sub_98197C(image_id, 2, 2, 10, 10, 9, height, 3, 3, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 7)) - sub_98197C(image_id, 2, 18, 10, 10, 9, height, 3, 19, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 11)) - sub_98197C(image_id, 18, 18, 10, 10, 9, height, 19, 19, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 15)) - sub_98197C(image_id, 18, 2, 10, 10, 9, height, 19, 3, height + 2, get_current_rotation()); - - - image_id = base_image_id + SPR_MAZE_OFFSET_WALL_TOP_LEFT; - if (maze_entry & (1 << 0)) - sub_98197C(image_id, 2, 0, 10, 1, 9, height, 3, 1, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 13)) - sub_98197C(image_id, 18, 0, 10, 1, 9, height, 19, 1, height + 2, get_current_rotation()); - - - image_id = base_image_id + SPR_MAZE_OFFSET_WALL_BOTTOM_RIGHT; - if (maze_entry & (1 << 5)) - sub_98197C(image_id, 2, 30, 10, 1, 9, height, 3, 30, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 8)) - sub_98197C(image_id, 18, 30, 10, 1, 9, height, 19, 30, height + 2, get_current_rotation()); - - - image_id = base_image_id + SPR_MAZE_OFFSET_WALL_TOP_RIGHT; - if (maze_entry & (1 << 1)) - sub_98197C(image_id, 0, 2, 1, 10, 9, height, 1, 3, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 4)) - sub_98197C(image_id, 0, 18, 1, 10, 9, height, 1, 19, height + 2, get_current_rotation()); - - - image_id = base_image_id + SPR_MAZE_OFFSET_WALL_BOTTOM_LEFT; - if (maze_entry & (1 << 12)) - sub_98197C(image_id, 30, 2, 1, 10, 9, height, 30, 3, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 9)) - sub_98197C(image_id, 30, 18, 1, 10, 9, height, 30, 19, height + 2, get_current_rotation()); - - - image_id = base_image_id + SPR_MAZE_OFFSET_WALL_INNER_NE_SW; - if (maze_entry & (1 << 2)) - sub_98197C(image_id, 2, 14, 10, 4, 9, height, 3, 14, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 10)) - sub_98197C(image_id, 18, 14, 10, 4, 9, height, 19, 14, height + 2, get_current_rotation()); - - - image_id = base_image_id + SPR_MAZE_OFFSET_WALL_INNER_NW_SE; - if (maze_entry & (1 << 14)) - sub_98197C(image_id, 14, 2, 4, 10, 9, height, 14, 3, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 6)) - sub_98197C(image_id, 14, 18, 4, 10, 9, height, 14, 19, height + 2, get_current_rotation()); - - - image_id = base_image_id + SPR_MAZE_OFFSET_COLUMN_CORNER; - if (maze_entry & (1 << 0 | 1 << 1)) - sub_98197C(image_id, 0, 0, 1, 1, 9, height, 1, 1, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 4 | 1 << 5)) - sub_98197C(image_id, 0, 30, 1, 1, 9, height, 1, 30, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 8 | 1 << 9)) - sub_98197C(image_id, 30, 30, 1, 1, 9, height, 30, 30, height + 2, get_current_rotation()); - - if (maze_entry & (1 << 12 | 1 << 13)) - sub_98197C(image_id, 30, 0, 1, 1, 9, height, 30, 1, height + 2, get_current_rotation()); - - - if (maze_entry & (1 << 0 | 1 << 13 | 1 << 14)) - sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_TOP_LEFT, 14, 0, 2, 1, 9, height, 15, 1, height + 2, get_current_rotation()); - - - if (maze_entry & (1 << 5 | 1 << 6 | 1 << 8)) - sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_BOTTOM_RIGHT, 14, 30, 2, 1, 9, height, 15, 30, height + 2, get_current_rotation()); - - - if (maze_entry & (1 << 1 | 1 << 2 | 1 << 4)) - sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_TOP_RIGHT, 0, 14, 1, 2, 9, height, 1, 15, height + 2, get_current_rotation()); - - - if (maze_entry & (1 << 9 | 1 << 10 | 1 << 12)) - sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_BOTTOM_LEFT, 30, 14, 1, 2, 9, height, 30, 15, height + 2, get_current_rotation()); - - - if (maze_entry & (1 << 2 | 1 << 6 | 1 << 10 | 1 << 14)) { - sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_CENTER, 14, 14, 2, 2, 8, height, 15, 15, height + 2, get_current_rotation()); - - RCT2_GLOBAL(0x141E9C4, uint16) = height + 12; - RCT2_GLOBAL(0x141E9C6, uint8) = 0x20; - } - - height += 32; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x141E9DA, uint8) = 0x20; - } -} - -/** - * rct2: 0x008A81E8 - */ -TRACK_PAINT_FUNCTION get_track_paint_function_maze(int trackType, int direction) { - if (trackType != 101) { - return NULL; - } - - return maze_paint_setup; -} - -/** - * - * rct2: 0x00761378 - * rct2: 0x007614DB - * rct2: 0x0076163F - * rct2: 0x007617A5 - */ -static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) -{ - bool hasSupports = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL); - - RCT2_GLOBAL(0x0141E9D0, sint16) = -1; - RCT2_GLOBAL(0x0141E9C4, sint16) = -1; - RCT2_GLOBAL(0x0141E9CC, sint16) = -1; - RCT2_GLOBAL(0x0141E9B8, sint16) = -1; - RCT2_GLOBAL(0x0141E9BC, sint16) = -1; - RCT2_GLOBAL(0x0141E9B4, sint16) = -1; - RCT2_GLOBAL(0x0141E9C0, sint16) = -1; - RCT2_GLOBAL(0x0141E9C8, sint16) = -1; - RCT2_GLOBAL(0x0141E9D4, sint16) = -1; - - rct_ride *ride = get_ride(rideIndex); - rct_ride_entry *rideEntry = get_ride_entry(ride->subtype); - rct_ride_entry_vehicle *firstVehicleEntry = &rideEntry->vehicles[0]; - - uint32 imageId = RCT2_GLOBAL(0x00F44198, uint32); - if (imageId & 0x80000000) { - imageId &= 0x60FFFFFF; - } - imageId += firstVehicleEntry->base_image_id; - imageId += direction; - - sint16 height16 = (sint16)height; - int rotation = get_current_rotation(); - if (hasSupports) { - uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32); - foundationImageId |= 3395; - sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); - - sub_98199C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); - } else { - sub_98197C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); - } - - height16 += 48; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height16) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height16; - RCT2_GLOBAL(0x00141E9DA, uint8) = 32; - } -} - -/* 0x00761160 */ -TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction) -{ - switch (trackType) { - case 118: - case 121: return shop_paint_setup; - } - return NULL; -} - -/** - * - * rct2: 0x00763234 - * rct2: 0x0076338C - * rct2: 0x00762F50 - * rct2: 0x007630DE - */ -static void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) -{ - bool hasSupports = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL); - - RCT2_GLOBAL(0x0141E9D0, sint16) = -1; - RCT2_GLOBAL(0x0141E9C4, sint16) = -1; - RCT2_GLOBAL(0x0141E9CC, sint16) = -1; - RCT2_GLOBAL(0x0141E9B8, sint16) = -1; - RCT2_GLOBAL(0x0141E9BC, sint16) = -1; - RCT2_GLOBAL(0x0141E9B4, sint16) = -1; - RCT2_GLOBAL(0x0141E9C0, sint16) = -1; - RCT2_GLOBAL(0x0141E9C8, sint16) = -1; - RCT2_GLOBAL(0x0141E9D4, sint16) = -1; - - rct_ride *ride = get_ride(rideIndex); - rct_ride_entry *rideEntry = get_ride_entry(ride->subtype); - rct_ride_entry_vehicle *firstVehicleEntry = &rideEntry->vehicles[0]; - - uint32 imageId = RCT2_GLOBAL(0x00F44198, uint32); - imageId |= firstVehicleEntry->base_image_id; - imageId += (direction + 2) & 3; - - sint16 height16 = (sint16)height; - int rotation = get_current_rotation(); - int lengthX = (direction & 1) == 0 ? 28 : 2; - int lengthY = (direction & 1) == 0 ? 2 : 28; - if (hasSupports) { - uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32); - foundationImageId |= 3395; - sub_98197C(foundationImageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); - - // Door image or base - sub_98199C(imageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); - } else { - // Door image or base - sub_98197C(imageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); - } - - // Base image if door was drawn - if (direction == 1) { - imageId += 2; - sub_98197C(imageId, 0, 0, 2, 28, 29, height, 28, 2, height16, rotation); - } else if (direction == 2) { - imageId += 4; - sub_98197C(imageId, 0, 0, 28, 2, 29, height, 2, 28, height16, rotation); - } - - height16 += 32; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height16) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height16; - RCT2_GLOBAL(0x00141E9DA, uint8) = 32; - } -} - -/* 0x00762D44 */ -TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction) -{ - switch (trackType) { - case 118: return facility_paint_setup; - } - return NULL; -} - -/** - * rct2: 0x00761378, 0x007614DB, 0x0076163F, 0x007617A5 - */ -static void ride_50_52_53_54_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { - bool supportsDrawn = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F441A4, uint32), NULL); - - RCT2_GLOBAL(0x0141E9D0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9CC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9B8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9BC, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9B4, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C0, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9C8, uint16) = 0xFFFF; - RCT2_GLOBAL(0x0141E9D4, uint16) = 0xFFFF; - - rct_ride *ride = get_ride(rideIndex); - - rct_ride_entry *rideEntry = get_ride_entry(ride->subtype); - - uint32 image_id = RCT2_GLOBAL(0x00F44198, uint32); - if (image_id & 0x80000000) { - image_id &= 0x60FFFFFF; - } - - image_id += rideEntry->vehicles[0].base_image_id; - image_id += direction; - if (supportsDrawn) { - uint32 ebx = (direction & 1 ? 3396 : 3395) | RCT2_GLOBAL(0x00F441A4, uint32); - sub_98197C(ebx, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation()); - - sub_98199C(image_id, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation()); - } else { - sub_98197C(image_id, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation()); - } - - height += 48; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; - RCT2_GLOBAL(0x00141E9DA, uint8) = 0x20; - } -} - -/** - * rct2: 0x00761160 - */ -TRACK_PAINT_FUNCTION get_track_paint_function_50_52_53_54(int trackType, int direction) { - switch (trackType) { - case 118: - case 121: - return ride_50_52_53_54_paint_setup; - } - return NULL; -} diff --git a/src/ride/transport/chairlift.c b/src/ride/transport/chairlift.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/transport/chairlift.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/transport/lift.c b/src/ride/transport/lift.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/transport/lift.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/transport/minature_railway.c b/src/ride/transport/minature_railway.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/transport/minature_railway.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/transport/monorail.c b/src/ride/transport/monorail.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/transport/monorail.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/transport/suspended_monorail.c b/src/ride/transport/suspended_monorail.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/transport/suspended_monorail.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/vehicle_paint.c b/src/ride/vehicle_paint.c new file mode 100644 index 0000000000..beb573ad12 --- /dev/null +++ b/src/ride/vehicle_paint.c @@ -0,0 +1,75 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#include "../paint/paint.h" +#include "../drawing/drawing.h" +#include "../world/sprite.h" +#include "../ride/ride_data.h" +#include "../interface/viewport.h" +#include "vehicle_paint.h" + +/** + * + * rct2: 0x006D4244 + */ +void vehicle_paint(rct_vehicle *vehicle, int imageDirection) +{ + rct_ride_entry *rideEntry; + const rct_ride_entry_vehicle *vehicleEntry; + + int x = vehicle->x; + int y = vehicle->y; + int z = vehicle->z; + + if (vehicle->flags & SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE) { + uint32 ebx = 22965 + vehicle->var_C5; + sub_98197C(ebx, 0, 0, 1, 1, 0, z, 0, 0, z + 2, get_current_rotation()); + return; + } + + if (vehicle->ride_subtype == 0xFF) { + vehicleEntry = &CableLiftVehicle; + } else { + rideEntry = get_ride_entry(vehicle->ride_subtype); + vehicleEntry = &rideEntry->vehicles[vehicle->vehicle_type]; + + if (vehicle->update_flags & VEHICLE_UPDATE_FLAG_11) { + vehicleEntry++; + z += 16; + } + } + + uint32 rct2VehiclePtrFormat = ((uint32)vehicleEntry) - offsetof(rct_ride_entry, vehicles); + RCT2_GLOBAL(0x00F64DFC, uint32) = rct2VehiclePtrFormat; + switch (vehicleEntry->car_visual) { + case VEHICLE_VISUAL_DEFAULT: RCT2_CALLPROC_X(0x006D45F8, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case VEHICLE_VISUAL_LAUNCHED_FREEFALL: vehicle_visual_launched_freefall(x, imageDirection, y, z, vehicle, vehicleEntry); break; + case VEHICLE_VISUAL_OBSERVATION_TOWER: vehicle_visual_observation_tower(x, imageDirection, y, z, vehicle, vehicleEntry); break; + case VEHICLE_VISUAL_RIVER_RAPIDS: RCT2_CALLPROC_X(0x006D5889, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case VEHICLE_VISUAL_MINI_GOLF_PLAYER: RCT2_CALLPROC_X(0x006D42F0, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case VEHICLE_VISUAL_MINI_GOLF_BALL: RCT2_CALLPROC_X(0x006D43C6, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case VEHICLE_VISUAL_REVERSER: RCT2_CALLPROC_X(0x006D4453, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case VEHICLE_VISUAL_SPLASH_BOATS_OR_WATER_COASTER: RCT2_CALLPROC_X(0x006D4295, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case VEHICLE_VISUAL_ROTO_DROP: vehicle_visual_roto_drop(x, imageDirection, y, z, vehicle, vehicleEntry); break; + case 10: RCT2_CALLPROC_X(0x006D5600, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case 11: RCT2_CALLPROC_X(0x006D5696, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case 12: RCT2_CALLPROC_X(0x006D57EE, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case 13: RCT2_CALLPROC_X(0x006D5783, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case 14: RCT2_CALLPROC_X(0x006D5701, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case VEHICLE_VISUAL_VIRGINIA_REEL: vehicle_visual_virginia_reel(x, imageDirection, y, z, vehicle, vehicleEntry); break; + case VEHICLE_VISUAL_SUBMARINE: RCT2_CALLPROC_X(0x006D44D5, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + } +} diff --git a/src/ride/vehicle_paint.h b/src/ride/vehicle_paint.h new file mode 100644 index 0000000000..f162e1bd0d --- /dev/null +++ b/src/ride/vehicle_paint.h @@ -0,0 +1,29 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#ifndef _VEHICLE_PAINT_H +#define _VEHICLE_PAINT_H + +#include "vehicle.h" + +void vehicle_paint(rct_vehicle *vehicle, int imageDirection); + +void vehicle_visual_roto_drop(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry); +void vehicle_visual_observation_tower(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry); +void vehicle_visual_launched_freefall(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry); +void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry); + +#endif diff --git a/src/ride/water/boat_ride.c b/src/ride/water/boat_ride.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/water/boat_ride.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/water/dingy_slide.c b/src/ride/water/dingy_slide.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/water/dingy_slide.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/water/log_flume.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/water/river_rafts.c b/src/ride/water/river_rafts.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/water/river_rafts.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/water/river_rapids.c b/src/ride/water/river_rapids.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/water/river_rapids.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/water/splash_boats.c b/src/ride/water/splash_boats.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/water/splash_boats.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/water/submarine_ride.c b/src/ride/water/submarine_ride.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/water/submarine_ride.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/ride/water/water_coaster.c b/src/ride/water/water_coaster.c new file mode 100644 index 0000000000..846fd9695d --- /dev/null +++ b/src/ride/water/water_coaster.c @@ -0,0 +1,15 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion diff --git a/src/windows/ride_construction.c b/src/windows/ride_construction.c index d6ab1cc3cf..91d3667e17 100644 --- a/src/windows/ride_construction.c +++ b/src/windows/ride_construction.c @@ -2381,7 +2381,7 @@ static void sub_6CBCE2( gMapSizeMaxXY = preserveMapSizeMaxXY; sub_688217(); - sub_688485(); + paint_quadrant_ps(); gCurrentViewportFlags = preserve_current_viewport_flags; }