Permalink
Browse files

first release

  • Loading branch information...
1 parent 330144e commit 670af6a12d2fcb23897151683b3a995fa2632b56 @PoufPoufProduction committed Apr 20, 2012
Showing with 10,108 additions and 3 deletions.
  1. +46 −3 README.txt
  2. +18 −0 bin/balls/makefile
  3. +180 −0 bin/balls/src/Balls.cpp
  4. +66 −0 bin/balls/src/Balls.hpp
  5. +20 −0 bin/splashouille/makefile
  6. +182 −0 bin/splashouille/src/Player.cpp
  7. +78 −0 bin/splashouille/src/Player.hpp
  8. +1,356 −0 lib/Doxyfile
  9. +84 −0 lib/inc/splashouille/Animation.hpp
  10. +132 −0 lib/inc/splashouille/Crowd.hpp
  11. +120 −0 lib/inc/splashouille/Defines.hpp
  12. +190 −0 lib/inc/splashouille/Engine.hpp
  13. +76 −0 lib/inc/splashouille/Event.hpp
  14. +94 −0 lib/inc/splashouille/Fashion.hpp
  15. +90 −0 lib/inc/splashouille/Image.hpp
  16. +122 −0 lib/inc/splashouille/Library.hpp
  17. +182 −0 lib/inc/splashouille/Object.hpp
  18. +39 −0 lib/inc/splashouille/Solid.hpp
  19. +58 −0 lib/inc/splashouille/Sound.hpp
  20. +119 −0 lib/inc/splashouille/Style.hpp
  21. +61 −0 lib/inc/splashouille/Timeline.hpp
  22. +156 −0 lib/inc/splashouilleImpl/Animation.hpp
  23. +176 −0 lib/inc/splashouilleImpl/Crowd.hpp
  24. +168 −0 lib/inc/splashouilleImpl/Engine.hpp
  25. +108 −0 lib/inc/splashouilleImpl/Event.hpp
  26. +194 −0 lib/inc/splashouilleImpl/Fashion.hpp
  27. +150 −0 lib/inc/splashouilleImpl/Image.hpp
  28. +129 −0 lib/inc/splashouilleImpl/Library.hpp
  29. +249 −0 lib/inc/splashouilleImpl/Object.hpp
  30. +81 −0 lib/inc/splashouilleImpl/Solid.hpp
  31. +112 −0 lib/inc/splashouilleImpl/Sound.hpp
  32. +162 −0 lib/inc/splashouilleImpl/Style.hpp
  33. +95 −0 lib/inc/splashouilleImpl/Timeline.hpp
  34. +68 −0 lib/makefile
  35. +403 −0 lib/src/Animation.cpp
  36. +431 −0 lib/src/Crowd.cpp
  37. +452 −0 lib/src/Engine.cpp
  38. +277 −0 lib/src/Event.cpp
  39. +327 −0 lib/src/Fashion.cpp
  40. +413 −0 lib/src/Image.cpp
  41. +349 −0 lib/src/Library.cpp
  42. +316 −0 lib/src/Object.cpp
  43. +151 −0 lib/src/Solid.cpp
  44. +198 −0 lib/src/Sound.cpp
  45. +253 −0 lib/src/Style.cpp
  46. +130 −0 lib/src/Timeline.cpp
  47. +71 −0 res/conf/animation.ini
  48. +166 −0 res/conf/bench.ini
  49. +390 −0 res/conf/demonstration01.ini
  50. +152 −0 res/conf/tags01.ini
  51. BIN res/img/logo.bmp
  52. BIN res/img/sphere.bmp
  53. BIN res/img/spherealpha.bmp
  54. BIN res/img/sprite.bmp
  55. BIN res/img/text_action.bmp
  56. BIN res/img/text_description.bmp
  57. +258 −0 res/raw/poufpoufproduction.svg
  58. +101 −0 res/raw/text_action.svg
  59. +109 −0 res/raw/text_description.svg
