Map_paint(3)                                                      Map_paint(3)



NNAAMMEE
       Map_paint -

SSYYNNOOPPSSIISS
       Inherits CCoooorrdd.

       Inherited by RRoooomm.


   PPuubblliicc MMeetthhooddss
       void cclleeaarr__ccoolloorrss ()
       void cclleeaarr__mmaapp ()
       int qquueerryy__hhaass__mmaapp ()
       int qquueerryy__mmaapp__ppaaiinntteedd ()
       int qquueerryy__mmaapp__xxddiimm ()
       int qquueerryy__mmaapp__yyddiimm ()
       int qquueerryy__ssmmaallll__mmaapp__xxddiimm ()
       int qquueerryy__ssmmaallll__mmaapp__yyddiimm ()
       int * qquueerryy__aaddjjaacceenntt__cceellllss ()
       int qquueerryy__ccoooorrdd ()
       void ppaaiinntt__mmaapp (string name)
       string qquueerryy__ssmmaallll__mmaapp ()
       int qquueerryy__vvaalliidd__ssqquuaarree (int x, int y)
       varargs void ppaaiinntt (int x, int y, int sym, int color, int z)
       void ppaaiinntt__rrooww (int x, int y, string syms, int color, int z)
       void ppaaiinntt__sshhaappee (int x, int y, string vals, int color, int z)
       varargs void ppaaiinntt__ttiillee (int x, int y, string block, mixed color, mixed
           z)
       varargs void ppaaiinntt__ttiillee__cclliippppeedd (int x, int y, string block, mixed
           color, mixed z)
       object * ggeett__rreeggiioonn (int origin, mapping shape)
       varargs mapping ggeett__eemmppttyy__sshhaappee (int origin, mapping shape, int
           use_base_zbuf)
       varargs int ggeett__eemmppttyy (int x, int y, int z, object exclude)

   PPuubblliicc AAttttrriibbuutteess
       nosave string ssmmaallll__mmaapp
       nosave string ccuurrrr__mmaapp
       nosave string mmaapp
       nosave string zzbbuuff
       nosave string bbaassee__zzbbuuff
       nosave int * aaddjjaacceenntt__cceellllss
       nosave int mmaapp__xxddiimm
       nosave int mmaapp__yyddiimm
       nosave int ssmmaallll__mmaapp__xxddiimm
       nosave int ssmmaallll__mmaapp__yyddiimm
       nosave int ppaaiinntt__ppooss
       nosave int ppaaiinntt__mmooddee
       nosave int hhaass__mmaapp
       nosave int hhaass__ssmmaallll__mmaapp
       nosave object * oobbjjss
       nosave mapping uusseedd__ccoooorrddss

DDEETTAAIILLEEDD DDEESSCCRRIIPPTTIIOONN
       A highly nasty piece of code for handling all the map painting. This
       has been pretty tightly integrated with most of the MUDlib, although it
       should still be possible to yank it back out if you want to get rid of
       maps. Most of the code that uses it is designed to work even if no map
       is available.

       Definition at line 20 of file map_paint.c.

