Adding qrash version 1.0

An animated musical demo for X11.

PR:		14554
Submitted by:	Trevor Johnson <trevor@jpj.net>
This commit is contained in:
Steve Price 1999-12-27 02:24:30 +00:00
parent ca9f43a18e
commit a08d0fc53f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=24143
27 changed files with 500 additions and 0 deletions

View file

@ -34,6 +34,7 @@
SUBDIR += offix-clipboard
SUBDIR += offix-execute
SUBDIR += props
SUBDIR += qrash
SUBDIR += rxvt
SUBDIR += sxpc
SUBDIR += tkgoodstuff

24
x11/qrash/Makefile Normal file
View file

@ -0,0 +1,24 @@
# New ports collection makefile for: qrash
# Version required: 1.0
# Date created: Oct 27, 1999
# Whom: Trevor Johnson <trevor@jpj.net>
#
# $FreeBSD$
#
DISTNAME= qrash
PKGNAME= qrash-1.0
CATEGORIES= x11
MASTER_SITES= http://metalab.unc.edu/pub/Linux/X11/demos/ \
ftp://metalab.unc.edu/pub/Linux/X11/demos/ \
ftp://qmg.rising.ru/pub/demos/qmg/
EXTRACT_SUFX= .tgz
MAINTAINER= trevor@jpj.net
GNU_CONFIGURE= yes
USE_GMAKE= yes
ALL_TARGET= qrash
USE_X_PREFIX= yes
.include <bsd.port.mk>

1
x11/qrash/distinfo Normal file
View file

@ -0,0 +1 @@
MD5 (qrash.tgz) = 3fc4a85b4b6093e08cd6dd85893bd118

12
x11/qrash/files/patch-aa Normal file
View file

@ -0,0 +1,12 @@
diff -ruN mikmod/drv_vox.c mikmod/drv_vox.c
--- mikmod/drv_vox.c Mon Sep 22 11:05:26 1997
+++ mikmod/drv_vox.c Mon Jul 26 12:10:35 1999
@@ -36,7 +36,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <linux/soundcard.h>
+#include <machine/soundcard.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include "mikmod.h"

36
x11/qrash/files/patch-ab Normal file
View file

@ -0,0 +1,36 @@
--- configure.orig Wed Sep 24 11:50:18 1997
+++ configure Sun Oct 24 05:48:05 1999
@@ -9,7 +9,7 @@
echo "what CPU has your box inside?"
echo "1) i386-compatible"
echo "2) none of the above"
-read cpu
+cpu=1
case $cpu in
1) echo "CPU=_g" > options ;
echo "CXXFLAGS += -Di386" >> options ;;
@@ -32,13 +33,13 @@
echo "3) Vesa (dos only)"
#echo "4) Win32 DirectDraw"
#echo "5) OS/2 DIVE"
-read gfx
+gfx=2
case $gfx in
1) echo "GFX=vga" >> options ;
echo "LIBS += -lvga" >> options ;;
2) echo "GFX=x11" >> options ;
- echo "LIBS += -L/usr/X11/lib -lX11" >> options ;;
+ echo "LIBS += -L/usr/X11R6/lib -lX11" >> options ;;
3) echo "GFX=dos" >> options ;
echo "LIBS += -Lsvgakit -lsvga -lpmode -lztime" >> options ;;
@@ -68,7 +70,7 @@
echo "10) none of the above"
#echo "11) Win32"
#echo "12) OS/2"
-read snd
+snd=1
case $snd in
1) echo "CXXFLAGS += -DLINUX" >> options ;
echo "DRIVER=vox" >> options ;;

10
x11/qrash/files/patch-ac Normal file
View file

@ -0,0 +1,10 @@
--- mikmod/virtch.c.orig Thu Sep 11 13:24:30 1997
+++ mikmod/virtch.c Sun Oct 24 04:31:42 1999
@@ -13,7 +13,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <malloc.h>
#include "mikmod.h"
#define FRACBITS 11

10
x11/qrash/files/patch-ad Normal file
View file

@ -0,0 +1,10 @@
--- mikmod/munitrk.c.orig Thu Sep 11 13:24:30 1997
+++ mikmod/munitrk.c Sun Oct 24 04:32:28 1999
@@ -10,7 +10,6 @@
All systems - all compilers
*/
-#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include "mikmod.h"

23
x11/qrash/files/patch-ae Normal file
View file

