Slade 2.0 alpha on Linux (and Unicode)

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Slade 2.0 alpha on Linux (and Unicode)

Post by Jim »

I made the necessary changes to get Slade 2.0 alpha (svn revision 53) to build on Linux with or without Unicode support built into wxWidgets. I wouldn't have undertaken it if I knew what a pain it would be, but I just decided to finish it once I got a good way into it.

It also contains some small code enhancements.
Attachments
slade_20_alpha-r53-linux.diff.gz
(15.63 KiB) Downloaded 66 times
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

After fixing error in render.cpp at line 1234 (cannot convert 'wxChar *' to 'const char *') and commenting out one of get_image_from_pk3 in archive.cpp or editor_window.cpp I was able to compile it. When I ran it it gave me an

Code: Select all

10:12:55: Error: can't open file 'řŚ°… řŚ°… ř Œ“řŚŻ• řŚ°… řŚ°… ř Œ“řŚŻ• ' (error 2: file not found)
error and then segfaulted.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Yeah, I haven't actually linked it yet, since now that I updated by NVIDIA drivers libwx_gtk2u_gl now references some symbols that aren't there. I'm rebuilding wxWidgets right now to fix that.

Here's a patch against revision 57, which is the latest as of this moment.

Edit: I've fixed my issue so it linked (see above, it's unrelated to anything in the patch), in addition to compiling. I get "Unable to open slade.pk3" when I run it. I'll see what I can do to fix that if I get a chance.
Attachments
slade_20_alpha-r57-linux.diff.gz
(15.5 KiB) Downloaded 53 times
User avatar
sirjuddington
Posts: 1025
Joined: Wed Jul 16, 2003 4:47 am
Location: Australia
Contact:

Post by sirjuddington »

slade.pk3 needs to be in the same directory as the slade executable. It runs fine for me in ubuntu/wxwidgets unicode without the patch, but most of those changes are needed so I'll merge it in, and update the svn soon.

Edit: Ok, SVN updated with the patch changes.

Also, by the way, you should delete archive.cpp and archive.h since they aren't needed any more and actually cause errors.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

Still the same error message with random characters.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Grubber wrote:Still the same error message with random characters.
That was because Slade read from a temporary buffer after it had been destroyed. This only occurred for Unicode capable builds of wxWidgets. I replaced the function responsible with a macro, which at least avoids causing the problem. (Not even an inline function worked when I tried that).

I fixed some more issues in the code (various examples of inefficiency or lack of portability). I also made unix builds store settings in ~/.slade and read the shared data files by default from data_files/. This can be changed by setting SHARE_DIR to something else (in case someone actually wishes to install slade).

It gets as far as loading textures from slade.pk3 for me. Then, it uses a bunch of cpu for awhile and then the process eventually dies on its own.
Attachments
slade_20_alpha-r58-linux.diff.gz
(2.04 KiB) Downloaded 41 times
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Okay, here is a patch to stop the bizarre crash I described (only to have it segfault later). For the curious (but lazy :p ) the crash occurred because of an integer overflow when sizeof(wxChar) != 1 that resulted in gobs of memory being allocated:

Code: Select all

Index: src/console.cpp
===================================================================
--- src/console.cpp     (revision 61)
+++ src/console.cpp     (working copy)
@@ -103,7 +103,7 @@
        string line = _T("<< S.L.A.D.E. -- \"SlayeR's LeetAss Doom Editor\" (");
        line += __SLADEVERS;
        line += _T(")");
-       for (int a = 0; a < 21 - sizeof(__SLADEVERS); a++)
+       for (int a = 0; a < 21 - sizeof(__SLADEVERS)/sizeof(wxChar); a++)
                line += _T(" ");
        line += _T(">>");
        console_print(_T("<< ------------------------------------------------------------------ >>"));
Edit: The new patch now fixes the remaining crash too. That one was caused by slade looking for slade.pk3 in the current directory in src/wad_manager.cpp, instead of in the data directory.
Attachments
slade_20_alpha-r61-linux.diff.gz
(569 Bytes) Downloaded 47 times
User avatar
Krillancello
Posts: 309
Joined: Sat Nov 27, 2004 12:39 am
Location: Teh Intarwebivurs

