Skip to content

Commit

Permalink
Added FOV changer. Fixed window mode issues. Fixed warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitl committed Oct 5, 2018
1 parent 3cb0ef9 commit 53f0c67
Show file tree
Hide file tree
Showing 27 changed files with 282 additions and 162 deletions.
9 changes: 9 additions & 0 deletions Build/Enhanced-Changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Black Shades Enhanced v1.1
- Fixed a bug where the mouse sometimes clips out of the window in windowed mode.
- Added a new FOV setting.
- Changed the Sniper Rifle's FOV to 22.50 due to the equation used for calculating user-defined FOV.
- Includes the soundtrack!

Dev stuff:
Fixed all compiler warnings!

Black Shades Enhanced v1
- Increased the FPS limit from 90 to 300.
- Allows the user to set the FPS limit in the config.txt
Expand Down
117 changes: 117 additions & 0 deletions Build/Readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
Black Shades
By David Rosen

Please do not give a vote unless you are running in OS 9, Black Shades can run under OS X but only under emulation which does not work nearly as well.

Controls:
WASD = walk
shift = run
mouse = look
control = crouch/zoom
click = fire (while aiming) or smash (while running) or pick up gun (while crouching over a body and not aiming) or disarm (while not aiming)
q = aim or un-aim (important for picking up guns)
r = reload
e = psychic aim
z = toggle soul release
space = dive (while running forwards)

keys for debug mode:

tab = 3rdperson toggle
f = Force Push� :)
shift-x = switch weapons

Thats it

Instructions:
Try to keep your VIP (the guy in white) alive as long as possible. The assassins will all try to shoot or stab him to death. You must do all you can to prevent this. Your reputation has preceded you, so the VIP has absolute confidence in your abilities and will completely ignore all the assassins. When an assassin is aiming at your VIP with a gun, you will psychicly see a line of sight extending from him to your VIP. This line will narrow and redden until it disappears and the assassin fires. Depending on the situation it may be best just to shoot the assassin(s), or to dive and tackle the VIP to the ground to avoid the bullet. Unfortunately your psychic powers do not show the line of sight of knife-wielding assassins.

If you are feeling overwhelmed you can use psychic aiming to temporarily speed up your thought processes and aim your shots better. If there are no visible enemies you may want to release your soul and look for nearby enemies. When your soul is released your VIP pulsates between blue and red, civilians between black and red, and assassins are solid red.

If you die or your VIP is killed.. the level restarts. If you are are interested in the theory behind this: you are a psychic bodyguard, so you can see small distances into the future. The failure only occured in a possible future which you are now going to try and avoid.

The scoring system consists of:
150 points for a successful disarm
300 points for destroying a zombie (by blowing its head off)
100+50x points for completing a mission where x is the mission number (i.e. 450 points for completing mission 3)
75 points for incapacitating an assassin
+50 if he had a knife
-300 points for hurting a civilian
-200 points for allowing the VIP to die
The penalty for failing to protect the VIP is halved if you kill the assassin.

You can edit levels by setting "Custom levels" to 1 in the config and editing the customlevels.txt file in the data folder.