MMEEMMBBEERR FFUUNNCCTTIIOONN DDOOCCUUMMEENNTTAATTIIOONN
   vvooiidd cclleeaarr__ccoolloorrss (())
       A mostly internal function -- turns all the colors on the map to the
       default gray. This is done before redrawing to get all the colors
       right, since the wall-drawing routine doesn't set color as well.

       Definition at line 71 of file map_paint.c.

       References map_xdim, and map_ydim.

       Referenced by paint_map().

   vvooiidd cclleeaarr__mmaapp (())
       Forces the map to redraw from scratch next time it's requested. Do this
       if you change the shape of the map in the area or modify the scenery,
       so that it will refresh the map with the new rendering.

       Definition at line 79 of file map_paint.c.

       References has_map, and has_small_map.

   vvaarraarrggss iinntt ggeett__eemmppttyy ((iinntt xx,, iinntt yy,, iinntt zz,, oobbjjeecctt eexxcclluuddee))
       If x,y,z is empty (i.e. walkable), it'll return it as a coordinate.
       Otherwise, it will try to find the closest possible square (on the xy
       plane) and return its position. Useful for validating positions. If
       _e_x_c_l_u_d_e is given, then that object is excluded (generally this is the
       object for which you're seeking an empty position, so it doesn't block
       itself).

       Definition at line 795 of file map_paint.c.

       References base_zbuf, map_xdim, map_ydim, paint_mode, small_map,
       small_map_xdim, small_map_ydim, and used_coords.

   vvaarraarrggss mmaappppiinngg ggeett__eemmppttyy__sshhaappee ((iinntt oorriiggiinn,, mmaappppiinngg sshhaappee,, iinntt
       uussee__bbaassee__zzbbuuff))
       Clips shape so that only squares which are actually free are included.
       _s_h_a_p_e is offset by origin.  'Free' is defined as 'you can walk on top
       of whatever it is,' so there might be objects in the region returned,
       but they are walkable.

       Definition at line 761 of file map_paint.c.

       References query_map_xdim(), query_map_ydim(), and zbuf.

   oobbjjeecctt** ggeett__rreeggiioonn ((iinntt oorriiggiinn,, mmaappppiinngg sshhaappee))
       Get a list of all the objects in the room who fall in the _s_h_a_p_e
       centered at _o_r_i_g_i_n. For sample shapes, see the walk daemon
       (/daemon/walk).

       Definition at line 723 of file map_paint.c.

   vvaarraarrggss vvooiidd ppaaiinntt ((iinntt xx,, iinntt yy,, iinntt ssyymm,, iinntt ccoolloorr,, iinntt zz))
       Used for painting maps. This function is usable by both on_map_paint
       and on_paint events, but won't work as expected anywhere else (certain
       initialization has to happen for painting to work predictably).

       In a nutshell, this paints the character _s_y_m at x, y on this object's
       map, unless it is clipped in the z buffer, which is determined using
       the z height value (see /include/const.h LAYER_xxx constants for
       available z values). The color is a bit-packed value -- the bottom 4
       bits are the foreground color (ANSI standards, add 8 for brighter
       values), and the 3 bits above are the background color. If you set the
       highest bit, then the background color is modified to match whatever is
       underneath the painted object (objects which return true on
       'qquueerryy__iiss__llaannddssccaappee(())' are always painted first, to mitigate the paint-
       ordering problem that this creates).

       Definition at line 491 of file map_paint.c.

       References curr_map, map_xdim, map_ydim, objs, paint_pos, used_coords,
       and zbuf.

       Referenced by paint_row(), and paint_shape().

   vvooiidd ppaaiinntt__mmaapp ((ssttrriinngg nnaammee))
       This function completely draws the map, based on data gleaned from the
       surrounding area object. It is pretty slow. If you need to update the
       map (because some permanent scenery has changed, for example), you
       should call cclleeaarr__mmaapp(()), and this will be called as soon as the map
       data is needed again. You generally shouldn't need to call this
       function directly.

       _n_a_m_e The name to use in looking up the room information. You could
       theoretically use this to draw a map that doesn't belong to this room
       (although the environment of this_object() would have to have the name
       listed).

       TTooddoo::
            Take multi-level rooms into account.

       Definition at line 321 of file map_paint.c.

       References base_zbuf, clear_colors(), curr_map, has_map, has_small_map,
       map, paint_mode, Coord::query_x(), Coord::query_y(), small_map,
       small_map_xdim, small_map_ydim, and zbuf.

   vvooiidd ppaaiinntt__rrooww ((iinntt xx,, iinntt yy,, ssttrriinngg ssyymmss,, iinntt ccoolloorr,, iinntt zz))
       A utility function to paint a row of characters at a time.

       Definition at line 534 of file map_paint.c.

       References paint().

   vvooiidd ppaaiinntt__sshhaappee ((iinntt xx,, iinntt yy,, ssttrriinngg vvaallss,, iinntt ccoolloorr,, iinntt zz))
       Allows you to paint a monochromatic sprite-like object. Basically, you
       can think of _v_a_l_s as a string of commands:

       Start with the cursor at x, y. Any character: Paint the character, move
       cursor right one space. Newline (\n): Move the cursor to x, cursor_y+1
       Tab (\t): Move the cursor one right, paint nothing.

       Definition at line 549 of file map_paint.c.

       References paint().

   vvaarraarrggss vvooiidd ppaaiinntt__ttiillee ((iinntt xx,, iinntt yy,, ssttrriinngg bblloocckk,, mmiixxeedd ccoolloorr,, mmiixxeedd zz))
       A higher performance, unclipped paint function used for painting
       overworld maps. It's faster, but it takes off the kid gloves. Errors
       using this will show up as such. It paints in 5x3 blocks.

       If _c_o_l_o_r is an integer, then it will be painted in that solid color. If
       it's a string (must be 15 characters), then it will be used as a color
       key.

       Same goes for zbuffer values ... integer will be padded, string used
       directly. The zbuffer is ignored for painting, but is set directly.

       Definition at line 574 of file map_paint.c.

       References curr_map, map_xdim, and zbuf.

   vvaarraarrggss vvooiidd ppaaiinntt__ttiillee__cclliippppeedd ((iinntt xx,, iinntt yy,, ssttrriinngg bblloocckk,, mmiixxeedd ccoolloorr,,
       mmiixxeedd zz))
       This behaves identically to paint_tile, except that it respects the
       zbuffer in its painting. This means that objects in the room can use
       it, but you should expect a performance hit.

       Definition at line 615 of file map_paint.c.

       References curr_map, map_xdim, and zbuf.

   iinntt** qquueerryy__aaddjjaacceenntt__cceellllss (())
       RReettuurrnnss::
           An array of cell adjacency information

       Definition at line 126 of file map_paint.c.

       References adjacent_cells, and has_small_map.

   iinntt qquueerryy__hhaass__mmaapp (())
       RReettuurrnnss::
           True, if the object has a grid, but false otherwise. This sets an
           internal flag to remember if this object has a map.

       Definition at line 87 of file map_paint.c.

   iinntt qquueerryy__mmaapp__ppaaiinntteedd (())
       RReettuurrnnss::
           True, if the map is painted, 0 if it isn't, and -1 if this object
           has no map.

       Definition at line 93 of file map_paint.c.

       References has_map.

   iinntt qquueerryy__mmaapp__xxddiimm (())
       RReettuurrnnss::
           The x dimension (number of columns sideways) of the fully rendered
           map.

       Definition at line 98 of file map_paint.c.

       References has_small_map, and map_xdim.

       Referenced by get_empty_shape().

   iinntt qquueerryy__mmaapp__yyddiimm (())
       RReettuurrnnss::
           The y dimension (number of rows) of the fully rendered map.

       Definition at line 105 of file map_paint.c.

       References has_small_map, and map_ydim.

       Referenced by get_empty_shape().

   ssttrriinngg qquueerryy__ssmmaallll__mmaapp (())
       RReettuurrnnss::
           The small map itself (i.e. a map of the cells). Cells which do not
           belong to the room are '\255', anything else belongs (generally,
           this should be spaces: ' ').

       Definition at line 388 of file map_paint.c.

       References has_small_map, and small_map.

       Referenced by query_valid_square().

   iinntt qquueerryy__ssmmaallll__mmaapp__xxddiimm (())
       RReettuurrnnss::
           The number of cells wide that this map is.

       Definition at line 112 of file map_paint.c.

       References has_small_map, and small_map_xdim.

   iinntt qquueerryy__ssmmaallll__mmaapp__yyddiimm (())
       RReettuurrnnss::
           The number of cells high that this map is.

       Definition at line 119 of file map_paint.c.

       References has_small_map, and small_map_ydim.

   iinntt qquueerryy__vvaalliidd__ssqquuaarree ((iinntt xx,, iinntt yy))
       RReettuurrnnss::
           1 if the given coordinate is valid on this map. No-map rooms are
           always valid.

       Definition at line 395 of file map_paint.c.

       References query_small_map(), small_map, small_map_xdim, and
       small_map_ydim.

