1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

new-port: game, train control simulation

New port, game, a little simulation of a train dispatching station.

	Can simulate real station with real schedules. Datafiles
	downloadable from the home page.

PR:		ports/45316
Submitted by:	Guido Falsi <mad@madpilot.net>
This commit is contained in:
Edwin Groothuis 2003-09-08 06:58:00 +00:00
parent b56dbeaac9
commit 7870753520
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=88745
14 changed files with 215 additions and 0 deletions

View File

@ -359,6 +359,7 @@
SUBDIR += torcs
SUBDIR += tornado
SUBDIR += tractorgen
SUBDIR += traindirector
SUBDIR += trojka
SUBDIR += ttraffic
SUBDIR += tux-aqfh

View File

@ -0,0 +1,37 @@
# New ports collection makefile for: oneko
# Date created: 15/11/2002
# Whom: Guido Falsi <mad@madpilot.net>
#
# $FreeBSD$
#
PORTNAME= tdir
PORTVERSION= 1.17f
CATEGORIES= games
MASTER_SITES= http://www.backerstreet.com/traindir/
DISTNAME= tdir117s
MAINTAINER= mad@madpilot.net
COMMENT= Train controller simulation
USE_ZIP= yes
USE_XLIB= yes
USE_X_PREFIX= yes
USE_GNOME= gtk12 glib12
USE_REINPLACE= yes
NO_WRKSUBDIR= yes
post-extract:
${REINPLACE_CMD} -e 's/ //' ${WRKSRC}/*
post-patch:
@ cd ${WRKSRC} ; ${LN} MAKEFILE Makefile ; \
${MV} Gdialog.c gdialog.c ; ${MV} Gtkopen.c gtkopen.c ; \
${MV} Gtkopen.h gtkopen.h ; ${MV} Html.c html.c ; \
${MV} Html.h html.h
post-configure:
${REINPLACE_CMD} -e 's,\#include \<malloc.h\>,/* include malloc.h */,' \
${WRKSRC}/gdialog.c
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (tdir117s.zip) = a395243f384798de3e1a0bd6af40a3c5

View File

@ -0,0 +1,47 @@
*** MAKEFILE.orig Sat May 20 09:37:10 2000
--- MAKEFILE Fri Nov 15 17:35:13 2002
***************
*** 1,20 ****
! OBJS = button.o clist.o field.o gtkask.o gtkmain.o loadsave.o \
! menu.o run.o table.o track.o trsim.o
CC = gcc
! CFLAGS =
DEBUG = -g
all: trsim
trsim: $(OBJS)
! $(CC) -o $@ $(OBJS) `gtk-config --libs` -lcurses
.c.o:
! $(CC) `gtk-config --cflags` $(CFLAGS) $(DEBUG) -c $<
clean:
rm -f *.o trsim core
--- 1,22 ----
! OBJS = button.o clist.o field.o gtkask.o gtkmain.o gtkopen.o gdialog.o \
! loadsave.o menu.o run.o table.o track.o trsim.o html.o tgraph.o
CC = gcc
! CFLAGS +=
DEBUG = -g
all: trsim
trsim: $(OBJS)
! $(CC) -o $@ $(OBJS) `gtk12-config --libs` -lcurses
.c.o:
! $(CC) `gtk12-config --cflags` $(CFLAGS) $(DEBUG) -c $<
+ install: trsim
+ $(INSTALL) -o bin -g bin -m 555 trsim $(PREFIX)/bin
clean:
rm -f *.o trsim core

View File

@ -0,0 +1,10 @@
--- field.c.orig Sun Sep 7 23:43:51 2003
+++ field.c Sun Sep 7 23:43:58 2003
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <malloc.h>
#include "trsim.h"
#include "gtkui.h"

View File

@ -0,0 +1,11 @@
--- gtkmain.c.orig Sun Sep 7 23:48:20 2003
+++ gtkmain.c Sun Sep 7 23:48:30 2003
@@ -143,7 +143,7 @@
#ifdef unix
if(getenv("TDHOME"))
- chdir(getenv("TDHOME"))
+ chdir(getenv("TDHOME"));
#endif
screen_width = gdk_screen_width();

View File

@ -0,0 +1,11 @@
--- loadsave.c.orig Sun Sep 7 23:41:44 2003
+++ loadsave.c Sun Sep 7 23:41:51 2003
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <memory.h>
#include <string.h>
#include "trsim.h"

View File

@ -0,0 +1,43 @@
--- run.c.orig Sun Sep 7 23:40:41 2003
+++ run.c Sun Sep 7 23:42:04 2003
@@ -20,10 +20,15 @@
#include <stdio.h>
#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
#include "ask.h"
#include "trsim.h"
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
+
int assign_ok = 1;
int changed;
@@ -56,7 +61,11 @@
{
if(i >= v->size) {
printf("Bad index %d: only %d elements in vector!\n", i, v->size);
+#if (defined(BSD) && (BSD >= 199103))
+ abort();
+#else
abort(0);
+#endif
}
return v->ptr[i];
}
@@ -65,7 +74,11 @@
{
if(i >= v->size) {
printf("Bad index %d: only %d elements in vector!\n", i, v->size);
+#if (defined(BSD) && (BSD >= 199103))
+ abort();
+#else
abort(0);
+#endif
}
return v->flags[i];
}

View File

@ -0,0 +1,11 @@
--- tgraph.c.orig Sun Sep 7 23:42:59 2003
+++ tgraph.c Sun Sep 7 23:43:04 2003
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <malloc.h>
+#include <stdlib.h>
#include "trsim.h"
#define STATION_WIDTH 100

View File

@ -0,0 +1,11 @@
--- track.c.orig Sun Sep 7 23:43:06 2003
+++ track.c Sun Sep 7 23:43:10 2003
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
#include "trsim.h"
#include "ask.h"

View File

@ -0,0 +1,11 @@
--- track1.c.orig Sun Sep 7 23:43:12 2003
+++ track1.c Sun Sep 7 23:43:16 2003
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
#include "trsim.h"
#include "ask.h"

View File

@ -0,0 +1,11 @@
--- trsim.c.orig Sun Sep 7 23:43:16 2003
+++ trsim.c Sun Sep 7 23:43:23 2003
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <stdlib.h>
#include "ask.h"
#include "html.h"

View File

@ -0,0 +1,9 @@
With Train Director you can simulate the work of the Centralized
Traffic Control by controlling the movement of trains by throwing
switches and clearing signals. You can also create your own territories
with the included track layout editor.
WWW: http://www.backerstreet.com/traindir/trdireng.htm
--
Guido Falsi <mad@madpilot.net>

View File

@ -0,0 +1 @@
bin/trsim