Weapons:
Bare Hands: Smack people with them. Or if you want to be nice, walk or stand (don't run) near somebody with a gun and take it away.

Knife: Like bare hands, but deadly and with longer range. Look out for knife-wielding assassins, they are the most dangerous.

Handgun: One shot with this should be enough to incapacitate any human target, but they may remain conscious for a second (this can be bad if they are about to stab your VIP, aim for the head)

Magnum: Not as much ammo as the vanilla handgun, but one shot is an instantenous kill

Assault Rifle: This weapon has quite a kick and is bigger and more unwieldy than the handguns, but it has a large magazine and can fire quickly if necessary

Sniper Rifle: A bit more powerful than the magnum, with a scope. Very difficult to aim unless you are zoomed in (zoom by holding the control key)

Shotgun: Aim and shoot. Very powerful but somewhat inaccurate.

Grenade: Hold down the mouse button to take out the pin, release the button to throw it. Crouch to change your mind and put
the pin back in. You can knock people out if you hit them in the head, or of course you can just blow them to pieces.

Troubleshooting:
The only known bugs are:
�It doesn't work too well under classic emulation
�Occasional collision detection issues
�Turning virtual memory off can cause speed issues

History:
11-6 to 11-9 main menu, score, etc.
10-9 to 11-6 better ai, gibbing, added zombies, weather, knife, shotgun, misc. stuff
10-8 shooting delay/ effect
10-6 added rich vip guy
10-5 bug fixes, gibbing, slomo psychicness
10-4 bug fixes, blood toggle, environments, falling damage
10-1 worked on menu, pathfinding
9-27 added black shades, bug fixes, added some IDG sounds, better collision, config.txt
9-22 bug fixes
9-21 mouse smoothing, better aiming, different blood
9-20 fixed street clipping, grenades working, more blood
9-19 fixed grenade faces, fixed some assassin AI, fixed penetration bugs
9-18 started assassin AI, some more assassin AI, some work on grenades
9-17 faster aiming/crouching, VBL sync, slightly improved control sensitivity stuff
9-16 glock added, penetrating sniper rounds, better scope, different zooming
9-15 suicide, improved bashing, npcs can carry guns, reloading, headshot sound, camera positioned better, handgun
9-14 rifle bashing, aim modifications, redder headshots, speed
9-13 everything in one folder, stationary 3rd person cam toggle, visible bullets, some sound stuff
9-12 crouching, duck to snipe, pain animations
9-11 more fluid aiming, different costumes, assault rifle, health system, impact reaction, kill counter
9-10 sniper rifle scope, bullets, sounds
9-9 bug fix
9-8 sniper rifle added (fires blanks, can't zoom), ragdoll system improved, ragdoll sounds
9-7 smooth transition to pointing arms, walking, better running, skeletal 'ragdoll' system + collisions
9-6 fixed sound bug
9-5 Added distance people sprites (very far view distance, faster also) Added limit to # of people per block, more even spacing, added pointing arms (pistol aiming without the pistol)
9-4 Added random civilian placement system (populated entire city instead of a block)
9-3 Too Busy
9-2 Too Busy
9-1 Too Busy
8-31 Started basic civilian AI
8-30 Fog fixed on ground and sky, better skeletal animation, pre-calced rotations for joints
8-29 Real Life� intervened, no time
8-28 Air control added, some collision fixed, occluding people, sky plane, ground does not occlude
8-27 looking up/down changes animation, editors updated to CW 8, animation editor tweaks, optimised a bit
8-26 look at previous soul position when going back into body, sound fx added, movement speed tweaks, can't see body while soul is released
8-25 black sunglasses idea(prevent visions) "dark shades" or "black shades" name
psychic vision effect added
better collision added
8-24 working under CW 8
8-23 collision detection on street (with sidewalk+buildings)
8-22 collision detection models + firstperson view
8-21 psychic bodyguard idea
8-20 basic city engine, skeletal animation from glfighters2 pre-alpha, player+building models, jogger group

Main menu music is included with permission from musician John Graham, Copyright 2002.
Due to legal difficulties all other music is composed by me at the last minute based on some nice loops made by Carlos Camacho, hence the 'programmer music'.
Also many thanks to my other friends and beta testers, and to artist David Drew for modelling the assault rifle, sniper rifle, handgun, shotgun and grenade.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Build/Soundtrack/Cover.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Build/blackshades.exe
Binary file not shown.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ But recently I figured out a way to compile it, and thus the Black Shades Enhanc

**What is included?**

As of v1.0.0:
As of v1.1.0:
- Increased the FPS limit from 90 to 300.
- Allows the user to set the FPS limit in the config.txt
- Allows the user to run the game in windowed mode.
- Added an icon for use in Windowed Mode.
- Added SQL_Image support
- Added SQL_Image support.
- Added a new FOV setting.
- Changed the Sniper Rifle's FOV to 22.50 due to the equation used for calculating user-defined FOV.
- Fixed all compiler warnings!
- Includes the soundtrack!

All the new settings can be set in the config.txt the game generates.

**Images:**

Expand Down
12 changes: 6 additions & 6 deletions blackshades/Source/Fog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ void Fog::SetFog(float colorR, float colorG, float colorB, float fStart, float f
glFogfv(GL_FOG_COLOR,fogColor);
glFogf(GL_FOG_DENSITY,fogDensity);
glFogi(GL_FOG_HINT,GL_DONT_CARE);
glFogi(GL_FOG_START,fogStart);
glFogi(GL_FOG_END,fogEnd);
glFogf(GL_FOG_START,fogStart);
glFogf(GL_FOG_END,fogEnd);

glEnable(GL_FOG);
}
Expand All @@ -34,8 +34,8 @@ void Fog::TempFog(float colorR, float colorG, float colorB)
glFogfv(GL_FOG_COLOR,tempfogColor);
glFogf(GL_FOG_DENSITY,fogDensity);
glFogi(GL_FOG_HINT,GL_DONT_CARE);
glFogi(GL_FOG_START,fogStart);
glFogi(GL_FOG_END,fogEnd);
glFogf(GL_FOG_START,fogStart);
glFogf(GL_FOG_END,fogEnd);

glEnable(GL_FOG);
}
Expand All @@ -46,8 +46,8 @@ void Fog::ResetFog()
glFogfv(GL_FOG_COLOR,fogColor);
glFogf(GL_FOG_DENSITY,fogDensity);
glFogi(GL_FOG_HINT,GL_DONT_CARE);
glFogi(GL_FOG_START,fogStart);
glFogi(GL_FOG_END,fogEnd);
glFogf(GL_FOG_START,fogStart);
glFogf(GL_FOG_END,fogEnd);

glEnable(GL_FOG);
}
Expand Down
12 changes: 6 additions & 6 deletions blackshades/Source/Frustum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void FRUSTUM::
frustum[5][3] = clip[15] + clip[14];

