Initial commit, I believe I fixed MIDI playback - but I don't remember.

This commit is contained in:
Marco Cawthorne 2022-02-14 00:15:25 -08:00
commit b646117313
Signed by: eukara
GPG Key ID: C196CD8BA993248A
259 changed files with 150479 additions and 0 deletions

342
COPYING Executable file
View File

@ -0,0 +1,342 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

116
README Executable file
View File

@ -0,0 +1,116 @@
================
ROTT Port README
================
This is a port of Apogee's 3D action title Rise of the Triad, originally
released in 1994. This port duplicates the functionality of the original
game on modern operating systems, including Linux, Win32, and Mac OS X.
This port makes use of the Simple Direct Media Layer, or SDL, and an additional
library named SDL_mixer. If you do not have these libraries installed, check
the links section below.
This software is distributed in source code format and is licensed under the
terms of the GNU General Public License. A copy of this license is included
with the software in the file COPYING.
This software is not supported by 3D Realms, Apogee, or the porters.
For reference, the primary contributors to this port are:
Steven Fuller
Ryan C. Gordon
John Hall
Dan Olson
-------------------------
Notes for the 1.1 Release
-------------------------
Thanks to the effort of the contributors listed below (and probably many more),
lots of bug fixes, portability improvements and new features have found their
way into the 1.1 release. Many changes have been ported over from the WinRott
port (not WinRottGL but plain WinRott) with the high resolution software
rendering support being the main feature of all these changes. Portability
fixes include support for 64-bit and big-endian systems.
Birger N. Andreasen (author of the WinRott port
<http://home14.inet.tele.dk/Bna-Info/>, initial work by Jonathan Bailey)
Hans de Goede (porting of the WinRott high resolution renderer,
lots of bug and portability fixes for the Fedora package)
Alexander Thomas aka Dr. Lex (author of the OS X port
<http://www.dr-lex.be/software/rott.html>, thanks Filippo Giunchedi for
creating the appropriate patch for the Debian package)
Michael Karcher (lots of bug and portability fixes for the Debian package)
Fabian Greffrath (some minor improvements)
----------------------------
Notes for the 1.1.x Releases
----------------------------
Version 1.1.1 is merely a bugfix release that contains all the patches that
have accumulated in Fedora and Debian during the previous year.
Version 1.1.2 is another bugfix release that contains the Debian patches from
the previous two and a half years; among them enabling the playback of demo
files. Furthermore the build system has undergone a complete overhaul.
Enabling the use of UNICODE (instead of keyboard scancodes) for the cheat codes
and names in the highscore table is considered the release goal for the next
point release. Getting network play working is considered the release goal for
the 2.0 version. Work on both of these projects has not yet begun, though...
In this context: Please send bug reports, questions, suggestions and comments
to the Fedora or Debian maintainers of the respective rott packages in these
distributions. Patches are always welcome. ;-)
-------------
General Hints
-------------
To compile the source code under Linux, change to the rott/ directory and type:
make clean
make
The build system is setup to use shareware binaries. If you want to use the
registered version of ROTT, compile with:
make SHAREWARE=0
You may additionally append SUPERROTT=1 or SITELICENSE=1, if you want to use
the CD version or the Site License CD version, respectively. However, make
sure to only set one of them to 1 at once. You may want to edit rott/Makefile
to make your changes persistent.
It is generally recommended to build against the most recent version of
the Simple Direct Media Layer and SDL_mixer.
------------
Known Issues
------------
- Demos go out of sync.
- No netplay support.
-------------
Helpful Links
-------------
ROTT Port site:
http://icculus.org/rott/
The Simple Direct Media Layer:
http://www.libsdl.org/
SDL_mixer:
http://www.libsdl.org/projects/SDL_mixer
3D Realms official forum on ROTT source code:
http://forums.3drealms.com/ubb/ultimatebb.php?ubb=forum;f=24

35
doc/13todo.txt Executable file
View File

@ -0,0 +1,35 @@
( ) NME does not always exit level upon killing him
( ) Game locks when firing Darkstaff or Dog Mode at El Oscuro
( ) Network server locks up when exiting net game
( ) Stand( )alone server doesn't work consistently
( ) Break out with error message if ROTT is run with no sound.rot
( ) Quickload question should have (Y/N) on end
( ) Phone number length needs to be lengthed.
( ) Network packets need checksum word added to their packets
( ) VR gear new mouse sub functions
( ) Dog mode still locks up as well as some bat blast stuff
( ) Fix Live Remote Ridicule
( ) Wall can push you into platform so you fall down inside of it and be
stuck.
( ) Hanging at menu after a few network/modem games
( ) Hanging at warp menu prompt
( ) Warp Menu: chose level, screen went black, some how still in level select
( ) Unexpect Interrupt
( ) Generat random levels and battle levels. Choose alternate both.
New game End Game New Game Kaboom
( ) Make snake heads hurt to touch (fixes snake trapping you)
( ) Fix missiles not hitting enemy when standing face to face
( ) lockup on snake with one head left
( ) gamepad enabled before joystick enabled
( ) bark blast under dog walls and stuff
( ) config files saved in alternat RTS directory
( ) people complaining about reconfiging joystick each time
( ) Panic mapping over modem glass in 8 megs not in 4 megs
( ) Voice credit for OverPatrol (CHuck) Lightning guard (william)
MAP Stuff
( ) level 1( )3 in random powerup crossroads room, two different wall types
( ) Krist, if led outside of room, goes up disks, but can't go down them.
So he winds up running around sky. Fix map to lock door so Krist cannot
come out...