@ -0,0 +1,23 @@
--- Makefile.in.orig Wed Sep 24 09:49:16 1997
+++ Makefile.in Sun Oct 24 06:59:51 1999
@@ -1,5 +1,5 @@
# Maximum optimization
-CXXFLAGS += -O6 -ffast-math -funroll-loops -w
+CXXFLAGS += -O6 -ffast-math -funroll-loops -w -I /usr/X11R6/include/
# Debugging options
#CXXFLAGS += -g
@@ -49,6 +49,13 @@
parts.o:
$(CC) -c parts.cc
+
+install:
+ strip -s qrash
+ mkdir $(X11BASE)/share/qrash/
+ install -c -m 755 -o root -g wheel qrash $(X11BASE)/bin/
+ install -c -m 644 -o root -g wheel qrash.dat $(X11BASE)/share/qrash/
+ install -c -m 644 -o root -g wheel README $(X11BASE)/share/qrash/
DUMMY:

10
x11/qrash/files/patch-af Normal file
View file

@ -0,0 +1,10 @@
--- mikmod/load_xm.c.orig Thu Sep 11 13:24:30 1997
+++ mikmod/load_xm.c Sun Oct 24 06:55:11 1999
@@ -14,7 +14,6 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#include <malloc.h>
#include "mikmod.h"
/**************************************************************************

11
x11/qrash/files/patch-ag Normal file
View file

@ -0,0 +1,11 @@
--- resource.cc.orig Wed Sep 24 04:43:18 1997
+++ resource.cc Wed Oct 27 05:16:26 1999
@@ -62,7 +62,7 @@
void resInit( char* name )
{
- strcpy( resource_name, my_strlwr(name) );
+ strcpy( resource_name, "/usr/X11R6/share/qrash/qrash.dat" );
FILE* f = fopen( resource_name, "rb" );
if(f) {
fseek( f, -4, SEEK_END );

11
x11/qrash/files/patch-ah Normal file
View file

@ -0,0 +1,11 @@
--- video.h.orig Sun Dec 26 17:13:19 1999
+++ video.h Sun Dec 26 17:13:37 1999
@@ -28,7 +28,7 @@
#define VID_MAX_BRIGHT 64
#define MAX_RGB 256
-const VID_AVG_BRIGHT = VID_MAX_BRIGHT/2;
+const int VID_AVG_BRIGHT = VID_MAX_BRIGHT/2;
extern bool vidInitialized;

20
x11/qrash/files/patch-ai Normal file
View file

@ -0,0 +1,20 @@
--- video.cc.orig Sun Dec 26 17:14:12 1999
+++ video.cc Sun Dec 26 17:21:33 1999
@@ -99,7 +99,7 @@
modify [eax ebx ecx edx esi edi];
#else
-#ifdef i386
+#if defined(i386) && !defined(__FreeBSD__)
inline void
comb1( uchar* c1, uchar* b1, uchar* c, uchar* b, int n )
@@ -314,7 +314,7 @@
if( vidStartTime == -1 ) {
vidStartTime = sysTimer();
}
- static time = 0;
+ static int time = 0;
if( sysDebug && vidFrameCount%3 ) {
int frame_time = (sysTimer()-time);
int fps = frame_time ? 3*sysTimerRes / frame_time : 0;

38
x11/qrash/files/patch-aj Normal file
View file

@ -0,0 +1,38 @@
--- image.cc.orig Sun Dec 26 17:22:13 1999
+++ image.cc Sun Dec 26 17:22:52 1999
@@ -221,7 +221,7 @@
uchar* from = data + offsety*bytesPerLine + offsetx/8;
uchar* to = page + y*vidBytesPerLine + x;
for( int i=0; i<sizey; i++ ) {
- register mask = 0x80 >> (offsetx&7);
+ register int mask = 0x80 >> (offsetx&7);
for( int j=0,k=0; j<sizex; j++ ) {
if( from[k] & mask ) to[j]=color;
mask >>= 1; if( !mask ) { mask = 0x80; k++; }
@@ -285,7 +285,7 @@
int stepy = (sizeY<<16)/h; y=0;
for( int i=0; i<size_y; i++, y+=stepy ) {
from1 = from+(y>>16)*bytesPerLine;
- register stepx = (sizeX<<16)/w;
+ register int stepx = (sizeX<<16)/w;
for( int j=0, x=0; j<size_x; j++, x+=stepx ) {
if( from1[x>>16] ) to[j] = from1[x>>16];
}
@@ -316,7 +316,7 @@
int stepy = (sizeY<<16)/h; y=0;
for( int i=0; i<size_y; i++, y+=stepy ) {
from1 = from+(y>>16)*bytesPerLine;
- register stepx = (sizeX<<16)/w;
+ register int stepx = (sizeX<<16)/w;
for( int j=0, x=0; j<size_x; j++, x+=stepx ) {
if( from1[x>>16] ) to[j] = color;
}
@@ -347,7 +347,7 @@
int stepy = (sizeY<<16)/h; y=0;
for( int i=0; i<size_y; i++, y+=stepy ) {
from1 = from+(y>>16)*bytesPerLine;
- register stepx = (sizeX<<16)/w;
+ register int stepx = (sizeX<<16)/w;
for( int j=0, x=0; j<size_x; j++, x+=stepx ) {
to[j] = from1[x>>16]+to[j] <= 255 ? from1[x>>16]+to[j] : 255;
}

65
x11/qrash/files/patch-ak Normal file
View file

@ -0,0 +1,65 @@
--- 3d.cc.orig Sun Dec 26 17:23:11 1999
+++ 3d.cc Sun Dec 26 17:24:10 1999
@@ -234,7 +234,7 @@
if(x2ZGTS > offset && x1<offset+vidSizeX) {
if(x2ZGTS > offset+vidSizeX-1) x2ZGTS = offset+vidSizeX-1;
if(x1<offset) {
- register tmp = offset-x1;
+ register int tmp = offset-x1;
DrawLineZGTS( offset, leftz+zsZGTS*tmp, leftl+lsZGTS*tmp,
shorts( leftt.s.u+tsZGTS.s.u*tmp,
leftt.s.v+tsZGTS.s.v*tmp ) );
@@ -260,7 +260,7 @@
if(*x2ZGT > offset+vidSizeX)
*x2ZGT = offset+vidSizeX;
if( x1 < offset ) {
- register tmp = offset-x1;
+ register int tmp = offset-x1;
DrawLineZGT( offset, leftz+*zsZGT*tmp, leftl+*lsZGT*tmp,
shorts( leftt.s.u+tsZGT->s.u*tmp,
leftt.s.v+tsZGT->s.v*tmp ) );
@@ -339,7 +339,7 @@
if(x2ZG> offset && x1<offset+vidSizeX) {
if(x2ZG> offset+vidSizeX) x2ZG= offset+vidSizeX;
if(x1<offset) {
- register tmp = offset-x1;
+ register int tmp = offset-x1;
DrawLineZG( offset, leftz+zsZG*tmp, leftl+lsZG*tmp, 0 );
}
else {
@@ -373,7 +373,7 @@
if(x2SGT > offset+vidSizeX)
x2SGT = offset+vidSizeX;
if( x1 < offset ) {
- register tmp = offset-x1;
+ register int tmp = offset-x1;
DrawLineSGT( offset, 0, leftl+lsSGT*tmp,
shorts( leftt.s.u+tsSGT.s.u*tmp,
leftt.s.v+tsSGT.s.v*tmp ) );
@@ -455,7 +455,7 @@
if(*x2ZP > offset && x1<offset+vidSizeX) {
if(*x2ZP > offset+vidSizeX) *x2ZP = offset+vidSizeX;
if(x1<offset) {
- register tmp = offset-x1;
+ register int tmp = offset-x1;
DrawLineZP( offset, leftz+*zsZP*tmp,
shorts( leftl.s.u+lsZP->s.u*tmp,
leftl.s.v+lsZP->s.v*tmp ), 0 );
@@ -492,7 +492,7 @@
if(*x2SP> offset && x1<offset+vidSizeX) {
if(*x2SP> offset+vidSizeX) *x2SP = offset+vidSizeX;
if(x1<offset) {
- register tmp = offset-x1;
+ register int tmp = offset-x1;
DrawLineSP( offset, 0,
shorts( leftl.s.u+lsSP->s.u*tmp,
leftl.s.v+lsSP->s.v*tmp ), 0 );
@@ -1455,7 +1455,7 @@
void FacedObject::SplitFace( Face* f, bool vertical )
{
- static color = 255;
+ static int color = 255;
Point *p1, *p2;
int n1 ,n2;
bool s01 = false;

22
x11/qrash/files/patch-al Normal file
View file

@ -0,0 +1,22 @@
--- crash.cc.orig Sun Dec 26 17:24:37 1999
+++ crash.cc Sun Dec 26 17:24:56 1999
@@ -109,7 +109,7 @@
{ { 1, partText, 1, 2 }, { 0, 0, 0, 0 } }, // 60
{ { 1, foo, 0, 0 }, { 0, 0, 0, 0 } } // 61
};
- const N_PARTS = sizeof(parts)/2/sizeof(PartDesc);
+ const int N_PARTS = sizeof(parts)/2/sizeof(PartDesc);
// sysRegisterKeyboardHandler( &handler ); doesn't work anymore
@@ -195,8 +195,8 @@
musSetVolume( 100-row*100/64 );
}
if( skip ) {
- static first = true;
- static skip_order = 0;
+ static int first = true;
+ static int skip_order = 0;
if( first ) {
skip_order = order;
first = false;

20
x11/qrash/files/patch-am Normal file
View file

@ -0,0 +1,20 @@
--- rotate.cc.orig Sun Dec 26 17:25:17 1999
+++ rotate.cc Sun Dec 26 17:25:29 1999
@@ -23,7 +23,7 @@
#include "music.h"
#include "common.h"
-const ANGLE_TIME = 6*sysTimerRes;
+const int ANGLE_TIME = 6*sysTimerRes;
class Rotate: public Part {
void Init();
@@ -64,7 +64,7 @@
u[i] = uu+backpic->sizeX/2; v[i] = vv+backpic->sizeY/2;
}
- static offset=0;
+ static int offset=0;
backpic->MapToPage2( u[0], v[0], u[1], v[1], u[2], v[2], u[3], v[3],
bw+offset );
offset = 1-offset;

37
x11/qrash/files/patch-an Normal file
View file

@ -0,0 +1,37 @@
--- abstract.cc.orig Sun Dec 26 17:25:53 1999
+++ abstract.cc Sun Dec 26 17:26:20 1999
@@ -26,7 +26,7 @@
#include "parts.h"
#include "common.h"
-const N_FIG=9, N_PHASES=4;
+const int N_FIG=9, N_PHASES=4;
struct Abstract: public Part {
TPoly2D* fig_phases[N_PHASES][N_FIG];
@@ -77,7 +77,7 @@
// if( !what ) return;
- static phase = 0;
+ static int phase = 0;
static bool phase_done = true;
TPoly2D* fig[N_FIG];
for( i=0; i<N_FIG; i++ ) {
@@ -111,14 +111,14 @@
phase_done = true;
}
}
- static scale_timer = 0;
+ static int scale_timer = 0;
static int old_order = 0;
static int next_row = 5;
if( old_order != order ) {
old_order = order;
next_row = 7;
}
- static color_offset = 10;
+ static int color_offset = 10;
switch( what ) {
case 0: {
if( row >= next_row ) {

22
x11/qrash/files/patch-ao Normal file
View file

@ -0,0 +1,22 @@
--- brain.cc.orig Sun Dec 26 17:26:48 1999
+++ brain.cc Sun Dec 26 17:27:03 1999
@@ -24,7 +24,7 @@
#include "music.h"
#include "lines.h"
-const NX=6, NY=4;
+const int NX=6, NY=4;
class Brain: public Part {
@@ -112,8 +112,8 @@
// vidSizeY *= 2; vidBytesPerLine /= 2;
// offset = vidBytesPerLine-offset;
// cage->Draw( 0, color, bw );
- static c = 0;
- static old_row = -1;
+ static int c = 0;
+ static int old_row = -1;
if( row/6 != old_row ) {
old_row = row/6;
c += 6;

20
x11/qrash/files/patch-ap Normal file
View file

@ -0,0 +1,20 @@
--- begin.cc.orig Sun Dec 26 17:27:30 1999
+++ begin.cc Sun Dec 26 17:27:56 1999
@@ -27,7 +27,7 @@
#include "parts.h"
#include "common.h"
-const ANGLE_TIME = 4*sysTimerRes,
+const int ANGLE_TIME = 4*sysTimerRes,
ALIGN_TIME = 2*sysTimerRes,
PAL_TIME = 5*sysTimerRes,
FLASH_TIME = 0.5*sysTimerRes;
@@ -147,7 +147,7 @@
}
// SmoothPage(bw,bw);
- static offset=0;
+ static int offset=0;
back->MapToPage2( u[0], v[0], u[1], v[1], u[2], v[2], u[3], v[3],
color+offset );
offset = 1-offset;

29
x11/qrash/files/patch-aq Normal file
View file

@ -0,0 +1,29 @@
--- space.cc.orig Sun Dec 26 17:28:16 1999
+++ space.cc Sun Dec 26 17:29:43 1999
@@ -31,8 +31,8 @@
"anvil.asc",
"abomb2.asc",
"vette.asc" };
-const N_OBJECTS = sizeof(obj_names) / sizeof(char*);
-const N_MAN=5;
+const int N_OBJECTS = sizeof(obj_names) / sizeof(char*);
+const int N_MAN=5;
struct Space: public Part {
@@ -149,13 +149,13 @@
VID_MAX_SIZE_X/2 - 2*cur_timer*VID_MAX_SIZE_X/sysTimerRes );
objects[cur_object]->Draw( 0, color, bw );
- static offset = 0;
+ static int offset = 0;
vidSizeY /= 2; vidBytesPerLine *= 2;
vidCopyPage(color+offset,back->data);
vidSizeY *= 2; vidBytesPerLine /= 2;
offset = vidBytesPerLine - offset;
- static prev_row = -1, delta = 0, prev_time = 0, mirror = 1;
+ static int prev_row = -1, delta = 0, prev_time = 0, mirror = 1;
if( row/12 != prev_row ) {
delta = -vidSizeX/5;
mirror = -mirror;

20
x11/qrash/files/patch-ar Normal file
View file

@ -0,0 +1,20 @@
--- cars.cc.orig Sun Dec 26 17:29:59 1999
+++ cars.cc Sun Dec 26 17:30:19 1999
@@ -105,7 +105,7 @@
}
what &= 0xF;
- static old_order = -1, next_row = 5, scale_timer = 0;
+ static int old_order = -1, next_row = 5, scale_timer = 0;
static bool scale_flag = false;
if( old_order != order ) {
old_order = order;
@@ -117,7 +117,7 @@
scale_flag = !scale_flag;
}
- static offset = 0;
+ static int offset = 0;
float scale = 1;

11
x11/qrash/files/patch-as Normal file
View file

@ -0,0 +1,11 @@
--- wave.cc.orig Sun Dec 26 17:30:36 1999
+++ wave.cc Sun Dec 26 17:30:46 1999
@@ -22,7 +22,7 @@
#include "music.h"
#include "common.h"
-const WAVE_WIDTH = VID_MAX_SIZE_X/3;
+const int WAVE_WIDTH = VID_MAX_SIZE_X/3;
struct Wave: public Part {
void Init();

11
x11/qrash/files/patch-at Normal file
View file

@ -0,0 +1,11 @@
--- dlines.cc.orig Sun Dec 26 17:31:31 1999
+++ dlines.cc Sun Dec 26 17:31:41 1999
@@ -24,7 +24,7 @@
#include "smooth.h"
#include "image.h"
-const MIN_LINE_LIFE = 2*sysTimerRes,
+const int MIN_LINE_LIFE = 2*sysTimerRes,
MAX_LINE_LIFE = 4*sysTimerRes,
MAX_LINES = 300;

25
x11/qrash/files/patch-au Normal file
View file

@ -0,0 +1,25 @@
--- points.cc.orig Sun Dec 26 17:32:08 1999
+++ points.cc Sun Dec 26 17:32:34 1999
@@ -95,7 +95,7 @@
}
case 1: {
- static old_row=-1, scale_timer = -1;
+ static int old_row=-1, scale_timer = -1;
if( row != old_row &&
(row == 2 || row == 6 || row == 9 || row == 11 || row == 14) ) {
old_row = row;
@@ -128,11 +128,11 @@
if( what == 4 ) {
vidCopyPage( color, pic->data );
}
- static offset = 0;
+ static int offset = 0;
static int old_row=-1;
if( row/6 != old_row && row > 18 ) {
old_row = row/6;
- static coord = 0;
+ static int coord = 0;
coord = (coord+1) % 4;
u[coord] *= 0.7; v[coord] *= 0.7;
}

1
x11/qrash/pkg-comment Normal file
View file

@ -0,0 +1 @@
Animated musical demo for X11

6
x11/qrash/pkg-descr Normal file
View file

@ -0,0 +1,6 @@
This program is a demo for X11, combining mod-format music with animation
"featuring 2D and 3D engines with texturing and shading". Some of the
content may be offensive.
Trevor Johnson
trevor@jpj.net

4
x11/qrash/pkg-plist Normal file
View file

@ -0,0 +1,4 @@
bin/qrash
share/qrash/README
share/qrash/qrash.dat
@dirrm share/qrash/