Post by Krillancello »

Grubber wrote:After fixing error in render.cpp at line 1234 (cannot convert 'wxChar *' to 'const char *') and commenting out one of get_image_from_pk3 in archive.cpp or editor_window.cpp I was able to compile it.
Could you give a diff of these changes or

Code: Select all

 them?
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Post by Siggi »

:( What do I need to compile this?
Spoiler: The failure that is my compilation attempt
I think I'm missing things.
User avatar
Krillancello
Posts: 309
Joined: Sat Nov 27, 2004 12:39 am
Location: Teh Intarwebivurs

Post by Krillancello »

Siggi: Do you have wxWidgets (GTK version) aka wxGTK, and wxScintilla, installed properly?
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Post by Siggi »

Krillancello wrote:Siggi: Do you have wxWidgets (GTK version) aka wxGTK, and wxScintilla, installed properly?
I'm pretty sure I have wxWidgets installed, wxScintilla I'm not too sure about.
I've found a link to Scintilla, I'm going to try and see if I can get that working.
Are those really the only 2 things I need?
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Krillancello wrote:
Grubber wrote:After fixing error in render.cpp at line 1234 (cannot convert 'wxChar *' to 'const char *') and commenting out one of get_image_from_pk3 in archive.cpp or editor_window.cpp I was able to compile it.
Could you give a diff of these changes or

Code: Select all

 them?[/quote]
The changes in the previous patches I posted have already been applied to the latest svn and include a fix for these problems in addition to innumerable other issues.

Just check out revision 61, apply slade_20_alpha-r61-linux.diff, and compile.  Keep in mind that even though it actualy runs without crashing with the patch, there are still some more fixes that need to be made before it will run very well.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Psycho Siggi wrote:
Krillancello wrote:Siggi: Do you have wxWidgets (GTK version) aka wxGTK, and wxScintilla, installed properly?
I'm pretty sure I have wxWidgets installed, wxScintilla I'm not too sure about.
I've found a link to Scintilla, I'm going to try and see if I can get that working.
Are those really the only 2 things I need?
Scintilla is not wxScintilla. You can download the source for wxScintilla 1.69.2 right here and then extract it and apply this patch I made: wxscintilla_1.69.2-Makefile.diff.gz. Then, build it and copy libwxscintilla.so to /usr/lib/ and wxscintilla.h to /usr/include/wx-2.6/wx/.
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Post by Siggi »

Ok, I knew it was something stupid. Either my wxWidgets wasn't installed at all, or not installed correctly. I've reinstalled that from source and have reduced the compile erros I'm getting to this:

Code: Select all

g++ -c -O2 `wx-config --cxxflags` -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNO_MAP_VIEWER=1 -DUNIX=1 -DSHARE_DIR="\"data_files/\"" -o src/3dmode.o src/3dmode.cpp
src/tex_browser.h:24: error: expected class-name before ‘{’ token
src/3dmode.cpp: In function ‘void apply_gravity()’:
src/3dmode.cpp:70: warning: passing ‘float’ for argument 1 to ‘point2_t::point2_t(int, int)’
src/3dmode.cpp:70: warning: passing ‘float’ for argument 2 to ‘point2_t::point2_t(int, int)’
make: *** [src/3dmode.o] Error 1
Jim: That was where I got wxScintilla (wxscintilla_1.69.2.tar.gz) from (I won't leave the 'wx' off this time :P), however it did compile without errors. Should I recompile after applying your diff?
Also, is that the cause for my current compile error?

Thanks for the help guys :)
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Yes, you should recompile it because otherwise when you link you will get an error complaining about a missing symbol "lmSpice". (I reported this bug; so it will be fixed in the next version.)

No, that is not the reason for your current compile error.

Your current error is most likely occurring because you don't have wxGTK-gl and wxGTK-gl-devel installed (the exact names and makeup of these packages will vary between distributions, e.g. SuSE doesn't have/need a wxGTK-gl-devel package).
Locked

Return to “Editing (Archive)”