Skip to content
Snippets Groups Projects
Select Git revision
  • 6a37b3c0c66ee30ecdcc67b8bad793d97c12c70d
  • next default protected
  • next-test
  • classic-netcode-fixes
  • fix-dedi-pthread
  • fix-enemy-target
  • master protected
  • better-distance-math
  • movie
  • softcode-info
  • acs
  • clipmidtex
  • custom-map-names
  • nogravity-trampolines
  • 2214-pre4
  • 2214-pre3
  • just-in-case
  • fix-opengl-parameter-crash
  • 2214-pre2
  • 2214-pre1
  • delfile2
  • SRB2_release_2.2.15
  • SRB2_release_2.2.13
  • SRB2_release_2.2.12
  • SRB2_release_2.2.11
  • SRB2_release_2.2.10
  • SRB2_release_2.2.9
  • SRB2_release_2.2.8
  • SRB2_release_2.2.7
  • SRB2_release_2.2.6
  • SRB2_release_2.2.5
  • SRB2_release_2.2.4
  • SRB2_release_2.2.3
  • SRB2_release_2.2.2
  • SRB2_release_2.2.1
  • SRB2_release_2.2.0
  • SRB2_release_2.1.25
  • SRB2_release_2.1.24
  • SRB2_release_2.1.23
  • SRB2_release_2.1.22
  • SRB2_release_2.1.21
41 results

lua_hudlib_drawlist.h

Blame
  • lua_hudlib_drawlist.h 3.04 KiB
    // SONIC ROBO BLAST 2
    //-----------------------------------------------------------------------------
    // Copyright (C) 2022-2023 by Sonic Team Junior.
    //
    // This program is free software distributed under the
    // terms of the GNU General Public License, version 2.
    // See the 'LICENSE' file for more details.
    //-----------------------------------------------------------------------------
    /// \file  lua_hudlib_drawlist.h
    /// \brief a data structure for managing cached drawlists for the Lua hud lib
    
    // The idea behinds this module is to cache drawcall information into an ordered
    // list to repeat the same draw operations in later frames. It's used to ensure
    // that the HUD hooks from Lua are called at precisely 35hz to avoid problems
    // with variable framerates in existing Lua addons.
    
    #ifndef __LUA_HUDLIB_DRAWLIST__
    #define __LUA_HUDLIB_DRAWLIST__
    
    #include "doomtype.h"
    #include "r_defs.h"
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    typedef struct huddrawlist_s *huddrawlist_h;
    
    // Create a new drawlist. Returns a handle to it.
    huddrawlist_h LUA_HUD_CreateDrawList(void);
    // Clears the draw list.
    void LUA_HUD_ClearDrawList(huddrawlist_h list);
    // Destroys the drawlist, invalidating the given handle
    void LUA_HUD_DestroyDrawList(huddrawlist_h list);
    boolean LUA_HUD_IsDrawListValid(huddrawlist_h list);
    
    void LUA_HUD_AddDraw(
    	huddrawlist_h list,
    	INT32 x,
    	INT32 y,
    	patch_t *patch,
    	INT32 flags,
    	UINT8 *colormap
    );
    void LUA_HUD_AddDrawScaled(
    	huddrawlist_h list,
    	fixed_t x,
    	fixed_t y,
    	fixed_t scale,
    	patch_t *patch,
    	INT32 flags,
    	UINT8 *colormap
    );
    void LUA_HUD_AddDrawStretched(
    	huddrawlist_h list,
    	fixed_t x,
    	fixed_t y,
    	fixed_t hscale,
    	fixed_t vscale,
    	patch_t *patch,
    	INT32 flags,
    	UINT8 *colormap
    );
    void LUA_HUD_AddDrawCropped(
    	huddrawlist_h list,
    	fixed_t x,
    	fixed_t y,
    	fixed_t hscale,
    	fixed_t vscale,
    	patch_t *patch,
    	INT32 flags,
    	UINT8 *colormap,
    	fixed_t sx,
    	fixed_t sy,
    	fixed_t w,
    	fixed_t h
    );
    void LUA_HUD_AddDrawNum(
    	huddrawlist_h list,
    	INT32 x,
    	INT32 y,
    	INT32 num,
    	INT32 flags
    );
    void LUA_HUD_AddDrawPaddedNum(
    	huddrawlist_h list,
    	INT32 x,
    	INT32 y,
    	INT32 num,
    	INT32 digits,
    	INT32 flags
    );
    void LUA_HUD_AddDrawFill(
    	huddrawlist_h list,
    	INT32 x,
    	INT32 y,
    	INT32 w,
    	INT32 h,
    	INT32 c
    );
    void LUA_HUD_AddDrawString(
    	huddrawlist_h list,
    	fixed_t x,
    	fixed_t y,
    	const char *str,
    	INT32 flags,
    	INT32 align
    );
    void LUA_HUD_AddDrawNameTag(
    	huddrawlist_h list,
    	INT32 x,
    	INT32 y,
    	const char *str,
    	INT32 flags,
    	UINT16 basecolor,
    	UINT16 outlinecolor,
    	UINT8 *basecolormap,
    	UINT8 *outlinecolormap
    );
    void LUA_HUD_AddDrawScaledNameTag(
    	huddrawlist_h list,
    	fixed_t x,
    	fixed_t y,
    	const char *str,
    	INT32 flags,
    	fixed_t scale,
    	UINT16 basecolor,
    	UINT16 outlinecolor,
    	UINT8 *basecolormap,
    	UINT8 *outlinecolormap
    );
    void LUA_HUD_AddDrawLevelTitle(
    	huddrawlist_h list,
    	INT32 x,
    	INT32 y,
    	const char *str,
    	INT32 flags
    );
    void LUA_HUD_AddFadeScreen(
    	huddrawlist_h list,
    	UINT16 color,
    	UINT8 strength
    );
    
    // Draws the given draw list
    void LUA_HUD_DrawList(huddrawlist_h list);
    
    #ifdef __cplusplus
    } // extern "C"
    #endif
    
    #endif // __LUA_HUDLIB_DRAWLIST__