Debug hack + actual fixings

This commit is contained in:
Dander7BD 2014-02-18 10:28:46 +01:00
parent 55e3aaaabc
commit b2e98f1207
6 changed files with 39 additions and 10 deletions

View File

@ -64,7 +64,12 @@ namespace DanBias
{
WindowShell::CreateConsoleWindow();
//if(! data.window->CreateWin(WindowShell::WINDOW_INIT_DESC(L"Window", cPOINT(1600, 900), cPOINT())))
if(! data.window->CreateWin(WindowShell::WINDOW_INIT_DESC()))
WindowShell::WINDOW_INIT_DESC winDesc;
winDesc.windowSize.x = 1280;
winDesc.windowSize.y = 720;
if(! data.window->CreateWin(winDesc) )
return DanBiasClientReturn_Error;
if( FAILED( InitDirect3D() ) )
@ -136,7 +141,7 @@ namespace DanBias
Oyster::Graphics::API::Option p;
p.modelPath = L"..\\Content\\Models\\";
p.texturePath = L"..\\Content\\Textures\\";
p.Resolution = Oyster::Math::Float2( 1024, 768);
p.Resolution = Oyster::Math::Float2( 1280.0f, 720.0f );
//! @todo fix proper amb value
p.AmbientValue = 1.0f;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>

View File

@ -112,7 +112,8 @@ void Camera_FPS::StrafeLeft( Float distance )
void Camera_FPS::PitchUp( Float radian )
{
this->pitchUp = Clamp( this->pitchUp + radian, -0.48f * pi, 0.48f * pi );
//this->pitchUp = Clamp( this->pitchUp + radian, -0.48f * pi, 0.48f * pi );
this->pitchUp = this->pitchUp + radian; // debug hack
this->head.SetAngular( this->body.angularAxis + this->pitchUp * this->body.direction.v[0] );
}

View File

@ -17,6 +17,7 @@ using namespace ::Oyster::Math3D;
using namespace ::GameLogic;
using namespace ::Utility::DynamicMemory;
using namespace ::Utility::String;
using namespace ::Utility::Value;
struct GameState::MyData
{
@ -76,8 +77,23 @@ bool GameState::Init( SharedStateContent &shared )
this->privData->staticObjects = &shared.staticObjects;
this->privData->dynamicObjects = &shared.dynamicObjects;
Graphics::API::Option gfxOp = Graphics::API::GetOption();
Float aspectRatio = gfxOp.Resolution.x / gfxOp.Resolution.y;
this->privData->camera.SetPerspectiveProjection( Radian(90.0f), aspectRatio, 0.1f, 1000.0f );
Graphics::API::SetProjection( this->privData->camera.GetProjectionMatrix() );
//tell server ready
this->privData->nwClient->Send( Protocol_General_Status(Protocol_General_Status::States_ready) );
//this->privData->nwClient->Send( Protocol_General_Status(Protocol_General_Status::States_ready) );
// Debugg hack
this->InitiatePlayer( 0, "crate_generic.dan",Float3( 0,132, 10), Quaternion::identity, Float3(1), true );
Graphics::Definitions::Pointlight light;
light.Pos = Float3( 0,132,0);
light.Color = Float3( 1.0f );
light.Bright = 1.0f;
light.Radius = 1000.0f;
Graphics::API::AddLight( light );
// end debug hack
return true;
}
@ -98,6 +114,9 @@ void GameState::InitiatePlayer( int id, const std::string &modelName, const floa
{
this->privData->myId = id;
this->privData->camera.SetPosition( this->privData->player.getPos() );
Float3 offset = Float3( 0.0f );
offset.y = this->privData->player.getScale().y + 0.5f; // debug hack +0.5f
this->privData->camera.SetHeadOffset( offset );
this->privData->camera.UpdateOrientation();
}
}
@ -113,6 +132,7 @@ void GameState::InitiatePlayer( int id, const std::string &modelName, const floa
GameClientState::ClientState GameState::Update( float deltaTime )
{
this->ReadKeyInput();
return this->privData->nextState;
}
@ -219,8 +239,8 @@ void GameState::ReadKeyInput()
//send delta mouse movement
{
this->privData->camera.YawRight( -this->privData->input->GetYaw() );
this->privData->camera.PitchUp( this->privData->input->GetPitch() );
this->privData->camera.YawRight( this->privData->input->GetYaw() * 0.017f );
this->privData->camera.PitchDown( this->privData->input->GetPitch() * 0.017f );
this->privData->camera.UpdateOrientation();
privData->nwClient->Send( Protocol_PlayerLook(this->privData->camera.GetLook(), this->privData->camera.GetRight()) );

View File

@ -54,8 +54,11 @@ bool NetLoadState::Init( SharedStateContent &shared )
// we may assume that nwClient is properly connected to the server
// signals querry to server for loading instructions
this->privData->nwClient->Send( Protocol_QuerryGameType() );
//this->privData->nwClient->Send( Protocol_QuerryGameType() );
// debugg
this->LoadGame( "..//Content//Worlds//2ofAll_updated.bias");
this->ChangeState( ClientState_Game );
return true;
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup>
</Project>