watched
For debugging purposes, an entity can be permanently observed by setting
this predefined pointer to the entity. The entity parameters are then displayed
on screen.
Type:
ENTITY*
Remarks:
Important parameters of the watched entity are permanently visible in
the following lines on the screen:
- Type, handle number, name
-
Position, angle, scale, PRV color values
-
Ambient, albedo, alpha, rgb, frame, next_frame, skin
-
Flags
-
Functions currently run by this entity
- Event function, material
-
Ground below the entity, surface number, texture name, and A6.6 object
touched by the collision detection.
While single stepping through a function, the entity parameters are displayed
below the debugger display. For switching off the parameter display, set the watched
pointer to NULL.
Example:
The [Shift-F11] debugging feature uses the watched
pointer and was implemented through a few lines of C-Script 'hardwired' in the
engine:
function _tog_dbg()
{
if(key_shift)
{
freeze_mode = (freeze_mode == 0); // toggle freeze mode
while(freeze_mode)
{
mouse_mode = 2;
mouse_pointer = 2;
mouse_pos.x = mouse_cursor.x; // move the mouse pointer
mouse_pos.y = mouse_cursor.y;
if(mouse_left)
{
watched = mouse_ent; // set entity to debug
}
wait(1);
}
}
}
See also:
Debugging, debug_external,
debug_mode
► latest
version online