106
doc/cheats.txt Executable file
View File

@ -0,0 +1,106 @@
DISPSTICK // enable cheats
\ECC // enable cheats
SLACKER // three keys, more health
\BUM // three keys, more health
CHOJIN // normal god mode
\WWW // normal god mode
GOTO // warp
\GTL // warp
SIXTOYS // all keys, armor, 100% health
\GAI // all keys, armor, 100% health
TOOSAD // god mode powerup
\GOD // god mode powerup
// Register only
WOOF // dog mode powerup
\DOG // dog mode powerup
// end
FLYBOY // mercury mode powerup
\MER // mercury mode powerup
BADTRIP // shrooms mode powerup
\SHR // shrooms mode powerup
BOING // elasto mode powerup
\ELA // elasto mode powerup
GOOBERS // warp to level 1, start with pistol
\GOO // warp to level 1, start with pistol
WHACK // hurt player 10%
\OOF // hurt player 10%
SPEED // run fast all the time
\RFA // run fast all the time
PANIC // back to normal
\PAN // back to normal
DIMON // light diminishing on
\DON // light diminishing on
DIMOFF // light diminishing off
\DOF // light diminishing off
LONDON // fog on (0x00 - 0x80 minmax)
\FON // fog on (0x00 - 0x80 minmax)
NODNOL // fog off (0x80 - 0xFF minmax)
\FOF // fog off (0x80 - 0xFF minmax)
GOGATES // blow out of game
\L8R // blow out of game
GOARCH // end the current level
\ECL // end the current level
GOTA386 // floor and ceiling off
\CON // floor and ceiling off
GOTA486 // floor and ceiling on
\COF // floor and ceiling on
SHOOTME // bullet proof armor
\BAR // bullet proof armor
BURNME // fire proof armor
\FAR // fire proof armor
LUNGDUNG // gas mask
\GAR // gas mask
HUNTPACK // all keys, armor, 100% health, MP40,
\OFP // all keys, armor, 100% health, MP40,
86ME // kill player
\DIE // kill player
NEER // re-enter level
\REL // re-enter level
JOHNWOO // give double pistol
\GW2 // give double pistol
PLUGME // give mp40
\GW3 // give mp40
VANILLA // give bazooka
\GW4 // give bazooka
HOTTIMES // give heatseeker
\GW5 // give heatseeker
BOOZE // give drunk missile
\GW6 // give drunk missile
FIREBOMB // give firebomb
\GW7 // give firebomb
BONES // give firewall
\GW8 // give firewall
SEEYA // give god hand
\GW9 // give god hand
// Register Only
SPLIT // give split missile
\GWA // give split missile
KESOFDEATH // give kes
\GWB // give kes
HOMERUN // give bat
\GWC // give bat
CUJO // give dog weapon
\GWD // give dog weapon
// end
RIDE // give MISSILE CAM
\CAM // give Missile Cam
WHERE // turn where am i on/off
\HUD // give hud
\FUN // Rotation fun
RECORD // Demo RECORD
STOP // Demo stop recording
PLAY // Demo Playback
\EKG // Engine Killing Gibs
MAESTRO // JukeBox
\LEE // JukeBox
CARTIER // Map Cheat
\MAP // Map Cheat
\YOU // Secret Message
HAVE // Secret Message
\NO // Secret Message
LIFE // Secret Message

75
doc/cmdline.txt Executable file
View File

@ -0,0 +1,75 @@
ROTT.EXE
========
NOWAIT go to menu, skip intro
NOSOUND no music no sound
NOW go immediately into game default difficulty default level 1
DOPEFISH Scott Head intro, random sounds in credits, burping while
caching, silly strings, eluder/deluder as scott's head,
silly death cam, silly menu sounds
MAPSTATS Print out map statistics to MAPDEBUG.TXT
TILESTATS Print out tile statistics to MAPDEBUG.TXT
VER Rott version number
PAUSE Pause after printing startup info
SOUNDSETUP Launch sound Setup WARP [level] Launch to any level (1 based)
LEVELSIZE compute memory needed for level
SLOWDEATH slow down death rotation
QUIET get rid of all start up text except for errors
FILE
FILE1 add external wads for graphic replacement
FILE2
NOJOYS disable joystick test
NOMOUSE disable mouse test
SPACEBALL enable spaceball avenger
CYBERMAN enable cyberman
ASSASSIN enable wingman assassin
NOECHO turn off reverb effect
DEMOEXIT exit the game when demo is interrupted
TIMELIMIT play for a certain amount of time in seconds
once time is gone game ends (unlimited lives)
get more time by killing guards and picking up ankhs
must use MAXTIMELIMIT as well
MAXTIMELIMIT the max time to count down from so if you keep killing
guards you cannot get an infinite amount of time
must use TIMELIMIT as well
ENABLEVR enable Virtual Reality support for HMD's (Head mounted disp)
WARP warp to a specific level 1 based level 1 is 1
NET Used by ROTTSER and ROTTIPX
IS8250 Used by ROTTSER whether you have an 8250 or not
TEDLEVEL Ted stuff
(DEV ONLY) MONO enable mono-monitor support (Development only)
(DEV ONLY) TRANSPORT Warp to any x,y,angle in level (Development only)
(DEV ONLY) SCREENSHOTS get rid of screen title stuff (Development only)
ROTTSER.EXE
========
VECTOR interrupt vector with which to communicate with ROTT
ANSWER answer mode
DIAL dial mode
PAUSE pause before launching
STATS print out run time stats after ROTT returns
PLAYER 0 - makes you the master
1 - makes you not the master
must be used on both systems with different values, to work
properly
ROTTIPX.EXE
========
VECTOR interrupt vector with which to communicate with ROTT
PAUSE pause before launching
NODES number of players in game
SOCKET network socket to use
SERVER specify this computer to be a server
STANDALONE specify this server to be standalone
else client on top of server
MASTER used by client to make yourself the master
REMOTERIDICULE turn on remote ridicule support

