New GUI skin [update: new skins, support for 1.5/1.6]

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
IceFire_darkalex
Posts: 3
Joined: Mon Sep 01, 2008 1:08 pm

Post by IceFire_darkalex »

I'm getting crazy here >.<

Included the gheaders and addet the cpp Files to the Project.

When compiling I get ONE funking ERROR >.<

Would be verry verry nice if anyone could help:

Code: Select all

int main...

		device->getFileSystem()->addZipFileArchive("data/TexSkiMod.zip", true, false); //Main Data Archive

		// Load GUI Skin
		SImageGUISkinConfig guicfg = LoadGUISkinFromFile(guienv->getFileSystem(), driver, "gui/guiskin.cfg");
		CImageGUISkin *skin = new CImageGUISkin(guienv->getVideoDriver(), (IGUISkin *)guienv->getSkin()); //<--------HERE IS LINE 50!
		skin->loadConfig(guicfg);
		gui::IGUIFont* font = guienv->getFont("fonts/defaultfont.bmp");
		if (font != 0)
			skin->setFont(font, gui::EGDF_DEFAULT);
		guienv->setSkin(skin);
		skin->drop();

...
Error message:

Code: Select all

1>Main.cpp
1>c:\dokumente und einstellungen\meep\desktop\test3d\application\client\main.cpp(50) : error C2259: 'irr::gui::CImageGUISkin' : cannot instantiate abstract class
1>        due to following members:
1>        'void irr::gui::IGUISkin::draw3DTabButton(irr::gui::IGUIElement *,bool,const irr::core::rect<T> &,const irr::core::rect<T> *,irr::gui::EGUI_ALIGNMENT)' : is abstract
1>        with
1>        [
1>            T=irr::s32
1>        ]
1>        c:\dokumente und einstellungen\meep\desktop\test3d\application\irrmix\iguiskin.h(464) : see declaration of 'irr::gui::IGUISkin::draw3DTabButton'
1>        'void irr::gui::IGUISkin::draw3DTabBody(irr::gui::IGUIElement *,bool,bool,const irr::core::rect<T> &,const irr::core::rect<T> *,irr::s32,irr::gui::EGUI_ALIGNMENT)' : is abstract
1>        with
1>        [
1>            T=irr::s32
1>        ]
1>        c:\dokumente und einstellungen\meep\desktop\test3d\application\irrmix\iguiskin.h(475) : see declaration of 'irr::gui::IGUISkin::draw3DTabBody'
1>CImageGUISkin.cpp
1>Generating Code...
1>Build log was saved at "file://c:\Dokumente und Einstellungen\meep\Desktop\test3d\Application\Client\BuildLog.htm"
1>Test-3D-Project - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
full.metal.coder
Posts: 68
Joined: Sat May 10, 2008 11:30 am
Contact:

Post by full.metal.coder »

it looks like two method signatures have changed in a recent Irrlicht release and the code of this skin has not been updated.

You need to edit the iguiskin.h header (and presumably the iguiskin.cpp or cguiskin.cpp) to change the method signatures accordingly (probably just a const keyword to add somewhere or something similar... just compare the signature in those files to the one expected by the compiler, as reported in the error message)
Nakid
Posts: 3
Joined: Fri May 22, 2009 5:42 pm

Post by Nakid »

Hmm someone fixed this problem ? :S
Nakid
Posts: 3
Joined: Fri May 22, 2009 5:42 pm

Post by Nakid »

Can someone give a fix for this problem ? :

Code: Select all

>Main.cpp
1>c:\dokumente und einstellungen\meep\desktop\test3d\application\client\main.cpp(50) : error C2259: 'irr::gui::CImageGUISkin' : cannot instantiate abstract class
1>        due to following members:
1>        'void irr::gui::IGUISkin::draw3DTabButton(irr::gui::IGUIElement *,bool,const irr::core::rect<T> &,const irr::core::rect<T> *,irr::gui::EGUI_ALIGNMENT)' : is abstract
1>        with
1>        [
1>            T=irr::s32
1>        ]
1>        c:\dokumente und einstellungen\meep\desktop\test3d\application\irrmix\iguiskin.h(464) : see declaration of 'irr::gui::IGUISkin::draw3DTabButton'
1>        'void irr::gui::IGUISkin::draw3DTabBody(irr::gui::IGUIElement *,bool,bool,const irr::core::rect<T> &,const irr::core::rect<T> *,irr::s32,irr::gui::EGUI_ALIGNMENT)' : is abstract
1>        with
1>        [
1>            T=irr::s32
1>        ]
1>        c:\dokumente und einstellungen\meep\desktop\test3d\application\irrmix\iguiskin.h(475) : see declaration of 'irr::gui::IGUISkin::draw3DTabBody'
1>CImageGUISkin.cpp
1>Generating Code...
1>Build log was saved at "file://c:\Dokumente und Einstellungen\meep\Desktop\test3d\Application\Client\BuildLog.htm"
1>Test-3D-Project - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ========== 

