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
Krillancello
Posts: 309
Joined: Sat Nov 27, 2004 12:39 am
Location: Teh Intarwebivurs

Post by Krillancello »

Okay, I did an rm -Rf on my slade directory, did an svn checkout, and gunzipped and patch -p0'd the r61 diff; but the make still gave the same error as Grubber mentioned at the beginning of his first post:

Code: Select all

hjuki slade # make
g++ -c -O2 `wx-config --cxxflags` -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNO_MAP_VIEWER=1 -DUNIX=1 -DSHARE_DIR="\"data_files/\"" -o src/render.o src/render.cpp
src/render.cpp: In function `void render_3d_view(int, int)':
src/render.cpp:1234: error: cannot convert `const wxChar*' to `const char*' for argument `6' to `void draw_text_scale(int, int, rgba_t, BYTE, int, const char*, ...)'
make: *** [src/render.o] Error 1
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Okay, the problem is that render.cpp's svn properties say that it is a binary file, so my changes aren't showing up in a diff performed via "svn diff". This patch also needs to be applied:

Code: Select all

--- src/render.cpp      2006-09-04 22:09:26.000000000 -0500
+++ src/render.cpp.old  2006-09-06 22:39:40.939388600 -0500
@@ -1231,7 +1231,7 @@
                if (messages_3d[a].fade < 255)
                        al = messages_3d[a].fade;

-               draw_text_scale(0, a*(10*render_text_scale), rgba_t(255, 255, 255, al), 0, render_text_scale, chr(messages_3d[a].message));
+               draw_text_scale(0, a*(10*render_text_scale), rgba_t(255, 255, 255, al), 0, render_text_scale, messages_3d[a].message.c_str());

                messages_3d[a].fade -= 7;
        }
Slayer, you need to fix the properties on the file. I think running this from inside the slade/slade_20_alpha/ directory should work:

Code: Select all

svn propdel svn:mime-type src/render.cpp 
Hopefully, that should fix its properties when you check in the next revision. If not, you might have to operate directly on the svn repository.
Attachments
render.diff.gz
(258 Bytes) Downloaded 33 times
User avatar
sirjuddington
Posts: 1030
Joined: Wed Jul 16, 2003 4:47 am
Location: Australia
Contact:

Post by sirjuddington »

That's really strange. TortoiseSVN doesn't show any abnormal properties for render.cpp. Anyway I 'recreated' the file so hopefully it'll be treated as text now.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

@Jim: The error is in the "messages_3d[a].message.c_str()", so after patching.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

SlayeR wrote:That's really strange. TortoiseSVN doesn't show any abnormal properties for render.cpp. Anyway I 'recreated' the file so hopefully it'll be treated as text now.
No, that does not fix the problem. Why didn't you do what I suggested?
User avatar
sirjuddington
Posts: 1030
Joined: Wed Jul 16, 2003 4:47 am
Location: Australia
Contact:

Post by sirjuddington »

Because I had to reinstall windows and don't have a VM linux any more :P Unless there's a way to do it with tortoise svn?
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

I don't really know offhand. However, in Linux, you can also just edit the file containing the properties directly. Specifically, you can edit slade/slade_20_alpha/src/.svn/props/render.cpp.svn-work to contain nothing but END. I would think you could do something similar on windows.

Anyway, I have attached a patch for revision 66.
Attachments
slade_20_alpha-r66-linux.diff.gz
(5.24 KiB) Downloaded 33 times
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Slayer: Good, you applied my latest patch and managed to fix the properties on render.cpp. Which way did you finally get to work?
User avatar
sirjuddington
Posts: 1030
Joined: Wed Jul 16, 2003 4:47 am
Location: Australia
Contact:

Post by sirjuddington »

Found the option in tortoise svn. It's strange because I'm sure I tried that before but it didn't show the offending property for render.cpp.
User avatar
Krillancello
Posts: 309
Joined: Sat Nov 27, 2004 12:39 am
Location: Teh Intarwebivurs

Post by Krillancello »

I just checked out r67 and built it, there were no errors at all (I didn't even have to apply any of Jim's diffs).

When I execute slade, it complains that it can't find slade.pk3 unless I'm in the parent directory of a data_files (ergo, unless I'm in the slade root directory).
Also, most of the text in dialogs seems to be broken (displaying ?'s and characters' hex code boxes in place of the characters); possibly because of Unicode and perhaps somehow my Unicode support being incorrect.
I also can't seem to do anything in the map editor except in Vertices or Things mode.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

All of that is completely expected. He has been applying my patches and yes, there are still a lot of problems with the text. However, I dispute that most of the text is garbled. Most of it is not, just a significant portion of it, including few somewhat critical things such as the name you save a wad to.

Unfortunately, I don't see any really obvious mistakes anymore. I'm sure if I went over everything really closely I could at least solve most of the remaining Unicode-related problems. However, I can't guarantee that I will continue to track down these more subtle problems due to the amount of time required.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

This patch for svn r67 should fix most Unicode-related issues. The problem is that wxString::Format("%s", mystring) needs mystring to be converted to type wxChar*, not type char*. This is accomplished by calling mystring.c_str() if mystring is of type wxString. Slade should actually be useable on Linux with this patch.

This patch also includes a few small optimizations made via search and replace. (It gets rid of some unnecessary creation of temporary objects).
Attachments
slade_20_alpha-r67-linux.diff.gz
(7 KiB) Downloaded 41 times
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

There haven't been any Linux-related problems with Slade 2.0 alpha since you applied that previous patch. However, I thought I would do something about some of the multitude of warnings that gcc spits out when you compile slade. This patch fixes a gets rid of a bunch of those warnings and also fixes, optimizes, or otherwise enhances some various other bits of code.

As always, I have been careful not to change the actual effect of any code (unless I was very certain that it was previously incorrect).
Attachments
slade_20_alpha-r75-fixes.diff.gz
(15.28 KiB) Downloaded 33 times
User avatar
sirjuddington
Posts: 1030
Joined: Wed Jul 16, 2003 4:47 am
Location: Australia
Contact:

Post by sirjuddington »

Ok I applied the patch and updated the svn (just had to change one thing in prefs_colours.cpp that wouldn't compile).
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

And here are the Linux fixes for revision 80.
Attachments
slade_20_alpha-r80-linux.diff.gz
(511 Bytes) Downloaded 29 times
Locked

Return to “Editing (Archive)”