Ipv4AddressHelper::Ipv4AddressHelper (
  const Ipv4Address network, 
  const Ipv4Mask    mask,
  const Ipv4Address address)
{
  NS_LOG_FUNCTION_NOARGS ();
  SetBase (network, mask, address);
}
Esempio n. 2
0
void ACharacter::ClearCrossLevelReferences()
{
    if( BasedMovement.MovementBase != NULL && GetOutermost() != BasedMovement.MovementBase->GetOutermost() )
    {
        SetBase( NULL );
    }

    Super::ClearCrossLevelReferences();
}
Esempio n. 3
0
void AUTWeaponPawn::TryToSetupSeat()
{
	if (MyVehicle != NULL && MyVehicle->Seats.IsValidIndex(MySeatIndex))
	{
		MyVehicle->Seats[MySeatIndex].SeatPawn = this;
		MyVehicle->Seats[MySeatIndex].Gun = MyVehicleWeapon;
		SetBase(MyVehicle);
	}
}
Esempio n. 4
0
void ACharacter::TeleportSucceeded(bool bIsATest)
{
	//move based pawns and remove base unless this teleport was done as a test
	if (!bIsATest  && CharacterMovement)
	{
		CharacterMovement->bJustTeleported = true;
		SetBase(NULL);
	}

	Super::TeleportSucceeded(bIsATest);
}
Esempio n. 5
0
void CStreamBase::ResetFlags()
{
	SetBase(DECIMAL);
	SetNotation(NONE);
	SetBoolAlpha(false);
	SetSkipWhitespace(true);
	SetAddBase(true);
	SetBaseUpperCase(false);
	SetNumberUpperCase(false);
	SetShowDecimalPoint(false);
	SetShowPositiveSign(false);
}
Esempio n. 6
0
DOF1::DOF1(af::TElement& B)	
{
	Root = B.GetRoot();

	if(B.GetName() == "New")
	{
		QString s;
		SetObjectName("DOF_" + s.sprintf("%d", Root.Tag()));
		SetExternal(false);
		SetBase(false);
		SetValue(0.);
	}
}
Esempio n. 7
0
bool cxSkin::ParseBase(const std::string &Text)
{
	int i;
	for (i = 0; i < (int)__COUNT_BASE__; ++i) {
		if (ScreenBases[i] == Text)
			break;
	}
	if (i < (int)__COUNT_BASE__) {
		SetBase((eScreenBase)i);
		return true;
	}
	return false;
}
Esempio n. 8
0
__INLINE__ __integer __INTERNAL_FUNC__ SetModrmSib(PASM_OBJ pAsmObj, PASMER_OPERAND pRO, PASMER_OPERAND pModRmSib) {
	SetMod(pAsmObj, pModRmSib);//设置MOD
	SetRO(pAsmObj, pRO->Base);//设置RO
	SetRM(pAsmObj, pModRmSib->Base);//设置RM
	// 确定是否有SIB位
	if (IsGotoSIB(pAsmObj)) {
		SetSS(pAsmObj, pModRmSib->Scale);//设置SS
		SetIndex(pAsmObj, pModRmSib->Index);//设置Index
		SetBase(pAsmObj, pModRmSib->Base);//设置Base
		return 2;
	}
	return 1;
}
Esempio n. 9
0
bool ACharacter::RestoreReplicatedMove(const FSimulatedRootMotionReplicatedMove& RootMotionRepMove)
{
    UPrimitiveComponent* ServerBase = RootMotionRepMove.RootMotion.MovementBase;
    const FName ServerBaseBoneName = RootMotionRepMove.RootMotion.MovementBaseBoneName;

    // Relative Position
    if( RootMotionRepMove.RootMotion.bRelativePosition )
    {
        bool bSuccess = false;
        if( MovementBaseUtility::UseRelativeLocation(ServerBase) )
        {
            FVector BaseLocation;
            FQuat BaseRotation;
            MovementBaseUtility::GetMovementBaseTransform(ServerBase, ServerBaseBoneName, BaseLocation, BaseRotation);

            const FVector ServerLocation = BaseLocation + RootMotionRepMove.RootMotion.Location;
            FRotator ServerRotation;
            if (RootMotionRepMove.RootMotion.bRelativeRotation)
            {
                // Relative rotation
                ServerRotation = (FRotationMatrix(RootMotionRepMove.RootMotion.Rotation) * FQuatRotationTranslationMatrix(BaseRotation, FVector::ZeroVector)).Rotator();
            }
            else
            {
                // Absolute rotation
                ServerRotation = RootMotionRepMove.RootMotion.Rotation;
            }

            UpdateSimulatedPosition(ServerLocation, ServerRotation);
            bSuccess = true;
        }
        // If we received local space position, but can't resolve parent, then move can't be used. :(
        if( !bSuccess )
        {
            return false;
        }
    }
    // Absolute position
    else
    {
        UpdateSimulatedPosition(RootMotionRepMove.RootMotion.Location, RootMotionRepMove.RootMotion.Rotation);
    }

    SetBase( ServerBase, ServerBaseBoneName );

    return true;
}
Esempio n. 10
0
void ParseAllConversations(){
    
    SetBase("/Users/fabiensanglard/SC/SC/");

    
    
    TreArchive gameFlow ;
    gameFlow.InitFromFile("GAMEFLOW.TRE");
    
    TreEntry* metaConfEntry = gameFlow.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\CONVDATA.IFF");
    IffLexer iffConData ;
    iffConData.InitFromRAM(metaConfEntry->data, metaConfEntry->size);
    //
    //iffConData.List(stdout);
    
 
    
}
Esempio n. 11
0
void ReverseOBKViewButton(){
    SetBase("/Users/fabiensanglard/SC/SC/");
    Screen.Init(2);
    VGA.Init();
    VGA.Activate();
    
    TreArchive tre ;
    tre.InitFromFile("GAMEFLOW.TRE");
    //TreEntry* e = tre.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\OBJVIEW.PAK");
//    ExploreImages(e->data, e->size, 0);
    
    TreArchive misc ;
    misc.InitFromFile("MISC.TRE");
    misc.List(stdout);
    TreEntry* MAINOPT = tre.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\TM.SHP");
    ExploreImages(MAINOPT->data,MAINOPT->size,0);

}
Esempio n. 12
0
void ExploreMIDGAMES(void){
    SetBase("/Users/fabiensanglard/SC/SC/");
    
    const char* trePath = "GAMEFLOW.TRE";
    TreArchive treArchive;
    treArchive.InitFromFile(trePath);
    
    //treArchive.List(stdout);
    
    //Find the sounds PAKS.
    const char* pakName = "..\\..\\DATA\\MIDGAMES\\MIDGAMES.PAK";
    TreEntry* treEntry = treArchive.GetEntryByName(pakName);
    
    
    PakArchive pakArchive;
    pakArchive.InitFromRAM(pakName,treEntry->data, treEntry->size);
    
    //Decompress it
    pakArchive.Decompress(".","PAK");
    pakArchive.List(stdout);
}
Esempio n. 13
0
bool ACharacter::RestoreReplicatedMove(const FSimulatedRootMotionReplicatedMove & RootMotionRepMove)
{
	UPrimitiveComponent * ServerBase = RootMotionRepMove.RootMotion.MovementBase;

	// Relative Position
	if( RootMotionRepMove.RootMotion.bRelativePosition )
	{
		bool bSuccess = false;
		if( MovementBaseUtility::UseRelativePosition(ServerBase) )
		{
			const FVector ServerLocation = ServerBase->GetComponentLocation() + RootMotionRepMove.RootMotion.Location;
			const FRotator ServerRotation = (FRotationMatrix(RootMotionRepMove.RootMotion.Rotation) * FRotationMatrix(ServerBase->GetComponentRotation())).Rotator();
			UpdateSimulatedPosition(ServerLocation, ServerRotation);
			bSuccess = true;
		}
		// If we received local space position, but can't resolve parent, then move can't be used. :(
		if( !bSuccess )
		{
			return false;
		}
	}
	// Absolute position
	else
	{
		UpdateSimulatedPosition(RootMotionRepMove.RootMotion.Location, RootMotionRepMove.RootMotion.Rotation);
	}

	// Set base
	if( MovementBase != ServerBase )
	{
		SetBase( ServerBase );
	}

	// fixme laurent is this needed?
	if( CharacterMovement )
	{
		CharacterMovement->bJustTeleported = false;
	}
	return true;
}
Esempio n. 14
0
void testoptions(void){
    
    SetBase("/Users/fabiensanglard/SC/SC/");
    Screen.Init(2);
    VGA.Init();
    VGA.Activate();
    
    
    TreArchive gameflow ; gameflow.InitFromFile("GAMEFLOW.TRE");
    TreArchive misc ;     misc.InitFromFile("MISC.TRE");
    TreArchive mis ;      mis.InitFromFile("MISSIONS.TRE");
    TreArchive obj ;      obj.InitFromFile("OBJECTS.TRE");
    
    /*
    TreEntry* optionsEntry = gameflow.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\OPTIONS.IFF"); //Camera configuration
    IffLexer lexerOption;
    lexerOption.InitFromRAM(optionsEntry->data, optionsEntry->size);
    lexerOption.List(stdout);
    */
    TreEntry* midGamesEntry = gameflow.GetEntryByName("..\\..\\DATA\\MIDGAMES\\MIDGAMES.IFF"); //Camera configuration
    IffLexer lexerMidGame;
    lexerMidGame.InitFromRAM(midGamesEntry->data, midGamesEntry->size);
    lexerMidGame.List(stdout);
    
    
    TreEntry* midGamesPAKEntry = gameflow.GetEntryByName("..\\..\\DATA\\MIDGAMES\\MIDGAMES.PAK"); //Camera configuration
    PakArchive miadGamesPAK;
    miadGamesPAK.InitFromRAM("", midGamesPAKEntry->data, midGamesPAKEntry->size);
    miadGamesPAK.Decompress("/Users/fabiensanglard/Desktop/DATA/DATA/MIDGAMES.PAK.CONTENT/", "TXT");
    /*
     
     TreEntry* BWFONT = misc.GetEntryByName("..\\..\\DATA\\FONTS\\CONVFONT.SHP"); // OPTFONT.SHP CONVFONT.SHP
     ExploreImages(BWFONT->data,BWFONT->size,0);
    */
    
}
Esempio n. 15
0
/*
================
idAF::LoadBody
================
*/
bool idAF::LoadBody( const idDeclAF_Body *fb, const idJointMat *joints )
{
	int id, i;
	float length, mass;
	idTraceModel trm;
	idClipModel *clip;
	idAFBody *body;
	idMat3 axis, inertiaTensor;
	idVec3 centerOfMass, origin;
	idBounds bounds;
	idList<jointHandle_t> jointList;
	
	origin = fb->origin.ToVec3();
	axis = fb->angles.ToMat3();
	bounds[0] = fb->v1.ToVec3();
	bounds[1] = fb->v2.ToVec3();
	
	switch( fb->modelType )
	{
		case TRM_BOX:
		{
			trm.SetupBox( bounds );
			break;
		}
		case TRM_OCTAHEDRON:
		{
			trm.SetupOctahedron( bounds );
			break;
		}
		case TRM_DODECAHEDRON:
		{
			trm.SetupDodecahedron( bounds );
			break;
		}
		case TRM_CYLINDER:
		{
			trm.SetupCylinder( bounds, fb->numSides );
			break;
		}
		case TRM_CONE:
		{
			// place the apex at the origin
			bounds[0].z -= bounds[1].z;
			bounds[1].z = 0.0f;
			trm.SetupCone( bounds, fb->numSides );
			break;
		}
		case TRM_BONE:
		{
			// direction of bone
			axis[2] = fb->v2.ToVec3() - fb->v1.ToVec3();
			length = axis[2].Normalize();
			// axis of bone trace model
			axis[2].NormalVectors( axis[0], axis[1] );
			axis[1] = -axis[1];
			// create bone trace model
			trm.SetupBone( length, fb->width );
			break;
		}
		default:
			assert( 0 );
			break;
	}
	trm.GetMassProperties( 1.0f, mass, centerOfMass, inertiaTensor );
	trm.Translate( -centerOfMass );
	origin += centerOfMass * axis;
	
	body = physicsObj.GetBody( fb->name );
	if( body )
	{
		clip = body->GetClipModel();
		if( !clip->IsEqual( trm ) )
		{
			clip = new idClipModel( trm );
			clip->SetContents( fb->contents );
			clip->Link( gameLocal.clip, self, 0, origin, axis );
			body->SetClipModel( clip );
		}
		clip->SetContents( fb->contents );
		body->SetDensity( fb->density, fb->inertiaScale );
		body->SetWorldOrigin( origin );
		body->SetWorldAxis( axis );
		id = physicsObj.GetBodyId( body );
	}
	else
	{
		clip = new idClipModel( trm );
		clip->SetContents( fb->contents );
		clip->Link( gameLocal.clip, self, 0, origin, axis );
		body = new idAFBody( fb->name, clip, fb->density );
		if( fb->inertiaScale != mat3_identity )
		{
			body->SetDensity( fb->density, fb->inertiaScale );
		}
		id = physicsObj.AddBody( body );
	}
	if( fb->linearFriction != -1.0f )
	{
		body->SetFriction( fb->linearFriction, fb->angularFriction, fb->contactFriction );
	}
	body->SetClipMask( fb->clipMask );
	body->SetSelfCollision( fb->selfCollision );
	
	if( fb->jointName == "origin" )
	{
		SetBase( body, joints );
	}
	else
	{
		AFJointModType_t mod;
		if( fb->jointMod == DECLAF_JOINTMOD_AXIS )
		{
			mod = AF_JOINTMOD_AXIS;
		}
		else if( fb->jointMod == DECLAF_JOINTMOD_ORIGIN )
		{
			mod = AF_JOINTMOD_ORIGIN;
		}
		else if( fb->jointMod == DECLAF_JOINTMOD_BOTH )
		{
			mod = AF_JOINTMOD_BOTH;
		}
		else
		{
			mod = AF_JOINTMOD_AXIS;
		}
		AddBody( body, joints, fb->jointName, mod );
	}
	
	if( fb->frictionDirection.ToVec3() != vec3_origin )
	{
		body->SetFrictionDirection( fb->frictionDirection.ToVec3() );
	}
	if( fb->contactMotorDirection.ToVec3() != vec3_origin )
	{
		body->SetContactMotorDirection( fb->contactMotorDirection.ToVec3() );
	}
	
	// update table to find the nearest articulated figure body for a joint of the skeletal model
	animator->GetJointList( fb->containedJoints, jointList );
	for( i = 0; i < jointList.Num(); i++ )
	{
		if( jointBody[ jointList[ i ] ] != -1 )
		{
			gameLocal.DWarning( "%s: joint '%s' is already contained by body '%s'",
								name.c_str(), animator->GetJointName( ( jointHandle_t )jointList[i] ),
								physicsObj.GetBody( jointBody[ jointList[ i ] ] )->GetName().c_str() );
		}
		jointBody[ jointList[ i ] ] = id;
	}
	
	return true;
}
Esempio n. 16
0
	// CXmlNode
	CXmlNode::CXmlNode(const CXmlNode& oSrc)
	{
		m_pBase = NULL;
		SetBase(oSrc.m_pBase);
	}
