Example #1
0
void CluzookaRocket::Explosion()
{
  if (m_timed_out) {
    DoSpawn();
    Ghost();
  } else
    WeaponProjectile::Explosion();

  flying_sound.Stop();
}
Example #2
0
void CluzookaCluster::Refresh()
{
#ifdef CLUSTERS_SPAWN_CLUSTERS
  if (m_recursion_depth > 1) {
    uint time = GameTime::GetInstance()->Read();
    Double flying_time = ( Double )( time - begin_time );

    if ( flying_time >= m_time_before_spawn )
    {
        DoSpawn();
        Explosion();
        return;
    };
  };
#endif

  WeaponProjectile::Refresh();
// no SetRotation needed as images are balls :)
  //image->SetRotation_rad(GetSpeedAngle());
}
Example #3
0
static bool SetupOperations( void )
/*********************************/
{
    bool                uninstall;

    // are we doing an UnInstall?
    uninstall = VarGetIntVal( UnInstall );

    if( GetVariableIntVal( "IsUpgrade" ) == 1 ) {
        if( !CheckUpgrade() ) {
            return( FALSE );
        }
    }

    DoSpawn( WHEN_BEFORE );
#ifdef PATCH
    if( GetVariableIntVal( "Patch" ) == 1 ) {
        IsPatch = 1;
        if( !PatchFiles() ) {
            return( FALSE );
        }
    }
#endif

    DeleteObsoleteFiles();

    // Copy the files
    if( GetVariableIntVal( "DoCopyFiles" ) == 1 ) {
        if( !CopyAllFiles() ) {
            return( FALSE );
        }
    }
    DoSpawn( WHEN_AFTER );

    // Modify AUTOEXEC.BAT and CONFIG.SYS
    if( GetVariableIntVal( "DoModifyAuto" ) == 1 ) {
        if( !ModifyStartup( uninstall ) ) {
            return( FALSE );
        }
    }

    // Perform file associations
    if( GetVariableIntVal( "DoFileAssociations" ) == 1 ) {
        if( !ModifyAssociations( uninstall ) ) {
            return( FALSE );
        }
    }

    // Generate batch file
    if( GetVariableIntVal( "GenerateBatchFile" ) == 1 ) {
        if( !GenerateBatchFile( uninstall ) ) {
            return( FALSE );
        }
    }

    // Create program group (folder)
    if( GetVariableIntVal( "DoCreateIcons" ) == 1 ||
        GetVariableIntVal( "DoCreateHelpIcons" ) == 1 ) {
        if( !ModifyEnvironment( uninstall ) ) {
            return( FALSE );
        }
    }

    // Add uninstaller to Add/Remove Programs
    if( GetVariableIntVal( "DoUninstall" ) == 1 ) {
        if( !ModifyUninstall( uninstall ) ) {
            return( FALSE );
        }
    }

    DoSpawn( WHEN_END );

    return( TRUE );
}
Example #4
0
long MySpawn( const char *cmd )
{
    bool        cp;
    long        rc;
    exec_block  exeparm;
    _fcb        fcb1, fcb2;
    cmd_struct  cmds;
    char        path[_MAX_PATH], file[_MAX_PATH];
    tiny_ret_t  ret;
    int         i;
    char        chkfname[L_tmpnam];

    minMemoryLeft = MaxMemFree & ~((long)MAX_IO_BUFFER - 1);
    chkSwapSize = 1 + (unsigned short)
        (((minMemoryLeft + ((long)MAX_IO_BUFFER - 1)) & ~((long)MAX_IO_BUFFER - 1)) /
         (long)MAX_IO_BUFFER);

    /*
     * set up checkpoint file stuff:
     */
#ifndef NOEMS
    if( !EMSBlockTest( chkSwapSize ) ) {
        xHandle = alloca( chkSwapSize * sizeof( long ) );
        xSize = alloca( chkSwapSize * sizeof( short ) );
        for( i = 0; i < chkSwapSize; i++ ) {
            EMSGetBlock( &xHandle[i] );
        }
        isWhere = IN_EMS;
        currMem = 0;
        goto evil_goto;
    }
#endif
#ifndef NOXMS
    if( !XMSBlockTest( chkSwapSize ) ) {
        xHandle = alloca( chkSwapSize * sizeof( long ) );
        xSize = alloca( chkSwapSize * sizeof( short ) );
        for( i = 0; i < chkSwapSize; i++ ) {
            XMSGetBlock( &xHandle[i] );
        }
        isWhere = IN_XMS;
        currMem = 0;
        goto evil_goto;
    }
#endif
    file[0] = 0;
    tmpnam( chkfname );
    StrMerge( 3, file, TmpDir, FILE_SEP_STR, chkfname );
    fullName = file;
    ret = TinyCreate( fullName, TIO_NORMAL );
    if( ret < 0 ) {
        return( 0 );
    }
    fileHandle = ret;
    isWhere = ON_DISK;

    /*
     * build command line
     */
evil_goto:
    GetSpawnCommandLine( path, cmd, &cmds );

    /*
     * set up parm block
     */
    exeparm.envp = 0;
    exeparm.cmdline = &cmds;
    exeparm.fcb1 = fcb1;
    exeparm.fcb2 = fcb2;
    GetFcb( &cmds.cmd, &fcb1 );
    GetFcb( &cmds.cmd, &fcb2 );

    /*
     * spawn the command
     */
    cp = checkPointMem( minMemoryLeft / 16 );
    rc = DoSpawn( path, &exeparm );
    if( cp ) {
        CheckPointRestore();
    }

    return( rc );
}
Example #5
0
long MySpawn( const char *cmd )
{
    bool        cp;
    long        rc;
    exec_block  exeparm;
    _fcb        fcb1, fcb2;
    cmd_struct  cmds;
    char        path[_MAX_PATH], f_buff[_MAX_PATH];
    int         i;
    where_parm  where;
    long        minMemoryLeft;
#if defined( USE_XMS ) || defined( USE_EMS )
    int         chkSwapSize;
    long        *xHandle;
    unsigned short *xSize;
#endif


    minMemoryLeft = MaxMemFree & ~((long)MAX_IO_BUFFER - 1);
#if defined( USE_XMS ) || defined( USE_EMS )
    chkSwapSize = 1 + (unsigned short)
        (((minMemoryLeft + ((long)MAX_IO_BUFFER - 1)) & ~((long)MAX_IO_BUFFER - 1)) /
         (long)MAX_IO_BUFFER);

    /*
     * set up checkpoint file stuff:
     */
#if defined( USE_EMS )
    if( !EMSBlockTest( chkSwapSize ) ) {
        xHandle = alloca( chkSwapSize * sizeof( long ) );
        xSize = alloca( chkSwapSize * sizeof( short ) );
        for( i = 0; i < chkSwapSize; i++ ) {
            EMSGetBlock( &xHandle[i] );
        }
        XSwapInit( chkSwapSize, xHandle, xSize );
        where = IN_EMS;
        goto evil_goto;
    }
#endif
#if defined( USE_XMS )
    if( !XMSBlockTest( chkSwapSize ) ) {
        xHandle = alloca( chkSwapSize * sizeof( long ) );
        xSize = alloca( chkSwapSize * sizeof( short ) );
        for( i = 0; i < chkSwapSize; i++ ) {
            XMSGetBlock( &xHandle[i] );
        }
        XSwapInit( chkSwapSize, xHandle, xSize );
        where = IN_XMS;
        goto evil_goto;
    }
#endif
#endif
    where = ON_DISK;

    /*
     * build command line
     */
evil_goto:
    GetSpawnCommandLine( path, cmd, &cmds );

    /*
     * set up parm block
     */
    exeparm.envp = 0;
    exeparm.cmdline = &cmds;
    exeparm.fcb1 = fcb1;
    exeparm.fcb2 = fcb2;
    GetFcb( &cmds.cmd, &fcb1 );
    GetFcb( &cmds.cmd, &fcb2 );

    /*
     * spawn the command
     */
    cp = CheckPointMem( where, minMemoryLeft / 16, f_buff );
    rc = DoSpawn( path, &exeparm );
    if( cp ) {
        CheckPointRestore( where );
    }
    return( rc );
}