Hugor: A new Linux/Mac OS X/Windows port of the Hugo engine

I am having a problem with image loading, which is a recurring issue though I’ve had success in the past. As far as I can tell, I have everything needed as far as what’s called for and can compile from source without a problem though I can’t get any version to load graphics for any game from 0.8 - testing. Launching from a terminal reveals no errors, so I’m more than a little baffled.

Just what the devil am I missing or not have configured? I’m on a 64-bit disto and what follows is everything I have installed in regards to Qt and SDL:

### Installed Qt-centric

attica 0.3.0-1 
grantlee 0.2.0-1 
libdbusmenu-qt 0.9.2-1 
libqzeitgeist 0.8.0-2 
polkit-qt 0.103.0-1 
poppler-qt 0.18.4-2 
pyqt 4.9.1-1 
python2-pyqt 4.9.1-1 
qca 2.0.3-2 
qt 4.8.2-1 
qtwebkit 2.2.2-1 
soprano 2.7.6-1 
strigi 0.7.7-1

### Installed SDL-centric

sdl 1.2.15-1 
sdl_image 1.2.12-2 
sdl_mixer 1.2.12-1 
sdl_net 1.2.8-1 
sdl_sound 1.0.3-3 
smpeg 0.4.4-6  

Just to make sure: is the “Enable Graphics” option checked in the preferences? Other than that, are you sure the games you’re trying out actually have graphics?

If all the above checks out, is it a problem only when you compile it yourself, or are the provided binaries also affected? (They should run on virtually every distro out there.)

Thanks for the quick response, Nikos.

I’ve got all the in-program options set for graphics & sound, have tried games from Guilty Bastards to Necrotic Drift, tried all the precompiled binaries and only compiled from source as a last resort.

Example from Fallacy of Dawn:

Weird. The only reason I can think of right now is that the Qt library installed on your system is unable to decode JPEG images, for whatever reason.

To verify that this is indeed the case, open “src/heqt.cc” in a text editor, and locate the following code (should be lines 788 and 789):

    file.open(infile, QIODevice::ReadOnly);
    file.seek(pos);

Delete these two lines and replace them with:

    if (not file.open(infile, QIODevice::ReadOnly)) {
        qWarning() << "Could not open image resource file";
    }
    if (not file.seek(pos)) {
        qWarning() << "Could not seek in image resource file";
    }

A few lines further down (line 802), delete this line:

    img.loadFromData(data);

And replace it with:

    if (not img.loadFromData(data)) {
        qWarning() << "Could decode image data";
    }

Rebuild and run from a terminal. Post here any messages that are printed.

Here is stdout:

uic src/aboutdialog.ui
uic src/confdialog.ui
compiling src/aboutdialog.cc
compiling src/confdialog.cc
compiling src/happlication.cc
compiling src/heqt.cc
compiling src/hframe.cc
compiling src/hmainwindow.cc
compiling src/hmarginwidget.cc
compiling src/hscrollback.cc
compiling src/kcolorbutton.cc
compiling src/main.cc
compiling src/settings.cc
compiling hugo/he.c
compiling hugo/hebuffer.c
compiling hugo/heexpr.c
compiling hugo/hemisc.c
compiling hugo/heobject.c
compiling hugo/heparse.c
hugo/heparse.c: In function ‘MatchObject’:
hugo/heparse.c:1017:6: warning: variable ‘nextobj’ set but not used [-Wunused-but-set-variable]
compiling hugo/heres.c
hugo/heres.c: In function ‘FindResource’:
hugo/heres.c:334:6: warning: variable ‘resfileversion’ set but not used [-Wunused-but-set-variable]
hugo/heres.c: In function ‘PlayVideo’:
hugo/heres.c:282:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
hugo/heres.c:291:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
hugo/heres.c: In function ‘PlaySample’:
hugo/heres.c:225:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
hugo/heres.c: In function ‘PlayMusic’:
hugo/heres.c:138:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
hugo/heres.c:147:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
hugo/heres.c:156:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
hugo/heres.c:165:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
compiling hugo/herun.c
hugo/herun.c: In function ‘RunWindow’:
hugo/herun.c:2738:27: warning: variable ‘temp_current_text_x’ set but not used [-Wunused-but-set-variable]
compiling hugo/heset.c
hugo/heset.c: In function ‘RunSet’:
hugo/heset.c:40:7: warning: variable ‘outofrange’ set but not used [-Wunused-but-set-variable]
hugo/heset.c:278:14: warning: ‘af_flag’ may be used uninitialized in this function [-Wmaybe-uninitialized]
compiling hugo/stringfn.c
compiling src/soundsdl.cc
compiling src/rwopsbundle.c
moc src/aboutdialog.h
compiling tmp/moc_aboutdialog.cpp
moc src/confdialog.h
compiling tmp/moc_confdialog.cpp
moc src/happlication.h
compiling tmp/moc_happlication.cpp
moc src/hframe.h
compiling tmp/moc_hframe.cpp
moc src/hmainwindow.h
compiling tmp/moc_hmainwindow.cpp
moc src/hmarginwidget.h
compiling tmp/moc_hmarginwidget.cpp
moc src/hscrollback.h
compiling tmp/moc_hscrollback.cpp
moc src/kcolorbutton.h
compiling tmp/moc_kcolorbutton.cpp
rcc resources.qrc
compiling qrc_resources.cpp
linking hugor

I mean what it prints when you run the interpreter, not when you compile it :mrgreen:

:blush:
As far as that, I have several instances of:

Could decode image data

Sounds promising.

Nope. That was a typo by me. It’s meant to say “could not decode image data.” Your Qt library doesn’t seem to be able to decode JPEG.

I’ll try to come up with a test-case. Probably not today though. Which Linux distribution are you using? I can install it myself and have a look at what’s going on with the Qt version it ships.

EDIT & UPDATE:

Found the root of the problem after much hammering away. I went so far as doing a Debian Wheezy netinstall that mirrored my Arch system as closely as possible and even did a full install of KDE on top of that with still no images loading.

The problem? Some time ago, I did a recursive renaming to lowercase in my Hugo directory, causing the failure. It was all apparently a matter of case-sensitivity since the Windows version of Hugor loaded the images.

Feeling ashamed and ecstatic at the same time but mostly feeling grateful to you, Nikos.

Good thinking. I mean the solving, not the original file renaming :mrgreen:

Two questions, as I think about future projects:

  1. What would be involved in getting movie support into Hugor?

  2. Is it possible to add new formats for audio, like AAC?

  1. Use of a cross-platform video API, such as GStreamer, and building of GStreamer on Linux, Mac and Windows. And the time to do all that :mrgreen:

  2. Making Hugor incompatible with the official engine versions is probably a bad idea. Other than that, it is possible. Though AAC doesn’t make much sense, since there’s Vorbis (interestingly, Hugor already has Vorbis support in it, but you simply can’t use it; it’s currently coded to refuse to play anything that’s not supported by standard Hugo.)