Esempio n. 17
0
int maine( int argc,char** argv){

    //testoptions();
    //ParseAllConversations();
    
    
   // ReverseOBKViewButton();
    TestMouseCursor();
    
    //ExploreMIDGAMES();
    
    
    return 0;
    //decompressTREs("/Users/fabiensanglard/Desktop/DATA/");
    
    //return 0;

//    listTRE();
//    return 0;
    
//    ExploreRootIFFS();
//    return 0;
    
    /*
    TreArchive archiveSound ;
    archiveSound.InitFromFile("SOUND.TRE");
    archiveSound.List(stdout);
    
    
    TreArchive archive ;
    archive.InitFromFile("GAMEFLOW.TRE");
    archive.List(stdout);
    
    RSImage screen;
    screen.Create("Screen",320, 200);
    
    RLECodex codex;
    size_t byteRead;
    codex.ReadImage(archive.GetData()+5824512, &screen, &byteRead);
    
    renderer.Init(320, 200);
    
    renderer.ShowWindow();
    renderer.Pause();
    while(renderer.IsPaused()){
        renderer.DrawImage(&screen, 1);
        renderer.Swap();
    }
    */
    
    //Render palette
    /*
    renderer.Init(512, 512);
    renderer.SetClearColor(255,0,255);
    renderer.Clear();
    renderer.ShowPalette(renderer.GetDefaultPalette());
    */
    
    
    /*
    SetBase("/Users/fabiensanglard/Desktop/ARENA.PAK.CONTENT/");
    PakArchive archiveMauritan ;
    archiveMauritan.InitFromFile("FILE1.TXT");
    archiveMauritan.Decompress("/Users/fabiensanglard/Desktop/ARENA.PAK.CONTENT/MIP_MAX/", "MIP_MAX");
    
    PakArchive f ;
    f.InitFromFile("FILE2.TXT");
    f.Decompress("/Users/fabiensanglard/Desktop/ARENA.PAK.CONTENT/MIP_MED/", "MIP_MED");
    
    PakArchive g ;
    g.InitFromFile("FILE3.TXT");
    g.Decompress("/Users/fabiensanglard/Desktop/ARENA.PAK.CONTENT/MIP_MIN/", "MIP_MIN");
    */
    
    /*
    PakArchive archiveMauritan ;
    archiveMauritan.InitFromFile("ARENA.PAK");
    archiveMauritan.Decompress("/Users/fabiensanglard/Desktop/", "TXT");
    */
    
    
    /*
    testShowAllTexturesPAK();
    return 0;
    */
    
    //WIP
    /*
    renderer.Init(640, 400);
    TreArchive tre;
    tre.InitFromFile("GAMEFLOW.TRE");
    
    TreEntry* pakToExplore = tre.GetEntryByName("..\\..\\DATA\\MIDGAMES\\MID1.PAK");
    
    PakArchive arch;
    arch.InitFromRAM("MID1.PAK",pakToExplore->data,pakToExplore->size);
    
    printf("MID1.PAK" " contains %lu entries\n.",arch.GetNumEntries());
    
    for(size_t i =0 ;i < arch.GetNumEntries() ; i++){
        
        PakEntry* entry = arch.GetEntry(i);
        PakArchive a;
        a.InitFromRAM("", entry->data, entry->size);
        showAllImageInArchive(&a);
    }
    return 0;
    */
    
    
    /*
    SCMainMenu mainMenu;
    mainMenu.Init();
    mainMenu.Run();
    return 0;
    */

    /* 
    SCDogFightMenu dogFightMenu;
    dogFightMenu.Init();
    dogFightMenu.Run();
    return 0;
    */
    
    /*
    SCObjectViewer viewer;
    viewer.Init();
    viewer.Run();
    return 0;
    */
    
    /*
    PakArchive archiveCanyon ;
    archiveCanyon.InitFromFile("CANYON.PAK");
    archiveCanyon.Decompress("/Users/fabiensanglard/Desktop/", "TXT");

    PakArchive archiveMauritan ;
    archiveMauritan.InitFromFile("MAURITAN.PAK");
    archiveMauritan.Decompress("/Users/fabiensanglard/Desktop/", "TXT");

    return 0;
    */
    
    
    
    
    //testShowAllTexturesPAK();
    
    SetBase("/Users/fabiensanglard/SC/SC/");
    RSArea* area = new RSArea();

    area->InitFromPAKFileName("ARENA.PAK");
    area->InitFromPAKFileName("ALASKA.PAK");
    area->InitFromPAKFileName("EUROPE.PAK");
    // // NOT A MAP !area.InitFromPAKFileName("MSFILES.PAK");
    area->InitFromPAKFileName("SANFRAN.PAK");
    area->InitFromPAKFileName("ANDMAL1.PAK");
    area->InitFromPAKFileName("CANYON.PAK");
    // // NOT A MAP !area.InitFromPAKFileName("MAPDATA.PAK");
    area->InitFromPAKFileName("QUEBEC.PAK");
    area->InitFromPAKFileName("TURKEY.PAK");
    area->InitFromPAKFileName("ANDMAL2.PAK");
    area->InitFromPAKFileName("EGYPT.PAK");
    area->InitFromPAKFileName("MAURITAN.PAK");
    area->InitFromPAKFileName("RHODEI.PAK");
    
    return EXIT_SUCCESS;
}
Esempio n. 18
0
void ExploreRootIFFS(void){
    
    //IffLexer instant;
    //instant.InitFromFile("INSTANT.IFF");
    //instant.List(stdout);
    
    IffLexer misn2op;
    misn2op.InitFromFile("MISN2OP.IFF");
    misn2op.List(stdout);
    
    
    IffLexer opt2misn;
    opt2misn.InitFromFile("OP2MISN.IFF");
    opt2misn.List(stdout);
    
    
    IffLexer palette;
    palette.InitFromFile("PALETTE.IFF");
    palette.List(stdout);
    
    
    IffLexer palFade;
    palFade.InitFromFile("PALFADE.IFF");
    palFade.List(stdout);
    
    IffLexer txmList;
    txmList.InitFromFile("TXM_LIST.IFF");
    txmList.List(stdout);
    
    
    
    PakArchive eject;
    eject.InitFromFile("EJECT.PAK");
    eject.List(stdout);
    eject.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/", "TXT");
    
    SetBase("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT");
    
    PakArchive file0;
    file0.InitFromFile("FILE0.TXT");
    file0.List(stdout);
    file0.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE0", "TXT");


    PakArchive file1;
    file1.InitFromFile("FILE1.TXT");
    file1.List(stdout);
    file1.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE1", "TXT");


    PakArchive file2;
    file2.InitFromFile("FILE2.TXT");
    file2.List(stdout);
    file2.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE2", "TXT");
    
    PakArchive file3;
    file3.InitFromFile("FILE3.TXT");
    file3.List(stdout);
    file3.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE3", "TXT");
    
    PakArchive file4;
    file4.InitFromFile("FILE4.TXT");
    file4.List(stdout);
    file4.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE4", "TXT");
    
    PakArchive file5;
    file5.InitFromFile("FILE5.TXT");
    file5.List(stdout);
    file5.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE5", "TXT");
    
    PakArchive file6;
    file6.InitFromFile("FILE6.TXT");
    file6.List(stdout);
    file6.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE6", "TXT");
    
    PakArchive file7;
    file7.InitFromFile("FILE7.TXT");
    file7.List(stdout);
    file7.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE7", "TXT");
    
    PakArchive file8;
    file8.InitFromFile("FILE8.TXT");
    file8.List(stdout);
    file8.Decompress("/Users/fabiensanglard/Desktop/DATA/OBJECTS/EJECT/EJECT.PAK.CONTENT/FILE8", "TXT");
}
Esempio n. 19
0
void TestMouseCursor(void){
    
    SetBase("/Users/fabiensanglard/SC/SC/");
    Screen.Init(2);
    VGA.Init();
    VGA.Activate();
    
    
    TreArchive gameflow ; gameflow.InitFromFile("GAMEFLOW.TRE");
    TreArchive misc ;     misc.InitFromFile("MISC.TRE");
    TreArchive mis ;      mis.InitFromFile("MISSIONS.TRE");
    TreArchive obj ;      obj.InitFromFile("OBJECTS.TRE");
    
    
    //TreEntry* BWFONT = gameflow.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\BWFONT.SHP"); //Camera configuration
   // ExploreImages(BWFONT->data,BWFONT->size,0);
    
   
    
    // TreEntry* mainFont = gameflow.GetEntryByName("..\\..\\DATA\\MIDGAMES\\MID1.PAK"); //Camera configuration
     //ExploreImages(mainFont->data,mainFont->size,0);
     
    
    
    
    
   // TreEntry* camropt = misc.GetEntryByName("..\\..\\DATA\\FONTS\\CAMROPT.SHP"); //Camera configuration
    //ExploreImages(camropt->data,camropt->size,0);

    
    
   
   //  TreEntry* chkexit = misc.GetEntryByName("..\\..\\DATA\\FONTS\\CHKEXIT.SHP"); //Exit to DOS configuration
     //ExploreImages(chkexit->data,chkexit->size,0);
    
    
    
  
    //TreEntry* cockopt = misc.GetEntryByName("..\\..\\DATA\\FONTS\\COCKOPT.SHP"); // Cockpit configuration
    //ExploreImages(cockopt->data,cockopt->size,0);
    
    
    
    // TreEntry* convFont = misc.GetEntryByName("..\\..\\DATA\\FONTS\\CONVFONT.SHP"); // Unknown but likely a font wiht 128 entries
    //ExploreImages(convFont->data,convFont->size,0);
    
    
    
    
    
   //  TreEntry* detlopt = misc.GetEntryByName("..\\..\\DATA\\FONTS\\DETLOPT.SHP"); // Details options
     //ExploreImages(detlopt->data,detlopt->size);
    
    
    
   
   // TreEntry* FLITOPT = misc.GetEntryByName("..\\..\\DATA\\FONTS\\FLITOPT.SHP"); // Control options
    //ExploreImages(FLITOPT->data,FLITOPT->size,0);
    
    
    

  //  TreEntry* FORMFONT = misc.GetEntryByName("..\\..\\DATA\\FONTS\\FORMFONT.SHP"); // Font option
    //ExploreImages(FORMFONT->data,FORMFONT->size);
    
    
    

   // TreEntry* GAMEOPT = misc.GetEntryByName("..\\..\\DATA\\FONTS\\GAMEOPT.SHP"); // Gameplay option
    //ExploreImages(GAMEOPT->data,GAMEOPT->size);
    
    
    
    
   // TreEntry* GRAVFONT = misc.GetEntryByName("..\\..\\DATA\\FONTS\\GRAVFONT.SHP"); // Gameplay option
    //ExploreImages(GRAVFONT->data,GRAVFONT->size);
    
    
    
  
   // TreEntry* MENBGRND = misc.GetEntryByName("..\\..\\DATA\\FONTS\\MENBGRND.SHP"); // DogFight background
   // ExploreImages(MENBGRND->data,MENBGRND->size,0);
    
    
    
  
   /// TreEntry* MTYPEBUT = misc.GetEntryByName("..\\..\\DATA\\FONTS\\MTYPEBUT.SHP"); // Dogfight/Search&Destroy ...WHY is is duplicated from MAINMENU.PAK??
    //ExploreImages(MTYPEBUT->data,MTYPEBUT->size,0);
    
    
    
  
   // TreEntry* OVBKGRND = misc.GetEntryByName("..\\..\\DATA\\FONTS\\OVBKGRND.SHP"); // Object Viewer background ...WHY is is duplicated from OBJVIEW.PAK??
    //ExploreImages(OVBKGRND->data,OVBKGRND->size,0);
    
    
    
 
    //TreEntry* RESTART = misc.GetEntryByName("..\\..\\DATA\\FONTS\\RESTART.SHP"); // Restart menu
    //ExploreImages(RESTART->data,RESTART->size,0);
    
    
   
   // TreEntry* BETTY = mis.GetEntryByName("..\\..\\DATA\\COCKPITS\\BETTY.PAK");    // ?
    //ExploreImages(BETTY->data,BETTY->size,0);
    
    
    

    //TreEntry* mid1 = gameflow.GetEntryByName("..\\..\\DATA\\MIDGAMES\\MIDGAMES.PAK");
   // ExploreImages(mid1->data,mid1->size,0);
    
    
    

    //TreEntry* tm = gameflow.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\TM.SHP");  //Training mission builder dialog
    //ExploreImages(tm->data,tm->size,0);
    
    
    

    //TreEntry* MAINMENU = gameflow.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\MAINMENU.PAK");  //Main Menu buttons. No background :( !
    //ExploreImages(MAINMENU->data,MAINMENU->size,0);
    
    
    
    
    TreArchive gf ;
    gf.InitFromFile("GAMEFLOW.TRE");
    TreEntry* CONVSHPS = gameflow.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\CONVSHPS.PAK");  // ALL SETS AND CHARACTERS !!!!!
    ExploreImages(CONVSHPS->data,CONVSHPS->size,0);
    
    //Check palettes fro that too
    /*
    TreEntry* palettesEConv = gf.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\CONVPALS.PAK");
    PakArchive palettesArchiveConv ;
    palettesArchiveConv.InitFromRAM("CONVPALS.PAK", palettesEConv->data, palettesEConv->size);
    palettesArchiveConv.List(stdout);
    */
    

    
   
    TreEntry* optShps = gameflow.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\OPTSHPS.PAK");  // A LLOOOOOOT OF GOOOD STUFFF !!! Background, bar animations, all airplanes
                                                                                // airplane preparation,
    /*
        118 - > female pinup
        119 -> wild cat base entry
        119 -> deset landing strip
     
     17 jeep animation
     18 wildcat hangar
     20 truck animatiopn
     22 accountant anim
     25 tent background
     35 36 people hangar top down animations
     
     40  f16
     41
     
     50 werapons buttons
     90
     91 f-16 weapon selection
     
     128 map north america
     129 map south america
     130 map europe
     131 map africa
     */
    
    
    ExploreImages(optShps->data,optShps->size,0);

    //Check palettes fro that too
    /*
    TreEntry* palettesE = gf.GetEntryByName("..\\..\\DATA\\GAMEFLOW\\OPTPALS.PAK");
    PakArchive palettesArchive ;
    palettesArchive.InitFromRAM("OPTPALS.PAK", palettesE->data, palettesE->size);
    palettesArchive.List(stdout);
    */
    
    
    
    
    
   
    //TreEntry* MAINOPT = misc.GetEntryByName("..\\..\\DATA\\FONTS\\MAINOPT.SHP");
    //ExploreImages(MAINOPT->data,MAINOPT->size,0);
     
    
    
    
    //TreEntry* objE = obj.GetEntryByName("..\\..\\DATA\\OBJECTS\\EJECT.PAK");   //Eject/Crash animation
    //ExploreImages(objE->data,objE->size,0);
    
}
Esempio n. 20
0
void ToHitStats::SetOwner(Actor* owner)
{
	Owner = owner;
	// rerun this, so both the stats get set correctly
	SetBase(base);
}
Esempio n. 21
0
void
ProjectPath::Set(const char *base, const char *path)
{
	SetBase(base);
	SetPath(path);
}
Esempio n. 22
0
void
DataView::MessageReceived(BMessage *message)
{
	switch (message->what) {
		case kMsgUpdateData:
		case kMsgDataEditorUpdate:
			UpdateFromEditor(message);
			break;

		case kMsgDataEditorParameterChange:
		{
			int32 viewSize;
			off_t offset;
			if (message->FindInt64("offset", &offset) == B_OK) {
				fOffset = offset;
				SetSelection(0, 0);
				MakeVisible(0);
			}
			if (message->FindInt32("view_size", &viewSize) == B_OK) {
				fDataSize = viewSize;
				fData = (uint8 *)realloc(fData, fDataSize);
				UpdateScroller();
				SendNotices(kDataViewPreferredSize);
			}
			if (message->FindInt64("file_size", &offset) == B_OK)
				UpdateFromEditor();
			break;
		}

		case kMsgBaseType:
		{
			int32 type;
			if (message->FindInt32("base", &type) != B_OK)
				break;

			SetBase((base_type)type);
			break;
		}

		case kMsgSetSelection:
		{
			int64 start, end;
			if (message->FindInt64("start", &start) != B_OK
				|| message->FindInt64("end", &end) != B_OK)
				break;

			SetSelection(start, end);
			break;
		}

		case B_SELECT_ALL:
			SetSelection(0, fDataSize - 1);
			break;

		case B_COPY:
			Copy();
			break;

		case B_PASTE:
			Paste();
			break;

		case B_UNDO:
			fEditor.Undo();
			break;

		case B_REDO:
			fEditor.Redo();
			break;

		case B_MIME_DATA:
			if (AcceptsDrop(message)) {
				const void *data;
				ssize_t size;
				if (message->FindData("text/plain", B_MIME_TYPE, &data, &size) == B_OK
					|| message->FindData(B_FILE_MIME_TYPE, B_MIME_TYPE, &data, &size) == B_OK) {
					if (fEditor.Replace(fOffset + fStart, (const uint8 *)data, size) != B_OK)
						SetSelection(fStoredStart, fStoredEnd);

					fDragMessageSize = -1;
				}
			}
			break;

		default:
			BView::MessageReceived(message);
	}
}
Esempio n. 23
0
static base_n addtotable( token_n *tokens, token_n *end_token, action_n *actions,
                            token_n default_token, token_n parent_token )
{
    base_n              start, i;
    token_n             max;
    action_n            default_action;
    token_n             *r;
    a_table             *t;
    a_table             *tstart;
    action_n            actval;
    token_n             tokval;

    if( compactflag ) {
        start = used++;
        expand_table( used );   // Leave room for parent & default
        default_action = ACTION_NULL;
        for( r = tokens; r < end_token; ++r ) {
            tokval = *r;
            if( tokval == default_token ) {
                default_action = actions[tokval];
            } else if( tokval != parent_token ) {
                actval = actions[tokval];
                if( tokval > 0x0FFF ) {
                    printf( "Error: token index 0x%X for item %d is higher then 0x0FFF !\n", tokval, start );
                }
                if( actval > 0x0FFF ) {
                    printf( "Error: token action 0x%X for item %d is higher then 0x0FFF !\n", actval, start );
                }
                expand_table( used + 1 );
                table[used].token = tokval;
                table[used].action = actval;
                ++used;
            }
        }
        actval = actions[parent_token];
        if( actval > 0x0FFF ) {
            printf( "Error: parent action 0x%X for item %d is higher then 0x0FFF !\n", actval, start );
        }
        if( default_action > 0x0FFF ) {
            printf( "Error: default action 0x%X for item %d is higher then 0x0FFF !\n", default_action, start );
        }
        table[start].token = (token_n)actval;
        table[start].action = default_action;
    } else {
        max = *tokens;
        for( r = tokens + 1; r < end_token; ++r ) {
            if( *r > max ) {
                max = *r;
            }
        }
        for( start = 0; ; ++start ) {
            i = avail;
            expand_table( start + max + 1 );
            while( i < avail ) {
                table[i].token = TOKEN_IMPOSSIBLE;
                table[i].action = ACTION_NULL;
                ++i;
            }
            tstart = table + start;
            if( !IsBase( tstart ) ) {
                for( r = tokens; r < end_token; ++r ) {
                    if( IsUsed( tstart + *r ) ) {
                        break;
                    }
                }
                if( r >= end_token ) {
                    break;
                }
            }
        }
        SetBase( tstart );
        for( r = tokens; r < end_token; ++r ) {
            tokval = *r;
            t = tstart + tokval;
            if( ! bigflag ) {
                if( tokval >= UCHAR_MAX ) {
                    msg( "too many tokens!\n" );
                }
            }
            SetToken( t, tokval );
            actval = actions[tokval];
            if( (actval & ACTION_MASK) != actval ) {
                printf( "Error: token action 0x%X for token %d is higher then 0x3FFF !\n", actval, tokval );
            }
            SetAction( t, actval );
        }
        i = start + max + 1;
        if( i > used ) {
            used = i;
        }
    }
    return( start );
}