Пример #1
0
bp::object
gettext_path()
{
    // TODO: distinguish between -d runs and normal runs
    // TODO: can we detect DESTDIR-installs?
    QStringList candidatePaths = QStandardPaths::locateAll( QStandardPaths::GenericDataLocation, "locale", QStandardPaths::LocateDirectory );
    QString extra = QCoreApplication::applicationDirPath();
    _add_localedirs( candidatePaths, extra ); // Often /usr/local/bin
    if ( !extra.isEmpty() )
    {
        QDir d( extra );
        if ( d.cd( "../share/locale" ) ) // Often /usr/local/bin/../share/locale -> /usr/local/share/locale
            _add_localedirs( candidatePaths, d.canonicalPath() );
    }
    _add_localedirs( candidatePaths, QDir().canonicalPath() ); // .

    cDebug() << "Standard paths" << candidatePaths;

    for ( auto lang : _gettext_languages() )
        for ( auto localedir : candidatePaths )
        {
            QDir ldir( localedir );
            cDebug() << "Checking" << lang << "in" <<ldir.canonicalPath();
            if ( ldir.cd( lang ) )
                return bp::object( localedir.toStdString() );
        }
    return bp::object();  // None
}
Пример #2
0
int JRenderServer::AddDirLight( const Vec3& dir, DWORD diffuse, DWORD specular, bool bPerPixel )
{
    D3DLIGHT8 light;
    light.Type          = D3DLIGHT_DIRECTIONAL ;            
    light.Diffuse       = ConvertColor( diffuse  );
    light.Specular      = ConvertColor( specular );        
    light.Ambient       = ConvertColor( 0xFF000000 );   

    Vec3 ldir( dir.x, dir.y, dir.z );
    ldir.normalize();
    light.Direction.x   = ldir.x; 
    light.Direction.y   = ldir.y;
    light.Direction.z   = ldir.z;

    light.Range         = 100.0f;
    light.Position.x    = 0.0f; 
    light.Position.y    = 0.0f;
    light.Position.z    = 0.0f;

    light.Attenuation0  = 0.0f;
    light.Attenuation1  = 0.0f;
    light.Attenuation2  = 0.0f;

    light.Falloff       = 0.0f;
    light.Theta         = c_PI;
    light.Phi           = c_PI;

    IDirect3DDevice8* pDevice = GetDirect3DDevice8();
    pDevice->LightEnable( 0, TRUE );
    pDevice->SetLight   ( 0, &light );
    
    return 0;
} // JRenderServer::AddDirLight
Пример #3
0
void CDatabaseManager::RemoveField(QString *pICAO)
{
    //First remove the directory
    s_Field* lfld = new s_Field();
    GetField(*pICAO, lfld);
    QDir ldir(lfld->Path);
    ldir.cd(lfld->Path);
    QStringList lFiles;
    lFiles = ldir.entryList();
    QString fileName;
    foreach(fileName, lFiles)
    {
        QString fn(lfld->Path);
        fn.append("/");
        fn.append(fileName);
        QFile::remove(fn);
    }
Пример #4
0
int main(int argc, char *argv[]){

	char buff[N], *param; //1024
	int j = 0, nb;

	if( argc != 2){

		printf("Usage: %s <server host>\n", argv[0]);
		exit(1);
	}

	printf("commands\n");
	do{

		memset(buff, '\0', N);
		
		prompt();	
		gets(buff);
	
		param = strchr(buff,' '); // param <- commands
		if (param) {
    			*param=0;
    			param++;
  		}

		for(j = 0; j < NB_CMDS; j++)
			if( !strcmp(buff, commandes[j]))
				break;	
			
		switch(j){

 			case(OPEN):	if(connection) printf("already connected\n");
					else myconnect(argv[1]);
					break;
		
			case(GET):	if(!connection) printf("Not connected!\n"); 
					else get(param);
					break;

			case(PUT):	if(!connection) printf("Not connected!\n"); 
					else put(param);
					break;
				
			case(MGET):	if(!connection) printf("Not connected!\n"); 
					else mget(param);
					break;		
			case(MPUT):	if(!connection) printf("Not connected!\n"); 
					else mput(param);
					break;
			
			case(CD):	if(!connection) printf("NoT connecteD!\n"); 
					else cd(param);
					break;
			
			case(LCD):	lcd(param);
					break;
							
			case(MGET_):	if(!connection) printf("Not connected!\n"); 
					else mget_(param);
					break;		
			case(MPUT_):	if(!connection) printf("Not connected!\n"); 
					else mput_(param);
					break;
			

 			case(DIR):	if(!connection) printf("Not connecte!\n"); 
					else dir();
					break;
			case(LDIR):
					ldir();
					break;
			case(RGET):	if(!connection) printf("Not connected!\n"); 
					else rget(param);
					break;		
			case(RPUT):	if(!connection) printf("Not connected!\n"); 
					else rput(param);
					break;		

			//case (HELP):	aide();
			//		break;

			default:	printf("%s command invalid\n", buff);
					printf("Commands are as follows\n");
					printf(" get : To Get A file from Server\n");
					printf(" put : To Put A file to Server\n");
					printf(" cd : change Server's Current Directory\n");
					printf(" lcd : Change Client's current Directory\n");
					printf(" mget : To Get multiple files from Server\n");
					printf(" mput : To put multiple files from Server\n");
					printf(" dir : List the Server's current Directory\n");
					printf(" ldir : List the Client's current Directory\n");
					printf(" mget_ : Put files with wildcard support\n");
					printf("mput_ : get files with wildcard support\n");
					printf("rget : Get a directory recursively\n");
					printf("rput : Put a Directory recursiovely\n");
					break;
		}
		
	}
	while(1);
 	
return(0);
}
Пример #5
0
int OneTimeSceneInit()
{
	int ret;
	
	D3DXVECTOR3 campos = D3DXVECTOR3( -1955.0f, 4875.0f, 622.0f );
	ret = E3DSetCameraPos( campos );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 camtar = D3DXVECTOR3( -2203.0f, 3135.0f, 4871.0f );
	D3DXVECTOR3 camup = D3DXVECTOR3( 0.0f, 1.0f, 0.0f );
	ret = E3DSetCameraTarget( camtar, camup );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetProjection( 1000.0f, 40000.0f, 60.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	char gname[MAX_PATH];
	sprintf_s( gname, MAX_PATH, "%s\\ground05mv.sig", szMediaDir );
	ret = E3DLoadSigFileAsGround( gname, 1.0f, 0, &hsid0 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	char signame[MAX_PATH];
	sprintf_s( signame, MAX_PATH, "%s\\moro.sig", szMediaDir );
	ret = E3DSigLoad( signame, 0, 1.0f, &hsid1 ); 
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	char motname[MAX_PATH];
	sprintf_s( motname, MAX_PATH, "%s\\moro.qua", szMediaDir );
	int maxframe;
	ret = E3DAddMotion( hsid1, motname, 1.0f, &motid1, &maxframe );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetMotionKind( hsid1, motid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	ret = E3DCreateLight( &lid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 ldir( 1.0f, -1.0f, 1.0f );
	E3DCOLOR4UC col= {255, 255, 255, 255 };
	ret = E3DSetDirectionalLight( lid1, ldir, col );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ret = E3DCreateFont( 20, 0, 400, 0, 0, 0, "MS ゴシック", &fontid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	//へたくそなアニメですまん。。。急いでたんだよ
	char animname[MAX_PATH];
	sprintf_s( animname, MAX_PATH, "%s\\test1.gpa", szMediaDir );
	ret = E3DLoadGPFile( hsid1, animname, &animno1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetGPGroundHSID( hsid1, animno1, hsid0 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	sprintf_s( animname, MAX_PATH, "%s\\test2.gpa", szMediaDir );
	ret = E3DLoadGPFile( hsid1, animname, &animno2 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetGPGroundHSID( hsid1, animno2, hsid0 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ret = E3DSetGPAnimNo( hsid1, animno1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	
	ret = E3DSetNextGPAnimFrameNo( hsid1, animno1, animno2, 0, -1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetNextGPAnimFrameNo( hsid1, animno2, animno1, 0, -1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	return 0;

}
Пример #6
0
int OneTimeSceneInit()
{
	int ret;
	D3DXVECTOR3 campos = D3DXVECTOR3( 53898.0f, 3000.0f, 44982.0f - 2500.0f );
	ret = E3DSetCameraPos( campos );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 camtar = D3DXVECTOR3( 53898.0f, 2500.0f, 44982.0f );
	D3DXVECTOR3 camup = D3DXVECTOR3( 0.0f, 1.0f, 0.0f );
	ret = E3DSetCameraTarget( camtar, camup );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetProjection( 1000.0f, proj_far, 60.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	//地面データのロード
	char name1[MAX_PATH];
	sprintf_s( name1, MAX_PATH, "%s\\g_6_20_1.bmp", szMediaDir );
	char name2[MAX_PATH];
	sprintf_s( name2, MAX_PATH, "%s\\8.bmp", szMediaDir );
	char name3[MAX_PATH];
	sprintf_s( name3, MAX_PATH, "%s\\g_river_6_20_1.bmp", szMediaDir );
	char name4[MAX_PATH];
	sprintf_s( name4, MAX_PATH, "%s\\BG43.bmp", szMediaDir );
	float mapsize = 120000.0f;
	int mapdiv = 50;
	float mapheight = 5500.0f;
	ret = E3DLoadGroundBMP( name1, name2, name3, name4, mapsize, mapsize, mapdiv, mapdiv, mapheight, &hsid0 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	
	//モロ星人のロード
	char signame[MAX_PATH];
	sprintf_s( signame, MAX_PATH, "%s\\morob_6_26_r3.sig", szMediaDir );
	ret = E3DSigLoad( signame, 0, 1.0f, &hsid1 ); 
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	char quaname[MAX_PATH];
	sprintf_s( quaname, MAX_PATH, "%s\\morob_6_26_r3.qua", szMediaDir );
	int maxframe;
	ret = E3DAddMotion( hsid1, quaname, 1.0f, &motid1, &maxframe );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetMotionKind( hsid1, motid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	curpos = D3DXVECTOR3( 53898.0f, 3000.0f, 44982.0f );
	befpos = curpos;
	ret = E3DSetPos( hsid1, curpos );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 deg = D3DXVECTOR3( 0.0f, 120.0f, 0.0f );
	ret = E3DSetDir( hsid1, deg );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetBeforePos( hsid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	//木(ビルボード)の読み込みと設置
	
		// PosOnGround 命令を使うために、ChkInViewを、あらかじめ、呼んでおく必要があります。
	int state;
	ret = E3DChkInView( scid, hsid0, &state );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	srand( 321 );
	int bbcnt;
	for( bbcnt = 0; bbcnt < BBNUM; bbcnt++ ){
		int treekind;
		char treename[MAX_PATH];

		treekind = rand() % 3;
		if( treekind == 0 ){
			sprintf_s( treename, MAX_PATH, "%s\\tree01S.tga", szMediaDir );
		}else if( treekind == 1 ){
			sprintf_s( treename, MAX_PATH, "%s\\tree02S.tga", szMediaDir );
		}else{
			sprintf_s( treename, MAX_PATH, "%s\\tree35S.tga", szMediaDir );
		}
		ret = E3DCreateBillboard( treename, 2000.0f, 3000.0f, 0, 0, 0, bbid + bbcnt );
		if( ret ){
			_ASSERT( 0 );
			return 1;
		}

		int divsize;
		divsize = (int)mapsize / 4;
		int randx, randz;
		randx = ( rand() % divsize ) * 4;
		randz = ( rand() % divsize ) * 4;

		ret = E3DSetBillboardOnGround( bbid[bbcnt], hsid0, mapheight, -100.0f, (float)randx, (float)randz );
		if( ret ){
			_ASSERT( 0 );
			return 1;
		}
	}

	
	//ライト
	ret = E3DCreateLight( &lid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 ldir( 0.0f, -1.0f, 2.0f );
	E3DCOLOR4UC col= {255, 255, 255, 255 };
	ret = E3DSetDirectionalLight( lid1, ldir, col );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
   
	//フォグ
	E3DCOLOR4UC fogcol = { 255, 0, 0, 255 };
	ret = E3DSetLinearFogParams( 1, fogcol, 1000.0f, proj_far, -1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	//モーションブラーの準備
		//3番目の引数で何フレーム前のデータでブラーを作るかを指定
	ret = E3DSetMotionBlur( hsid0, BLUR_CAMERA, 15 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetMotionBlur( hsid1, BLUR_CAMERA, 5 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetMotionBlur( -1, BLUR_CAMERA, 3 );//-1はビルボード
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	blurdisp[0] = hsid0;
	blurdisp[1] = hsid1;
	blurdisp[2] = -1;

	return 0;
}
Пример #7
0
int OneTimeSceneInit()
{
	int ret;

	D3DXVECTOR3 campos = D3DXVECTOR3( 0.0f, 800.0f, -2000.0 );
	ret = E3DSetCameraPos( campos );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetCameraDeg( 180.0f, 0.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetProjection( 1000.0f, 30000.0f, 60.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	
	char signame[MAX_PATH];
	sprintf_s( signame, MAX_PATH, "%s\\befmorph5.sig", szMediaDir );
	ret = E3DSigLoad( signame, 0, 1.0f, &hsid1 ); 
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	ret = E3DCreateLight( &lid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 ldir( 0.0f, 0.0f, 1.0f );
	E3DCOLOR4UC col= {255, 255, 255, 255 };
	ret = E3DSetDirectionalLight( lid1, ldir, col );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ret = E3DCreateFont( 20, 0, 400, 0, 0, 0, "MS ゴシック", &fontid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ret = CreateMorph();
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ret = GetMorphDispInfo();
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ret = GetMorphMotion();
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	return 0;

}
Пример #8
0
int OneTimeSceneInit()
{
	int ret;

	D3DXVECTOR3 campos = D3DXVECTOR3( 0.0f, 800.0f, -2000.0 );
	ret = E3DSetCameraPos( campos );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetCameraDeg( 180.0f, 0.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetProjection( 1000.0f, 30000.0f, 60.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	
	char signame[MAX_PATH];
	sprintf_s( signame, MAX_PATH, "%s\\poo\\poo.sig", szMediaDir );
	ret = E3DSigLoad( signame, 0, 1.0f, &hsid1 ); 
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	char motname[MAX_PATH];
	sprintf_s( motname, MAX_PATH, "%s\\poo\\idling.qua", szMediaDir );
	ret = E3DAddMotion( hsid1, motname, 1.0f, &motid1, &maxframe1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetMotionKind( hsid1, motid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	ret = E3DCreateLight( &lid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 ldir( 0.0f, 0.0f, 1.0f );
	E3DCOLOR4UC col= {255, 200, 200, 200 };
	ret = E3DSetDirectionalLight( lid1, ldir, col );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	int okflag;
	SIZE largesize = { 256, 256 };
	SIZE smallsize = { 64, 64 };
	ret = E3DCreateRenderTargetTexture( largesize, D3DFMT_X8R8G8B8, &scid_org, &texid_org, &okflag );
	if( ret || !okflag ){
		_ASSERT( 0 );
		return 1;
	}
	E3DCOLOR4UC clearcol = { 0, 0, 0, 0 };
	ret = E3DSetClearCol( scid_org, clearcol );
	_ASSERT( !ret );

	ret = E3DCreateRenderTargetTexture( smallsize, D3DFMT_A8R8G8B8, &scid_small, &texid_small, &okflag );
	if( ret || !okflag ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DCreateRenderTargetTexture( smallsize, D3DFMT_A8R8G8B8, &scid_work, &texid_work, &okflag );
	if( ret || !okflag ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DCreateRenderTargetTexture( smallsize, D3DFMT_A8R8G8B8, &scid_blur, &texid_blur, &okflag );
	if( ret || !okflag ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DCreateRenderTargetTexture( largesize, D3DFMT_A8R8G8B8, &scid_final, &texid_final, &okflag );
	if( ret || !okflag ){
		_ASSERT( 0 );
		return 1;
	}

	char spname[MAX_PATH];
	sprintf_s( spname, MAX_PATH, "%s\\dummy256.png", szMediaDir );

	ret = E3DCreateSprite( spname, 0, 0, &spid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetTextureToDispObj( -2, spid1, texid_org );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ret = E3DCreateSprite( spname, 0, 0, &spid2 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetTextureToDispObj( -2, spid2, texid_blur );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ret = E3DCreateSprite( spname, 0, 0, &spid3 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetTextureToDispObj( -2, spid3, texid_final );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	return 0;

}
Пример #9
0
int OneTimeSceneInit()
{
	int ret;

	result1 = 0;
	result2 = 0;
	adj1 = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
	adj2 = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
	n1 = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
	n2 = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );


	D3DXVECTOR3 campos = D3DXVECTOR3( 0.0f, 2500.0f, 0.0f );
	ret = E3DSetCameraPos( campos );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetCameraDeg( 180.0f, 0.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetProjection( 1000.0f, 50000.0f, 60.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	

	char gname1[MAX_PATH];
	char gname2[MAX_PATH];
	char gname3[MAX_PATH];
	char gname4[MAX_PATH];
	sprintf_s( gname1, MAX_PATH, "%s\\g_6_20_1.bmp", szMediaDir );
	sprintf_s( gname2, MAX_PATH, "%s\\8.bmp", szMediaDir );
	sprintf_s( gname3, MAX_PATH, "%s\\g_river_6_20_1.bmp", szMediaDir );
	sprintf_s( gname4, MAX_PATH, "%s\\BG43.bmp", szMediaDir );
	ret = E3DLoadGroundBMP( gname1, gname2, gname3, gname4,
		MAPSIZE, MAPSIZE, MAPDIV, MAPDIV, MAPHEIGHT, &hsid0 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	char signame[MAX_PATH];
	sprintf_s( signame, MAX_PATH, "%s\\morob_6_26_r3.sig", szMediaDir );
	ret = E3DSigLoad( signame, 0, 1.0f, &hsid1 ); 
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	char motname[MAX_PATH];
	sprintf_s( motname, MAX_PATH, "%s\\morob_6_26_r3.qua", szMediaDir );
	ret = E3DAddMotion( hsid1, motname, 1.0f, &motid1, &maxframe1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetMotionKind( hsid1, motid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	pos1.x = 53898.0f;
	pos1.y = 3000.0f;//初期位置は必ず地面よりも上でなければならない。
	pos1.z = 44982.0;
	befpos1 = pos1;
	D3DXVECTOR3 deg1( 0.0f, 180.0f, 0.0f );
	ret = E3DSetPos( hsid1, pos1 );
	_ASSERT( !ret );
	ret = E3DSetDir( hsid1, deg1 );
	_ASSERT( !ret );

	ret = E3DSetBeforePos( hsid1 );//位置を初期化した直後に必ず呼ぶこと!
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	ret = E3DSetMovableArea( gname2, MAPSIZE, MAPSIZE, MAPDIV, MAPDIV, MAPHEIGHT + 1000.0f, &hsid2 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	ret = E3DCreateLight( &lid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 ldir( 0.0f, 0.0f, 1.0f );
	E3DCOLOR4UC col= {255, 255, 255, 255 };
	ret = E3DSetDirectionalLight( lid1, ldir, col );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	E3DCOLOR4UC fogcol;
	fogcol.a = 255;
	fogcol.r = 0;
	fogcol.g = 0;
	fogcol.b = 255;
	ret = E3DSetLinearFogParams( 1, fogcol, 1000.0f, 50000.0f, -1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	char bgname1[MAX_PATH];
	char bgname2[MAX_PATH];
	sprintf_s( bgname1, MAX_PATH, "%s\\lake.bmp", szMediaDir );
	sprintf_s( bgname2, MAX_PATH, "%s\\cloud3.bmp", szMediaDir );
	ret = E3DCreateBG( scid, bgname1, bgname2, 0.001f, 0.0f, 0, 50000.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	return 0;

}
Пример #10
0
int OneTimeSceneInit()
{
	int ret;

	cameradist = 3000.0f;
	cameraheight = 800.0f;
	campos.x = (float)GROUND_SIZE * 0.5f;
	campos.y = (float)GROUND_HEIGHT + cameraheight;
	campos.z = ( (float)GROUND_SIZE * 0.5f ) - cameradist;

	ret = E3DSetProjection( 500.0f, 50000.0f, 60.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	ZeroMemory( ci, sizeof( CHARAINFO ) * CHARA_MAX );


//赤キャラ初期化
	char signame[MAX_PATH];
	sprintf_s( signame, MAX_PATH, "%s\\poo\\poo.sig", szMediaDir );
	ret = E3DSigLoad( signame, 0, 1.0f, &(ci[CHARA_RED].hsid) ); 
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	
	ci[CHARA_RED].pos = D3DXVECTOR3( 1000.0f, GROUND_HEIGHT, 0.0f );
	ret = E3DSetPos( ci[CHARA_RED].hsid, ci[CHARA_RED].pos );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	E3DCOLOR4UC redcol = { 255, 255, 0, 0 };
	ret = E3DSetToonEdge0Color( ci[CHARA_RED].hsid, -1, "dummy", redcol );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetToonEdge0Width( ci[CHARA_RED].hsid, -1, "dummy", 10.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DRotateY( ci[CHARA_RED].hsid, 90.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	char motname[MAX_PATH];
	sprintf_s( motname, MAX_PATH, "%s\\poo\\poo.moa", szMediaDir );
	ret = E3DLoadMOAFile( ci[CHARA_RED].hsid, motname, 10, 1.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DCreateQ( &(ci[CHARA_RED].qid) );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetBeforePos( ci[CHARA_RED].hsid );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ci[CHARA_RED].hp = HPMAX;

//青きゃらの初期化
	sprintf_s( signame, MAX_PATH, "%s\\poo\\poo.sig", szMediaDir );
	ret = E3DSigLoad( signame, 0, 1.0f, &(ci[CHARA_BLUE].hsid) ); 
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	
	ci[CHARA_BLUE].pos = D3DXVECTOR3( -1000.0f, GROUND_HEIGHT, 0.0f );
	ret = E3DSetPos( ci[CHARA_BLUE].hsid, ci[CHARA_BLUE].pos );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	E3DCOLOR4UC bcol = { 255, 0, 0, 255 };
	ret = E3DSetToonEdge0Color( ci[CHARA_BLUE].hsid, -1, "dummy", bcol );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetToonEdge0Width( ci[CHARA_BLUE].hsid, -1, "dummy", 10.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DRotateY( ci[CHARA_BLUE].hsid, -90.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	sprintf_s( motname, MAX_PATH, "%s\\poo\\poo.moa", szMediaDir );
	ret = E3DLoadMOAFile( ci[CHARA_BLUE].hsid, motname, 10, 1.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DCreateQ( &(ci[CHARA_BLUE].qid) );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DSetBeforePos( ci[CHARA_BLUE].hsid );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ci[CHARA_BLUE].hp = HPMAX;
///////////////////

	E3DGetMotionNum( ci[CHARA_RED].hsid, &motnum );
	motionidptr = (int*)malloc( sizeof( int ) * motnum );
	if( !motionidptr ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "idling", motionidptr + MOT_IDLING );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "walk", motionidptr + MOT_WALK );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "tsuki", motionidptr + MOT_TSUKI );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "kick", motionidptr + MOT_KICK );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "defence", motionidptr + MOT_DEFENCE );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "mochiage", motionidptr + MOT_MOCHIAGE );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "jitabata", motionidptr + MOT_JITABATA );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "nagerare", motionidptr + MOT_NAGERARE );
		if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	ret = E3DGetMotionIDByName( ci[CHARA_RED].hsid, "tsunagi", motionidptr + MOT_TSUNAGI );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
////////////////////

	char bgname[MAX_PATH];	
	sprintf_s( bgname, MAX_PATH, "%s\\bmpfile\\a007bcg.bmp", szMediaDir );
	ret = E3DCreateBG( scid, bgname, "dummy", 0.0f, 0.0f, 0, 50000.0f );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}

	char gname[MAX_PATH];
	sprintf_s( gname, MAX_PATH, "%s\\bmpfile\\gplane.mqo", szMediaDir );
	ret = E3DLoadMQOFileAsGround( gname, 100.0, 0, BONETYPE_RDB2, &groundhsid );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}



	ret = E3DCreateLight( &lid1 );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}
	D3DXVECTOR3 ldir( 0.0f, -1.0f, 1.0f );
	E3DCOLOR4UC col= {255, 255, 255, 255 };
	ret = E3DSetDirectionalLight( lid1, ldir, col );
	if( ret ){
		_ASSERT( 0 );
		return 1;
	}


	confflag = 0;
	gameflag = 0;


	return 0;
}