View
@@ -1,4 +1,47 @@
-Splashouille
-By Pouf-Pouf Production
-2011
+SPLASHOUILLE README
+===================
+Splashouille is a dynamic animations engine. This framework allows users to easily define their own animations thanks to configuration files and to handle them dynamicly by using API.
+
+The code is C++
+
+
+COPYRIGHT AND LICENSE
+=====================
+
+All of Splashouille's source code is released under the GNU GPL version 3. Later versions are permitted.
+
+
+LINKS
+=====
+
+Homepage http://poufpoufproduction.fr
+Source https://github.com/PoufPoufProduction/splashouille
+Email johannc@poufpoufproduction.fr
+
+
+DEPENDENCIES
+============
+
+To build splashouille you need the 1.2 Development Libraries for SDL, SDL_image and SDL_mixer
+You also need the libconfig version 9.0
+
+
+BUILDING SPLASHOUILLE
+=====================
+
+To build splashouille, go to the lib directory and run the following commands:
+
+ make
+
+If you want the framework installed system-wide, as root, install with:
+
+ make install
+
+Splashouille will be installed into '/usr/local'
+
+
+COMPILING WITH SPLASHOUILLE
+===========================
+
+Compile with /usr/local/include, and link with the options -L/usr/local/lib and -lsplashouille.
View
@@ -0,0 +1,18 @@
+CC=g++
+CFLAGS=-g -W -Wall -ansi -DSDL=1
+INCLUDES=-Isrc -I/usr/local/include -I/usr/include -I/usr/include/SDL
+LDFLAGS=-L/usr/local/lib -ldl -rdynamic -lSDL -lSDL_image -lSDL_mixer -lsplashouille
+EXEC=balls
+
+all: $(EXEC)
+
+$(EXEC): obj/Balls.o
+ $(CC) -o $@ $^ $(LDFLAGS)
+
+obj/Balls.o : src/Balls.cpp src/Balls.hpp
+ $(CC) -o $@ -c $< $(CFLAGS) $(INCLUDES)
+
+clean:
+ @rm -f obj/*
+ @rm -f balls
+
View
@@ -0,0 +1,180 @@
+#include <splashouille/Library.hpp>
+#include <splashouille/Timeline.hpp>
+#include <splashouille/Crowd.hpp>
+#include <splashouille/Object.hpp>
+#include <splashouille/Solid.hpp>
+#include <splashouille/Image.hpp>
+#include <splashouille/Style.hpp>
+#include <splashouille/Fashion.hpp>
+#include <splashouille/Animation.hpp>
+#include <splashouille/Defines.hpp>
+
+#include <Balls.hpp>
+
+#include <iostream>
+
+#define BALLS true
+
+using namespace splashouille;
+
+/**
+ * Callback on a object
+ * @param _object is an object of the crowd
+ * @return false for ending the current process
+ */
+bool Balls::onObject(splashouille::Object * _object)
+{
+ bool ret = true;
+ if (_object->getStyle()->getTop()>640)
+ {
+ engine->getCrowd()->dropObject(_object);
+ engine->getLibrary()->deleteObject(_object);
+ ret = false;
+ }
+ return ret;
+}
+
+/**
+ * Callback called each second
+ * @param _frame is the frame number from the beginning of the animation
+ * @param _frameSec is the number of frames played during the last second
+ * @param _second is the current second
+ */
+void Balls::onSecond(int _frame, int _frameSec, int _second)
+{
+ std::cout<<"Frame: "<<_frame<<" Second: "<<_second<<" FPS: "<<_frameSec<<" Size: "<<engine->getCrowd()->getSize()<<std::endl;
+}
+
+/**
+ * Callback called on each frame
+ * @param _frame is the frame number from the beginning of the animation
+ * @param _timeStampInMilliSeconds is the current timestamp
+ */
+void Balls::onFrame(int _frame UNUSED, int _timeStampInMilliSeconds)
+{
+ static int lastTimeStamp = 0;
+
+ if (!engine->isOnPause())
+ {
+ engine->getCrowd()->forEach(this);
+
+ // A function would be better
+ int number = 1+_timeStampInMilliSeconds/2000;
+
+ // Add a sphere
+ if (number >= engine->getCrowd()->getSize() && _timeStampInMilliSeconds>lastTimeStamp+(500/number) )
+ {
+ lastTimeStamp = _timeStampInMilliSeconds;
+ char id[128];
+ snprintf(id, 128, "sphere%06d", _timeStampInMilliSeconds%1000000);
+ Object * obj = engine->getLibrary()->copyObject(BALLS?"sphere":"solid", id);
+ if (!BALLS) { obj->getStyle()->setBackgroundColor(128+(rand()%128), 128+(rand()%128), 128+(rand()%128)); }
+
+ float r = -10.0 - 20.0 * (rand()%1000)/1000;
+ Style * style = obj->getFashion()->addTransition(0, 1000, r, 1);
+ style->setTop(800);
+
+ r = 416*(rand()%1000)/1000;
+ style = obj->getFashion()->addTransition(0, 1000, .5, .5);
+ style->setLeft(r);
+
+ engine->getCrowd()->insertObject(_timeStampInMilliSeconds, obj);
+ }
+ }
+}
+
+/**
+ * The onEvent Callback
+ * @param _event is the SDL_Event
+ */
+bool Balls::onEvent(SDL_Event & _event, int _timestamp UNUSED)
+{
+ if (_event.type == SDL_KEYDOWN) {
+ Uint8 *keystates = SDL_GetKeyState( NULL );
+
+ if (keystates[' ']) { engine->pause(); }
+ }
+ return true;
+}
+
+/**
+ * Callback on the quit event
+ * @return true if the event is consumed
+ */
+bool Balls::onStop() { running = false; return true; }
+
+/**
+ * Run the player
+ */
+void Balls::run()
+{
+ // CREATE THE SDL WINDOW
+ SDL_Surface * screen = SDL_SetVideoMode(screenSize[0], screenSize[1], screenDepth, SDL_SWSURFACE | SDL_DOUBLEBUF );
+
+ // OPEN AND PARSE THE CONFIGURATION FILE
+ do {
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 96, 128, 224));
+ SDL_Flip(screen);
+
+
+ // CREATE AND PREPARE THE ANIMATION
+ engine = splashouille::Engine::createEngine();
+ engine->addListener(this);
+
+ Image * sphere = engine->getLibrary()->createImage("sphere");
+ Solid * solid = engine->getLibrary()->createSolid("solid");
+ if (!sphere->setFilename("res/img/sphere.bmp"))
+ {
+ std::cout<<"Can not find res/img/sphere.bmp - Run balls from the splashouille/ folder."<<std::endl;
+ running = false;
+ }
+ else
+ {
+ // BUILD THE ANIMATION OF THE REFERENCE BALL
+ sphere->setAlphaColor();
+ sphere->getStyle()->setTop(640);
+ sphere->getStyle()->setLeft(208);
+ sphere->getStyle()->setWidth(64);
+ sphere->getStyle()->setHeight(64);
+ sphere->getStyle()->setPosition(0,0);
+ for (int y=0; y<4; y++) for (int x=0; x<8; x++)
+ {
+ int speed = 10;
+ Style * style = sphere->getFashion()->addTransition(speed*(x+y*8), speed*(x+y*8), 1, 1, 32*speed);
+ style->setPosition(x*64, y*64);
+ }
+
+ // BUILD THE SOLID
+ solid->getStyle()->setTop(640);
+ solid->getStyle()->setLeft(208);
+ solid->getStyle()->setWidth(64);
+ solid->getStyle()->setHeight(64);
+ solid->getStyle()->setBackgroundColor(255, 0, 0);
+ solid->getStyle()->setOpacity(200);
+
+ // RUN THE ENGINE
+ engine->setFPS(60);
+ engine->run(screen);
+ }
+
+ splashouille::Engine::deleteEngine(engine);
+ } while(running);
+
+
+}
+
+/**
+ * The player main function
+ * @param argc is the number of arguments
+ * @param argv is the argument values
+ * @return 1
+ */
+int main()
+{
+ std::cout<<"SPLASHOUILLE Balls v1 - PoufPouf Production 2011"<<std::endl;
+
+ Balls * balls = new Balls();
+ balls->run();
+
+ return 1;
+}
View
@@ -0,0 +1,66 @@
+#ifndef SPLASHOUILLE_BALLS_HPP_
+#define SPLASHOUILLE__HPP_
+
+#include <string>
+#include <splashouille/Engine.hpp>
+#include <splashouille/Crowd.hpp>
+#include <SDL.h>
+
+namespace splashouille
+{
+class Balls : public splashouille::Engine::Listener, public splashouille::Crowd::Listener
+{
+private:
+ int screenSize[2];
+ int screenDepth;
+ splashouille::Engine * engine;
+ bool running;
+public:
+ Balls():screenDepth(32), engine(0), running(true)
+ {
+ screenSize[0] = 480;
+ screenSize[1] = 640;
+ }
+
+ /**
+ * Callback called each second
+ * @param _frame is the frame number from the beginning of the animation
+ * @param _frameSec is the number of frames played during the last second
+ * @param _second is the current second
+ */
+ void onSecond(int _frame, int _frameSec, int _second);
+
+ /**
+ * Callback called on each frame
+ * @param _frame is the frame number from the beginning of the animation
+ * @param _timeStampInMilliSeconds is the current timestamp
+ */
+ void onFrame(int _frame, int _timeStampInMilliSeconds);
+
+ /**
+ * The onEvent Callback
+ * @param _event is the SDL_Event
+ */
+ bool onEvent(SDL_Event & _event, int _timestamp);
+
+ /**
+ * Callback on the quit event
+ * @return true if the event is consumed
+ */
+ bool onStop();
+
+ /**
+ * Callback on a object
+ * @param _object is an object of the crowd
+ * @return false for ending the current process
+ */
+ bool onObject(splashouille::Object * _object);
+
+ /**
+ * Run the player
+ */
+ void run();
+};
+}
+
+#endif
View
@@ -0,0 +1,20 @@
+CC=g++
+CFLAGS=-g -W -Wall -ansi -DSDL=1
+INCLUDES=-Isrc -I/usr/local/include -I/usr/include -I/usr/include/SDL
+LDFLAGS=-L/usr/local/lib -ldl -rdynamic -lSDL -lSDL_image -lSDL_mixer -lconfig++ -lsplashouille
+EXEC=splashouille
+
+all: $(EXEC)
+
+$(EXEC): obj/Player.o
+ $(CC) -o $@ $^ $(LDFLAGS)
+
+obj/Player.o : src/Player.cpp src/Player.hpp
+ $(CC) -o $@ -c $< $(CFLAGS) $(INCLUDES)
+
+clean:
+ @rm -f obj/*
+ @rm -f splashouille
+
+install:
+ @cp splashouille /usr/local/bin
Oops, something went wrong.

0 comments on commit 670af6a

Please sign in to comment.