SLADE v1.13

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
Nash
 
 
Posts: 17503
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Slayer, just wanted to let you know that the age-old "pressing Q does not set the resolution I've specified in Options " bug I've kept complaining about has magically been solved...

I must say... I'm using SLADE a lot more now. =) If you can add the stuff I suggested above... SLADE will replace DoomBuilder for me. ;)
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Okay, my post on the previous page details how to build Slade on Linux. However, it mentions a hack to get Slade to link because wxScintilla 1.69.2's Makefile builds a broken library with a missing symbol "lmSpice".

I have attached a diff that fixes the missing symbol when compiling wxScintilla 1.69.2 (and it improves the Makefile slightly). With this applied, no hacks are necessary to get it to build. Just extract wxscintilla_1.69.2.tar.gz and apply the patch from the top directory like so:

Code: Select all

tar -xvzf wxscintilla_1.69.2.tar.gz
gunzip wxscintilla_1.69.2-Makefile.diff.gz
mv wxscintilla_1.69.2-Makefile.diff wxscintilla_1.69.2/
cd  wxscintilla_1.69.2/
patch -p0 < wxscintilla_1.69.2-Makefile.diff
Attachments
slade-svn39-linux.diff.gz
A clean, minimal patch to get Slade SVN version 39 to build on Linux.
(737 Bytes) Downloaded 28 times
wxscintilla_1.69.2-Makefile.diff.gz
Makefile fix for wxScintilla 1.69.2
(473 Bytes) Downloaded 65 times
User avatar
sirjuddington
Posts: 1030
Joined: Wed Jul 16, 2003 4:47 am
Location: Australia
Contact:

Post by sirjuddington »

Jim wrote:However, the resulting executable seems pretty broken, even when you run it from the data_files/ directory. Slayer, could you add my fixes (minus the hack for lmSpice) and the Makefile and upload it into the SVN server?
How exactly is it 'broken'? I'm guessing it might have something to do with the working directory stuff. Anyway the SVN is updated with the linux changes and makefile.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

It is broken in a number of respects:
* The "Tip of the Day" is in the background when Slade starts (and is a modal dialog). So the only way to get anywhere is to minimize and then re-maximize Slade. Then you can finally close the "Tip of the Day" and continue to the wad manager. This can be fixed by moving the "Tip of the Day" intialization after the wad manager is launched.
* It crashes when you try to use 3D mode.
* There are various strange rendering errors, including thHowever, the de title bar which is offcentered and says something like "unsaved, NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL". The grid is also sometimes only partially rendered (see Krillancello screenshot). It seems like the grid might be extending down from there off the screen. Drawing a line with the mouse up where the grid is missing results in stuff being done where the grid is rendered.

This is just off the top of my head. In summary, it is broken beyond usefullness. However, I haven't ever run Slade before, so I'm not quite certain what the exact desired behavior is for all things. I probably ran into more of these things.

Once these things and other serious problems are fixed, there are the secondary issues of putting settings in ~/.slade and so on.
User avatar
Krillancello
Posts: 309
Joined: Sat Nov 27, 2004 12:39 am
Location: Teh Intarwebivurs

Post by Krillancello »

