Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - WitchD0ctor

Pages: 1 ... 3 4 [5] 6 7
61
SFML projects / SF Video Player
« on: September 23, 2010, 02:28:13 pm »
what errors are you getting?

you should include files,
movie_clip.cpp/h
movie_player.cpp/h
and
OpenAL_AudioInterface.cpp/h
in your project,

then link
OpenAL32.lib  
libtheoraplayer_static.lib

in your project,

the 'main.cpp' is just a simplistic example of how to use the lib, you can include that if you want to build the sample program yourself
remember to set your project so it can find the Dependencies' 'include' and 'lib' folders

this is for Visual Studios 2010, you would need a version of libtheoraplayer_static.lib that is compiled on 2008 or what have you compiler to work, (Hate that a lib compiled on 2008 doesn't work in 2010, and vise versa,  crazy bull right there.)


shouldn't be any harder than that. Let me know if you have any other issues

62
Window / Possibility of displaying Zoom/Rotate in increments
« on: September 22, 2010, 08:16:57 am »
sounds like you can use some good ol' LERP!

63
Graphics / How format and draw variables on screen
« on: September 21, 2010, 06:50:48 am »
how many hairs are drawn in the sfml demo? i got about 300FPS on schools computer with the SFML demo, and about 150FPS when drawing 2000 hairs with HGE and 285, when drawing 1000

64
SFML projects / SF Video Player
« on: September 10, 2010, 06:37:19 pm »
don't really know how :o

65
SFML projects / SF Video Player
« on: September 08, 2010, 03:19:13 pm »
I recently Integrated kspes' Theora Playback Library
http://sourceforge.net/projects/libtheoraplayer/

to use SFML images and sprites for cut-scenes in my game, I thought I would share it here for anybody who found it useful. Its not to much more than a simple wrapper, but it works quite well for most situations




with this you can get a video up and playing in about 5 lines,
the test program,
Code: [Select]




//Project files!
#include <iostream>
#include "movie_player.h"




/* Minimal Example */
 int main()
 {

sf::RenderWindow Rendow( sf::VideoMode(800, 600, 32), "Ubar Videoz", 6 );




MoviePlayer movieManager;


//Load and play Cutscenes
std::string vid_location = "resources/demo.ogv";
movieManager.playCutscene(&Rendow, vid_location, sf::Key::Escape, true);



Rendow.Close();

     return EXIT_SUCCESS;
 }//End ov Main!



the
Code: [Select]
playCutscene() is just a utility function to play a full screened video, that can be exited by a button you specify, you can also tell it to let the user control the video or not (seek, pause, etc).

you can also create an instance of MovieClip and control how/when to update/draw your movie, since it inherits from sf::Sprite, you can treat it like any other sprite object. So,

Code: [Select]



MoviePlayer movieManager;


//Load video manually
MovieClip *clip;
clip = movieManager.loadClip( vid_location, TH_RGBA );

//TH_RGBA is an enum for how to load the video pixel data,
//SFML's LoadFromPixel function likes this one

...

//in while loop

//Do silly Sprite things to the video
                clip->SetPosition(30, 50);
clip->Rotate(10);
clip->SetColor( sf::Color(255,255,255,100) );
                clip->Resize(800, 600);



clip->Update( Rendow->GetFrameTime() );

             Rendow->Clear();
                    clip->Draw( &Rendow );
             Rendow->Display();


This would play a movie that sets its position, rotates, resizes,  and is partially transparent, not sure why you would do that, however the option is there!

here it is,

...

Includes the sources, VS2010 project,  dependencies to compile it, and a simple test program,
note I didn't include the debug version of the dependencies, so the test program  will only compile in Release mode. You should be able to fix this if you include it in your game

Let me know what you think of it.


[EDIT] Newer Version: Just updated to include vs2008 project, nothing really new :o
Win.





PS. I used the OpenAL interface straight from the Theora playback lib examples, if any body wants to make and share an interface using SFML's audio library, I would be most grateful.  

PSS. If you need to convert video into the Theora format, i would suggest Theora Converter.NET if your on windows, Dead simple to use and works quite well.

66
SFML projects / simple SFML + Box2D test project
« on: September 08, 2010, 01:18:48 pm »
neat, i plan on adding box2d to my game sometime soon, this will definitely help ease the transition

thanks!

67
General discussions / Your favorite?
« on: September 07, 2010, 02:22:28 am »
Simple, like DooM II

68
General / Entity issues!
« on: September 02, 2010, 07:08:50 am »
Hey, since I've had a lot of luck here, i thought I'd ask you guys,
sorry to cross-post like this, but im having some issues with my entity system in my game, I've posted the whole issue at gamedev.net which I'll link to, to save typing.

http://www.gamedev.net/community/forums/topic.asp?topic_id=580749

if any body has any advise on how to remedy the situation, I would most definitely appreciate it

thank you!

69
General / Events Misfiring?
« on: September 02, 2010, 05:11:44 am »
wow, I was doing something stupid, Thank you!
seems to work fine now

70
General / Events Misfiring?
« on: September 02, 2010, 04:35:55 am »
so here's the spiel,

In my Game i have a function that acts like a regular game loop to play a cutscene video, In it i read in events to know if the user has pressed the escape key, if so, i exit out of the cutscene and begin the real game loop. however, while watching the movie, sometimes it will randomly exit, and go to the normal game loop, i put a cout, in the Event when its suppose to be fired, and sure enough, when it exits randomly, the cout' is printed.

which is weird because my hand is nowhere near the Escape key.
Is this a known issue or am i doing something stupid?

the codez

Code: [Select]


//Play fullscreened Cutscene
bool MoviePlayer::playCutscene(sf::RenderWindow *rendow, MovieClip *cutscene, bool player_control, sf::Key::Code escKey)
{
if(!cutscene->isValid() )
{
return false;
}

bool run_cutscene = true;

cutscene->Loop(false);
cutscene->SetOrigin(0,0);
cutscene->SetPosition(0, 0);





while (run_cutscene)
     {
// Process events
         sf::Event Event;
         while (rendow->GetEvent(Event))
         {
//Exit if the close button is pressed
 if (Event.Type == sf::Event::Closed)
{
                 rendow->Close();
run_cutscene = false;
}
 
           //The Problem! this gets called randomly sometimes
if(Event.Key.Code == escKey)
{
              cout << "Escaped Cutscene!\n";
run_cutscene = false;

}

}//End of Events

cutscene->Resize(rendow->GetWidth(), rendow->GetHeight());
//Update images and sound
cutscene->Update( rendow->GetFrameTime() );


 //if finsished, exit cutscene
if(cutscene->isFinished())
{
run_cutscene = false;
}

//Draw the cutscenes
rendow->Clear();
cutscene->Draw(rendow);
rendow->Display();
}//End ov While loop

return cutscene->isFinished();
}//EoF


any ideas?

also, the problem is also in the main game loop, I've known about this problem for a while, but have finally decided to deal with it now so my cutscene system is finalized

71
General discussions / CMake support added
« on: August 25, 2010, 09:05:09 am »
Quote from: "Laurent"
To get a static version of the libraries, you must set BUILD_SHARED_LIBS to FALSE.


Worked great, thanks!

72
General discussions / CMake support added
« on: August 24, 2010, 04:23:36 pm »
was just, curious, when CMake generates a vs2010 project file, the build options are, Release, Debug, MinSizeRel, and RelWithDebInfo,

does any of these produce static version of the lib?

73
General / Scrolling Enemy with map
« on: August 24, 2010, 02:39:14 pm »
I'm using the sfml mappy playback library that's in the project forums, when drawing a map, it automaticly culls tiles that are not in the view. So when I scroll with a view, the rest of the map is cut off. I'm currently looking for a way to disable this so I can use views to simplify my life.


EDIT:

nevermind, i got it working with views (Wahoo!)
Thank you

74
General / Scrolling Enemy with map
« on: August 23, 2010, 12:51:07 am »
Yes, I mentioned those in my post script :)

75
General / Scrolling Enemy with map
« on: August 22, 2010, 02:30:15 pm »
I'm honestly surprised that i haven't run into this problem sooner,

I need help figuring out how to draw enemies in their correct positions, when the map starts scrolling. Previously when I worked with the allegro Library, i would do something like this
Code: [Select]

g_blitTile(Images.Enemy, enemy_x - Map.x_scroll, enemy_y-Map.y_scroll, 32, 32, frame);


which means i would simply call a draw function and subtract the Maps scroll offset, but in SFML, i can't exactly do that. because there are no parameters for draw, it just takes its current position. Seems like a simple problem to solve but I can't seem to wrap my head around it, Might be because its 5 in the morning :o...need sleep.

Any suggestions?


PS. I would use views to simply the whole matter but Mappy doesn't play nice with them, (auto culls out of screen tiles)

Pages: 1 ... 3 4 [5] 6 7
anything