diff options
author | Marcus Comstedt | 2011-04-20 23:43:33 +0200 |
---|---|---|
committer | Marcus Comstedt | 2011-04-20 23:46:45 +0200 |
commit | 8a8742930665010b83ed6518fe019b68b7b9ae7f (patch) | |
tree | cb144dbabba0ceb30e0358a60bfa19dcc0f9da0d /backends/platform | |
parent | 21421d2e86cf44a3236dd39da847ee15b366d95f (diff) | |
download | scummvm-rg350-8a8742930665010b83ed6518fe019b68b7b9ae7f.tar.gz scummvm-rg350-8a8742930665010b83ed6518fe019b68b7b9ae7f.tar.bz2 scummvm-rg350-8a8742930665010b83ed6518fe019b68b7b9ae7f.zip |
DC: Provide some feedback when loading plugins
Display the names of the plugins being loaded, and display amount
of free memory while doing so. This should make it easier to spot
the case that too many engine plugins have been placed on the boot
medium.
Diffstat (limited to 'backends/platform')
-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) { |