MMEEMMBBEERR DDAATTAA DDOOCCUUMMEENNTTAATTIIOONN
   nnoossaavvee iinntt** aaddjjaacceenntt__cceellllss
       RRoooomm adjacency information. Same dimensions as the small_map. Value is
       an 'array of four bytes', packed into a single integer. x&0xFF is the
       room to the right of the cell, x&0xFF00 is above, x&0xFF0000 is the
       room to the left, and x&0xFF000000 is below. As usual, a value of 255
       means that the cell in question is empty. Note that a room may be
       adjacent to itself...

       Definition at line 41 of file map_paint.c.

       Referenced by query_adjacent_cells().

   nnoossaavvee ssttrriinngg bbaassee__zzbbuuff
       Data saving the state of the map.

       Definition at line 29 of file map_paint.c.

       Referenced by get_empty(), and paint_map().

   nnoossaavvee ssttrriinngg ccuurrrr__mmaapp
       Data saving the state of the map.

       Definition at line 29 of file map_paint.c.

       Referenced by paint(), paint_map(), paint_tile(), and
       paint_tile_clipped().

   nnoossaavvee iinntt hhaass__mmaapp
       1: Yes, I have a map. -1: No, I don't. 0: I don't know, have to check.

       Definition at line 47 of file map_paint.c.

       Referenced by clear_map(), paint_map(), and query_map_painted().

   nnoossaavvee iinntt hhaass__ssmmaallll__mmaapp
       1: Yes, I have a map. -1: No, I don't. 0: I don't know, have to check.

       Definition at line 47 of file map_paint.c.

       Referenced by clear_map(), paint_map(), query_adjacent_cells(),
       query_map_xdim(), query_map_ydim(), query_small_map(),
       query_small_map_xdim(), and query_small_map_ydim().

   nnoossaavvee ssttrriinngg mmaapp
       Data saving the state of the map.

       Definition at line 29 of file map_paint.c.

       Referenced by paint_map().

   nnoossaavvee iinntt mmaapp__xxddiimm
       The dimensions of the map.

       Definition at line 43 of file map_paint.c.

       Referenced by clear_colors(), get_empty(), paint(), paint_tile(),
       paint_tile_clipped(), and query_map_xdim().

   nnoossaavvee iinntt mmaapp__yyddiimm
       The dimensions of the map.

       Definition at line 43 of file map_paint.c.

       Referenced by clear_colors(), get_empty(), paint(), and
       query_map_ydim().

   nnoossaavvee oobbjjeecctt** oobbjjss
       An accumulator for special mode painting (for finding objects in a
       region, etc.).

       Definition at line 49 of file map_paint.c.

       Referenced by paint().

   nnoossaavvee iinntt ppaaiinntt__mmooddee
       Paint states for the map.

       Definition at line 45 of file map_paint.c.

       Referenced by get_empty(), and paint_map().

   nnoossaavvee iinntt ppaaiinntt__ppooss
       Paint states for the map.

       Definition at line 45 of file map_paint.c.

       Referenced by paint().

   nnoossaavvee ssttrriinngg ssmmaallll__mmaapp
       Data saving the state of the map.

       Definition at line 29 of file map_paint.c.

       Referenced by get_empty(), paint_map(), query_small_map(), and
       query_valid_square().

   nnoossaavvee iinntt ssmmaallll__mmaapp__xxddiimm
       The dimensions of the map.

       Definition at line 43 of file map_paint.c.

       Referenced by get_empty(), paint_map(), query_small_map_xdim(), and
       query_valid_square().

   nnoossaavvee iinntt ssmmaallll__mmaapp__yyddiimm
       The dimensions of the map.

       Definition at line 43 of file map_paint.c.

       Referenced by get_empty(), paint_map(), query_small_map_ydim(), and
       query_valid_square().

   nnoossaavvee mmaappppiinngg uusseedd__ccoooorrddss
       An accumulator for finding the nearest adjacent empty cell to an
       object.

       Definition at line 51 of file map_paint.c.

       Referenced by get_empty(), and paint().

   nnoossaavvee ssttrriinngg zzbbuuff
       Data saving the state of the map.

       Definition at line 29 of file map_paint.c.

       Referenced by get_empty_shape(), paint(), paint_map(), paint_tile(),
       and paint_tile_clipped().


AAUUTTHHOORR
       Generated automatically by Doxygen for Walraven from the source code.



Walraven                          8 Jan 2004                      Map_paint(3)
