Subversion Repositories DMapEdit

Compare Revisions

Rev 2 → Rev 3

Lines.c
3549,80 → 3549,7
{}
else
{
goto skip;
v3 = linedefs[line].v1;
v4 = linedefs[line].v2;
x3 = vertexes[v3].x;
x4 = vertexes[v4].x;
y3 = vertexes[v3].y;
y4 = vertexes[v4].y;
 
dx1 = x2 - x1;
dx2 = x4 - x3;
dy1 = y2 - y1;
dy2 = y4 - y3;
 
/* C is very closely related to the difference of the slopes. */
 
C = (long) dy2 * dx1 - dx2 * dy1;
if (!C) /* parallel */
{
} else
{
dx = x1 - x3;
dy = y1 - y3;
 
s = (double) (dy * dx1 - dx * dy1) / C;
/* t = (double) (dx * dy2 - dy * dx2) / C; */
t = (double) (dy * dx2 - dx * dy2) / C;
 
if (!t) /* v1 touches line2, forming T connection */
{
} else if (t == 1.0)
{ /* v2 touches line2 */
}
else if (!s)
{ /* v3 touches line1 */
}
else if (s == 1.0)
{ /* v4 touches line1 */
}
else if (s>0.0 && s<1.0 && t>0.0 && t<1.0)
{ /* lines cross */
v = add_vertex(x1 + t * dx1, y1 + t * dy1);
if (l_size+2 > l_max)
{
l_max += 20;
resize_mem((void **) &linedefs, l_max *
sizeof(Linedefs), "Linedefs");
if (game_id == 8 || game_id == 32)
resize_mem((void **) &hlinedefs, l_max *
sizeof(struct Hexen_extra_l_struct),
"Hexen extra linedefs");
}
 
copy_line(i, l_size);
linedefs[i].v2 = v;
linedefs[l_size++].v1 = v;
 
copy_line(line, l_size);
linedefs[line].v2 = v;
linedefs[l_size].v1 = v;
 
if (max == list_size)
{
list_size += 5;
resize_mem((void **) &list, list_size *
sizeof(struct list_s), "line list");
}
 
add_to_list(&list[j], line);
add_to_list(&list[max++], l_size++);
if (l_size > l_max)
fatal_error("fuck me!");
}
}
skip:
continue;
}
}
}
Threed.c
78,6 → 78,9
#include <math.h>
#include <string.h>
#include <conio.h>
 
#include <grx20.h>
 
#include "dme.h"
#include "dme2.h"
 
Wad.c
4365,4 → 4365,3
 
return;
}
}
\ No newline at end of file
Sectors.c
2217,4 → 2217,3
unmark_all();
return;
}
}
\ No newline at end of file
Help.c
44,6 → 44,9
 
#include <string.h>
#include <ctype.h>
 
#include <grx20.h>
 
#include "dme.h"
#include "dme2.h"
 
123,7 → 126,6
if (!h_text_op.txo_font)
fatal_error("Unable to load BIOS font");
 
h_text_op.txo_xmag = h_text_op.txo_ymag = 1;
h_text_op.txo_fgcolor.v = 254;
h_text_op.txo_bgcolor.v = 0;
h_text_op.txo_direct = GR_TEXT_RIGHT;
Mouse.c
613,8 → 613,8
{
demo_buffer[demo_position++] = -128;
demo_buffer[demo_position++] = -1;
(uchar) demo_buffer[demo_position++] = bkey / 256;
(uchar) demo_buffer[demo_position++] = bkey & 0x00ff;
demo_buffer[demo_position++] = bkey / 256;
demo_buffer[demo_position++] = bkey & 0x00ff;
}
 
} else if (demo_mode == 2)
791,7 → 791,7
{
demo_buffer[demo_position++] = -128;
demo_buffer[demo_position++] = 8 + keypress / 256;
(uchar) demo_buffer[demo_position++] = keypress & 0x00ff;
demo_buffer[demo_position++] = keypress & 0x00ff;
 
} else if (demo_mode == 2)
{ /* playback */
Misc.c
1509,4 → 1509,3
exit(100); /* tell XPD to start DMapEdit again */
 
}
}
\ No newline at end of file
Makefile
0,0 → 1,37
CC = gcc
CFLAGS = -g -O2 -I$(DJDIR)\contrib\grx249\include
 
OBJECTS = \
Advanced.o \
Convert.o \
Debug.o \
Graphics.o \
Help.o \
Iformat.o \
Iformat2.o \
Ini.o \
Linemath.o \
Lines.o \
Main.o \
Memory.o \
Menus.o \
Misc.o \
Mouse.o \
Nodes.o \
Rect.o \
Sectors.o \
Sidedefs.o \
Template.o \
Textures.o \
Things.o \
Threed.o \
Vertexes.o \
Wad.o \
Windows.o \
Xpdrun.o
 
main.exe : $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) -o main.exe -L$(DJDIR)\contrib\grx249\lib\dj2 -lgrx20
 
%.o : %.c
$(CC) $(CFLAGS) -c $<
\ No newline at end of file
Graphics.c
53,6 → 53,8
 
#if defined(__GNUC__)
 
#include <grx20.h>
 
static word res[5][3] = {
{ 320, 200, 256 },
{ 640, 400, 256 },
Ini.c
2771,4 → 2771,3
s2++;
}
}
}
\ No newline at end of file
Textures.c
1881,7 → 1881,7
word i, *buffer2;
 
get_mem((void **) &buffer, 4100, "texture image buffer");
(uchar *) buffer2 = buffer;
buffer2 = buffer;
*buffer2 = *(buffer2 + 1) = 63;
 
if (game_id == 1)
Debug.c
523,4 → 523,3
}
return;
}
}
\ No newline at end of file