1 #include "core/advdumper.hpp"
2 #include "core/command.hpp"
3 #include "core/dispatch.hpp"
4 #include "library/globalwrap.hpp"
6 #include "library/string.hpp"
13 globalwrap
<std::map
<std::string
, adv_dumper
*>> dumpers
;
16 const std::string
& adv_dumper::id() throw()
21 adv_dumper::~adv_dumper()
23 dumpers().erase(d_id
);
24 information_dispatch::do_dumper_update();
27 std::set
<adv_dumper
*> adv_dumper::get_dumper_set() throw(std::bad_alloc
)
29 std::set
<adv_dumper
*> d
;
30 for(auto i
: dumpers())
35 adv_dumper::adv_dumper(const std::string
& id
) throw(std::bad_alloc
)
38 dumpers()[d_id
] = this;
41 unsigned adv_dumper::target_type_mask
= 3;
42 unsigned adv_dumper::target_type_file
= 0;
43 unsigned adv_dumper::target_type_prefix
= 1;
44 unsigned adv_dumper::target_type_special
= 2;
46 template<bool X
> void render_video_hud(struct framebuffer
<X
>& target
, struct framebuffer_raw
& source
, uint32_t hscl
,
47 uint32_t vscl
, uint32_t roffset
, uint32_t goffset
, uint32_t boffset
, uint32_t lgap
, uint32_t tgap
,
48 uint32_t rgap
, uint32_t bgap
, void(*fn
)())
50 struct lua_render_context lrc
;
54 lrc
.bottom_gap
= bgap
;
57 lrc
.width
= source
.get_width();
58 lrc
.height
= source
.get_height();
59 lua_callback_do_video(&lrc
);
62 target
.set_palette(roffset
, goffset
, boffset
);
63 target
.reallocate(lrc
.left_gap
+ source
.get_width() * hscl
+ lrc
.right_gap
, lrc
.top_gap
+
64 source
.get_height() * vscl
+ lrc
.bottom_gap
, false);
65 target
.set_origin(lrc
.left_gap
, lrc
.top_gap
);
66 target
.copy_from(source
, hscl
, vscl
);
70 template void render_video_hud(struct framebuffer
<false>& target
, struct framebuffer_raw
& source
, uint32_t hscl
,
71 uint32_t vscl
, uint32_t roffset
, uint32_t goffset
, uint32_t boffset
, uint32_t lgap
, uint32_t tgap
,
72 uint32_t rgap
, uint32_t bgap
, void(*fn
)());
73 template void render_video_hud(struct framebuffer
<true>& target
, struct framebuffer_raw
& source
, uint32_t hscl
,
74 uint32_t vscl
, uint32_t roffset
, uint32_t goffset
, uint32_t boffset
, uint32_t lgap
, uint32_t tgap
,
75 uint32_t rgap
, uint32_t bgap
, void(*fn
)());