Jim: There is technically a workaround for the data_files / ~/.slade issue. If you copy data_files/* to ~/.slade (after making the directory), you can cd into ~/.slade and then run slade from there and it'll work the same (it will also put slade.cfg in ~/.slade).

Example:

Code: Select all

$ mkdir ~/.slade
$ cp -r /path/to/slade/data_files/* ~/.slade
-- or --
$ cp -r /path/to/slade/data_files ~
$ mv ~/data_files ~/.slade
-- then --
$ cd ~/.slade
$ slade
Edit: The problem with the funky grid display seems to occur whenever a subwindow is opened (to edit a LineDef or a Thing or whatnot). Also, the textures only show up in the main window. The texture previews are not shown in the LineDef subwindow when editing the LineDef, or when choosing a texture for a sidedef. See the screenshot below for a visual.

Image
Last edited by Krillancello on Sat Jul 22, 2006 10:29 am, edited 1 time in total.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Yes, I understand that. And you could then put a file containing this in one of the directories in your PATH:

Code: Select all

#!/bin/sh
cd ~/.slade
/full/path/to/slade
I doesn't matter much, though. It's unuseable with the other problems.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Okay, in addition to a multitude of problems in compiling this new 2.0 alpha, the file render.cpp in SVN is corrupt. I have attached a fixed version of render.cpp.
Attachments
render.cpp.gz
(4.72 KiB) Downloaded 27 times
User avatar
Nash
 
 
Posts: 17503
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Slayer, I've just noticed that tooltips tend to "disappear"... probably because something (the main window perhaps?) is always trying to draw in front of them.
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Here is the (somewhat large) diff to get it to build (inline and attached):

Code: Select all

Index: src/tex_box.cpp
===================================================================
--- src/tex_box.cpp     (revision 42)
+++ src/tex_box.cpp     (working copy)
@@ -134,7 +134,7 @@
                        texname = "-";
        }
        else
-               texname = entry->GetValue();//game.get_ttype(atoi(wx_to_str(entry->GetValue()).c_str()))->name;
+               texname = (char*) entry->GetValue().c_str();//game.get_ttype(atoi(wx_to_str(entry->GetValue()).c_str()))->name;

        setup_tex_browser(textype);
        TextureBrowser tb(texname);
Index: src/render.cpp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: src/line_edit.cpp
===================================================================
--- src/line_edit.cpp   (revision 42)
+++ src/line_edit.cpp   (working copy)
@@ -590,11 +590,11 @@
                tex_lower->set_texture(sides[0]->get_texname(TEX_LOWER), 1);

        // Offsets
-       entry_xoff->SetValue(wxString::Format("%d", sides[0]->get_xoff()));
-       entry_yoff->SetValue(wxString::Format("%d", sides[0]->get_yoff()));
+       entry_xoff->SetValue(wxString::Format((const wxChar*)"%d", sides[0]->get_xoff()));
+       entry_yoff->SetValue(wxString::Format((const wxChar*)"%d", sides[0]->get_yoff()));

        // Sector ref
-       entry_sector->SetValue(wxString::Format("%d", d_map.hilight_line()->sector_index(side == 1)));
+       entry_sector->SetValue(wxString::Format((const wxChar*)"%d", d_map.hilight_line()->sector_index(side == 1)));

        // Check for inconsistency
        for (int a = 0; a < sides.size(); a++)
Index: src/dm_sector.cpp
===================================================================
--- src/dm_sector.cpp   (revision 42)
+++ src/dm_sector.cpp   (working copy)
@@ -53,12 +53,12 @@
        temp[8] = 0;

        memcpy(temp, s.f_tex, 8);
-       f_tex = strupr(temp);
+       f_tex = str_upper(temp);
        tex = get_texture(f_tex);
        if (tex) tex->use_count++;

        memcpy(temp, s.c_tex, 8);
-       c_tex = strupr(temp);
+       c_tex = str_upper(temp);
        tex = get_texture(c_tex);
        if (tex) tex->use_count++;

Index: src/draw.cpp
===================================================================
--- src/draw.cpp        (revision 42)
+++ src/draw.cpp        (working copy)
@@ -3,6 +3,7 @@
 #include "structs.h"
 #include "textures.h"

+#include <stdarg.h>
 #include <GL/gl.h>

 char charmap[16][16] =
@@ -373,4 +374,4 @@
                        }
                }
        }
-}
\ No newline at end of file
+}
Index: src/doom_map.h
===================================================================
--- src/doom_map.h      (revision 42)
+++ src/doom_map.h      (working copy)
@@ -119,7 +119,7 @@
        bool    hexen() { return !!(flags & MAP_HEXEN); }
        bool    opened() { return !!(flags & MAP_OPEN); }

-       vector<int>     selection() { return selected_items; }
+       vector<int>&    selection() { return selected_items; }
        int                     hilight()       { return hilight_item; }

        Vertex* hilight_vertex();
Index: src/dm_side.cpp
===================================================================
--- src/dm_side.cpp     (revision 42)
+++ src/dm_side.cpp     (working copy)
@@ -48,17 +48,17 @@
        temp[8] = 0;

        memcpy(temp, s.tex_lower, 8);
-       this->tex_lower = strupr(temp);
+       this->tex_lower = str_upper(temp);
        tex = get_texture(this->tex_lower);
        if (tex) tex->use_count++;

        memcpy(temp, s.tex_middle, 8);
-       this->tex_middle = strupr(temp);
+       this->tex_middle = str_upper(temp);
        tex = get_texture(this->tex_middle);
        if (tex) tex->use_count++;

        memcpy(temp, s.tex_upper, 8);
-       this->tex_upper = strupr(temp);
+       this->tex_upper = str_upper(temp);
        tex = get_texture(this->tex_upper);
        if (tex) tex->use_count++;

Index: src/wx_stuff.h
===================================================================
--- src/wx_stuff.h      (revision 42)
+++ src/wx_stuff.h      (working copy)
@@ -4,10 +4,16 @@

 #include "wx/wxprec.h"

+#undef min
+#undef max
+
 #ifndef WX_PRECOMP
     #include "wx/wx.h"
 #endif

+#define max(a,b) (((a)>(b))?(a):(b))
+#define min(a,b) (((a)<(b))?(a):(b))
+
 string wx_to_str(wxString str);
 wxString str_to_wx(string str);

Index: src/main.cpp
===================================================================
--- src/main.cpp        (revision 42)
+++ src/main.cpp        (working copy)
@@ -21,6 +21,7 @@

 #include "archive.h"

+#include <stdarg.h>
 #include <wx/image.h>
 #include <wx/sysopt.h>

Index: src/main.h
===================================================================
--- src/main.h  (revision 42)
+++ src/main.h  (working copy)
@@ -15,14 +15,24 @@

 #include <algorithm>

+#ifdef _MSC_VER
+typedef unsigned __int32 uint32_t;
+typedef __int32 int32_t;
+#else
+#include <stdint.h>
+#endif
+
 // Define some variable types
 #ifndef _VAR_TYPES
-#define _VAR_TYPES
-#define BYTE unsigned char
-#define WORD unsigned short
-#define DWORD unsigned long
-#define SWORD signed short
+typedef unsigned char BYTE;
+typedef unsigned short WORD;
+typedef   signed short SWORD;
+#ifdef _WIN32
+typedef unsigned long DWORD;
+#else
+typedef uint32_t DWORD;
 #endif
+#endif

 // A macro to check if a value exists in a vector
 #define vector_exists(vec, val) find(vec.begin(), vec.end(), val) != vec.end()
jbentler@jbentler:~/cvs/slade/slade_20_alpha> cd src
jbentler@jbentler:~/cvs/slade/slade_20_alpha/src> svn diff
Index: tex_box.cpp
===================================================================
--- tex_box.cpp (revision 42)
+++ tex_box.cpp (working copy)
@@ -134,7 +134,7 @@
                        texname = "-";
        }
        else
-               texname = entry->GetValue();//game.get_ttype(atoi(wx_to_str(entry->GetValue()).c_str()))->name;
+               texname = (char*) entry->GetValue().c_str();//game.get_ttype(atoi(wx_to_str(entry->GetValue()).c_str()))->name;

        setup_tex_browser(textype);
        TextureBrowser tb(texname);
Index: render.cpp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: line_edit.cpp
===================================================================
--- line_edit.cpp       (revision 42)
+++ line_edit.cpp       (working copy)
@@ -590,11 +590,11 @@
                tex_lower->set_texture(sides[0]->get_texname(TEX_LOWER), 1);

        // Offsets
-       entry_xoff->SetValue(wxString::Format("%d", sides[0]->get_xoff()));
-       entry_yoff->SetValue(wxString::Format("%d", sides[0]->get_yoff()));
+       entry_xoff->SetValue(wxString::Format((const wxChar*)"%d", sides[0]->get_xoff()));
+       entry_yoff->SetValue(wxString::Format((const wxChar*)"%d", sides[0]->get_yoff()));

        // Sector ref
-       entry_sector->SetValue(wxString::Format("%d", d_map.hilight_line()->sector_index(side == 1)));
+       entry_sector->SetValue(wxString::Format((const wxChar*)"%d", d_map.hilight_line()->sector_index(side == 1)));

        // Check for inconsistency
        for (int a = 0; a < sides.size(); a++)
Index: dm_sector.cpp
===================================================================
--- dm_sector.cpp       (revision 42)
+++ dm_sector.cpp       (working copy)
@@ -53,12 +53,12 @@
        temp[8] = 0;

        memcpy(temp, s.f_tex, 8);
-       f_tex = strupr(temp);
+       f_tex = str_upper(temp);
        tex = get_texture(f_tex);
        if (tex) tex->use_count++;

        memcpy(temp, s.c_tex, 8);
-       c_tex = strupr(temp);
+       c_tex = str_upper(temp);
        tex = get_texture(c_tex);
        if (tex) tex->use_count++;

Index: draw.cpp
===================================================================
--- draw.cpp    (revision 42)
+++ draw.cpp    (working copy)
@@ -3,6 +3,7 @@
 #include "structs.h"
 #include "textures.h"

+#include <stdarg.h>
 #include <GL/gl.h>

 char charmap[16][16] =
@@ -373,4 +374,4 @@
                        }
                }
        }
-}
\ No newline at end of file
+}
Index: doom_map.h
===================================================================
--- doom_map.h  (revision 42)
+++ doom_map.h  (working copy)
@@ -119,7 +119,7 @@
        bool    hexen() { return !!(flags & MAP_HEXEN); }
        bool    opened() { return !!(flags & MAP_OPEN); }

-       vector<int>     selection() { return selected_items; }
+       vector<int>&    selection() { return selected_items; }
        int                     hilight()       { return hilight_item; }

        Vertex* hilight_vertex();
Index: dm_side.cpp
===================================================================
--- dm_side.cpp (revision 42)
+++ dm_side.cpp (working copy)
@@ -48,17 +48,17 @@
        temp[8] = 0;

        memcpy(temp, s.tex_lower, 8);
-       this->tex_lower = strupr(temp);
+       this->tex_lower = str_upper(temp);
        tex = get_texture(this->tex_lower);
        if (tex) tex->use_count++;

        memcpy(temp, s.tex_middle, 8);
-       this->tex_middle = strupr(temp);
+       this->tex_middle = str_upper(temp);
        tex = get_texture(this->tex_middle);
        if (tex) tex->use_count++;

        memcpy(temp, s.tex_upper, 8);
-       this->tex_upper = strupr(temp);
+       this->tex_upper = str_upper(temp);
        tex = get_texture(this->tex_upper);
        if (tex) tex->use_count++;

Index: wx_stuff.h
===================================================================
--- wx_stuff.h  (revision 42)
+++ wx_stuff.h  (working copy)
@@ -4,10 +4,16 @@

 #include "wx/wxprec.h"

+#undef min
+#undef max
+
 #ifndef WX_PRECOMP
     #include "wx/wx.h"
 #endif

+#define max(a,b) (((a)>(b))?(a):(b))
+#define min(a,b) (((a)<(b))?(a):(b))
+
 string wx_to_str(wxString str);
 wxString str_to_wx(string str);

Index: main.cpp
===================================================================
--- main.cpp    (revision 42)
+++ main.cpp    (working copy)
@@ -21,6 +21,7 @@

 #include "archive.h"

+#include <stdarg.h>
 #include <wx/image.h>
 #include <wx/sysopt.h>

Index: main.h
===================================================================
--- main.h      (revision 42)
+++ main.h      (working copy)
@@ -15,14 +15,24 @@

 #include <algorithm>

+#ifdef _MSC_VER
+typedef unsigned __int32 uint32_t;
+typedef __int32 int32_t;
+#else
+#include <stdint.h>
+#endif
+
 // Define some variable types
 #ifndef _VAR_TYPES
-#define _VAR_TYPES
-#define BYTE unsigned char
-#define WORD unsigned short
-#define DWORD unsigned long
-#define SWORD signed short
+typedef unsigned char BYTE;
+typedef unsigned short WORD;
+typedef   signed short SWORD;
+#ifdef _WIN32
+typedef unsigned long DWORD;
+#else
+typedef uint32_t DWORD;
 #endif
+#endif

 // A macro to check if a value exists in a vector
 #define vector_exists(vec, val) find(vec.begin(), vec.end(), val) != vec.end()
The diff indicates that src/render.cpp is marked as a binary file in the SVN server. That may be why it ended up screwed up or it might be marked as binary because the file is messed up.

A few comments about portability: You shouldn't use min/max as macros when you #include <algorithms>. You shouldn't really mix and match std::string with wxString; use one or the other.
Attachments
slade_20_alpha.diff.gz
(1.49 KiB) Downloaded 24 times
User avatar
Krillancello
Posts: 309
Joined: Sat Nov 27, 2004 12:39 am
Location: Teh Intarwebivurs

Post by Krillancello »

I applied the diff above, copied over your Makefile, and ran a 'make'. As with the previous SVN version of SLADE, there were a lot of warnings; mostly number type conversions. When it got to src/render.cpp, it came up with a damn lot of 'null character(s) ignored' warnings and some errors.

I reran the make with a &> piping... the output is here. (Right-click, Save As if you don't want to view it in your browser.)
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Read the message before my previous message. Download render.cpp.gz (attached to that message), gunzip it, and copy it over src/render.cpp. Then, use the attached Makefile.
Attachments
Makefile.gz
Makefile for Slade 2.0 alpha
(348 Bytes) Downloaded 34 times
User avatar
Krillancello
Posts: 309
Joined: Sat Nov 27, 2004 12:39 am
Location: Teh Intarwebivurs

Post by Krillancello »

I got SLADE 2.0a to compile, but now it segfaults... gdb output below.

Code: Select all

(gdb) run
Starting program: /opt/bin/slade 
[Thread debugging using libthread_db enabled]
[New Thread -1229460672 (LWP 23978)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1229460672 (LWP 23978)]
0xb7585579 in strtof_l () from /lib/libc.so.6
(gdb) backtrace
#0  0xb7585579 in strtof_l () from /lib/libc.so.6
Cannot access memory at address 0xbfb623f0
User avatar
Jim
Posts: 535
Joined: Mon Aug 11, 2003 10:56 am

Post by Jim »

Yeah, the same for me. I was about to mention that.
User avatar
sirjuddington
Posts: 1030
Joined: Wed Jul 16, 2003 4:47 am
Location: Australia
Contact:

Post by sirjuddington »

That gdb output doesn't really tell me anything :/ Seems I'll have to install linux on a VM or something and figure out whats up.
User avatar
Krillancello
Posts: 309
Joined: Sat Nov 27, 2004 12:39 am
Location: Teh Intarwebivurs

Post by Krillancello »

SlayeR wrote:That gdb output doesn't really tell me anything :/ Seems I'll have to install linux on a VM or something and figure out whats up.
I'm not proficient in the use of gdb. :P
I guessed at the backtrace command and got lucky. I've just never bothered to look into how to properly use gdb, as I've used it a total of two times.
Locked

Return to “Editing (Archive)”