Slade 2.0 alpha on Linux (and Unicode)

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Slade 2.0 alpha on Linux (and Unicode)

Postby Jim » Mon Sep 04, 2006 1:01 am

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 55 times
User avatar
Jim
By the Power of Grayskull...I have the Source Code!
 
Joined: 11 Aug 2003

Postby Grubber » Mon Sep 04, 2006 2:17 am

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 allExpand view
10:12:55: Error: can't open file 'řŚ°… řŚ°… ř Œ“řŚŻ• řŚ°… řŚ°… ř Œ“řŚŻ• ' (error 2: file not found)

error and then segfaulted.
User avatar
Grubber
I can wire anything directly into anything. I am the professor!
 
Joined: 15 Oct 2003
Location: Czech Republic

Postby Jim » Mon Sep 04, 2006 11:12 am

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 42 times
User avatar
Jim
By the Power of Grayskull...I have the Source Code!
 
Joined: 11 Aug 2003

Postby sirjuddington » Mon Sep 04, 2006 12:19 pm

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
sirjuddington
 
Joined: 16 Jul 2003
Location: Australia
Discord: sirjuddington#7496
Github ID: sirjuddington

Postby Grubber » Mon Sep 04, 2006 2:28 pm

Still the same error message with random characters.
User avatar
Grubber
I can wire anything directly into anything. I am the professor!
 
Joined: 15 Oct 2003
Location: Czech Republic

Postby Jim » Mon Sep 04, 2006 11:55 pm

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 30 times
User avatar
Jim
By the Power of Grayskull...I have the Source Code!
 
Joined: 11 Aug 2003

Postby Jim » Tue Sep 05, 2006 9:58 am

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 allExpand view
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 37 times
User avatar
Jim
By the Power of Grayskull...I have the Source Code!
 
Joined: 11 Aug 2003

Postby Krillancello » Tue Sep 05, 2006 11:20 am

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] them?
User avatar
Krillancello
LWM is My Hero
 
Joined: 27 Nov 2004
Location: Teh Intarwebivurs

Postby Siggi » Tue Sep 05, 2006 11:35 am

:( What do I need to compile this?
Spoiler: "The failure that is my compilation attempt"

I think I'm missing things.
User avatar
Siggi
 
Joined: 03 Oct 2004
Location: South Africa

Postby Krillancello » Tue Sep 05, 2006 11:40 am

Siggi: Do you have wxWidgets (GTK version) aka wxGTK, and wxScintilla, installed properly?
User avatar
Krillancello
LWM is My Hero
 
Joined: 27 Nov 2004
Location: Teh Intarwebivurs

Postby Siggi » Tue Sep 05, 2006 12:01 pm

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
Siggi
 
Joined: 03 Oct 2004
Location: South Africa

Postby Jim » Tue Sep 05, 2006 12:13 pm

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] them?

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
By the Power of Grayskull...I have the Source Code!
 
Joined: 11 Aug 2003

Postby Jim » Tue Sep 05, 2006 12:30 pm

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
Jim
By the Power of Grayskull...I have the Source Code!
 
Joined: 11 Aug 2003

Postby Siggi » Tue Sep 05, 2006 1:32 pm

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 allExpand view
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
Siggi
 
Joined: 03 Oct 2004
Location: South Africa

Postby Jim » Wed Sep 06, 2006 2:31 pm

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).
User avatar
Jim
By the Power of Grayskull...I have the Source Code!
 
Joined: 11 Aug 2003

Next

Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 1 guest