diablodiab / libretro-scummvm-backend

libretro backend for scummvm
7 stars 8 forks source link

A pure virtual function is not implemented #28

Closed i30817 closed 1 year ago

i30817 commented 1 year ago
Compiling libretro_os.cpp...
../../../../backends/platform/libretro/libretro_os.cpp: In function ‘OSystem* retroBuildOS(bool)’:
../../../../backends/platform/libretro/libretro_os.cpp:1327:45: error: invalid new-expression of abstract class type ‘OSystem_RETRO’
 1327 |    return new OSystem_RETRO(aEnableSpeedHack);
      |                                             ^
../../../../backends/platform/libretro/libretro_os.cpp:345:7: note:   because the following virtual functions are pure within ‘OSystem_RETRO’:
  345 | class OSystem_RETRO : public EventsBaseBackend, public PaletteManager {
      |       ^~~~~~~~~~~~~
In file included from ../../../../backends/base-backend.h:25,
                 from ../../../../backends/platform/libretro/libretro_os.cpp:33:
../../../../common/system.h:1190:22: note:     ‘virtual void OSystem::showOverlay(bool)’
 1190 |         virtual void showOverlay(bool inGUI = true) = 0;
      |                      ^~~~~~~~~~~
make: *** [Makefile:577: ../../../../backends/platform/libretro/libretro_os.o] Error 1

Scummvm master added a new default argument to these functions 3 days ago:

https://github.com/scummvm/scummvm/commit/87bad2cc7d602488ba3fbdf8ff067d3d74fc2b85

not sure sure if it's the only error.

i30817 commented 1 year ago

Also as further bad news, it seems it can't be a no-op anymore without impacting games since as the commit message mentions 'can be used to show subtitles'.

I suppose some engines are going to implement subtitles using overlays 'not in the GUI'.

i30817 commented 1 year ago

Just adding the default argument to the virtual function implementation in libretro_os.cpp can make the core build again, modulo any problems that may or may not occur from this being a no-op.

i30817 commented 1 year ago

And here is the apparent followup, which will probably break some subtitles now that this no-op is actually important: https://github.com/scummvm/scummvm/pull/4424