dis3dsource

所属分类:OpenGL
开发工具:Visual C++
文件大小:530KB
下载次数:38
上传日期:2007-10-10 17:19:06
上 传 者CCxil
说明:  采用VC++和OpenGL编程,在太空中打陨石的游戏软件,很好玩的,带全套源代码。
(Used VC++ And OpenGL programming, meteorites in space fighting game software, is a lot of fun, and with a full set of source code.)

文件列表:
3dgame.cpp (171276, 2002-02-24)
3dglasses.cpp (4583, 2001-06-17)
3dglasses.h (1262, 2001-04-15)
console.cpp (12399, 2002-02-24)
console.h (430, 2002-02-21)
cvars.cpp (2215, 2002-02-24)
cvars.h (624, 2002-02-21)
Disasteroids.rc (4828, 2001-06-17)
Disasteroids3d.dsp (7524, 2002-02-24)
Disasteroids3d.dsw (545, 2000-04-28)
diutil.cpp (16154, 2000-12-01)
diutil.h (1833, 2001-02-07)
dsutil.cpp (13178, 2000-11-16)
dsutil.h (5868, 2001-02-07)
font.cpp (0, 2001-05-24)
game.h (3003, 2002-02-24)
glext.h (144343, 2000-06-12)
LookupTables.h (791, 2000-05-11)
menus.cpp (30392, 2001-07-19)
menus.h (2232, 2000-12-05)
modeldata.h (17563, 2000-06-22)
mp3control.cpp (2904, 2001-06-17)
mp3control.h (47, 2001-05-08)
renderflags.cpp (3702, 2001-07-06)
renderflags.h (489, 2001-07-06)
resource.h (1449, 2001-04-15)
Res\blast.bmp (49206, 2000-04-15)
Res\disasteroids 3d.ico (3774, 2000-04-20)
Res\explode1.wav (9575, 2000-02-24)
Res\explode2.wav (10948, 2000-02-24)
Res\explode3.wav (9575, 2000-02-24)
Res\extraship.bmp (6198, 2000-08-13)
Res\fire.wav (2719, 2000-02-24)
Res\font.bmp (196662, 2000-11-16)
Res\life.wav (15059, 2000-02-24)
Res\logo.bmp (196662, 2000-10-19)
Res\lsaucer.wav (1908, 2000-02-24)
Res\menubeep.wav (560, 2000-08-12)
Res\rock.bmp (49206, 2000-10-22)
... ...

