Jump to content

Anderl

Members
  • Posts

    2,266
  • Joined

  • Last visited

Everything posted by Anderl

  1. Anderl

    Problem

    Hey guys, This may not be the right place to ask what I need but I already searched on forums/Google about this problem and I didn't find anything. Also no one wants to help .__. So here we go: I'm making some test apps/games in C++ and I just wanted to render a video when the game starts but it does not seem to be working like I wanted. Here is the function: int DirectX9::renderIntro( LPCWSTR filePath, HWND hWnd ) { // declare variables IGraphBuilder* pGraph = NULL; IMediaControl* pControl = NULL; IMediaEvent* pEvent = NULL; IVideoWindow* pVidWin = NULL; // initialize COM library HRESULT hrInitialize = CoInitialize( NULL ); if( FAILED( hrInitialize ) ) { MessageBox( NULL, L"Unable to initialize COM library.", L"Warning", NULL ); return 1; } // create filter HRESULT hrFilter = CoCreateInstance ( CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (VOID**) &pGraph ); if( FAILED( hrFilter ) ) { MessageBox( NULL, L"Unable to create filter to render video.", L"Warning", NULL ); return 1; } hrFilter = pGraph->QueryInterface( IID_IMediaControl, (void**)&pControl ); hrFilter = pGraph->QueryInterface( IID_IMediaEvent, (void**)&pEvent ); hrFilter = pGraph->QueryInterface( IID_IVideoWindow, (void**)&pVidWin ); pVidWin->put_Owner( (OAHWND)hWnd ); pVidWin->put_WindowStyle( WS_CHILD | WS_CLIPSIBLINGS ); //pVidWin->SetWindowPosition( 0, 0, 500, 400 ); //pVidWin->put_MessageDrain( (OAHWND)hWnd ); pVidWin->put_Visible( 1 ); pVidWin->put_FullScreenMode( 1 ); // render video HRESULT hrVideo = pGraph->RenderFile( filePath, NULL ); if( SUCCEEDED( hrVideo ) ) { // run video HRESULT hrVide = pControl->Run(); if( SUCCEEDED( hrVide ) ) { HRESULT hrIntroDone = pEvent->WaitForCompletion( INFINITE, &evCode ); switch( hrIntroDone ) { case S_OK: hrVide = pControl->Stop(); exit(0); break; case E_ABORT: exit(0); break; default: exit(0); break; } } } else { MessageBox( NULL, L"Unable to load video file.", L"Warning", NULL ); switch( hrVideo ) { case S_OK: MessageBox( NULL, L"Everything ok.", L"Warning", NULL ); break; case VFW_S_AUDIO_NOT_RENDERED: MessageBox( NULL, L"Audio not rendered.", L"Warning", NULL ); break; case VFW_S_DUPLICATE_NAME: MessageBox( NULL, L"Filter duplicated name.", L"Warning", NULL ); break; case VFW_S_PARTIAL_RENDER: MessageBox( NULL, L"Stream not supported.", L"Warning", NULL ); break; case VFW_S_VIDEO_NOT_RENDERED: MessageBox( NULL, L"Some part not rendered.", L"Warning", NULL ); break; case E_ABORT: MessageBox( NULL, L"Aborted.", L"Warning", NULL ); break; case E_FAIL: MessageBox( NULL, L"Failure.", L"Warning", NULL ); break; case E_INVALIDARG: MessageBox( NULL, L"Invalid arguments", L"Warning", NULL ); break; case VFW_E_INVALID_FILE_FORMAT: MessageBox( NULL, L"File format invalid.", L"Warning", NULL ); break; case VFW_E_NOT_FOUND: MessageBox( NULL, L"File not found.", L"Warning", NULL ); break; } exit(0); } // release and free memory pControl->Release(); pEvent->Release(); pGraph->Release(); CoUninitialize(); return 0; } I call that function in the "renderStuff" function with this: // render intro char szPath[MAX_PATH]; GetFullPathName( L"movies\\GTAmovie.mpg", sizeof( szPath ), (LPWSTR)szPath, NULL ); if( !DirectX3D->renderIntro( (LPCWSTR)szPath, hWnd ) ) { exit(0); } The problem is that: The video loads in a new window but I want it in the same window... As you can see, I used "pVidWin->put_FullScreenMode( 1 )" and it didn't work Should I use other renderer? If so, what renderer should I use? Should I use VMR-9 with Windowless mode?
  2. Why not use guiStaticImageLoadImage instead of creating a new image?
  3. Anderl

    Stack overflow

    It should not anyway. Someone needs some lessons on what, how, and why a program uses a stack. Most importantly, how an over flow occurs. I don't need any lessons about that, I know perfectly that. I just did not know that it would re-call every time using "root" ( never had that issue ).
  4. As far as I know, no. But I can help you, just tell me what you do need.
  5. The code is wrong anyway. Client-side: addEvent( 'Event::Knowledge', true ); addEventHandler( 'onClientResourceStart', resourceRoot, function( ) createTeam( 'Another', 255, 0, 0 ); for _, v in ipairs( getElementsByType 'player' ) do triggerEvent( v, 'Event::Knowledge', v, getTeamFromName( 'Another' ) ); end end ) addEventHandler( 'Event::Knowledge', root, function( pTeam ) for _, v in ipairs( getElementsByType( 'vehicle' ) ) do if( getTeamName( getPlayerTeam( source ) ) == getTeamName( pTeam ) ) then if( getElementModel( v ) == 429 ) then setVehicleLocked( v, false ); end else setVehicleLocked( v, true ); end end end ) Well, that's very wrong even more. ???? Damn shit. Forgot that 'createTeam' was only server-sided. Just change 'onClientResourceStart' event to server-side and change its name to 'onResourceStart'.
  6. Não. Você apenas tem que LER TOTALMENTE O QUE EU ESCREVO E ESTUDAR A LÓGICA DA PROGRAMAÇÃO. ( Desculpe pelo Caps Lock, mas parece que só assim ele vai entender. )
  7. Nada haver música com isso cara. Já te falei, estude a lógica de programação.
  8. Obviamente, não. Cara, já falei, estude LUA e a lógica da programação.
  9. A imagem está localizada no modo race, não no mapa.
  10. Would not be better to lock this? He started in March, a command-based system does not even take 1 day to do.
  11. The code is wrong anyway. Client-side: addEvent( 'Event::Knowledge', true ); addEventHandler( 'onClientResourceStart', resourceRoot, function( ) createTeam( 'Another', 255, 0, 0 ); for _, v in ipairs( getElementsByType 'player' ) do triggerEvent( v, 'Event::Knowledge', v, getTeamFromName( 'Another' ) ); end end ) addEventHandler( 'Event::Knowledge', root, function( pTeam ) for _, v in ipairs( getElementsByType( 'vehicle' ) ) do if( getTeamName( getPlayerTeam( source ) ) == getTeamName( pTeam ) ) then if( getElementModel( v ) == 429 ) then setVehicleLocked( v, false ); end else setVehicleLocked( v, true ); end end end )
  12. Anderl

    Stack overflow

    It should not anyway.
  13. Yes, you can. Use "callRemote" function.
  14. I wrote this function right now to get group pointeirs by name list: _aclGetGroup = aclGetGroup function aclGetGroup( sGroupList ) if( sGroupList and type( sGroupList ) == 'string' ) then local aGroups = split( string.gsub( sGroupList, ' ', '' ), ',' ); local aGroupPointers = { } for _, v in ipairs( aGroups ) do table.insert( aGroupPointers, _aclGetGroup( v ) ); end return aGroupPointers end return false end It should work that way: local aGroups = aclGetGroup( 'Admin, Moderator' ); Then you can get group pointers that way: aGroups[1] --> Admin group pointer aGroups[2] --> Moderator group pointer Function not tested, it may have some errors, or a lot
  15. Add an 'end' on line 2669.
  16. Anderl

    Log

    I'm not having any issue with MTA:SA, I was just curious why were those things appearing.
  17. Anderl

    how

    Note that this won't follow the car.
  18. We talked by PM, he already solved the problem. The dll file was corrupted.
  19. Cara, esse problema era do MTASA 1.1/1.2. Esse erro já foi corrigido faz tempo, não há necessidade de deixar um post de um erro de uma versão bem desatualizada QUE JÁ FOI CORRIGIDO desbloqueado.
  20. O erro já foi corrigido então não vejo porque continuar com o post desbloqueado.
  21. ERROR: Couldn't find resource panel. Check it exists. You're trying to start a resource which does not exist. WARNING: Bad argument @ 'bindKey' An argument in the function 'bindKey' is wrong, you should check it. ERROR: Couldn't find resource win. Check it exists. You're trying to start a resource which does not exist. WARNING: stats/core_server.lua [server] is encoded in ANSI instead of UTF-8. Please convert your file to UTF-8. WARNING: stats/core_server.lua(Line 784) [server] isVehicleFrozen is deprecated and may not work in future versions. Please replace with isElementFrozen. WARNING: stats/core_server.lua(Line 786) [server] setVehicleFrozen is deprecated and may not work in future versions. Please replace with setElementFrozen. Do 'upgrade' on Console. SCRIPT ERROR: stats\core_server.lua:1067: '=' expected near 'end' WARNING: Loading script failed: stats\core_server.lua:1067: '=' expected near 'end' Something is wrong in the code, fix it like I said in the other error or show the codes so we can check. WARNING: File 'img/title.png' in resource 'race' is invalid. You made some mistake in the image/race meta.xml.
  22. Do "info global" in the Console and check what it says.
×
×
  • Create New...