logo

libbulletml

Library of Bullet Markup Language (forked from https://shinh.skr.jp/libbulletml/index_en.html )git clone https://hacktivis.me/git/libbulletml.git
commit: c630cc221ee56797a4f513942e0709a1fbab38b4
parent cb0f51bc5186995d025ec5aa41c694366e38172a
Author: shinichiro.h <hamaji@nii.ac.jp>
Date:   Fri, 22 Mar 2024 19:48:01 +0100

Apply 0.0.6-7.debian:patches/bulletml_d.patch

Diffstat:

Asrc/bulletml_d.cpp92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+), 0 deletions(-)

diff --git a/src/bulletml_d.cpp b/src/bulletml_d.cpp @@ -0,0 +1,92 @@ +#include "d_cpp_interface.h" + +#include "bulletmlparser.h" +#include "bulletmlparser-tinyxml.h" +#include "bulletmlrunner.h" + +// BulletMLParserTinyXML +extern "C" { + D_CPP_CLASS(BulletMLParserTinyXML, BulletMLParserTinyXML) + D_CPP_NEW_1(BulletMLParserTinyXML, BulletMLParserTinyXML_new, const char*) + D_CPP_METHOD_0(BulletMLParserTinyXML, parse, BulletMLParserTinyXML_parse, void) + D_CPP_DELETE(BulletMLParserTinyXML, BulletMLParserTinyXML_delete) +} + +// BulletMLParser +extern "C" { + D_CPP_CLASS(BulletMLParser, BulletMLParser) +} + +// BulletMLState +extern "C" { + D_CPP_CLASS(BulletMLState, BulletMLState) +} + +// BulletMLRunner virtual functions +D_CPP_BASE_CLASS_OPEN(BulletMLRunner, BulletMLRunnerD) + +BulletMLRunnerD(BulletMLParser* p) : BulletMLRunner(p), D_getRand_fp(0) {} +BulletMLRunnerD(BulletMLState* s) : BulletMLRunner(s), D_getRand_fp(0) {} + +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getBulletDirection, double) +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getAimDirection, double) +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getBulletSpeed, double) +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getDefaultSpeed, double) +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getRank, double) +D_CPP_VIRTUAL_METHOD_2(BulletMLRunnerD, createSimpleBullet, void, double, double) +D_CPP_VIRTUAL_METHOD_3(BulletMLRunnerD, createBullet, void, BulletMLState*, double, double) +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getTurn, int) +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, doVanish, void) + +D_CPP_VIRTUAL_METHOD_1(BulletMLRunnerD, doChangeDirection, void, double) +D_CPP_VIRTUAL_METHOD_1(BulletMLRunnerD, doChangeSpeed, void, double) +D_CPP_VIRTUAL_METHOD_1(BulletMLRunnerD, doAccelX, void, double) +D_CPP_VIRTUAL_METHOD_1(BulletMLRunnerD, doAccelY, void, double) +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getBulletSpeedX, double) +D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getBulletSpeedY, double) + +double (*D_getRand_fp) (BulletMLRunnerD*); +virtual double getRand() { + if (D_getRand_fp) { + return D_getRand_fp(this); + } + else { + return BulletMLRunner::getRand(); + } +} +void D_set_getRand(double (*fp) (BulletMLRunnerD*)) { + D_getRand_fp = fp; +} + +D_CPP_BASE_CLASS_CLOSE() + +// BulletMLRunner +extern "C" { + D_CPP_CLASS(BulletMLRunner, BulletMLRunner) + D_CPP_CLASS(BulletMLRunnerD, BulletMLRunnerD) + D_CPP_NEW_1(BulletMLRunnerD, BulletMLRunner_new_parser, BulletMLParser*) + D_CPP_NEW_1(BulletMLRunnerD, BulletMLRunner_new_state, BulletMLState*) + D_CPP_DELETE(BulletMLRunnerD, BulletMLRunner_delete) + D_CPP_METHOD_0(BulletMLRunnerD, run, BulletMLRunner_run, void) + D_CPP_METHOD_0(BulletMLRunnerD, isEnd, BulletMLRunner_isEnd, bool) + + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getBulletDirection, BulletMLRunner_set_getBulletDirection, double) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getAimDirection, BulletMLRunner_set_getAimDirection, double) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getBulletSpeed, BulletMLRunner_set_getBulletSpeed, double) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getDefaultSpeed, BulletMLRunner_set_getDefaultSpeed, double) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getRank, BulletMLRunner_set_getRank, double) + D_CPP_VIRTUAL_METHOD_SETTER_2(BulletMLRunnerD, createSimpleBullet, BulletMLRunner_set_createSimpleBullet, void, double, double) + D_CPP_VIRTUAL_METHOD_SETTER_3(BulletMLRunnerD, createBullet, BulletMLRunner_set_createBullet, void, BulletMLState*, double, double) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getTurn, BulletMLRunner_set_getTurn, int) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, doVanish, BulletMLRunner_set_doVanish, void) + + D_CPP_VIRTUAL_METHOD_SETTER_1(BulletMLRunnerD, doChangeDirection, BulletMLRunner_set_doChangeDirection, void, double) + D_CPP_VIRTUAL_METHOD_SETTER_1(BulletMLRunnerD, doChangeSpeed, BulletMLRunner_set_doChangeSpeed, void, double) + D_CPP_VIRTUAL_METHOD_SETTER_1(BulletMLRunnerD, doAccelX, BulletMLRunner_set_doAccelX, void, double) + D_CPP_VIRTUAL_METHOD_SETTER_1(BulletMLRunnerD, doAccelY, BulletMLRunner_set_doAccelY, void, double) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getBulletSpeedX, BulletMLRunner_set_getBulletSpeedX, double) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getBulletSpeedY, BulletMLRunner_set_getBulletSpeedY, double) + D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getRand, BulletMLRunner_set_getRand, double) + +} +