Disasteroids 3D is (C)2001 Thom Wetzel, Jr. Copyright (c) 2001 Thom Wetzel, Jr. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ----------------------------------------------------------- 2002.02.20-24 ----------------------------------------------------------- Well, I finally gathered some motivation to get started on a console for Dis3d and future projects built off this code. So far, the console doesn't do much but replace UpdateMessage() with a con_printf() and con_dprintf() for developer messages. A user can also enter in a cvar and its value is displayed on screen. ----------------------------------------------------------- 2002.01.15 ----------------------------------------------------------- Fixed a couple minor things: 1) Joystick x and y values were being displayed on-screen. This was some left-over debug code I forgot to remove for the release version. Rats. 2) Added a line in KillGLWindow() to make sure Dis3D wasn't leaving any TaskBar boxes hanging around after closure. ----------------------------------------------------------- 2001/07/19 ----------------------------------------------------------- Have fun! ----------------------------------------------------------- 2001/05/08 ----------------------------------------------------------- I ended up not releasing the game a couple weeks ago. Things came up at work and home and I was a little busy! I took some time and went about implementing a mode that would use red/blue 3d glasses. I ran into a problem involving the screen size, and the effect really didn't add much to the game, so I commented out the lines that display the red/blue option in the display menu to get rid of it. If anyone is interested in seeing how I went about making it work, just remove the comments in menus.cpp on lines 196 and 197. I'm also adding controls so that Winamp (and other music players) can be controlled from within the game. Should be cool. ;) ----------------------------------------------------------- 2001/02/25 ----------------------------------------------------------- Added something stupid. When the ship rotates, it rolls a little. It isn't perfect, but it was something I always wanted to add. I'm updating the source code for the first time in a long time. There's a lot of new stuff (gamma, mouse, etc) that might be of interest to budding OpenGL dudes and dudettes out there in programming land. Hope SOMEONE finds it useful. Again, if you write me and don't get a response within a week, please resend your message. My ISP denies this, but I totally believe that messages intended for me are getting lost somewhere... Enjoy! The latest EXE will be released next weekend. :) ThomW ---------------------------------------------------------- 2001/02/07 ----------------------------------------------------------- After a two month hiatus I decided to add some new things to the game to add some features that were in the back of my mind * Color depth control * Gamma/brightness/contrast controls There seems to be something wrong with the fullscreen toggle. After flipping back and forth a couple times it crashes something in KERNEL32.DLL. I'm going to try and look at it later when I get some time. It's probably my video card drivers, though. ----------------------------------------------------------- 2000/12/13 ----------------------------------------------------------- Added code to make sure rocks don't get too dark, while maintaining the coloring from prior versions. In windowed mode, the mouse is only acquired when necessary. Something's still screwy if the user switches to windowed from fullscreen - the mouse isn't released, but I looked at it, couldn't find a quick fix, so it's staying. *grumble* ----------------------------------------------------------- 2000/12/09 ----------------------------------------------------------- I redid the resolutions screen as an option screen (I had this on my 'to-do list' from the last update). I moved the shields display to lower left. I changed the hard difficulty level. On hard, there should be twice as many rocks per level, and they should be quite a bit faster than on Normal. ----------------------------------------------------------- 2000/12/05 ----------------------------------------------------------- I added the ability to map two keys to each action. It's a little funky, but if you have rhythm you can really get some awesomely fast shots going. NeHe changed his OpenGL base code and I merged his changes into the game -- it was a minor thing in the fullscreen toggle code that makes a little more sense. He also made some changes so that the game doesn't claim 100% of the processor's time for itself when minimized. ----------------------------------------------------------- 2000/12/03 ----------------------------------------------------------- Somewhere between games of Counter-Strike I found time to make the following changes. I'm addicted to that stupid game -- I was up playing until 3am. *zzz* Mouse control implemented in DirectInput. It fixes the timing problems seen in the FPS display and hyperspace in the betas since mouse control was added. I tried to make it that the mouse is only acquired while the game is being played. While in menus or paused, the mouse should be released so that it can be used in other apps. I know I made more changes than that, but I can't remember what they are. ----------------------------------------------------------- 2000/11/27 ----------------------------------------------------------- Fixed volume at startup bug Shields recharge between rounds - 2 * level% of total ----------------------------------------------------------- 2000/11/23 (Some of these may be duplicates) ----------------------------------------------------------- Mouse buttons are now mappable. I need to find a way to let users map multiple keys to one action -- maybe like in Quake where two keys can have same action. Just to let you know, I used the Windows API to do it, so only three buttons are available. I could have used DirectInput, but it would have involved more work and the buttons wouldn't have been mappable. Added code to catch Hyperspace Abusers. After hyperspacing 3 times, your chances of being warped into the center of a rock increase with each warp in a ten second period Volume control - it only affects the in-game volume - not the master control - just like you asked ;) Added graphic to make percentage displays in menu look cooler. Also cleaned up menus a little (very little in fact) Shield power display using the boxes used in the menus ----------------------------------------------------------- 2000/11/23 ----------------------------------------------------------- I've been playing around and added a bunch of cool stuff in the last month or so. I added code that controls the player ship's top speed, so the ship won't be able to travel faster than one screen height/width, so it won't be able to disappear Added player rotate speed adjust to control menu. Use the arrow keys to change the value from 0% to 100%. Setting the adjust value to 50% would set the rotation speed to the original value. Made a change to the collision detection routine - there shouldn't be any rocks that you can fly and shoot right through. Added mouse support - cursor shows up in window mode, but rotation works fine. Also added support in menu to enable and control sensitivity. Added volume control code to make it easier to listen to MP3's while playing Dis3d. ;) Also added code to penalize a player for abuse of hyperspace. Your chances of warping into the middle of a rock increase everytime hyperspace is used in a 10 second period. I totally cheated on this one. I didn't put any of the variables into the actors type. I just made a bunch of variables to handle this problem as quickly as possible. :( Shields power display - using the boxes I added (oh yeah - i forgot to add that above) to help make the menu's 'slider' options look a little cooler. I modified the font.bmp to change two useless characters into one empty and one full box for slider controls, and thought they might make a cool way to display the shield power. I need to thank Agust "Nemesis1" for all of his excellent suggestions. Many of these latest fixes were prompted by his emails. Thanks again, Agust!!! In fact, thanks to everyone who wrote concerning the most recent version. I wrote a reponse to every message sent to me, and if you wrote and didn't get a reply. Blame my ISP. :) ----------------------------------------------------------- 2000/10/22 ----------------------------------------------------------- Added the top secret cheats menu. You'll never guess what the activation code is. ;) I'm off to distribute the game to its 10 fans! Enjoy! ----------------------------------------------------------- 2000/10/21 ----------------------------------------------------------- Played with timing code. I think I found a good way to position the timing updates in the program to jumps when another app's running in the background, and also think that vsync timing is better when mouse is moved over window and keys are held. I thought of this yesterday while I was driving home from Salisbury, MD, ending a sucky two day four-hour (one way) commute. :P ----------------------------------------------------------- 2000/10/19 ----------------------------------------------------------- Changed some joystick stuff * Mapped hyperspace to button 3 * Changed shields from down to button 2 Changed logo to color website version - it's sexier Made other little adjustments here and there. I still haven't even looked at the vsync stuff, but come hell or highwater, v1.2 is going out this weekend!!! Got another email today - this time from a French game magazine that would like to publish the game on their cover disc. Sweeet! ----------------------------------------------------------- 2000/10/18 ----------------------------------------------------------- Long time no work. In my last update I said I was releasing 1.2 the next day -- uh, I guess that didn't happen ;) A lot of people have been contacting me about the game lately, so I thought it would probably be a good idea to release the stuff I've been working on lately. I'm making one more attempt at fixing the vsync problem before sending this stupid thing out the door, so to speak. For fun, I finally fixed the stereo panning so that it works correctly. I must have been doing something wrong the whole time. I tried adding a stereo seperation multiplier, started at 0.8 and worked down to 0.1. Eureka! At 0.1 it works awesome! Killer. ;) ----------------------------------------------------------- 2000/08/21 ----------------------------------------------------------- Well, it's been a while since a release, and I've been sitting on a TON of new stuff. I was at my nephews' house and fired up the most recently released version, 1.1 and laughed at how lame it was compared with the version I've been playing for the last couple months. It's nothing HUGE, just a bunch of little stuff that makes 1.2 so much better. I added a couple of things I've been meaning to just to be done. Hyperspace and highscore difficulty/spacesize indicators. They're both hacks, but they're both features I wanted to add before releasing 1.2. Hopefully they won't cause any problems --- ;) Other than improving the two things I just added, the only additional thing I'd love to do to the game is make it head-to-head on one PC. Unfortunately it's not going to happen. The main game code is just too messy and I don't feel like writing it all over again. I'm moving on and starting a new project, hopefully something I can release as shareware down the road. Don't worry -- my goal is to make something cool that I will sell for less than $10 and make it worth the fee... Oh well, I'm going to upload the files tonight and send out the press releases, etc tomorrow. ----------------------------------------------------------- 2000/07/16 ----------------------------------------------------------- I've been spending the weekend going over the timing code, fixing up the menus, creating difficulty settings, and doing general cleanup in preparation of the next release of the game. I'm going to send out copies of the game to some of the guys and see if they report any problems with the game before releasing it. ----------------------------------------------------------- 2000/07/13 ----------------------------------------------------------- EUREKA! Well, looks like my suspicions were correct all along. Rendering > 700 fps is a total waste PLUS it was the reason why Dis3d ran so lousy with vsync enabled. With the latest changes I made today, DrawGLScene is throttled back to update at 120fps while the SwapBuffer is updated at 60fps. It works so well on my GeForce that I'm not sure it's working *wink*. It also works well on my P2/266 equiped with a Voodoo2, so I must be on to something. Another thing affecting the game was the keyboard repeat rate. Don't know why, but that problem has also been fixed by the rendering throttle. If anyone gets this code, compiles it and has any problems with the throttling LET ME KNOW. I'm thinking that I may need to figure out some way of getting (or computing) the computer's refresh rate or capability and program the game to automatically throttle itself back for that machine. I'm going to do some testing on a range of computers in my office next week to see if I need to be concerned about trying to maintain 60 fps. If anyone plays around with the code and finds a way to improve it at all, LET ME KNOW. This is a first attempt, and someone may already know a better way of doing this. One question I have now, is should I be Sleep()ing every cycle so that Dis3d isn't hogging the processor? If so, how long is cool... I need to try this out. :) OTHER COOL STUFF 1. MOTION BLUR This isn't ready for 'prime time' but it's amusing. It's only available if you change the '#if 1' in DrawGLBackground() to '#if 0', so it's something only a few elite people who bother to recompile the source will ever get to see. ;) 2. WORLD ROTATION EXPERIMENT Instead of the ship rotating, everything else on the screen is rotated around the player's ship while it stays pointing right on the screen. This is another developer's-exclusive and it's activated by setting EnableVomitComet = 1 in DrawGLScene. Within seconds you'll be able to see why this isn't going to be implemented in a release of the game -- ha ha. ----------------------------------------------------------- 2000/07/11 ----------------------------------------------------------- Well, I've been playing with a lot of things over the past week or so. Made a big breakthrough today going through DrawGLScene. I was using a lot of unnecessary calls throughout the main rendering routine, and have seen big strides made through the removal of these useless OpenGL commands. Very cool. Also seperated out a couple of routines for profiling purposes. I wanted to make sure that drawing the background or setting up lights wasn't taking longer than it should. I'm still not happy with the vsync situation, and that is the only thing that I need to find a correction to before releasing a new version of the game. Started working on the new game in a big way the other night. Modelling -- oof. ----------------------------------------------------------- 2000/06/27 ----------------------------------------------------------- Removed all of the useless MatrixMode() calls. Changed the ship remaining display. Instead of drawing the player ship model for every remaining life, I created a 32x32 image of the ship that I'm using instead. That should speed things up a little. Redrawing the player's model was pretty piggish... ;) ----------------------------------------------------------- 2000/06/25 - 26 ----------------------------------------------------------- While running the game on Wan's laptop, we noticed that the game didn't 'stutter' while in Pre-Copernicus mode. I looked at the code and found that the space rendering code has useless MatrixMode calls all over the place. Removed those, and things seem pretty zippy now :) The stuttering has been bothering me for a while, and it really cool to find the cause of it!!! :) Went through on the 26th and looked for useless GL calls... ----------------------------------------------------------- 2000/06/23 - 25 ----------------------------------------------------------- Updated Dis3d's website in my spare time. Looks much cooler now ;) ----------------------------------------------------------- 2000/06/12 - 2000/06/22 ----------------------------------------------------------- Working on getting save values implemented. Had a major rewrite of the menu system to integrate the Cvars into it. Now each menu item can point to a Cvar so the menu's displays are tied directly to their corresponding variable. Makes things much cleaner. :) Figured out how to toggle Vsync. Working great, even though some cards (ATI mobility) doesn't support the call... ? If anyone reads this and knows another way around this, let me know. :) ----------------------------------------------------------- 2000/06/09 - 06/11 ----------------------------------------------------------- I've spent much of the last several nights (and days) working on a console variable system, similar to that used by Quake and its offspring. I got a functional system working before peeking at the Q1 source code, and much to my surpise, it looked pretty much like Quake's!!! Way cool! One thing I liked better about Quake's system were the function names, so I kind of adopted those to my ... ...

近期下载者

相关文件


收藏者