home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Libraries / MacWT 0.04 / MacREADME < prev    next >
Encoding:
Text File  |  1994-10-31  |  7.8 KB  |  222 lines  |  [TEXT/MPS ]

  1. MacWT   v0.04                                       QUICK NOTES
  2.  
  3. A quickie port of Chris Laurel’s “wt” experiment to the Macintosh.
  4.  
  5. =======================
  6. New 0.04 Info at bottom
  7. =======================
  8.  
  9.  
  10. About “wt”
  11. ==========
  12.  
  13. Chris Laurel on “wt”:
  14. “ wt is my portable 3D game engine. It is by no means a complete
  15. and ready-to-go game. Right now, it is little other than a demo of the
  16. graphics engine’s capabilities. While wt does look similar in many
  17. respects to Id Software's game DOOM, it is not in any way connected.”
  18.  
  19. wt runs on X-window Unix systems, PeeCees, and now, the Macintosh.
  20.  
  21. Note! wt is a real CPU hog.
  22. For best results, use a 68040 (or better yet, an 060 :-).
  23.  
  24. This was built with Chris's "wt" version 0.03 distribution.
  25.  
  26. For more information on the "wt" project, please read the posting
  27. from Chris Laurel entitled "wt Update".
  28.  
  29.  
  30. About the Macintosh port
  31. ========================
  32. This was quickly hacked together (as if you couldn't guess.)
  33. The "wt" distribution REQUIRES 32-bit "int"s, and currently
  34. has a few types (e.g., "Region") which clash with the Mac's.
  35. So Precompiled Headers for all sources are out; I have to
  36. manually include them at the start of each of the Mac-specific
  37. C files (there are only 3, so its not too bad.)
  38.  
  39. Most of the work was done in Metrowerks, an environment I can heartily
  40. recommend (especially in the light of my experiences with THICK C.)
  41.  
  42.   Organisation of Sources
  43.   =======================
  44.     MacMain.c  -- macintosh main program for the game
  45.     MacWT.c    -- macintosh functions used by "base" wt
  46.     MacGame.h  -- shared between MacMain.c and MacWT.c
  47.     WT.µ       -- Metrowerks project file for MacWT
  48.     MacWT      -- the Metrowerks version of the MacWT application
  49.     mac_wt.h   -- Hack alert: how I bolt onto the "base" wt
  50.     wt         -- this folder contains the "wt" distribution (v0.03)
  51.     WT.µ.rsrc  -- Resource file
  52.     WT.π       -- Think C 7 project file for MacWT
  53.     turlsLibs  -- various files of mine needed to build MacWT
  54.     Mac README -- this file
  55.     wt Update  -- A posting to rec.games.programmer" from Mr. Laurel
  56.  
  57.  
  58. NB: I HAVE HAD TO MODIFY THE "BASE" wt DISTRIBUTION;
  59. USE THIS BUILD SYSTEM AT YOUR OWN RISK UNTIL CHRIS LAUREL ACCEPTS MY
  60. MODS INTO HIS "BASE".
  61.  
  62.  
  63. I get about 6-7 frames per second (just sitting there) on my Centris
  64. 650 (a stock 25MHz 68040.) That's in a teensy 320x200 window with
  65. direct screen writes on (i.e., bypassing QuickDraw)! Zooming doubles
  66. every pixel to give a 640x400 but (as you can imagine) slows us down
  67. somewhat. Direct screen writing ONLY WORKS WITH 8 BITS PER PIXEL; the
  68. user interface for this is a bit noddy at the moment. I'll fix it during
  69. the week.
  70.  
  71. When moving around, you get some squiffy bits passing thru walls and
  72. doors or passing thru the ceiling when you jump, so there's definitely
  73. something wrong on this front.
  74.  
  75. The THICK C version is quite happy if you're just sitting there (you get
  76. about 4-5 fps.) Unfortunately, it's CRASH AND BURN TIME if you walk thru 
  77. a wall or whatever.
  78.  
  79.  
  80. Project File
  81. ============
  82.  
  83. My Project file (in case you want to roll your own and can't use mine):
  84.  
  85. You need a "-D macintosh".
  86.  
  87. Seg#1: MacMain.c                    <Main program, event loop, etc. Not brilliant.>
  88.        MacWT.c                        <Routines needed by the "base" WT system>
  89.        :turlslib:Failure.c            <a handy printf-like _DebugStr>
  90.        :turlslib:FixMulDiv.c        <68K asm for Fixed-point muls/divs>
  91.        :turlslib:DirScrnWrite.c        <Handy direct-screen writing stuff>
  92.                                     <NB: ONLY 8-bit at the moment, sorry>
  93.  
  94.        :wt:fixed.c                    <Leave all WT files in their own folder.>
  95.        :wt:framebuf.c                <This makes it easier to just hide the old>
  96.        :wt:list.c                    <"wt" folder and replace it with a newer one!>
  97.        :wt:render.c
  98.        :wt:table.c
  99.        :wt:texture.c
  100.        :wt:view.c
  101.        :wt:world.c
  102.        :wt:worldfile.c
  103.        :wt:wt.c
  104.        :wt:wtmem.c
  105.  
  106. Seg#2:
  107.         MacTraps or MacOS.Lib
  108.         ANSI library (SUITABLE FOR 4-BYTE INTS!)
  109.  
  110. Resource file: WT.µ.rsrc
  111.  
  112.  
  113. Modified BASE FILES
  114. ===================
  115. "BASE" Files I have modified (all in the "wt" folder...)
  116.  
  117.         wt.h -- include "mac_wt.h" if we're being compiled on a Mac.
  118.         texture.c -- Allow texture palette indices to be adjusted on a Mac.
  119.         worldfile.c -- Macs don't use Unix pathnames.
  120.         render.c -- undefine PROFILE and TEST_ASM if we're a Mac.
  121.         fixed.h -- allow hosts to override the supplied fixmul/div routines.
  122.  
  123. DEFINITIONS I HAVE INTRODUCED
  124. =============================
  125. If you're compiling on a Mac, define "macintosh" so my hack regarding 
  126. inclusion of "mac_wt.h" in "wt.h" works. Metrowerks is taken care of by
  127. explicitly checking for __MWERKS__.
  128.  
  129.  
  130.   Plans
  131.   =====
  132.   • THINK C v5, v6 project files (if I can find TC5 and 6!)
  133.   • MPW C, Gnu C makefiles
  134.   • Tidy up horrible hacks (no Precompiled headers?)
  135.   • Why does the THICK C 7 version crash horribly when you pass thru
  136.     a wall/door/ceiling?
  137.   • Better fixed-point multiply routines (currently using _FracMul.)
  138.   • A PowerPC version -- should be a doddle with Metrowerks.
  139.     Possibly even an "xlc" version!
  140.  
  141.  
  142. --turly
  143.  
  144. Any Mac-specific issues/bug reports/fixes, etc, should be addressed to:
  145. "turly@isltd.insignia.com". I will do my best to fix all reported bugs
  146. and pass them on to Mr. Laurel for inclusion in a future "base" distribution.
  147.  
  148. Any "base" wt issues/bug reports/fixes, etc, should be mailed to the
  149. "wt" project mailing list (join by mailing "wtm-request@magoo.uwsuper.edu")
  150. See the "wt Update" document for more details.
  151.  
  152. Have fun!
  153.  
  154.  
  155. =====================
  156. New 0.04 Info, 11-May
  157. =====================
  158. Sorry folkz, this is a bit quick. I've got a 4 mile walk home and I'd like
  159. to reach there before 2:30AM!
  160.  
  161.  
  162. Basically, we now do PowerPC (easy with Metrowerks, new project supplied.)
  163. I make my fat binaries with Metrowerks by a brute force method -- open up
  164. the 68K and PPC apps using ResEdit and copy everything in the 68K one to 
  165. the PPC one! Dirty, but it works.
  166.  
  167.  
  168. MPW C (68K) -- very disappointing. My inline 68K asm FixMul etc. bust MPW C.
  169. And as for MPW C's "optimiser" -- Oh dear! Let's just forget it, shall we?
  170.  
  171.  
  172. MPW PPCC -- reasonable, if the optimiser worked on the ONE file that really
  173. needs it, "render.c". I've had to turn off optimisation for that file.
  174. See "MacWT.fat.make" for more details.
  175.  
  176.  
  177. GNU C -- haven't a clue, as the version I have (1.371r15) dies horribly. I
  178. haven't looked at it since I first tried it because I wanted to get the PPCC
  179. version working. On my "to-do" list.
  180.  
  181.  
  182. THICKC7 -- The more I use it, the more I loathe it!
  183. Current Proj file should work OK (albeit slowly.) 
  184. As a matter of interest, can I get THICK C to load a precompiled header file
  185. from within a header file? (As in "LoadMacHeaders.h"?) THINK experts??
  186.  
  187.  
  188. General -- thanks to Al Evans (al@crucible.powertools.com) for pointing out
  189. the lines I managed to miss when extracting the direct screen writing stuff
  190. from my C++ TDirScrn lib: basically, copy the screen colortable's ctSeed
  191. to the offscreen pixmap's colortable. This means that _CopyBits is now as
  192. fast as my hacky direct screen writing -- for 320x200. When we scale up to
  193. 640x400, direct screen writing is still 2x faster on both 68K and PPC Macs.
  194.  
  195. Al also looked into why THICK C falls over and found something in "slice.c".
  196. Unfortunately, "slice.c" has changed between 0.03 and 0.04. I added an
  197. "#ifdef PARANOID" around a check for 'nPix < 0'. "mac_wt.h" now defines
  198. PARANOID. THICK C seems to produce much better results if we don't use
  199. my inline asm versions of _FixMul, etc.
  200.  
  201. You can have lots of fun running various experiments with the settings in
  202. "mac_wt.h". See the various comments, etc, there!
  203.  
  204.  
  205. • NOTE •   Chris Laurel (wt's author) said that he'd try to incorporate my
  206. mods to ease Mac porting in wt-0.05. So you should:
  207.  
  208.     USE THIS BUILD SYSTEM AT YOUR OWN RISK UNTIL CHRIS LAUREL ACCEPTS MY
  209.     MODS INTO HIS "BASE".
  210.  
  211. Anyway, have fun again!
  212.  
  213. --turly
  214.  
  215. Oh, and PS, does anyone know if the PowerPC's _FixMul and _FracMul are 
  216. native? 'Cos if they are, hmmmm....
  217.  
  218.  
  219.  
  220. Turlough O'Connor, Insignia Solutions Ltd, High Wycombe, Bucks, UK.
  221. turly@isltd.insignia.com
  222.