SOURCES: Yadex_170_ALL.diff (NEW) - from http://glbsp.sourceforge....
glen
glen at pld-linux.org
Sat Jul 23 16:52:33 CEST 2005
Author: glen Date: Sat Jul 23 14:52:33 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- from http://glbsp.sourceforge.net/yadex/Yadex_170_ALL.diff
---- Files affected:
SOURCES:
Yadex_170_ALL.diff (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/Yadex_170_ALL.diff
diff -u /dev/null SOURCES/Yadex_170_ALL.diff:1.1
--- /dev/null Sat Jul 23 16:52:33 2005
+++ SOURCES/Yadex_170_ALL.diff Sat Jul 23 16:52:28 2005
@@ -0,0 +1,2825 @@
+diff -u -r -N yadex-1.7.0/atclib/al_adigits.c yadex-1.7.0-all/atclib/al_adigits.c
+--- yadex-1.7.0/atclib/al_adigits.c 1999-08-02 00:52:00.000000000 +1000
++++ yadex-1.7.0-all/atclib/al_adigits.c 2005-01-10 14:30:53.000000000 +1100
+@@ -29,5 +29,11 @@
+ #include "atclib.h"
+
+
+-const char al_adigits[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
++const char al_adigits[36] =
++{
++'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
++'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
++'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
++'U', 'V', 'W', 'X', 'Y', 'Z'
++};
+
+diff -u -r -N yadex-1.7.0/docsrc/index.html yadex-1.7.0-all/docsrc/index.html
+--- yadex-1.7.0/docsrc/index.html 2002-05-09 23:36:06.000000000 +1000
++++ yadex-1.7.0-all/docsrc/index.html 2005-01-10 14:30:53.000000000 +1100
+@@ -34,6 +34,7 @@
+
+ <ul>
+ <li><a href="palette.html">Palette viewer</a>
++<li><a href="preview.html">3D Level Preview</a>
+ <li><a href="advanced.html">Advanced user's guide</a>
+ <li><a href="../TODO"><code>TODO</code></a>
+ <li><a href="yadex.6">The man page for Yadex</a>
+diff -u -r -N yadex-1.7.0/docsrc/preview.html yadex-1.7.0-all/docsrc/preview.html
+--- yadex-1.7.0/docsrc/preview.html 1970-01-01 10:00:00.000000000 +1000
++++ yadex-1.7.0-all/docsrc/preview.html 2005-01-10 14:34:20.000000000 +1100
+@@ -0,0 +1,108 @@
++<html>
++<head>
++<title>Yadex 3D level preview</title>
++</head>
++<body>
++
++<div align="center">
++<img src="logo_small.png" alt="Fancy logo">
++<br>Yadex $VERSION ($SOURCE_DATE)
++<h1>3D Level Preview</h1>
++</div>
++<br>
++<br>
++<br>
++
++ <h2>What's it for</h2>
++
++<p>The 3D level preview function lets you get a rough idea of what
++your level looks like, quickly, without all the hassle of saving,
++building nodes and starting DOOM. It is activated by pressing the
++`R' key while editing a level, and draws the player's view that
++you would see within DOOM (with some limitations). While the
++rendering window is up, you can move around the level using the
++cursor keys and toggle things like texturing and sprites on/off.
++
++ <h2>Key bindings</h2>
++
++<dl>
++<dt>[<kbd>Left</kbd>]
++<br>[<kbd>Right</kbd>]
++<dd>Turn the view left or right. Use the SHIFT key to
++turn a greater amount.
++
++<dt>[<kbd>Up</kbd>]
++<br>[<kbd>Down</kbd>]
++<dd>Move the view forward or back. Use the SHIFT key to
++move a greater distance.
++
++<dt>[<kbd>n</kbd>]
++<br>[<kbd>m</kbd>]
++<dd>Move the view sideways left or right (strafing). Uppercase `N'
++and `M' (i.e. with the SHIFT key) will move a greater distance.
++
++<dt>[<kbd>c</kbd>]
++<br>[<kbd>d</kbd>]
++<dd>Move the view upwards or downwards (flying). Uppercase `C' and
++`D' (i.e. with the SHIFT key) will move a greater distance. Note
++that you cannot move up or down when "walking" mode is enabled.
++
++<dt>[<kbd>t</kbd>]
++<dd>Toggle texture mapping. When disabled (the default), all walls,
++ceilings and floors are drawn with solid (somewhat random) colours.
++
++<dt>[<kbd>s</kbd>]
++<dd>Toggle sprites.
++
++<dt>[<kbd>w</kbd>]
++<dd>Toggle walking mode. When enabled, the view height is always
++above the current floor. For example, if you move forward over a
++cliff, the view will drop down. When disabled (the default), you can
++fly about the level at any height.
++
++<dt>[<kbd>Esc</kbd>]
++<br>[<kbd>q</kbd>]
++<dd>Exit the 3D level preview. The current viewing state (position,
++direction, etc) are remembered, and will be used next time the 3D
++preview is activated (unless the player object has been moved, or a
++different level was loaded).
++
++</dl>
++
++ <h2>Features</h2>
++
++<ul>
++<li>No BSP (nodes) required !
++<li>Textures and flats are drawn exactly like DOOM, including X/Y
++offsets and upper/lower unpegging flags.
++<li>Sky is handled just like in DOOM (but drawn in solid blue).
++</ul>
++
++ <h2>Limitations</h2>
++
++<ul>
++<li>No lighting, the level appears full-bright all the time.
++<li>No mid-masked textures (rails, gratings) are drawn.
++<li>Thing sprites (especially monsters) are always drawn facing
++you, even when their direction is away from you.
++<li>Sprite positioning may be inaccurate, because their X and
++Y offsets are not honoured.
++<li>Things that are supposed to hang from the ceiling
++(hanging body parts, chandeliers, etc) will appear on the floor.
++<li>There are some glitches in the current renderer, which look like
++"slimetrails" (vertical lines).
++</ul>
++
++ <h2>Caveats</h2>
++
++One last thing. The 3D preview function can use a huge amount of
++memory when texturing and sprites are both enabled (and a large amount
++even when texturing and sprites are both disabled). If your computer
++has a very low amount of memory (e.g. less than 16 MB), then Yadex may
++crash with an out of memory error. I think you are unlikely to hit
++this problem, but if in doubt, save your work first.
++
++
++<p><hr>AJA $SELF_DATE
++</body>
++</html>
+diff -u -r -N yadex-1.7.0/GNUmakefile yadex-1.7.0-all/GNUmakefile
+--- yadex-1.7.0/GNUmakefile 2003-12-29 04:23:56.000000000 +1100
++++ yadex-1.7.0-all/GNUmakefile 2005-01-10 14:30:53.000000000 +1100
+@@ -160,6 +160,7 @@
+ s_swapf s_vertices sanity scrnshot \
+ selbox selectn selpath selrect \
+ serialnum spritdir sticker swapmem \
++ r_render r_images \
+ t_centre t_flags t_prop t_spin \
+ textures things trace v_centre \
+ v_merge v_polyg vectext verbmsg \
+@@ -237,6 +238,7 @@
+ docsrc/legal.html \
+ docsrc/packagers_guide.html \
+ docsrc/palette.html \
++ docsrc/preview.html \
+ docsrc/reporting.html \
+ docsrc/tips.html \
+ docsrc/trivia.html \
+@@ -609,8 +611,9 @@
+ #
+ ########################################################################
+
+-# If Makefile.config doesn't exist, give a hint...
++# If Makefile.config or config.h don't exist, give a hint...
+ $(OBJDIR)/Makefile.config:
++$(OBJDIR)/config.h:
+ @echo "Sorry guv'nor, but... did you run ./configure ?" >&2
+ @false
+
+@@ -637,7 +640,7 @@
+ # Note: the modules of Atclib are not scanned as they all
+ # depend on $(HEADERS_ATCLIB) and nothing else.
+
+-yadex.dep: $(SRC_NON_GEN)
++yadex.dep: $(SRC_NON_GEN) src/config.h
+ @echo "Generating $@"
+ @makedepend -f- -Y -Iatclib $(SRC_NON_GEN) 2>/dev/null \
+ | awk 'sub (/^src/, "") == 1 { \
+diff -u -r -N yadex-1.7.0/src/editloop.cc yadex-1.7.0-all/src/editloop.cc
+--- yadex-1.7.0/src/editloop.cc 2003-07-05 21:12:32.000000000 +1000
++++ yadex-1.7.0-all/src/editloop.cc 2005-01-10 14:30:53.000000000 +1100
+@@ -70,6 +70,7 @@
+ #include "x_exchng.h"
+ #include "x_hover.h"
+ #include "xref.h"
++#include "r_render.h"
+
+ #ifdef Y_X11
+ #include <X11/Xlib.h>
+@@ -304,8 +305,8 @@
+
+ e.mb_menu[MBM_EDIT] = new Menu (NULL,
+ "~Copy object(s)", 'o', 0,
+- "~Add object", YK_INS, 0,
+- "~Delete object(s)", YK_DEL, 0,
++ "~Add object", 'I', 0,
++ "~Delete object(s)", '\b', 0,
+ "~Exchange object numbers", 24, 0,
+ "~Preferences...", YK_F5, 0,
+ "~Snap to grid", 'y', MIF_VTICK, &e.grid_snap, 0,
+@@ -342,6 +343,7 @@
+ "~Next object", 'n', 0,
+ "~Prev object", 'p', 0,
+ "~Jump to object...", 'j', 0,
++ "~Find by type", 'f', 0,
+ NULL);
+
+ e.mb_menu[MBM_MISC_L] = new Menu ("Misc. operations",
+@@ -1344,8 +1346,8 @@
+ }
+ }
+
+- // [F8]: pop up the "Misc. operations" menu
+- else if (is.key == YK_F8
++ // [M]: pop up the "Misc. operations" menu
++ else if (is.key == 'M'
+ && e.menubar->highlighted () < 0)
+ {
+ e.modpopup->set (e.menubar->get_menu (MBI_MISC), 1);
+@@ -1706,7 +1708,15 @@
+ select_linedefs_path (&e.Selected, e.highlighted.num, YS_TOGGLE);
+ RedrawMap = 1;
+ }
+-
++ // [E]: add linedef and split sector -- [AJA]
++ else if (is.key == 'E' && e.obj_type == OBJ_VERTICES)
++ {
++ if (e.Selected)
++ {
++ MiscOperations (e.obj_type, &e.Selected, 5);
++ RedrawMap = 1;
++ }
++ }
+ // [E]: Select/unselect all 1s linedefs in path
+ else if (is.key == 'E' && e.highlighted._is_linedef ())
+ {
+@@ -1834,6 +1844,56 @@
+ RedrawMap = 1;
+ }
+
++ // [f]: find object by type
++ else if (is.key == 'f' && (! e.global || e.highlighted ()))
++ {
++ Objid find_obj;
++ int otype;
++ obj_no_t omax,onum;
++ find_obj.type = e.highlighted () ? e.highlighted.type : e.obj_type;
++ onum = find_obj.num = e.highlighted () ? e.highlighted.num : 0;
++ omax = GetMaxObjectNum(find_obj.type);
++ switch (find_obj.type)
++ {
++ case OBJ_SECTORS:
++ if ( ! InputSectorType( 84, 21, &otype))
++ {
++ for (onum = e.highlighted () ? onum + 1 : onum; onum <= omax; onum++)
++ if (Sectors[onum].special == (wad_stype_t) otype)
++ {
++ find_obj.num = onum;
++ GoToObject(find_obj);
++ break;
++ }
++ }
++ break;
++ case OBJ_THINGS:
++ if ( ! InputThingType( 42, 21, &otype))
++ {
++ for (onum = e.highlighted () ? onum + 1 : onum; onum <= omax; onum++)
++ if (Things[onum].type == (wad_ttype_t) otype)
++ {
++ find_obj.num = onum;
++ GoToObject(find_obj);
++ break;
++ }
++ }
++ break;
++ case OBJ_LINEDEFS:
++ if ( ! InputLinedefType( 0, 21, &otype))
++ {
++ for (onum = e.highlighted () ? onum + 1 : onum; onum <= omax; onum++)
++ if (LineDefs[onum].type == (wad_ldtype_t) otype)
++ {
++ find_obj.num = onum;
++ GoToObject(find_obj);
++ break;
++ }
++ }
++ break;
++ }
++ RedrawMap = 1;
++ }
+ #if 0
+ // [c]: clear selection and redraw the map
+ else if (is.key == 'c')
+@@ -1921,6 +1981,17 @@
+ StretchSelBox = false;
+ }
+
++ // [w]: split sector between vertices
++ else if (is.key == 'w' && e.obj_type == OBJ_VERTICES
++ && e.Selected && e.Selected->next && ! e.Selected->next->next)
++ {
++ SplitSector (e.Selected->next->objnum, e.Selected->objnum);
++ ForgetSelection (&e.Selected);
++ RedrawMap = 1;
++ DragObject = false;
++ StretchSelBox = false;
++ }
++
+ // [x]: spin things 1/8 turn clockwise
+ else if (is.key == 'x' && e.obj_type == OBJ_THINGS
+ && (e.Selected || e.highlighted ()))
+@@ -1987,7 +2058,7 @@
+ }
+
+ // [Del]: delete the current object
+- else if (is.key == YK_DEL
++ else if (is.key == '\b'
+ && (e.Selected || e.highlighted ())) /* 'Del' */
+ {
+ if (e.obj_type == OBJ_THINGS
+@@ -2015,7 +2086,7 @@
+ }
+
+ // [Ins]: insert a new object
+- else if (is.key == YK_INS || is.key == YK_INS + YK_SHIFT) /* 'Ins' */
++ else if (is.key == 'I' || is.key == YK_INS + YK_SHIFT) /* 'Ins' */
+ {
+ SelPtr cur;
+ int prev_obj_type = e.obj_type;
+@@ -2201,12 +2272,34 @@
+ RedrawMap = 1;
+ }
+
++ // [Z] Set sector on surrounding linedefs (AJA)
++ else if (is.key == 'Z' && e.pointer_in_window)
++ {
++ if (e.obj_type == OBJ_SECTORS && e.Selected)
++ {
++ SuperSectorSelector (e.pointer_x, e.pointer_y,
++ e.Selected->objnum);
++ }
++ else
++ {
++ SuperSectorSelector (e.pointer_x, e.pointer_y, OBJ_NO_NONE);
++ }
++ RedrawMap = 1;
++ }
++
+ // [!] Debug info (not documented)
+ else if (is.key == '!')
+ {
+ DumpSelection (e.Selected);
+ }
+
++ // [R] Render 3D view (AJA)
++ else if (is.key == 'R')
++ {
++ Render3D ();
++ RedrawMap = 1;
++ }
++
+ // [@] Show font (not documented)
+ else if (is.key == '@')
+ {
+@@ -2214,6 +2307,30 @@
+ RedrawMap = 1;
+ }
+
++ // [T] Transfer properties to selected objects (AJA)
++ else if (is.key == 'T' && e.Selected
++ && e.highlighted.num >= 0)
++ {
++ switch (e.obj_type)
++ {
++ case OBJ_SECTORS:
++ TransferSectorProperties (e.highlighted.num, e.Selected);
++ RedrawMap = 1;
++ break;
++ case OBJ_THINGS:
++ TransferThingProperties (e.highlighted.num, e.Selected);
++ RedrawMap = 1;
++ break;
++ case OBJ_LINEDEFS:
++ TransferLinedefProperties (e.highlighted.num, e.Selected);
++ RedrawMap = 1;
++ break;
++ default:
++ Beep ();
++ break;
++ }
++ }
++
+ // [|] Show colours (not documented)
+ else if (is.key == '|')
+ {
+diff -u -r -N yadex-1.7.0/src/editloop.h yadex-1.7.0-all/src/editloop.h
+--- yadex-1.7.0/src/editloop.h 2000-01-11 00:40:12.000000000 +1100
++++ yadex-1.7.0-all/src/editloop.h 2005-01-10 14:30:53.000000000 +1100
+@@ -6,6 +6,9 @@
+
+ void EditorLoop (const char *); /* SWAP! */
+ const char *SelectLevel (int levelno);
++extern int InputSectorType(int x0, int y0, int *number);
++extern int InputLinedefType(int x0, int y0, int *number);
++extern int InputThingType(int x0, int y0, int *number);
+
+
+
+diff -u -r -N yadex-1.7.0/src/gcolour1.cc yadex-1.7.0-all/src/gcolour1.cc
+--- yadex-1.7.0/src/gcolour1.cc 2003-03-28 23:37:32.000000000 +1100
++++ yadex-1.7.0-all/src/gcolour1.cc 2005-01-10 14:30:53.000000000 +1100
+@@ -127,6 +127,21 @@
+ }
+ verbmsg ("colours: colour %d remapped to %d (delta %d)\n",
+ IMG_TRANSP, colour0, smallest_delta);
++
++ rgb_c med_blue (0, 0, 128);
++ sky_colour = 0;
++ smallest_delta = INT_MAX;
++
++ for (size_t n = 0; n < DOOM_COLOURS; n++)
++ {
++ int delta = med_blue - rgb_values[n];
++ if (delta < smallest_delta)
++ {
++ sky_colour = n;
++ smallest_delta = delta;
++ }
++ }
++ verbmsg ("Sky Colour remapped to %d (delta %d)\n", sky_colour, smallest_delta);
+ }
+
+ #endif
+diff -u -r -N yadex-1.7.0/src/gcolour2.cc yadex-1.7.0-all/src/gcolour2.cc
+--- yadex-1.7.0/src/gcolour2.cc 2003-03-28 23:37:32.000000000 +1100
++++ yadex-1.7.0-all/src/gcolour2.cc 2005-01-10 14:30:53.000000000 +1100
+@@ -35,4 +35,5 @@
+
+ pcolour_t *game_colour = 0; // Pixel values for the DOOM_COLOURS game clrs.
+ int colour0; // Game colour to which g. colour 0 is remapped
++int sky_colour; // Game colour for a medium sky blue
+
+diff -u -r -N yadex-1.7.0/src/gcolour2.h yadex-1.7.0-all/src/gcolour2.h
+--- yadex-1.7.0/src/gcolour2.h 2000-08-11 07:18:16.000000000 +1000
++++ yadex-1.7.0-all/src/gcolour2.h 2005-01-10 14:30:53.000000000 +1100
+@@ -10,4 +10,5 @@
+
+ extern pcolour_t *game_colour; // Pixel values for the DOOM_COLOURS game clrs.
+ extern int colour0; // Game colour to which g. colour 0 is remapped
++extern int sky_colour; // Game colour for a medium blue sky
+
+diff -u -r -N yadex-1.7.0/src/l_prop.cc yadex-1.7.0-all/src/l_prop.cc
+--- yadex-1.7.0/src/l_prop.cc 2003-03-28 23:37:32.000000000 +1100
++++ yadex-1.7.0-all/src/l_prop.cc 2005-01-10 14:30:53.000000000 +1100
+@@ -105,7 +105,7 @@
+ * Prototypes of private functions
+ */
+ static char *GetTaggedLineDefFlag (int linedefnum, int flagndx);
+-static int InputLinedefType (int x0, int y0, int *number);
++int InputLinedefType (int x0, int y0, int *number);
+ static const char *PrintLdtgroup (void *ptr);
+
+
+@@ -475,7 +475,7 @@
+ * Let the user select a linedef type number and return it.
+ * Returns 0 if OK, <>0 if cancelled
+ */
+-static int InputLinedefType (int x0, int y0, int *number)
++int InputLinedefType (int x0, int y0, int *number)
+ {
+ int r;
+ int ldtgno = 0;
+@@ -547,3 +547,37 @@
+ return ((ldtgroup_t *)ptr)->desc;
+ }
+
++/*
++ * TransferLinedefProperties
++ *
++ * Note: right now nothing is done about sidedefs. Being able to
++ * (intelligently) transfer sidedef properties from source line to
++ * destination linedefs could be a useful feature -- though it is
++ * unclear the best way to do it. OTOH not touching sidedefs might
++ * be useful too.
++ *
++ * -AJA- 2001-05-27
++ */
++#define LINEDEF_FLAG_KEEP (1 + 4)
++
++void TransferLinedefProperties (int src_linedef, SelPtr linedefs)
++{
++ SelPtr cur;
++ wad_ldflags_t src_flags = LineDefs[src_linedef].flags & ~LINEDEF_FLAG_KEEP;
++
++ for (cur=linedefs; cur; cur=cur->next)
++ {
++ if (! is_obj(cur->objnum))
++ continue;
++
++ // don't transfer certain flags
++ LineDefs[cur->objnum].flags &= LINEDEF_FLAG_KEEP;
++ LineDefs[cur->objnum].flags |= src_flags;
++
++ LineDefs[cur->objnum].type = LineDefs[src_linedef].type;
++ LineDefs[cur->objnum].tag = LineDefs[src_linedef].tag;
++
++ MadeChanges = 1;
++ }
++}
++
+diff -u -r -N yadex-1.7.0/src/r_images.cc yadex-1.7.0-all/src/r_images.cc
+--- yadex-1.7.0/src/r_images.cc 1970-01-01 10:00:00.000000000 +1000
++++ yadex-1.7.0-all/src/r_images.cc 2005-01-10 14:30:53.000000000 +1100
+@@ -0,0 +1,400 @@
++/*
++ * r_images.cc
++ * AJA 2002-04-23 (based on textures.cc and flats.cc)
++ */
++
++
++/*
++This file is part of Yadex.
++
++Yadex incorporates code from DEU 5.21 that was put in the public domain in
++1994 by Raphaël Quinet and Brendon Wyber.
++
++The rest of Yadex is Copyright Š 1997-2000 André Majorel.
++
++This program is free software; you can redistribute it and/or modify it under
++the terms of the GNU General Public License as published by the Free Software
++Foundation; either version 2 of the License, or (at your option) any later
++version.
++
++This program is distributed in the hope that it will be useful, but WITHOUT
++ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
++FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License along with
++this program; if not, write to the Free Software Foundation, Inc., 59 Temple
++Place, Suite 330, Boston, MA 02111-1307, USA.
++*/
++
++
++#include "yadex.h"
++#ifdef Y_X11
++#include <X11/Xlib.h>
++#endif
++#include "dialog.h"
++#include "game.h" /* yg_picture_format */
++#include "gfx.h"
++#include "levels.h"
++#include "lists.h"
++#include "patchdir.h"
++#include "pic2img.h"
++#include "sticker.h"
++#include "flats.h"
++#include "textures.h"
++#include "wadfile.h"
++#include "wads.h"
++#include "wadres.h"
++#include "wstructs.h"
++
++#include "r_images.h"
++
++
++/*
++ * flat_list_entry_match
++ * Function used by bsearch() to locate a particular
++ * flat in the FTexture.
++ */
++static int flat_list_entry_match (const void *key, const void *flat_list_entry)
++{
++return y_strnicmp ((const char *) key,
++ ((const flat_list_entry_t *) flat_list_entry)->name,
++ WAD_FLAT_NAME);
++}
++
++
++/*
++ * load a flat into a new image. NULL if not found.
++ */
++
++Img * Flat2Img (const wad_flat_name_t& fname)
++{
++char name[WAD_FLAT_NAME + 1];
++strncpy (name, fname, WAD_FLAT_NAME);
++name[WAD_FLAT_NAME] = 0;
++
++flat_list_entry_t *flat = (flat_list_entry_t *)
++ bsearch (name, flat_list, NumFTexture, sizeof *flat_list,
++ flat_list_entry_match);
<<Diff was trimmed, longer than 597 lines>>
More information about the pld-cvs-commit
mailing list