Debug info for particles allocation
This commit is contained in:
parent
4f8720eecc
commit
d5435c50a9
@ -129,6 +129,9 @@ typedef unsigned int pixel;
|
|||||||
#define SDEUT
|
#define SDEUT
|
||||||
//#define REALHEAT
|
//#define REALHEAT
|
||||||
|
|
||||||
|
#define DEBUG_PARTS 0x0001
|
||||||
|
#define DEBUG_PARTCOUNT 0x0002
|
||||||
|
|
||||||
typedef unsigned char uint8;
|
typedef unsigned char uint8;
|
||||||
|
|
||||||
extern int amd;
|
extern int amd;
|
||||||
@ -151,6 +154,7 @@ extern int kiosk_enable;
|
|||||||
extern int aheat_enable;
|
extern int aheat_enable;
|
||||||
extern int decorations_enable;
|
extern int decorations_enable;
|
||||||
extern int hud_enable;
|
extern int hud_enable;
|
||||||
|
extern int debug_flags;
|
||||||
|
|
||||||
extern int active_menu;
|
extern int active_menu;
|
||||||
|
|
||||||
|
@ -160,6 +160,8 @@ void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry);
|
|||||||
|
|
||||||
int sdl_open(void);
|
int sdl_open(void);
|
||||||
|
|
||||||
|
int draw_debug_info(pixel* vid);
|
||||||
|
|
||||||
#ifdef OpenGL
|
#ifdef OpenGL
|
||||||
void Enable2D ();
|
void Enable2D ();
|
||||||
void RenderScene ();
|
void RenderScene ();
|
||||||
|
@ -65,4 +65,5 @@ int luatpt_cmode_set(lua_State* l);
|
|||||||
int luatpt_error(lua_State* l);
|
int luatpt_error(lua_State* l);
|
||||||
int luatpt_heat(lua_State* l);
|
int luatpt_heat(lua_State* l);
|
||||||
int luatpt_setfire(lua_State* l);
|
int luatpt_setfire(lua_State* l);
|
||||||
|
int luatpt_setdebug(lua_State* l);
|
||||||
#endif
|
#endif
|
||||||
|
@ -4436,6 +4436,26 @@ int sdl_open(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int draw_debug_info(pixel* vid)
|
||||||
|
{
|
||||||
|
if(debug_flags & DEBUG_PARTS)
|
||||||
|
{
|
||||||
|
int i = 0, x = 0, y = 0;
|
||||||
|
for(i = 0; i < NPART; i++){
|
||||||
|
if(parts[i].type){
|
||||||
|
drawpixel(vid, x, y, 255, 255, 255, 120);
|
||||||
|
} else {
|
||||||
|
drawpixel(vid, x, y, 0, 0, 0, 120);
|
||||||
|
}
|
||||||
|
x++;
|
||||||
|
if(x>=XRES){
|
||||||
|
y++;
|
||||||
|
x = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef OpenGL
|
#ifdef OpenGL
|
||||||
void Enable2D ()
|
void Enable2D ()
|
||||||
{
|
{
|
||||||
|
@ -54,6 +54,7 @@ void luacon_open(){
|
|||||||
{"throw_error", &luatpt_error},
|
{"throw_error", &luatpt_error},
|
||||||
{"heat", &luatpt_heat},
|
{"heat", &luatpt_heat},
|
||||||
{"setfire", &luatpt_setfire},
|
{"setfire", &luatpt_setfire},
|
||||||
|
{"setdebug", &luatpt_setdebug},
|
||||||
{NULL,NULL}
|
{NULL,NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1048,4 +1049,10 @@ int luatpt_setfire(lua_State* l)
|
|||||||
prepare_alpha(firesize, fireintensity);
|
prepare_alpha(firesize, fireintensity);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int luatpt_setdebug(lua_State* l)
|
||||||
|
{
|
||||||
|
int debug = luaL_optint(l, 1, 0);
|
||||||
|
debug_flags = debug;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -188,6 +188,7 @@ int frameidx = 0;
|
|||||||
//int CGOL = 0;
|
//int CGOL = 0;
|
||||||
//int GSPEED = 1;//causes my .exe to crash..
|
//int GSPEED = 1;//causes my .exe to crash..
|
||||||
int sound_enable = 0;
|
int sound_enable = 0;
|
||||||
|
int debug_flags = 0;
|
||||||
|
|
||||||
|
|
||||||
sign signs[MAXSIGNS];
|
sign signs[MAXSIGNS];
|
||||||
@ -1961,6 +1962,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
draw_svf_ui(vid_buf, sdl_mod & (KMOD_LCTRL|KMOD_RCTRL));
|
draw_svf_ui(vid_buf, sdl_mod & (KMOD_LCTRL|KMOD_RCTRL));
|
||||||
|
|
||||||
|
if(debug_flags)
|
||||||
|
{
|
||||||
|
draw_debug_info(vid_buf);
|
||||||
|
}
|
||||||
|
|
||||||
if (http_ver_check)
|
if (http_ver_check)
|
||||||
{
|
{
|
||||||
if (!do_check && http_async_req_status(http_ver_check))
|
if (!do_check && http_async_req_status(http_ver_check))
|
||||||
|
Reference in New Issue
Block a user