508
doc/hacker.txt Executable file
View File

@ -0,0 +1,508 @@
Rise of the Triad
Version 1.1
Hacker Info
RTL & RTC File format:
----------------------
Rise of the Triad (ROTT) uses two file extensions for levels data, RTL
and RTC. RTC indicates that the file is for Comm-bat (multiplayer) play
only and does not contain any enemies or exits. RTL indicates the file
can can be used for both Comm-bat and standard game levels. In Comm-bat,
the enemies in RTL maps in standard play are not present during Comm-bat
games and the exit and entrance arches behave like teleporters. Other than
these differences, the two files are alike.
The RTL/RTC file format changed with the release of ROTT version 1.1.
Since the shareware version of ROTT cannot use alternate levels, this
should not be a problem for map designers. The new format is much more
formal. If any changes are made in the format in the future, the first 8
bytes of the file will inform you if it is compatible with your editor/viewer.
The RTL/RTC file is broken into three sections: Version info, Header block,
and Data block.
RTL/RTC version info
This 8 byte block of data indicates what type of file it is and which
version of the RTL/RTC file format it is.
Offset Size Description
-------------------------------------------------------------
0 4 Format signature
4 4 Version number
Format signature :
This is used to indicate what type of levels are contained within the
file. This is a null-terminated string containing either "RTL" or "RTC".
Version number :
0101h for version 1.1. If this value is higher, it indicates that the file
format has changed. This is NOT the ROTT version.
RTL/RTC Header block
The header block contains an array of 100 structures with the following
format:
Offset Size Explanation
-------------------------------------------------------------
0 4 Used flag
4 4 CRC
8 4 RLEWtag
12 4 MapSpecials
12 4 Offset in file of Wall plane
16 4 Offset in file of Sprite plane
20 4 Offset in file of Info plane
24 4 Length of Wall plane
28 4 Length of Sprite plane
32 4 Length of Info plane
36 24 Name of level
Used flag :
This is non-zero if a map exists at this position.
CRC :
This value is used to determine if all the players in a multiplayer game
are using the same maps. You can use any method you like to calculate this
value.
RLEWtag :
This is the run-length encoding tag used for compressing and decompressing
the map data. The use of this will be described below.
MapSpecials :
This is used for flags that describe special conditions for the level.
Currently only one flag is used. If Bit 0 is set, then all the pushwalls
will be activated in Comm-bat mode. This is done in case there are player
start locations within hidden areas and the player would be trapped until
a pushwall was activated.
Offsets :
The Wall, Sprite, and Info plane offsets are each absolute offsets of the
data from the beginning of the file.
Lengths :
The Wall, Sprite, and Info plane lengths are each lengths of the
uncompressed data.
Name of level :
This is a null-terminated string containing the name of the level.
Although there is 24 bytes available, level names should be at most 22
bytes long.
RTL/RTC Data block
When expanded, ROTT maps contain 3 planes of 128 by 128 word sized data.
They are stored in the RTL/RTC files as 3 blocks of run-length encoded
data. The procedure for decompressing them is as follows:
1) Allocate 128 * 128 words of memory (32768 bytes)
2) Read one word from compressed block
3) If word is equal to RLEWTag, then the next two words are a compressed
run of data. The first word is the number of words to write.
The second word is the value to write map.
If word was not equal to RLEWTag, then simply write that word
to the map.
4) Go back to 2 until all data is written.
Here's an example of the procedure in C.
/*---------------------------------------------------------------------
Function: RLEW_Expand
Run-length encoded word decompression.
---------------------------------------------------------------------*/
void RLEW_Expand
(
unsigned short *source,
unsigned short *dest,
long length,
unsigned short rlewtag
)
{
unsigned short value;
unsigned short count;
unsigned short *end;
end = dest + length;
while( dest < end );
{
value = *source;
source++;
if ( value != rlewtag )
{
//
// uncompressed data
//
*dest = value;
dest++;
}
else
{
//
// compressed string
//
count = *source;
source++;
value = *source;
source++;
//
// expand the data
//
while( count > 0 )
{
*dest = value;
dest++;
count--;
}
}
}
}
Here is sample code for loading a ROTT map.
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>
#include <io.h>
/*---------------------------------------------------------------------
Map constants
---------------------------------------------------------------------*/
#define MAXLEVELNAMELENGTH 23
#define ALLOCATEDLEVELNAMELENGTH 24
#define NUMPLANES 3
#define NUMHEADEROFFSETS 100
#define MAPWIDTH 128
#define MAPHEIGHT 128
#define MAP_SPECIAL_TOGGLE_PUSHWALLS 0x0001
#define WALL_PLANE 0
#define SPRITE_PLANE 1
#define INFO_PLANE 2
/*---------------------------------------------------------------------
Type definitions
---------------------------------------------------------------------*/
typedef struct
{
unsigned long used;
unsigned long CRC;
unsigned long RLEWtag;
unsigned long MapSpecials;
unsigned long planestart[ NUMPLANES ];
unsigned long planelength[ NUMPLANES ];
char Name[ ALLOCATEDLEVELNAMELENGTH ];
} RTLMAP;
/*---------------------------------------------------------------------
Global variables
---------------------------------------------------------------------*/
unsigned short *mapplanes[ NUMPLANES ];
/*---------------------------------------------------------------------
Macros
---------------------------------------------------------------------*/
#define MAPSPOT( x, y, plane ) \
( mapplanes[ plane ][ MAPWIDTH * ( y ) + ( x ) ] )
#define WALL_AT( x, y ) ( MAPSPOT( ( x ), ( y ), WALL_PLANE ) )
#define SPRITE_AT( x, y ) ( MAPSPOT( ( x ), ( y ), SPRITE_PLANE ) )
#define INFO_AT( x, y ) ( MAPSPOT( ( x ), ( y ), INFO_PLANE ) )
/*---------------------------------------------------------------------
Function: ReadROTTMap
Read a map from a RTL/RTC file.
---------------------------------------------------------------------*/
void ReadROTTMap
(
char *filename,
int mapnum
)
{
char RTLSignature[ 4 ];
unsigned long RTLVersion;
RTLMAP RTLMap;
int filehandle;
long pos;
long compressed;
long expanded;
int plane;
unsigned short *buffer;
filehandle = open( filename, O_RDONLY | O_BINARY );
//
// Load RTL signature
//
read( filehandle, RTLSignature, sizeof( RTLSignature ) );
//
// Read the version number
//
read( filehandle, &RTLVersion, sizeof( RTLVersion ) );
//
// Load map header
//
lseek( filehandle, mapnum * sizeof( RTLMap ), SEEK_CUR );
read( filehandle, &RTLMap, sizeof( RTLMap ) );
if ( !RTLMap.used )
{
//
// Exit on error
//
printf( "ReadROTTMap: Tried to load a non existent map!" );
exit( 1 );
}
//
// load the planes in
//
expanded = MAPWIDTH * MAPHEIGHT * 2;
for( plane = 0; plane <= 2; plane++ )
{
pos = RTLMap.planestart[ plane ];
compressed = RTLMap.planelength[ plane ];
buffer = malloc( compressed );
lseek( filehandle, pos, SEEK_SET );
read( filehandle, buffer, compressed );
mapplanes[ plane ] = malloc( expanded );
RLEW_Expand( buffer, mapplanes[ plane ], expanded >> 1, RTLMap.RLEWtag );
free( buffer );
}
close( filehandle );
}
MAP WEIRDNESS
-------------
You can pretty much figure out most of the map data easily, but there are
a few things in the map which are a little oddly set up. Here's a few
helpful items.
THE UPPER CORNER
The first row of a map contains vital information to setting up a map.
In the first plane (WALLS) are these values:
0,0 FLOOR # (0xB4 through 0xC3, though we might cut some)
1,0 CEILING # (0xC6 through 0xD5, or skies: 0xEA to 0xEE)
2,0 BRIGHTNESS LEVEL (0xD8 to 0xDF, from dark to light)
3,0 RATE AT WHICH LIGHT FADES OUT WITH DISTANCE
(0xFC to 0x010B, fast to slow)
In the second plane (SPRITES) are these:
0,0 Height of level
(1-8 ranges from 0x5A to 0x61, 9-16 is from 0x01C2 to 0x01C9)
1,0 Height that sky is at relative to level (with same 1-16 arrangement)
(not needed for level with a ceiling)
2,0 Icon for NO FOG (0x68) or FOG (0x69)
3,0 Light sourcing icon (0x8B: if present, lights illuminate walls)
Optional items in the upper corner are:
Second Plane
Lightning icon (0x0179)
Timer icon (0x79: third plane points 0xXXYY to X,Y location of
timed thing--time in minutes/seconds there is MMSS in decimal
digits, so 0130 is 1 minute thirty seconds--and to one side of
that timed thing is the end time in the same format. This, for
instance, would say when to shut the door that opened at the
start time)
Third Plane (INFO)
Song number: 0xBAnn, where nn is song number. If not present,
the game will choose song 0. If greater than the number of
level songs (18 in shareware), the game will blow out.
DISKS
Gravitational Anomaly Disks (GADS) are set up with a GAD icon in the
second plane and a height in the third plane. The actual graphic has a
disk in the top quarter, so to put one on the floor, you sort of have to
put the object IN the floor, so the disk will be at the right height.
Heights for objects start with 0xB0 and have that last byte as a
tiles-off-the-floor nybble and sixteenths-of-a-tile fraction.
So 0xB000 is, for normal sprites, resting on the floor.
For disks, that would be a disk you could stand on to be one story
(eight feet) in the air. The heights of disks usually go by sixes (that's
the maximum they can be apart and you can still climb them like stairs) or
fours (for a more gradual ascension). Here are three sets of height
values. The values of 0xB0F1-$B0FE are into the floor, and $B0F6 is right
about floor height.
by 6 by 4 by 2
B0F6 B0F6 B0F6
B0FC B0FA B0F8
B002 B0FE B0FA
B008 B002 B0FC
B00E B006 B0FE
B014 B00A B010
B01A B00E B012
B020 B012 B014
B026 B016 ...
B02C B01A
B032 B01E
B038 B022
B03E B026
B044 B02A
B04A B02E
B050 B032
B056 B036
B05C B03A
B062 B03E
B068 B042
B06E B046
B074 B04A
B07A B04E
If you need higher ones, calculate them yourself, man.
SWITCHES AND TOUCHPLATES
Everything activated by a switch or touchplates points to the switch or
touchplate that activates it, with the standard 0xXXYY format. This way
tons of things can be activated by one switch. To make a door open with
multiple switches/touchplates, make it a few tiles wide and have different
parts of the door point to the different switches.
LOCKED DOORS
Locked doors are normal doors with a key sprite icon placed on them.
============================================================================
The ROTT WAD Format
-------------------
Most of you out there are probably very familiar with the WAD file
format developed by Id Software. We borrowed the format with their
consent and use it for all the data in Rise of the Triad.
The WAD structure itself is identical to that of other WAD's,
where the WAD header is as follows:
typedef struct
{
char identification[4];
long numlumps;
long infotableofs;
} wadinfo_t;
and the WAD directory is made up of [numlumps] of:
typedef struct
{
long filepos;
long size;
char name[8];
} lumpinfo_t;
ROTT Specific Data
------------------
WALLS - Walls are stored in the WAD between the two labels "WALLSTRT" and
"WALLSTOP". The format of each wall is a 4,096 block of data with no
header. The bitmaps are grabbed in vertical posts so that drawing in
modex is more straight format. All walls must be 64 x 64. The walls must
be the first few lumps in the WAD.
MASKED OBJECTS - Masked objects in the wad comprise all actors and
sprites. They can be found as weapons, objects, actors etc. They use the
following headers and structures:
typedef struct
{
short origsize; // the orig size of "grabbed" gfx
short width; // bounding box size
short height;
short leftoffset; // pixels to the left of origin
short topoffset; // pixels above the origin
unsigned short collumnofs[320]; // only [width] used, the [0] is &collumnofs[width]
} patch_t;
These are extremely similar to the patches used in another game, except
for the addition of the origsize parameter.
typedef struct
{
short origsize; // the orig size of "grabbed" gfx
short width; // bounding box size
short height;
short leftoffset; // pixels to the left of origin
short topoffset; // pixels above the origin
short translevel;
short collumnofs[320]; // only [width] used, the [0] is &collumnofs[width]
} transpatch_t;
Certain objects in the game like masked walls and touch plates will use
the second type of patch which acts like a translucent patch.
SKYS, FLOORS and CEILINGS - Skys are larger than the screen and are made
up of two 256X200 grabs in posts similar to the walls. The first grab
represents the bottom part of the sky and the second part the top of the
sky. The skys are denoted by the labels SKYSTRT and SKYSTOP. Floors and
ceilings use the following structure:
typedef struct
{
short width,height;
short orgx,orgy;
byte data;
} lpic_t;
They can be found between the labels UPDNSTRT and UPDNSTOP.
Okay, enough hints! Have fun figuring stuff out.
--THE DEVELOPERS OF INCREDIBLE POWER

