diff options
Diffstat (limited to 'backends/platform/dc')
-rw-r--r-- | backends/platform/dc/plugins.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/backends/platform/dc/plugins.cpp b/backends/platform/dc/plugins.cpp index 7b07947847..be329ab314 100644 --- a/backends/platform/dc/plugins.cpp +++ b/backends/platform/dc/plugins.cpp @@ -32,6 +32,39 @@ #include "dcloader.h" +extern void draw_solid_quad(float x1, float y1, float x2, float y2, + int c0, int c1, int c2, int c3); + +static void drawPluginProgress(const Common::String &filename) +{ + ta_sync(); + void *mark = ta_txmark(); + Label lab1, lab2, lab3; + char buf[32]; + unsigned memleft = 0x8cf00000-((unsigned)sbrk(0)); + float ffree = memleft*(1.0/(16<<20)); + int fcol = (memleft < (1<<20)? 0xffff0000: + (memleft < (4<<20)? 0xffffff00: 0xff00ff00)); + snprintf(buf, sizeof(buf), "%dK free memory", memleft>>10); + lab1.create_texture("Loading plugins, please wait..."); + lab2.create_texture(filename.c_str()); + lab3.create_texture(buf); + ta_begin_frame(); + draw_solid_quad(80.0, 320.0, 560.0, 350.0, + 0xff808080, 0xff808080, 0xff808080, 0xff808080); + draw_solid_quad(85.0, 325.0, 555.0, 345.0, + 0xff202020, 0xff202020, 0xff202020, 0xff202020); + draw_solid_quad(85.0, 325.0, 85.0+470.0*ffree, 345.0, + fcol, fcol, fcol, fcol); + ta_commit_end(); + lab1.draw(100.0, 200.0, 0xffffffff); + lab2.draw(100.0, 240.0, 0xffffffff); + lab3.draw(100.0, 280.0, 0xffffffff); + ta_commit_frame(); + ta_sync(); + ta_txrelease(mark); +} + class OSystem_Dreamcast::DCPlugin : public DynamicPlugin { protected: @@ -58,6 +91,7 @@ public: bool loadPlugin() { assert(!_dlHandle); + drawPluginProgress(_filename); _dlHandle = dlopen(_filename.c_str(), RTLD_LAZY); if (!_dlHandle) { |