diff options
author | Chris Xiong <chirs241097@gmail.com> | 2015-10-12 22:55:41 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2015-10-12 22:55:41 +0800 |
commit | 9b5621bda033c2e6b7c622c7494c56a172543554 (patch) | |
tree | f5fd661441867ca8a100d5c8aedcce430864d9d4 /src | |
parent | 627d814f487ac38d4f9b9b71da9bef46f33b3dad (diff) | |
download | bullet-lab-remix-9b5621bda033c2e6b7c622c7494c56a172543554.tar.xz |
Initial implementation of smPath.
Minor changes on the (s)coll effect.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/bullet.cpp | 12 | ||||
-rw-r--r-- | src/core/bullet.hpp | 2 | ||||
-rw-r--r-- | src/makefile | 4 | ||||
-rw-r--r-- | src/plugin/pluginmgr_dl.cpp | 7 |
4 files changed, 16 insertions, 9 deletions
diff --git a/src/core/bullet.cpp b/src/core/bullet.cpp index ddbf964..15cfef0 100644 --- a/src/core/bullet.cpp +++ b/src/core/bullet.cpp @@ -23,13 +23,13 @@ void bulletBase::update() if((pos-player->pos).l()>collrange)if(invincible)ccb=cb; if((pos-player->pos).l()<=scollrange&&(pos-player->pos).l()>collrange) { - if(!invincible)scollrange=-1,++player->scoll,bmInstance->addFXBullet(grey); - else{if(++cscb>scb)cscb=0,++player->scoll,bmInstance->addFXBullet(grey);} + if(!invincible)scollrange=-1,++player->scoll,bmInstance->addFXBullet(grey,5,5); + else{if(++cscb>scb)cscb=0,++player->scoll,bmInstance->addFXBullet(grey,5,5);} } if((pos-player->pos).l()<=collrange) { - if(!invincible)exist=false,++player->coll,bmInstance->addFXBullet(red); - else{if(++ccb>cb)ccb=0,++player->coll,bmInstance->addFXBullet(red);} + if(!invincible)exist=false,++player->coll,bmInstance->addFXBullet(red,15,15); + else{if(++ccb>cb)ccb=0,++player->coll,bmInstance->addFXBullet(red,15,15);} } } void bulletBase::render() @@ -123,9 +123,9 @@ void bulletManager::renderBullet() bullets[i]->render(); } } -void bulletManager::addFXBullet(TColors col) +void bulletManager::addFXBullet(TColors col,int base,int var) { - int c=rand()%5+5; + int c=rand()%var+base; for(int i=0;i<c;++i) bullets[allocBullet<bulletFX>()]->init(0,col); } diff --git a/src/core/bullet.hpp b/src/core/bullet.hpp index a917b95..244e944 100644 --- a/src/core/bullet.hpp +++ b/src/core/bullet.hpp @@ -80,7 +80,7 @@ public: } void updateBullet(); void renderBullet(); - void addFXBullet(TColors col); + void addFXBullet(TColors col,int base,int var); bulletBase* getHandle(int id); smEntity2D* getBulEntity2D(TColors col); smEntity3D* getBulEntity3D(TColors col); diff --git a/src/makefile b/src/makefile index 57d9356..560f68c 100644 --- a/src/makefile +++ b/src/makefile @@ -1,6 +1,6 @@ CC= g++ -CXXFLAGS= -std=c++11 -Wall -g -I/home/chrisoft/devel/BulletLabRemixIII/include -LINK= -L../smelt/sdl -L../extensions -lsmeltext -lsmelt -lCxImage -lSDL2 -lvorbis -lvorbisfile -lopenal -ljpeg -lpng -lfreetype -lz -pthread +CXXFLAGS= -std=c++11 -Wall -g -I/home/chrisoft/devel/BulletLabRemixIII/include -I/usr/include/freetype2 +LINK= -L../smelt/sdl -L../extensions -lsmeltext -lsmelt -lCxImage -lSDL2 -lvorbis -lvorbisfile -lopenal -ljpeg -lpng -lfreetype -lm -lz -ldl -pthread all: main diff --git a/src/plugin/pluginmgr_dl.cpp b/src/plugin/pluginmgr_dl.cpp index 337fa99..f6b4ef3 100644 --- a/src/plugin/pluginmgr_dl.cpp +++ b/src/plugin/pluginmgr_dl.cpp @@ -18,4 +18,11 @@ void pluginManager::scanPlugin() strcpy(fn[fcnt++],file->d_name); closedir(dir); } + for(int i=0;i<fcnt;++i) + { + void* hso=dlopen(fn[i],RTLD_LAZY); + if(!hso)continue; + void* hndi=dlsym(hso,"getPluginInterface"); + if(!hndi)continue; + } } |