mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-21 05:52:58 +08:00
72 lines
3.0 KiB
C++
72 lines
3.0 KiB
C++
//////////////////////////////////////////////////////////////////////////////
|
|
// Model: game.qm
|
|
// File: ././main.cpp
|
|
//
|
|
// This file has been generated automatically by QP Modeler (QM).
|
|
// DO NOT EDIT THIS FILE MANUALLY.
|
|
//
|
|
// Please visit www.state-machine.com/qm for more information.
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
#include "qp_port.h"
|
|
#include "bsp.h"
|
|
#include "game.h"
|
|
|
|
namespace GAME {
|
|
|
|
// Local-scope objects -------------------------------------------------------
|
|
static QP::QEvt const * l_missileQueueSto[2];
|
|
static QP::QEvt const * l_shipQueueSto[3];
|
|
static QP::QEvt const * l_tunnelQueueSto[GAME_MINES_MAX + 5];
|
|
|
|
static QF_MPOOL_EL(QP::QEvt) l_smlPoolSto[10];
|
|
static QF_MPOOL_EL(ObjectImageEvt) l_medPoolSto[2*GAME_MINES_MAX + 10];
|
|
|
|
static QP::QSubscrList l_subscrSto[MAX_PUB_SIG];
|
|
|
|
//............................................................................
|
|
extern "C" int_t main() {
|
|
|
|
BSP_init(); // initialize the Board Support Package
|
|
|
|
QP::QF::init(); // initialize the framework and the underlying RT kernel
|
|
|
|
// initialize the event pools...
|
|
QP::QF::poolInit(l_smlPoolSto,
|
|
sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
|
|
QP::QF::poolInit(l_medPoolSto,
|
|
sizeof(l_medPoolSto), sizeof(l_medPoolSto[0]));
|
|
|
|
QP::QF::psInit(l_subscrSto, Q_DIM(l_subscrSto)); // init publish-subscribe
|
|
|
|
// send object dictionaries for event queues...
|
|
QS_OBJ_DICTIONARY(l_missileQueueSto);
|
|
QS_OBJ_DICTIONARY(l_shipQueueSto);
|
|
QS_OBJ_DICTIONARY(l_tunnelQueueSto);
|
|
|
|
// send object dictionaries for event pools...
|
|
QS_OBJ_DICTIONARY(l_smlPoolSto);
|
|
QS_OBJ_DICTIONARY(l_medPoolSto);
|
|
|
|
// send signal dictionaries for globally published events...
|
|
QS_SIG_DICTIONARY(TIME_TICK_SIG, static_cast<void *>(0));
|
|
QS_SIG_DICTIONARY(PLAYER_TRIGGER_SIG, static_cast<void *>(0));
|
|
QS_SIG_DICTIONARY(PLAYER_QUIT_SIG, static_cast<void *>(0));
|
|
QS_SIG_DICTIONARY(GAME_OVER_SIG, static_cast<void *>(0));
|
|
|
|
// start the active objects...
|
|
AO_Missile->start(1U, // priority
|
|
l_missileQueueSto, Q_DIM(l_missileQueueSto),// evt queue
|
|
static_cast<void *>(0), 0U); // no per-thread stack
|
|
AO_Ship ->start(2U, // priority
|
|
l_shipQueueSto, Q_DIM(l_shipQueueSto), // evt queue
|
|
static_cast<void *>(0), 0U); // no per-thread stack
|
|
AO_Tunnel ->start(3U, // priority
|
|
l_tunnelQueueSto, Q_DIM(l_tunnelQueueSto), // evt queue
|
|
static_cast<void *>(0), 0U); // no per-thread stack
|
|
|
|
return QP::QF::run(); // run the QF application
|
|
}
|
|
|
|
} // namespace GAME
|
|
|