hi, i just removed GDK 2010 update for dbLoopObject working...
but got a strange error while compiling... see screenshot here is my code
#include "DarkGDK.h"
#include "SC_Collision.h"
int fCameraAngleX;
int fCameraAngleY;
int shootingTimer = dbTimer();
void mouse(void);
void drawCrosshair(int centerX, int centerY);
int ShootTimer = 60;
void LoadMap()
{
//dbLoadBSP ( "media//maps//iran//ut_iran.pk3", "ut_iran.bsp" );
dbLoadBSP ( "media//maps//Day After//ut_the_day_after2_fixed.pk3", "ut_the_day_after2_fixed.bsp" );
}
void LoadPlayer()
{
dbLoadObject("media//Objects//Mw2 Ak//ak47.dbo",10);
dbLoadObject("media//Objects//Mw2 Ak//reload.dbo",12);
dbSetObjectFrame(10,70);
dbHideObject(12);
dbAutomaticObjectCollision(10,.8,1);
dbAutomaticObjectCollision(12,.8,1);
}
void LoadEnemy()
{
dbLoadObject("media//Objects//Soldier//Soldier.dbo",11);
dbPositionObject(11,-11,0 ,-5);
dbScaleObject(11,3,3,3);
}
void LoadSky()
{
dbLoadObject ( "media//sky//skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbSetObjectTexture ( 2, 3, 2 );
dbScaleObject ( 2, 500, 500, 500 );
}
void LoadSounds()
{
dbLoadMusic("Media//Sounds//Soundtracks//track1.mp3", 20);
dbLoadSound("Media//Sounds//Weapons//AK47//Ak47-1.wav", 21);
}
void DarkGDK ( void )
{
dbSyncOn();
dbSyncRate(60);
int Desktop_Width;
int Desktop_Height;
int Dekstop_Depth = 32;
Desktop_Width=GetSystemMetrics(0);
Desktop_Height=GetSystemMetrics(1);
dbSetDisplayMode(Desktop_Width,Desktop_Height,Dekstop_Depth);
dbSetWindowOff();
dbSetGlobalShadowsOn();
dbSetShadowShadingOn (10);
dbSetShadowShadingOn (10, -1, 128, 1);
dbSetPointLight (0, 0, 100, 0.0);
dbAutoCamOff();
SC_Start();
LoadSky();
LoadMap();
LoadEnemy();
LoadPlayer();
//dbMaximizeWindow();
//dbSetDisplayMode(1280,800,32);
//dbSetWindowOff();
//Declare Camera Variables
float cf,cr;
float ncf=0;
float ncr=0;
float cx,cy;
float ncx=0;
float ncy=0;
dbMakeCamera(0);
dbPositionCamera(0,-10,3.5,-25);
dbSetBSPCamera(0);
dbBackdropOff(0);
dbSetCameraFOV(80);
dbSetBSPCameraCollision(1, 0, 0.75, 0 );
dbSetBSPCollisionHeightAdjustment(1,0.85);
//dbSetBSPCollisionThreshhold(1,0.9);
dbSetBSPObjectCollision(2,11,1,0);
LoadSounds();
dbAutomaticObjectCollision(11,2,1);
dbAutomaticObjectCollision(10,2,1);
dbHideMouse();
dbLockObjectOn(10);
dbSetCameraRange(0.001,3000);
while (LoopGDK( ) )
{
dbLoopObject(11);
dbLoopMusic(20);
dbPositionCamera(dbCameraPositionX(), dbCameraPositionY()- 0.1f, dbCameraPositionZ());
drawCrosshair(GetSystemMetrics(0)/2, GetSystemMetrics(1)/2);
if ( dbMouseClick ( ) == 1 )
{
dbHideObject(12);
dbShowObject(10);
dbLockObjectOn(10);
if(dbTimer() - shootingTimer > 110)
{
dbPlayObject(10);
dbSetObjectSpeed(10,500);
dbPositionSound(21, dbObjectPositionX(10),dbObjectPositionY(10), dbObjectPositionZ(10));
dbPlaySound(21);
shootingTimer = dbTimer();
}
}
if (dbKeyState (19))//Reload
{
dbHideObject(10);
dbShowObject(12);
dbLockObjectOn(12);
dbPlayObject(12);
dbSetObjectSpeed(12,100);
}
//display and update the position of camera + Object
dbPrint(dbStr(dbCameraPositionX(0)));
dbPrint(dbStr(dbCameraPositionY(0)));
dbPrint(dbStr(dbCameraPositionZ(0)));
dbPrint(dbStr(dbTotalObjectFrames(11)));
dbPrint(dbStr(dbCameraAngleX(0)));
dbPrint(dbStr(dbCameraAngleY(0)));
dbPrint(dbStr(dbTotalObjectFrames(12)));
dbSync ( );
//Movements
if( dbSpaceKey())
{
dbPositionCamera(dbCameraPositionX(), dbCameraPositionY()+ 0.5, dbCameraPositionZ());
}
if (dbKeyState (17))//(dbUpKey())
{
dbHideObject(12);
dbShowObject(10);
dbLockObjectOn(10);
dbMoveCamera(0.1);
}
cr=0;cf=0;
if(dbRightKey()==1 || dbKeyState(32)==1)
{
dbHideObject(12);
dbShowObject(10);
dbLockObjectOn(10);
cr=0.1;
}
if(dbLeftKey()==1 || dbKeyState(30)==1)
{
dbHideObject(12);
dbShowObject(10);
dbLockObjectOn(10);
cr=-0.1;
}
if(dbUpKey()==1 || dbKeyState(17)==1)
{
dbHideObject(12);
dbShowObject(10);
dbLockObjectOn(10);
cf=0.1;
}
if(dbDownKey()==1 || dbKeyState(31)==1)
{
dbHideObject(12);
dbShowObject(10);
dbLockObjectOn(10);
cf=-0.1;
}
ncr=dbCurveValue(cr,ncr,5);
ncf=dbCurveValue(cf,ncf,5);
cx=cx+dbMouseMoveY()*0.2;
cy=cy+dbMouseMoveX()*0.2;
if(cx>80) cx=80;
if(cx<-80) cx=-80;
ncx=dbCurveAngle(cx,ncx,2);
ncy=dbCurveAngle(cy,ncy,2);
dbMoveCamera(ncf);
dbRotateCamera(0,dbWrapValue(ncy+90),0);
dbMoveCamera(ncr);
dbRotateCamera(0,dbWrapValue(ncy-90),0);
dbRotateCamera(ncx,ncy,0);
}
return;
}
void drawCrosshair(int centerX, int centerY)
{
dbLine(centerX - 6, centerY, centerX + 6, centerY);
dbLine(centerX, centerY - 6, centerX, centerY + 6);
}
Any idea to solve this???