86
doc/readme.txt Executable file
View File

@ -0,0 +1,86 @@
Rise of the Triad (v1.3 CD Version) Source Code Release - December 20, 2002.
(If you can't read this right in your editor, turn on word wrap)
Please note that this is being released without any kind of support from Apogee Software, Ltd / 3D Realms Entertainment. We cannot and will not help in getting this running. We do not guarantee that you will be able to get it to work, nor do we guarantee that it won't blow up your computer if you do try and use it. Caveat Emptor - Use at your own risk. Having said that, this source code release was compiled on December 7, 2002 using the materials in this archive. Here's a note from one of the original ROTT programmers (Jim Dose) as to what will be needed to get this compiled:
------
You will need Watcom C v10.0b, which is what was used to compile the game originally. This source code release was tested with that version. Other versions are not guaranteed to work. Later versions such as v11.0 are known to most likely not work because of changes in the way data types are handled.
You also need Borland's Turbo Assembler (TASM), but it is not required to build the full game if you use the .obj files that are already included. To do a full rebuild of the C code without having TASM, delete all the .obj files except for the following files:
F_SCALE.OBJ
RT_DR_A.OBJ
RT_FC_A.OBJ
RT_SC_A.OBJ
RT_VH_A.OBJ
To compile ROTT, type "wmake all". To compile the audio library, run "wmake.bat".
(You'll also need a registered CD version of Rise of the Triad, too.)
-----
Please note that while we are releasing the source code to Rise of the Triad, the game itself has not been released in the same manner (in other words, Rise of the Triad is still commercial software). You can still buy the game from us by visiting http://www.3drealms.com.
Thanks to all the fans who have hung in there and waited for us to do something like this, we hope you enjoy it. If you produce something cool with this source code, drop us a line at rott@3drealms.com. In honor of the source code release, we contacted Tom Hall to reminicse a bit about the game, and we have some history from Scott Miller, President of Apogee. Their thoughts are below.
Furthermore, the release of the Rise of the Triad source code is dedicated to our late friend and cohort, William Scarboro. William was one of the original Rise of the Triad programmers, and he unfortunately died of an asthma attack on August 9, 2002.
William was born March 2, 1971 in El Paso, TX. He was a graduate of Texas A&M with a degree in Computer Science. He came to work here back in 1993, and was the first programmer we hired back then when we started doing in house development. He was mainly known for his work on Rise of the Triad where he worked on actor code, weapon stuff, and the gibs. In fact, William was directly responsible for the /EKG gib cheat in ROTT.
Joe Siegler
Apogee Software / 3D Realms
Dec 20, 2002
==============================================================================================
RISE OF THE TRIAD: The Source Code Release
A Note from Tom Hall
It was 1992. I had just worked through half of DOOM, a creative guy in a technologically-oriented company. We parted ways and I left to start up "In-House Development" at Apogee (later 3D Realms). We started accruing a programmer here, and artist there. Soon we had a team. I came in with a memo about something (like bonus dough for library functions or something), and at the end I said something like, "And once we complete all these, we will be... THE DEVELOPERS OF INCREDIBLE POWER!" The guys laughed and liked this a lot. And thus we became the DIPs. :)
With a game called ROTT, and a bunch of DIPs, you're heading for some derision. :) We had a fairly inexperienced crew: me, inexperienced at management; the rest of the guys, fairly new to the industry. It started as WOLFENSTEIN 3D, Part 2 -- a "transition project" my heart wasn't in, really. It wasn't my idea to do it, but it was something to do. Once we parted ways with that idea and id's involvement, things got rewritten, changed, and we came up with s-Quake functionality crammed into a Wolfenstein Plus/sub-DOOM engine. It was an example of pushing a technology to do what it really can't do well. We had a fun engine, but one that looked ugly, especially in the masked platforms -- they were paper thin! You could have had a fun game without doing what it couldn't do... but we were trying to beat the Joneses. And once we split ways with the id thing, I made three bad decisions: a) to keep the art we had already, b) to not redesign a new game and c) not to move over to the Build engine, where we could have had a Duke/DOOM level game going decently quickly.
Ah well. Hindsight's 20/20. I am too nice, I guess. Yet, ROTT, for all its tortured technology, all its semi-justified graphics, did have some stuff that there was to be proud of. It was the first game with Rocket Jumping, the first game with Jumppads, the first game with parental password and Violence level adjustment, the first game with Capture the Flag... Plus, I believe, the record for the most cheat codes ever in a game! And a Random Level creator! And what about all those cool Deathmatch options! And speaking of Deathmatch, I recall William's wonderful Corpseyard deathmatch map, and his "totally heinous" insane Drunk Missiles! Mr. Scarboro, you, and your tuna, egg, salsa, and Omega 3 fatty acid bowls of goo will be missed. Wah-bgsht! To Mark, Jim, Nolan, Steve, Tim, Chuck, Susan, JoeSke, Big Joe, Marianna, Lee, Bobby, Robert and all, thanks for sharing a strange time with me, and so many crazy memories! "Uh, guys... um...." The Disturbathon. "50 kills!" "Ooooooooooh... Mmmmmmm..." Going to that crazy Bazaar to digitize old weapons. "Check out what I got the boulders to do now." "Ass!" "Use the fish." "Bowooooooooo!" "I'm lookin' for some hot buns..."
And on and on... And thanks to Scott and George, for providing a place for us to be crazy together, and sticking with it even though it wasn't blockbuster stuff. I do owe you a debt in what was an odd, disorienting time for me. In the end, a couple hundred thousand folks seem to have enjoyed it, so there was something there that they liked. "See, Charlie Brown? It wasn't such a bad tree after all."
======
A little history...
by Scott Miller
ROTT, as it quickly became known, marked a turning point for Apogee. It was our first in-house game since I started the company in 1987 with my home grown Kroz games, the games that started the shareware revolution that resulted in the launch of three of the most successful independent PC developers, Epic, Id, and us -- all three still kicking after 12+ years (as of Dec. '02). It's hard to believe we're among the oldest of all surviving independent PC developers in the world now. Before ROTT, Apogee, as we were then known, solely worked with outside development teams, often funding and helping organize these teams, and helping guide their game designs using our experience. But around 1993 it was evident that this method wasn't going to work out much longer because as games got larger and more complicated to make, team sizes had to grow, too. So, in 1994 we started hiring developers to form our own internal team, with the first of those hires including William Scarboro, Nolan Martin, Mark Dochtermann, Jim Dosé, and the ever creative Tom Hall to run the show.
As Tom notes above, ROTT was originally an Id-approved sequel to Wolfenstein 3-D, using the original Wolf engine. The game was going to be called, Wolfenstein: Rise of the Triad, and explore what happened after Hitler's demise. About 4-5 months into development, though, a surprise call from John Romero ended the project, and we were left with a lot of content specific to the Wolfenstein premise, which had to be rolled into a new game concept so that we didn't waste all that we'd done. The result was a bit of a mish-mash, and as Tom says above, the project probably should've been restarted using our new Build engine, which our second internal team down the hall was using, making Duke Nukem 3D.
ROTT ended up selling several hundred thousand copies and making enough money to keep Duke 3D funded. But it was at this time that we knew we had to make a radical company change to shift with the times, and so we created the 3D Realms label, and began phasing out Apogee, which we were leaving behind with the glory days of shareware, and the arcade-style games Apogee was best known for.
We get a lot of requests to release the source code to many of the older Apogee games, but the problem is that Apogee does not own these games that were developed by external teams.
This source release is a long time coming, and hopefully it's not the last time we're able to do this.
Scott Miller, CEO / Founder
======
/*
Copyright (C) 1994-1995 Apogee Software, Ltd.
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.
*/

93
doc/rott.6 Executable file
View File

@ -0,0 +1,93 @@
.TH ROTT 6 "2008-04-23" "1.0" "Rise of the Triad"
.SH NAME
rott \- Rise of the Triad
.SH SYNOPSIS
.B rott
.RI [ options ]
.SH DESCRIPTION
.B ROTT
is a port of Apogee's 3D action title Rise of the Triad, originally released in 1994.
This port duplicates the functionality of the original game on modern operating systems, including Linux, Win32, and Mac OS X.
.SH OPTIONS
.TP
.BR aim
Give aim crosshair.
.TP
.BR fullscreen
Start in fullscreen mode.
.TP
.BR window
Start in windowed mode.
.TP
.BR resolution\ \fIwidth\fPx\fIheight\fP
Specify the screen resolution to use (next parameter is widthxheight).
Valid resolutions are 320x200, 640x480 and 800x600.
.TP
.BR spaceball
Enable check for Spaceball.
.TP
.BR nojoys
Disable check for joystick.
.TP
.BR nomouse
Disable check for mouse.
.TP
.BR nosound
Disable sound.
.TP
.BR cyberman
Enable check for Cyberman.
.TP
.BR assassin
Enable check for Wingman Assassin.
.TP
.BR ver
Version number.
.TP
.BR mapstats
Dump Map statistics to ERROR.
.TP
.BR tilestats
Dump Tile statistics to ERROR.
.TP
.BR mono
Enable mono-monitor support.
.TP
.BR screenshots
Clean screen capture for shots.
.TP
.BR pause
Pauses startup screen information.
.TP
.BR enablevr
Enable VR helmet input devices.
.TP
.BR noecho
Turn off sound reverb.
.TP
.BR demoexit
Exit program when demo is terminated.
.TP
.BR warp\ \fIlevel\fP
Warp to specific ROTT level (next parameter is level to start on).
.TP
.BR timelimit\ \fItime\fP
Play ROTT in time limit mode (next parameter is time in seconds).
.TP
.BR maxtimelimit\ \fItime\fP
Maximimum time to count down from (next parameter is time in seconds).
.TP
.BR dopefish
?
.SH AUTHORS
ROTT was created and published as shareware by Apogee Software, Ltd. and was published commercially by FormGen, Inc.
.PP
The primary contributors to the icculus.org port are: Steven Fuller, Ryan C. Gordon, John Hall and Dan Olson.
.PP
This manual page was written by Fabian Greffrath <fabian@debian-unofficial.org>
for the Debian project (but may be used by others).

82
doc/wad.txt Executable file
View File

@ -0,0 +1,82 @@
The ROTT WAD Format
-------------------
Most of you out there are probably very familiar with the WAD file
format developed by Id Software. We borrowed the format with their
consent and use it for all the data in Rise of the Triad.
The WAD structure itself is identical to that of other WAD's,
where the WAD header is as follows:
typedef struct
{
char identification[4];
long numlumps;
long infotableofs;
} wadinfo_t;
and the WAD directory is made up of [numlumps] of:
typedef struct
{
long filepos;
long size;
char name[8];
} lumpinfo_t;
ROTT Specific Data
------------------
WALLS - Walls are stored in the WAD between the two labels "WALLSTRT" and
"WALLSTOP". The format of each wall is a 4,096 block of data with no
header. The bitmaps are grabbed in vertical posts so that drawing in
modex is more straight format. All walls must be 64 x 64. The walls must
be the first few lumps in the WAD.
MASKED OBJECTS - Masked objects in the wad comprise all actors and
sprites. They can be found as weapons, objects, actors etc. They use the
following headers and structures:
typedef struct
{
short origsize; // the orig size of "grabbed" gfx
short width; // bounding box size
short height;
short leftoffset; // pixels to the left of origin
short topoffset; // pixels above the origin
unsigned short collumnofs[320]; // only [width] used, the [0] is &collumnofs[width]
} patch_t;
These are extremely similar to the patches used in another game, except
for the addition of the origsize parameter.
typedef struct
{
short origsize; // the orig size of "grabbed" gfx
short width; // bounding box size
short height;
short leftoffset; // pixels to the left of origin
short topoffset; // pixels above the origin
short translevel;
short collumnofs[320]; // only [width] used, the [0] is &collumnofs[width]
} transpatch_t;
Certain objects in the game like masked walls and touch plates will use
the second type of patch which acts like a translucent patch.
SKYS, FLOORS and CEILINGS - Skys are larger than the screen and are made
up of two 256X200 grabs in posts similar to the walls. The first grab
represents the bottom part of the sky and the second part the top of the
sky. The skys are denoted by the labels SKYSTRT and SKYSTOP. Floors and
ceilings use the following structure:
typedef struct
{
short width,height;
short orgx,orgy;
byte data;
} lpic_t;
They can be found between the labels UPDNSTRT and UPDNSTOP.

Binary file not shown.

File diff suppressed because it is too large Load Diff

12
mac/SDLMain.h Executable file
View File

@ -0,0 +1,12 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#import <Cocoa/Cocoa.h>
@interface SDLMain : NSObject
@end

278
mac/SDLMain.m Executable file
View File

@ -0,0 +1,278 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#import "SDL.h"
#import "SDLMain.h"
#import <sys/param.h> /* for MAXPATHLEN */
#import <unistd.h>
/* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 0
static int gArgc;
static char **gArgv;
static BOOL gFinderLaunch;
#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#else
/* An internal Apple class used to setup Apple menus */
@interface NSAppleMenuController:NSObject {}
- (void)controlMenu:(NSMenu *)aMenu;
@end
#endif
@interface SDLApplication : NSApplication
@end
@implementation SDLApplication
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
@end
/* The main class of the application, the application's delegate */
@implementation SDLMain
/* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
char parentdir[MAXPATHLEN];
char *c;
strncpy ( parentdir, gArgv[0], sizeof(parentdir) );
c = (char*) parentdir;
while (*c != '\0') /* go to end */
c++;
while (*c != '/') /* back up to parent */
c--;
*c++ = '\0'; /* cut off last part (binary name) */
if (shouldChdir)
{
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */
}
}
#if SDL_USE_NIB_FILE
/* Fix menu to contain the real app name instead of "SDL App" */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuItem;
aRange = [[aMenu title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
enumerator = [[aMenu itemArray] objectEnumerator];
while ((menuItem = [enumerator nextObject]))
{
aRange = [[menuItem title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
if ([menuItem hasSubmenu])
[self fixMenu:[menuItem submenu] withAppName:appName];
}
[ aMenu sizeToFit ];
}
#else
void setupAppleMenu(void)
{
/* warning: this code is very odd */
NSAppleMenuController *appleMenuController;
NSMenu *appleMenu;
NSMenuItem *appleMenuItem;
appleMenuController = [[NSAppleMenuController alloc] init];
appleMenu = [[NSMenu alloc] initWithTitle:@""];
appleMenuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
[appleMenuItem setSubmenu:appleMenu];
/* yes, we do need to add it and then remove it --
if you don't add it, it doesn't get displayed
if you don't remove it, you have an extra, titleless item in the menubar
when you remove it, it appears to stick around
very, very odd */
[[NSApp mainMenu] addItem:appleMenuItem];
[appleMenuController controlMenu:appleMenu];
[[NSApp mainMenu] removeItem:appleMenuItem];
[appleMenu release];
[appleMenuItem release];
}
/* Create a window menu */
void setupWindowMenu(void)
{
NSMenu *windowMenu;
NSMenuItem *windowMenuItem;
NSMenuItem *menuItem;
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
/* "Minimize" item */
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
[windowMenu addItem:menuItem];
[menuItem release];
/* Put menu into the menubar */
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
[windowMenuItem setSubmenu:windowMenu];
[[NSApp mainMenu] addItem:windowMenuItem];
/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];
/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
}
/* Replacement for NSApplicationMain */
void CustomApplicationMain (argc, argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
/* Ensure the application object is initialised */
[SDLApplication sharedApplication];
/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setupAppleMenu();
setupWindowMenu();
/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];
/* Start the main event loop */
[NSApp run];
[sdlMain release];
[pool release];
}
#endif
/* Called when the internal event loop has just started running */
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[self fixMenu:[NSApp mainMenu] withAppName:[[NSProcessInfo processInfo] processName]];
#endif
/* Hand off to main application code */
status = SDL_main (gArgc, gArgv);
/* We're done, thank you for playing */
exit(status);
}
@end
@implementation NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
{
unsigned int bufferSize;
unsigned int selfLen = [self length];
unsigned int aStringLen = [aString length];
unichar *buffer;
NSRange localRange;
NSString *result;
bufferSize = selfLen + aStringLen - aRange.length;
buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar));
/* Get first part into buffer */
localRange.location = 0;
localRange.length = aRange.location;
[self getCharacters:buffer range