2025-08-24 19:27 CEST

spring: develop d780f45f Diff ] Back to Repository ]
Author Committer Branch Timestamp Parent
kloot kloot develop 2010-04-08 22:28:32 develop 1ee6aeaf
Changeset * AI: add some more callbacks for visual debugging (and rename the old ones for consistency)

  The current list (copied from IAICallback) is:

    // the following functions allow AI's to plot real-time
    // performance graphs (useful for basic visual profiling)
    //
    // * position and size are specified in relative screen-space
    // (ie. position must be in [-1.0, 1.0], size in [0.0, 2.0])
    // * position refers to the bottom-left corner of the graph
    // * data-points are automatically normalized, but must not
    // exceed 1E9 (1000^3) in absolute value
    // * you must be a spectator and watching the team of an AI
    // that has called AddDebugGraphPoint() to see these graphs
    // (note: they are drawn IIF IsDebugDrawerEnabled())
    virtual bool IsDebugDrawerEnabled() const = 0;
    virtual void DebugDrawerAddGraphPoint(int lineId, float x, float y) = 0;
    virtual void DebugDrawerDelGraphPoints(int lineId, int numPoints) = 0;
    virtual void DebugDrawerSetGraphPos(float x, float y) = 0;
    virtual void DebugDrawerSetGraphSize(float w, float h) = 0;
    virtual void DebugDrawerSetGraphLineColor(int lineId, const float3& color) = 0;
    virtual void DebugDrawerSetGraphLineLabel(int lineId, const char* label) = 0;

    // the following functions allow AI's to visualize overlay
    // maps as textures (useful for analyzing threat-maps and
    // the like in real-time)
    //
    // * position and size are specified as for graphs
    // * AI's are responsible for normalizing the data
    // * the data must be stored in a one-dimensional
    // array of floats of length (w * h); updating
    // a texture sub-region must be done in absolute
    // (pixel) coordinates
    virtual int DebugDrawerAddOverlayTexture(const float* texData, int w, int h) = 0;
    virtual void DebugDrawerUpdateOverlayTexture(int texHandle, const float* texData, int x, int y, int w, int h) = 0;
    virtual void DebugDrawerDelOverlayTexture(int texHandle) = 0;
    virtual void DebugDrawerSetOverlayTexturePos(int texHandle, float x, float y) = 0;
    virtual void DebugDrawerSetOverlayTextureSize(int texHandle, float w, float h) = 0;
mod - AI/Wrappers/LegacyCpp/AIAICallback.cpp Diff ] File ]
mod - AI/Wrappers/LegacyCpp/AIAICallback.h Diff ] File ]
mod - rts/ExternalAI/AICallback.cpp Diff ] File ]
mod - rts/ExternalAI/AICallback.h Diff ] File ]
mod - rts/ExternalAI/IAICallback.h Diff ] File ]
mod - rts/ExternalAI/Interface/AISCommands.h Diff ] File ]
mod - rts/ExternalAI/SSkirmishAICallbackImpl.cpp Diff ] File ]
mod - rts/Rendering/DebugDrawerAI.cpp Diff ] File ]
mod - rts/Rendering/DebugDrawerAI.h Diff ] File ]