/* normalize the right plane */
t = sqrt(frustum[0][0]*frustum[0][0]
t = sqrtf(frustum[0][0]*frustum[0][0]
+ frustum[0][1]*frustum[0][1]
+ frustum[0][2]*frustum[0][2]);
frustum[0][0] /= t;
Expand All @@ -93,7 +93,7 @@ void FRUSTUM::
frustum[1][3] = clip[15] + clip[12];

/* normalize the left plane */
t = sqrt(frustum[1][0]*frustum[1][0]
t = sqrtf(frustum[1][0]*frustum[1][0]
+ frustum[1][1]*frustum[1][1]
+ frustum[1][2]*frustum[1][2]);
frustum[1][0] /= t;
Expand All @@ -108,7 +108,7 @@ void FRUSTUM::
frustum[2][3] = clip[15] + clip[13];

/* normalize the bottom plane */
t = sqrt(frustum[2][0]*frustum[2][0]
t = sqrtf(frustum[2][0]*frustum[2][0]
+ frustum[2][1]*frustum[2][1]
+ frustum[2][2]*frustum[2][2]);
frustum[2][0] /= t;
Expand All @@ -123,7 +123,7 @@ void FRUSTUM::
frustum[3][3] = clip[15] - clip[13];

/* normalize the top plane */
t = sqrt(frustum[3][0]*frustum[3][0]
t = sqrtf(frustum[3][0]*frustum[3][0]
+ frustum[3][1]*frustum[3][1]
+ frustum[3][2]*frustum[3][2]);
frustum[3][0] /= t;
Expand All @@ -138,7 +138,7 @@ void FRUSTUM::
frustum[4][3] = clip[15] - clip[14];

/* normalize the far plane */
t = sqrt(frustum[4][0]*frustum[4][0]
t = sqrtf(frustum[4][0]*frustum[4][0]
+ frustum[4][1]*frustum[4][1]
+ frustum[4][2]*frustum[4][2]);
frustum[4][0] /= t;
Expand All @@ -153,7 +153,7 @@ void FRUSTUM::
frustum[5][3] = clip[15] + clip[14];

/* normalize the near plane */
t = sqrt(frustum[5][0]*frustum[5][0]
t = sqrtf(frustum[5][0]*frustum[5][0]
+ frustum[5][1]*frustum[5][1]
+ frustum[5][2]*frustum[5][2]);
frustum[5][0] /= t;
Expand Down
5 changes: 3 additions & 2 deletions blackshades/Source/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ class Game
bool debug;
bool vblsync;

bool blur;
int blur;
bool blurness;

bool paused;
int paused;

int mainmenu;

Expand Down Expand Up @@ -239,6 +239,7 @@ class Game
//new stuff
int fpslimit;
int fullscreen;
int fov;

~Game() {
glDeleteTextures( 1, (const GLuint *)personspritetextureptr );
Expand Down
4 changes: 2 additions & 2 deletions blackshades/Source/GameDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,9 @@ int Game::DrawGLScene(GLvoid)

//Change fov if zooming with scope

if(!zoom)ReSizeGLScene(90,.1);
if(!zoom)ReSizeGLScene(fov,.1);

if(zoom)ReSizeGLScene(10,.6);
if(zoom)ReSizeGLScene(fov/4,.6);

nocolors=0;

Expand Down
12 changes: 12 additions & 0 deletions blackshades/Source/GameInitDispose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3650,6 +3650,8 @@ int Game::InitGL(GLvoid)
fpslimit=300;

fullscreen=1;

fov=90;


//If no config, write one
Expand Down Expand Up @@ -3716,6 +3718,10 @@ int Game::InitGL(GLvoid)

opstream << fullscreen;

opstream << "\nFOV (Field of View):\n";

opstream << fov;

opstream.close();

}
Expand Down Expand Up @@ -3806,6 +3812,12 @@ int Game::InitGL(GLvoid)

ipstream >> fullscreen;

ipstream.ignore(256,'\n');

ipstream.ignore(256,'\n');

ipstream >> fov;

ipstream.close();

}
Expand Down
26 changes: 0 additions & 26 deletions blackshades/Source/GameLoop.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#include "Game.h"
#include "SoundFX.h"
#ifdef OS9
#include <glut.h>
#else
#include <GL/glut.h>
#endif

extern double multiplier;

Expand Down Expand Up @@ -348,8 +343,6 @@ static void DoSDLKey(Game *g, SDL_Event *event)
void Game::ProcessSDLEvents(void)
{
SDL_Event event;

bool checked = 0;

if (SDL_PollEvent(&event)) {
do {
Expand Down Expand Up @@ -379,25 +372,6 @@ void Game::ProcessSDLEvents(void)
case SDL_KEYUP:
DoSDLKey(this, &event);
break;
case SDL_MOUSEMOTION:
if (!fullscreen && !mainmenu && gameinprogress)
{
if(checked)
{
int centerX = screenwidth/2;
int centerY = screenheight/2;
if (x != centerX || y != centerY)
{
glutWarpPointer(centerX, centerY);
}
checked = false;
}
else if(!checked)
{
checked = true;
}
}
break;
case SDL_QUIT:
exit(0);
}
Expand Down
Loading

0 comments on commit 53f0c67

Please sign in to comment.