Changeset 1105


Ignore:
Timestamp:
Dec 5, 2011, 9:24:04 AM (9 years ago)
Author:
sam
Message:

core: start working on the Emcee class.

Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r1097 r1105  
    1212    worldentity.cpp worldentity.h gradient.cpp gradient.h half.cpp half.h \
    1313    platform.cpp platform.h sprite.cpp sprite.h trig.cpp trig.h \
    14     real.cpp real.h \
     14    real.cpp real.h emcee.cpp emcee.h \
    1515    \
    1616    lol/unit.h \
  • trunk/src/application/application.cpp

    r1082 r1105  
    6060Application::Application(char const *name, ivec2 resolution, float framerate)
    6161{
     62    Emcee::Setup();
    6263    data = new ApplicationData(name, resolution, framerate);
    6364}
     
    7677{
    7778    delete data;
     79    Emcee::Shutdown();
    7880}
    7981
  • trunk/src/core.h

    r1093 r1105  
    104104
    105105// Managers
     106#include "emcee.h"
    106107#include "ticker.h"
    107108#include "forge.h"
  • trunk/src/entity.cpp

    r735 r1105  
    6969}
    7070
     71void Entity::SetState(uint32_t state)
     72{
     73    Emcee::SetState(this, state);
     74}
     75
     76void Entity::SetStateWhenMatch(uint32_t state,
     77                               Entity *other_entity, uint32_t other_state)
     78{
     79    Emcee::SetStateWhenMatch(this, state, other_entity, other_state);
     80}
     81
    7182} /* namespace lol */
    7283
  • trunk/src/entity.h

    r748 r1105  
    7878#endif
    7979
     80    // Emcee begin
     81private:
     82    void SetState(uint32_t newstate);
     83    void SetStateWhenMatch(uint32_t newstate,
     84                           Entity *other_entity, uint32_t other_state);
     85    virtual uint32_t OnStateChanged(uint32_t newstate)
     86    {
     87        return m_state = newstate;
     88    }
     89
     90    uint32_t m_state;
     91    // Emcee end
     92
    8093private:
    8194    Entity *gamenext, *drawnext, *autonext;
  • trunk/src/thread/threadbase.h

    r1101 r1105  
    1818
    1919#if defined __linux__ || defined __native_client__
    20 #   include <cstring>
    2120#   include <pthread.h>
    2221#elif defined _WIN32
  • trunk/test/debug/sandbox.cpp

    r961 r1105  
    1919#include "core.h"
    2020
     21class Moo
     22{
     23    Moo() {}
     24
     25    virtual int SetState(int state) { return state; }
     26};
     27
    2128using namespace std;
    2229using namespace lol;
Note: See TracChangeset for help on using the changeset viewer.