MCPcopy Create free account
hub / github.com/assaultcube/AC / guidetoggle

Function guidetoggle

source/src/texture.cpp:831–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829Texture *e_wall = NULL, *e_floor = NULL, *e_ceil = NULL;
830
831void guidetoggle()
832{
833 if(player1->state == CS_EDITING)
834 {
835 Slot *sw = &slots[DEFAULT_WALL];
836 Slot *sf = &slots[DEFAULT_FLOOR];
837 Slot *sc = &slots[DEFAULT_CEIL];
838
839 //if textures match original texture
840 if(e_wall == NULL || e_floor == NULL || e_ceil == NULL)
841 {
842 //replace defaults with grid texures
843 e_wall = sw->tex;
844 e_floor = sf->tex;
845 e_ceil = sc->tex;
846 sw->tex = textureload("packages/textures/map_editor/wall.png");
847 sf->tex = textureload("packages/textures/map_editor/floor.png");
848 sc->tex = textureload("packages/textures/map_editor/ceil.png");
849 conoutf("Guide: \f0on");
850 }
851 else
852 {
853 // restore textures
854 if(e_wall) sw->tex = e_wall;
855 if(e_floor) sf->tex = e_floor;
856 if(e_ceil) sc->tex = e_ceil;
857 e_wall = NULL;
858 e_floor = NULL;
859 e_ceil = NULL;
860 conoutf("Guide: \fBoff");
861 }
862 }
863 else
864 {
865 conoutf("\fBGuide view is only available when editing.");
866 }
867}
868
869COMMAND(guidetoggle, "");
870

Callers

nothing calls this directly

Calls 2

textureloadFunction · 0.85
conoutfFunction · 0.70

Tested by

no test coverage detected