Thanks you
t0rt0r0
Posts: 76
Joined: Fri May 22, 2009 11:02 am

Fix

Post by t0rt0r0 »

Hi,

Here is a fixed source : edit : see bottom ;)

Enjoy ;)

Ps : it's just a fix, i just added new method signature but new parameters aren't use, but seems to work ...
Last edited by t0rt0r0 on Wed Jun 10, 2009 6:31 pm, edited 1 time in total.
Jookia
Posts: 170
Joined: Wed Nov 19, 2008 1:11 am

Post by Jookia »

Using your selection, I get..

Code: Select all

..\irrlicht-SVN\include\skin\SkinLoader.h|34|warning: no newline at end of file|
C:\Documents and Settings\Administrator\My Documents\My Projects\C++\Vox\Break Things\source\main.cpp||In constructor `CMain::CMain()':|
C:\Documents and Settings\Administrator\My Documents\My Projects\C++\Vox\Break Things\source\main.cpp|40|error: cannot allocate an object of type `irr::gui::CImageGUISkin'|
C:\Documents and Settings\Administrator\My Documents\My Projects\C++\Vox\Break Things\source\main.cpp|40|error:   because the following virtual functions are abstract:|
..\irrlicht-SVN\include\IGUISkin.h|466|error:  virtual void irr::gui::IGUISkin::draw3DTabButton(irr::gui::IGUIElement*, bool, const irr::core::rect<irr::s32>&, const irr::core::rect<irr::s32>*, irr::gui::EGUI_ALIGNMENT)|
..\irrlicht-SVN\include\IGUISkin.h|479|error:  virtual void irr::gui::IGUISkin::draw3DTabBody(irr::gui::IGUIElement*, bool, bool, const irr::core::rect<irr::s32>&, const irr::core::rect<irr::s32>*, irr::s32, irr::gui::EGUI_ALIGNMENT)|
||=== Build finished: 4 errors, 1 warnings ===|
t0rt0r0
Posts: 76
Joined: Fri May 22, 2009 11:02 am

Post by t0rt0r0 »

Strange, it worked on my computer using dev c++ and irrlicht 1.5

I'm not at home for now so I can't debug this, maybe I've made a mistake when uploading :?
t0rt0r0
Posts: 76
Joined: Fri May 22, 2009 11:02 am

Post by t0rt0r0 »

I updated the rar above with correct (sure ^^) files ;)

Hope it works not only on my computer ;)
Jookia
Posts: 170
Joined: Wed Nov 19, 2008 1:11 am

Post by Jookia »

To make it more portable so you don't have to include it into your project files, I've used t0rt0r0's code and edited it to be a simple folder that you can include.

Download links. Unless the whole world explodes, atleast one will be up.

Code: Select all

http://willhostforfood.com/access.php?fileid=69788
http://www.zshare.net/download/611971668708b97c/
http://www.badongo.com/file/15398615
http://rapidshare.com/files/243083038/Klagui_Portable.zip.html
http://www.megaupload.com/?d=DL1WYNC3
http://depositfiles.com/files/esymsc4cx
t0rt0r0
Posts: 76
Joined: Fri May 22, 2009 11:02 am

Post by t0rt0r0 »

Great,
I've removed my link ;)
Jookia
Posts: 170
Joined: Wed Nov 19, 2008 1:11 am

Post by Jookia »

Actually, you should keep your link since I just realized that I was using Irrlicht 1.6 and it needed a small code change.
t0rt0r0
Posts: 76
Joined: Fri May 22, 2009 11:02 am

Post by t0rt0r0 »

I'll upload my dev c++ project in the day, because i've already removed the link ... :/
Jookia
Posts: 170
Joined: Wed Nov 19, 2008 1:11 am

Post by Jookia »

I'm pretty sure it's just a dimension2d thing anyway.
Ovan
Posts: 70
Joined: Thu Dec 18, 2008 12:41 am
Contact:

Post by Ovan »

i just modifing draw2DRectangle for my game, it's so funy :

Code: Select all

        void GameSkin::draw2DRectangle(IGUIElement* element, const SColor &color,const core::rect<s32>& pos, const core::rect<s32>* clip)
        {
//            FallbackSkin->draw2DRectangle(element, color, pos, clip);
            if(pos.UpperLeftCorner.X  >= element->getAbsolutePosition().UpperLeftCorner.X  && pos.UpperLeftCorner.Y  >= element->getAbsolutePosition().UpperLeftCorner.Y)
            if(pos.LowerRightCorner.X <= element->getAbsolutePosition().LowerRightCorner.X && pos.LowerRightCorner.Y <= element->getAbsolutePosition().LowerRightCorner.Y)
            {
                SImageGUIElementStyle tmp = *&Config.SunkenPane;
                tmp.Color = color;
                drawElementStyle(tmp,pos,clip);
            }
        }
sorry for my english i'm french :P
lpcpp
Posts: 18
Joined: Thu Aug 06, 2009 9:26 am
Location: Neverland
Contact:

Post by lpcpp »

Nice one.Thanks
Post Reply