diff --git a/activeGameState.cpp b/activeGameState.cpp index f8a6242..66ff352 100755 --- a/activeGameState.cpp +++ b/activeGameState.cpp @@ -32,92 +32,6 @@ namespace battleship{ const int size = 50; - ActiveGameState::UnitButton::UnitButton(ActiveGameState *activeState, Vector2 pos, Vector2 size, std::string name, int faction, int unitId) : vb01Gui::Button(pos, size, name, PATH + "Fonts/batang.ttf", -1, true){ - this->activeState=activeState; - this->faction=faction; - this->unitId=unitId; - } - - void ActiveGameState::UnitButton::onClick(){ - Player *player=activeState->getPlayer(); - Vector3 spawnPoint=player->getSpawnPoint(); - Unit *u; - - switch(unitData::unitType[unitId]){ - case unitData::UNIT_TYPE::VESSEL: - u=new Vessel(player,spawnPoint,unitId); - break; - case unitData::UNIT_TYPE::DESTROYER: - u=new Destroyer(player,spawnPoint,unitId); - break; - case unitData::UNIT_TYPE::CRUISER: - u=new Cruiser(player,spawnPoint,unitId); - break; - case unitData::UNIT_TYPE::AIRCRAFT_CARRIER: - u=new AircraftCarrier(player,spawnPoint,unitId); - break; - case unitData::UNIT_TYPE::SUBMARINE: - u=new Submarine(player,spawnPoint,unitId); - break; - } - - player->addUnit(u); - } - - void ActiveGameState::UnitButton::onMouseOver(){ - /* - if(!mouseOverDone){ - GameManager *gm = GameManager::getSingleton(); - GuiAppState *guiState=((GuiAppState*)GameManager::getSingleton()->getStateManager()->getAppState(AppStateTypes::GUI_STATE)); - guiState->addTooltip(new gui::Tooltip(pos-Vector2(100,0),name)); - } - */ - } - - void ActiveGameState::UnitButton::onMouseAway(){ - /* - if(!mouseAwayDone){ - GuiAppState *guiState=((GuiAppState*)GameManager::getSingleton()->getStateManager()->getAppState(AppStateTypes::GUI_STATE)); - guiState->removeAllTooltips(); - } - */ - } - - ActiveGameState::UnitActionButton::UnitActionButton(unitData::UNIT_TYPE type, Vector2 pos, Vector2 size, string name, string path) : vb01Gui::Button(pos, size, name, "", -1, true){ - this->type=type; - GameManager *gm = GameManager::getSingleton(); - activeState=((ActiveGameState*)gm->getStateManager()->getAppStateByType(AppStateType::ACTIVE_STATE)); - /* - IVideoDriver *driver = gm->getDevice()->getVideoDriver(); - setImageButton(new Image(driver->getTexture(path),pos,vector2di(50,50))); - */ - } - - void ActiveGameState::UnitActionButton::onClick(){ - std::vector &selectedUnits=activeState->getSelectedUnits(); - for(Unit *u : selectedUnits) - if(u->getType()==type) - units.push_back(u); - } - - void ActiveGameState::UnitActionButton::onMouseOver(){ - /* - if(!mouseOverDone){ - GuiAppState *guiState=((GuiAppState*)GameManager::getSingleton()->getStateManager()->getAppState(AppStateTypes::GUI_STATE)); - guiState->addTooltip(new gui::Tooltip(pos-Vector2(100,0),name)); - } - */ - } - - void ActiveGameState::UnitActionButton::onMouseAway(){ - /* - if(!mouseAwayDone){ - GuiAppState *guiState=((GuiAppState*)GameManager::getSingleton()->getStateManager()->getAppState(AppStateTypes::GUI_STATE)); - guiState->removeAllTooltips(); - } - */ - } - ActiveGameState::ActiveGameState(GuiAppState *guiState, Map *map, vector players, int playerId) { type = AppStateType::ACTIVE_STATE; this->guiState = guiState; @@ -156,22 +70,6 @@ namespace battleship{ int faction = mainPlayer->getFaction(), width = gm->getWidth(), height = gm->getHeight(), size = 50; string names[5] = {"Battleship", "Destroyer", "Cruiser", "Carrier", "Submarine"}; - /* - for(int i = 0; i < 5; i++){ - int id = 2 * i + (i == 4 && faction == 1 ? 0 : faction); - Vector2 pos = Vector2(width - size - 1, 1 + i * size), sizeVec = Vector2(size, size); - UnitButton *button = new UnitButton(this, pos, sizeVec, names[i], faction, id); - - if(i == 3) - names[i] = "aircraftCarrier"; - else - transform(names[i].begin(), names[i].end(), names[i], names[i]); - - //button->setImageButton(new Image(driver->getTexture(PATH+"Textures/Icons/"+names[i]+"0"+stringw(faction)+".png"),pos,sizeVec)); - guiState->addButton(button); - } - */ - Bind binds[]{Bind::LOOK_UP, Bind::LOOK_DOWN, Bind::LOOK_LEFT, Bind::LOOK_RIGHT}; int triggers[]{Mapping::MOUSE_AXIS_UP, Mapping::MOUSE_AXIS_DOWN, Mapping::MOUSE_AXIS_LEFT, Mapping::MOUSE_AXIS_RIGHT}; int numData = sizeof(triggers) / sizeof(int); @@ -198,8 +96,6 @@ namespace battleship{ dragboxNode->setVisible(isSelectionBox); renderUnits(); - renderGUIBorders(); - renderActionButtons(); if(!lookingAround) updateCameraPosition(); @@ -238,7 +134,6 @@ namespace battleship{ } } - //rendUn->getLight()->setVisible(true); u->getNode()->setVisible(true); } else{ @@ -252,107 +147,9 @@ namespace battleship{ u->getNode()->setVisible(dist <= units[i]->getLineOfSight() || isInLineOfSight(compUnPos, units[i]->getLineOfSight(), u) ? true : false); } } - - if (u->isDebuggable()) - u->debug(); } } - void ActiveGameState::renderGUIBorders(){ - /* - GameManager *gm = GameManager::getSingleton(); - IVideoDriver *driver = gm->getDevice()->getVideoDriver(); - int width = gm->getWidth(), height = gm->getHeight(), size = 50; - - for(int i=0;idraw2DRectangleOutline(recti(vector2di(width-(2*size+3),size*i),dimension2di(size+2,size+2))); - driver->draw2DRectangleOutline(recti(vector2di(width-(size+2),size*i),dimension2di(size+2,size+2))); - } - */ - } - - void ActiveGameState::renderActionButtons(){ - class MakeJetButton : public UnitActionButton{ - public: - MakeJetButton(int faction, unitData::UNIT_TYPE type, Vector2 pos, Vector2 size):UnitActionButton(type, pos, size, "Jet", PATH + "Textures/Icons/jet0" + to_string(faction) + ".png"){ - } - ~MakeJetButton(){} - void onClick(){ - UnitActionButton::onClick(); - - for(int i=0;imakeJet(); - } - private: - }; - class LaunchButton : public UnitActionButton{ - public: - LaunchButton(int faction, unitData::UNIT_TYPE type, Vector2 pos, Vector2 size) : UnitActionButton(type, pos, size, "Launch", PATH + "Textures/Icons/guidedMissile0" + to_string(faction) + ".png"){} - ~LaunchButton(){} - void onClick(){ - UnitActionButton::onClick(); - activeState->setSelectingLaunchPoint(true); - } - private: - }; - class MissileButton : public UnitActionButton{ - public: - MissileButton(bool aam, Vector2 pos, Vector2 size, string name, string path) : UnitActionButton(unitData::UNIT_TYPE::MISSILE_JET,pos,size,name,path){ - this->aam=aam; - } - ~MissileButton(){} - void onClick(){ - UnitActionButton::onClick(); - - for(int i=0;iinstallMissiles(aam); - } - private: - bool aam; - }; - - GameManager *gm = GameManager::getSingleton(); - int width = gm->getWidth(), height = gm->getHeight(), slotSize = size + 2, faction = mainPlayer->getFaction(); - bool carriers=false, cruisers=false, missileJets=false; - - for(int i=0;igetType()==unitData::UNIT_TYPE::AIRCRAFT_CARRIER) - carriers=true; - else if(selectedUnits[i]->getType()==unitData::UNIT_TYPE::CRUISER) - cruisers=true; - else if(selectedUnits[i]->getType()==unitData::UNIT_TYPE::MISSILE_JET) - missileJets=true; - } - if(carriers&&!actionButtons[0]){ - actionButtons[0] = new MakeJetButton(faction, unitData::UNIT_TYPE::AIRCRAFT_CARRIER, Vector2(width - 2 * slotSize, 0), Vector2(size, size)); - guiState->addButton(actionButtons[0]); - } - else if(!carriers&&actionButtons[0]){ - guiState->removeButton(actionButtons[0]); - actionButtons[0]=nullptr; - } - if(cruisers&&!actionButtons[1]){ - actionButtons[1] = new LaunchButton(faction, unitData::UNIT_TYPE::CRUISER, Vector2(width - 2 * slotSize, slotSize), Vector2(size, size)); - guiState->addButton(actionButtons[1]); - } - else if(!cruisers&&actionButtons[1]){ - guiState->removeButton(actionButtons[1]); - actionButtons[1]=nullptr; - } - if(missileJets&&!actionButtons[2]){ - actionButtons[2]=new MissileButton(true, Vector2(width - 2 * slotSize, slotSize * 3), Vector2(size, size), "AAM", PATH + "Textures/Icons/aam.png"); - actionButtons[3]=new MissileButton(false, Vector2(width - 2 * slotSize, slotSize * 4), Vector2(size, size), "AWM", PATH + "Textures/Icons/awm.png"); - guiState->addButton(actionButtons[2]); - guiState->addButton(actionButtons[3]); - } - else if(!missileJets&&actionButtons[2]){ - guiState->removeButton(actionButtons[2]); - guiState->removeButton(actionButtons[3]); - actionButtons[2]=nullptr; - actionButtons[3]=nullptr; - } - } - bool ActiveGameState::isInLineOfSight(Vector3 center, float radius, Unit *u) { bool inside = false; @@ -477,14 +274,6 @@ namespace battleship{ Ray::retrieveCollisions(camPos, rayDir, map->getWaterNode(), results); std::map unitData; - /* - for (Player *p : players) - for (Unit *u : p->getUnits()){ - Ray::retrieveCollisions(camPos, rayDir, u->getNode(), results); - unitData.emplace(u->getNode(), u); - } - */ - Ray::sortResults(results); if(!results.empty()){ @@ -579,9 +368,6 @@ namespace battleship{ break; case Bind::INSTALL_AAM: case Bind::INSTALL_AWM: - for(Unit *u : selectedUnits) - if(u->getType() == unitData::UNIT_TYPE::MISSILE_JET) - ((MissileJet*)u)->installMissiles(bind == Bind::INSTALL_AAM); break; case Bind::GROUP_0: case Bind::GROUP_1: diff --git a/activeGameState.h b/activeGameState.h index 8db36ef..ebd6866 100755 --- a/activeGameState.h +++ b/activeGameState.h @@ -25,34 +25,7 @@ namespace battleship{ inline std::vector& getSelectedUnits(){return selectedUnits;} inline std::vector& getUnitGroup(int i){return unitGroups[i];} private: - class UnitButton : public vb01Gui::Button{ - public: - UnitButton(ActiveGameState*, vb01::Vector2, vb01::Vector2, std::string, int, int); - ~UnitButton(){} - virtual void onClick(); - virtual void onMouseOver(); - virtual void onMouseAway(); - private: - ActiveGameState *activeState; - int faction, unitId; - }; - - class UnitActionButton : public vb01Gui::Button{ - public: - UnitActionButton(unitData::UNIT_TYPE, vb01::Vector2, vb01::Vector2, std::string, std::string); - ~UnitActionButton(){} - virtual void onClick(); - virtual void onMouseOver(); - virtual void onMouseAway(); - protected: - unitData::UNIT_TYPE type; - std::vector units; - ActiveGameState *activeState; - }; - void deselectUnits(); - void renderGUIBorders(); - void renderActionButtons(); void renderUnits(); void updateCameraPosition(); void updateSelectionBox(); @@ -72,7 +45,6 @@ namespace battleship{ std::vector unitLightNodes; std::vector unitGroups[9], selectedUnits; std::vector targets; - UnitActionButton *actionButtons[4]{nullptr, nullptr, nullptr, nullptr}; bool isSelectionBox = false, shiftPressed = false, controlPressed = false, selectingPatrolPoints = false, selectingGuidedMissileTarget = false,lookingAround=false; bool isInLineOfSight(vb01::Vector3, float, Unit*); int playerId, zooms = 0; diff --git a/consoleCommand.cpp b/consoleCommand.cpp index 2b469ea..01d6508 100755 --- a/consoleCommand.cpp +++ b/consoleCommand.cpp @@ -31,8 +31,6 @@ namespace battleship{ validateAddUnitArguments(fullCommand); executeAddUnit(atoi(fullCommand[1].c_str()), atoi(fullCommand[2].c_str())); } - else - printConsoleMessage("No such command"); } void ConsoleCommand::parse(string commandStr, vector &fullCommand){ @@ -101,42 +99,5 @@ namespace battleship{ } players[playerId]->addUnit(u); - } - - /* - void ConsoleCommand::debugUnits() { - if (arguments.size() == 0) - for (Player *pl : players){ - vector &units=pl->getUnits(); - - for (Unit *u : units){ - u->toggleDebugging(true); - vector projectiles=u->getProjectiles(); - - for(Projectile *pr : projectiles) - pr->debug(); - } - } - else - printConsoleMessage("Too many arguments"); - } - */ - - void ConsoleCommand::printConsoleMessage(string message) { - /* - int messageId = 0; - bool foundEmptySlot = false; - - for (int i = 0; i < listbox->getContents().size() && !foundEmptySlot; i++) - if (listbox->getContents()[i] == L"") { - messageId = i; - foundEmptySlot = true; - } - - if (foundEmptySlot) - listbox->changeLine(messageId, message); - else - listbox->addLine(message); - */ } } diff --git a/consoleCommand.h b/consoleCommand.h index 7ba573d..7149013 100755 --- a/consoleCommand.h +++ b/consoleCommand.h @@ -19,9 +19,6 @@ namespace battleship{ static void executeAddUnit(int, int); static void validateDebugUnitsArguments(); - static void debugUnits(); - - static void printConsoleMessage(std::string); }; } diff --git a/demoJet.cpp b/demoJet.cpp index 4a90645..7021165 100755 --- a/demoJet.cpp +++ b/demoJet.cpp @@ -29,25 +29,5 @@ namespace battleship{ void DemoJet::update(){ Jet::update(); - if(!onBoard&&!orders.empty()&&orders[0].type==Order::TYPE::ATTACK){ - GameManager *gm = GameManager::getSingleton(); - /* - ISceneManager *smgr = gm->getDevice()->getSceneManager(); - ISceneNode *collNode = castRay(smgr,pos,pos+dirVec*length); - - if(collNode && collNode != node){ - InGameAppState *inGameState = ((InGameAppState*)gm->getStateManager()->getAppState(AppStateTypes::IN_GAME_STATE)); - - for(Player *p : inGameState->getPlayers()) - for(Unit *u : p->getUnits()) - if(u->getNode() == collNode) - u->takeDamage(damage); - - blowUp(); - } - else if(pos.y<0) - blowUp(); - */ - } } } diff --git a/depthCharge.cpp b/depthCharge.cpp index e7daa6d..0f5d453 100755 --- a/depthCharge.cpp +++ b/depthCharge.cpp @@ -39,13 +39,6 @@ namespace battleship{ Vector3 p1 = u->getCorner(1); Vector3 p3 = u->getCorner(3); Vector3 p4 = u->getCorner(4); - - /* - if(isWithinCuboid(p0,p1,p3,p4,pos)){ - detonated=true; - collNode=u->getNode(); - } - */ } if(detonated) diff --git a/guiAppState.cpp b/guiAppState.cpp index 4be3632..2b6baa3 100755 --- a/guiAppState.cpp +++ b/guiAppState.cpp @@ -228,7 +228,6 @@ namespace battleship{ } void GuiAppState::onRawMousePress(int trigger){ - //updateControlsListbox(trigger); } Textbox* GuiAppState::getOpenTextbox() { @@ -278,10 +277,6 @@ namespace battleship{ void GuiAppState::removeButton(Button *b) { for (int i = 0; i < buttons.size(); i++) { if (b == buttons[i]) { - /* - if (b->isImageButton()) - GameManager::getSingleton()->detachImage(b->getImage()); - */ delete b; buttons.erase(buttons.begin() + i); } @@ -291,13 +286,7 @@ namespace battleship{ void GuiAppState::removeButton(string name) { for (int i = 0; i < buttons.size(); i++) { if (name == buttons[i]->getName() && buttons[i]->isSeparate()) { - /* - if (buttons[i]->isImageButton()) - GameManager::getSingleton()->detachImage(buttons[i]->getImage()); - */ - delete buttons[i]; - buttons.erase(buttons.begin() + i); } } diff --git a/inGameAppState.cpp b/inGameAppState.cpp index 361d5ec..9fcc0bd 100755 --- a/inGameAppState.cpp +++ b/inGameAppState.cpp @@ -129,9 +129,7 @@ namespace battleship{ } - InGameAppState::UnitCreationButton::UnitCreationButton(string icon, Vector2 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, PATH + "Fonts/batang.ttf", -1, separate) { - //setImageButton(new Image(icon, pos, size)); - } + InGameAppState::UnitCreationButton::UnitCreationButton(string icon, Vector2 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, PATH + "Fonts/batang.ttf", -1, separate) {} void InGameAppState::UnitCreationButton::onClick() { } @@ -229,14 +227,6 @@ namespace battleship{ if (map) map->update(); - if (isMainMenuActive) { - GameManager *gm = GameManager::getSingleton(); - /* - IVideoDriver *driver = gm->getDevice()->getVideoDriver(); - driver->draw2DRectangle(SColor(100, 0, 0, 0), rect(0, 0, gm->getWidth(), gm->getHeight())); - */ - } - for (Player *p : players) if (p) { p->update(); @@ -312,26 +302,6 @@ namespace battleship{ projectiles.erase(projectiles.begin()+i); } } - - for(int i=0;ifx[i].time){ - /* - IParticleSystemSceneNode *node=fx[i].node; - - if(node){ - node->removeAllAffectors(); - node->setVisible(false); - } - - if(fx[i].sfx){ - delete fx[i].sfx->getBuffer(); - delete fx[i].sfx; - } - - fx.erase(fx.begin()+i); - */ - } - } } void InGameAppState::attachGui() { @@ -340,14 +310,6 @@ namespace battleship{ if (mainPlayer->getFaction() == 1) idOffset += 7; - /* - IVideoDriver *driver = GameManager::getSingleton()->getDevice()->getVideoDriver(); - bcb = new BattleshipCreationButton(gameManager, driver->getTexture(iconPath[idOffset]), vector2d(gameManager->getWidth() - 100, gameManager->getHeight() - 540), vector2d(100, 100), "battleships", true); - dcb = new DestroyerCreationButton(gameManager, driver->getTexture(iconPath[idOffset + 1]), vector2d(gameManager->getWidth() - 100, gameManager->getHeight() - 430), vector2d(100, 100), "destroyers", true); - crcb = new CruiserCreationButton(gameManager, driver->getTexture(iconPath[idOffset + 2]), vector2d(gameManager->getWidth() - 100, gameManager->getHeight() - 320), vector2d(100, 100), "cruisers", true); - ccb = new CarrierCreationButton(gameManager, driver->getTexture(iconPath[idOffset + 3]), vector2d(gameManager->getWidth() - 100, gameManager->getHeight() - 210), vector2d(100, 100), "carriers", true); - scb = new SubmarineCreationButton(gameManager, driver->getTexture(iconPath[idOffset + 4]), vector2d(gameManager->getWidth() - 100, gameManager->getHeight() - 100), vector2d(100, 100), "submarines", true); - */ guiState->addButton(bcb); guiState->addButton(dcb); guiState->addButton(crcb); @@ -370,7 +332,6 @@ namespace battleship{ isMainMenuActive = true; gm->getStateManager()->dettachAppState(activeState); - //detachGui(); Vector2 pos = Vector2(100, 100); resumeButton = new ResumeButton(guiState, this, Vector2(pos.x, pos.y), Vector2(150, 50), "Resume", true); consoleButton = new ConsoleButton(guiState, this, Vector2(pos.x, pos.y + 60), Vector2(150, 50), "Console", true); @@ -382,13 +343,11 @@ namespace battleship{ guiState->addButton(optionsButton); guiState->addButton(mainMenuButton); guiState->addButton(exitButton); - //gameManager->getDevice()->getSceneManager()->getActiveCamera()->setVisible(false); } else { isMainMenuActive = false; gm->getStateManager()->attachAppState(activeState); - //attachGui(); guiState->removeAllCheckboxes(); guiState->removeAllListboxes(); guiState->removeAllSliders(); @@ -399,7 +358,6 @@ namespace battleship{ guiState->removeButton("Options"); guiState->removeButton("Exit"); guiState->removeButton("Resume"); - //gameManager->getDevice()->getSceneManager()->getActiveCamera()->setVisible(true); } } diff --git a/inGameAppState.h b/inGameAppState.h index 2319635..da77a5b 100755 --- a/inGameAppState.h +++ b/inGameAppState.h @@ -15,7 +15,6 @@ namespace battleship{ struct Fx { s64 initTime, time; - //irr::scene::IParticleSystemSceneNode *node=nullptr; sf::Sound *sfx = nullptr; }; diff --git a/jet.cpp b/jet.cpp index ab7ef84..a38cf67 100755 --- a/jet.cpp +++ b/jet.cpp @@ -141,9 +141,5 @@ namespace battleship{ dirVec = rotQuat * dirVec, upVec = rotQuat * upVec; horAngle = angle; float yAngle = model->getOrientation().y; - /* - node->setOrientation(vector3df(angle, 0, 0)); - node->setOrientation(vector3df(angle, yAngle, 0)); - */ } } diff --git a/jet.h b/jet.h index dd54960..265da92 100755 --- a/jet.h +++ b/jet.h @@ -14,7 +14,6 @@ namespace battleship{ class Jet : public Unit { public: Jet(Player*, vb01::Vector3, int, bool); - //virtual void attack(Order); virtual void update(); inline void setJetId(int i){this->jetId = i;} inline void setAircraftCarrier(AircraftCarrier *a){aircraftCarrier = a;} diff --git a/missileJet.cpp b/missileJet.cpp index 2397b3f..44ae2db 100755 --- a/missileJet.cpp +++ b/missileJet.cpp @@ -53,32 +53,4 @@ namespace battleship{ missiles--; lastFireTime=getTime(); } - - void MissileJet::installMissiles(bool aam){ - /* - if(!missilesInstalled){ - missiles=2; - GameManager *gm = GameManager::getSingleton(); - ISceneManager *smgr = gm->getDevice()->getSceneManager(); - IVideoDriver *driver = gm->getDevice()->getVideoDriver(); - - for(int i=0;igetMesh(projectileData::meshPath[id][i]); - missileNodes[i]=smgr->addAnimatedMeshSceneNode(missileMesh); - ITexture *diffuseTexture = driver->getTexture(projectileData::diffuseMapTextPath[id][i]); - - if (!diffuseTexture) - diffuseTexture = driver->getTexture(DEFAULT_TEXTURE); - - missileNodes[i]->setMaterialTexture(0, diffuseTexture); - missileNodes[i]->setMaterialFlag(EMF_LIGHTING, false); - missileNodes[i]->setPosition(projectileData::pos[id][aam][i]); - missileNodes[i]->setParent(node); - } - - type=(MissileType)aam; - missilesInstalled=true; - } - */ - } } diff --git a/optionsButton.cpp b/optionsButton.cpp index f8250e0..3c014d8 100755 --- a/optionsButton.cpp +++ b/optionsButton.cpp @@ -29,10 +29,6 @@ namespace battleship{ } void OptionsButton::BackButton::onClick() { GameManager *gm = GameManager::getSingleton(); - /* - gm->detachAllBitmapTexts(); - gm->detachAllImages(); - */ state->removeAllListboxes(); state->removeAllCheckboxes(); state->removeAllSliders(); @@ -52,7 +48,6 @@ namespace battleship{ OkButton *okButton = new OkButton(); DefaultsButton *defaultsButton = new DefaultsButton(); BackButton *returnButton = new BackButton(); - //defaultsButton->moveText(-25, 0); state->addButton(okButton); state->addButton(defaultsButton); state->addButton(returnButton); @@ -97,11 +92,6 @@ namespace battleship{ Textbox *mouseSensitivityTextbox = new Textbox(Vector2(pos.x + 320, pos.y - 10), Vector2(100, 20), font); Checkbox *reverseMouseCheckbox = new Checkbox(Vector2(pos.x, pos.y + 50), font); - /* - gm->attachBitmapText(new BitmapText("MouseSensitivity", vector2d(gm->getWidth() / 3 - 90, gm->getHeight() / 4 - 5), font)); - gm->attachBitmapText(new BitmapText("ReverseMouse", vector2d(gm->getWidth() / 3 + 20, gm->getHeight() / 4 + 50), font)); - */ - state->addTextbox(mouseSensitivityTextbox); state->addSlider(mouseSensitivitySlider); state->addCheckbox(reverseMouseCheckbox); @@ -134,14 +124,6 @@ namespace battleship{ Checkbox *parallaxMapCheckbox = new Checkbox(Vector2(pos.x, pos.y + 90), font); Checkbox *specularMapCheckbox = new Checkbox(Vector2(pos.x, pos.y + 110), font); - /* - gm->attachBitmapText(new BitmapText("Fullscreen", vector2d(pos.X + 20, pos.Y + 30), font)); - gm->attachBitmapText(new BitmapText("VSync", vector2d(pos.X + 20, pos.Y + 50), font)); - gm->attachBitmapText(new BitmapText("Normal map", vector2d(pos.X + 20, pos.Y + 70), font)); - gm->attachBitmapText(new BitmapText("Parallax map", vector2d(pos.X + 20, pos.Y + 90), font)); - gm->attachBitmapText(new BitmapText("Specular map", vector2d(pos.X + 20, pos.Y + 110), font)); - */ - state->addListbox(resolutionsListbox); state->addCheckbox(fullscreenCheckbox); state->addCheckbox(vsyncCheckbox); @@ -184,12 +166,6 @@ namespace battleship{ Textbox *udpTextbox = new Textbox(Vector2(pos.x, pos.y + 30), Vector2(100, 20), font); Textbox *playerNameTextbox = new Textbox(Vector2(pos.x, pos.y + 60), Vector2(100, 20), font); - /* - gm->attachBitmapText(new BitmapText("TCP port", vector2d(pos.X - 50, pos.Y), font)); - gm->attachBitmapText(new BitmapText("UDP port", vector2d(pos.X - 50, pos.Y + 30), font)); - gm->attachBitmapText(new BitmapText("Player name", vector2d(pos.X - 65, pos.Y + 60), font)); - */ - state->addTextbox(tcpTextbox); state->addTextbox(udpTextbox); state->addTextbox(playerNameTextbox); @@ -209,7 +185,6 @@ namespace battleship{ VideoTab *videoTab = new VideoTab(); AudioTab *audioTab = new AudioTab(); MultiplayerTab *mupltiplayerTab = new MultiplayerTab(); - //mupltiplayerTab->moveText(-20, 0); state->addButton(controlsTab); state->addButton(mouseTab); state->addButton(videoTab); diff --git a/optionsButton.h b/optionsButton.h index fdfbba6..91bfa60 100755 --- a/optionsButton.h +++ b/optionsButton.h @@ -66,55 +66,6 @@ namespace battleship { void onClick(); }; virtual void onClick(); - /* - class ReturnButton :public Button { - public: - ReturnButton(GuiAppState *state, GameManager *gM, vector2d pos, vector2d size, stringw name, bool separate) :Button(gM, pos, size, name, separate) { - this->state = state; - } - void onClick() { - state->removeAllListboxes(); - state->removeAllCheckboxes(); - state->removeAllTextboxes(); - state->removeAllSliders(); - IVideoDriver *driver = gameManager->getDevice()->getVideoDriver(); - SpButton *spButton = new SpButton(state, gameManager, vector2d(driver->getScreenSize().Width / 16, driver->getScreenSize().Height / 12), vector2d(150, 40), "Singleplayer", true); - OptionsButton *optionsButton = new OptionsButton(state, gameManager, vector2d(driver->getScreenSize().Width / 16, driver->getScreenSize().Height / 12 * 2), vector2d(150, 40), "Options", true); - ExitButton *exitButton = new ExitButton(gameManager, vector2d(driver->getScreenSize().Width / 16, driver->getScreenSize().Height / 12 * 3), vector2d(150, 40), "Exit", true); - state->addButton(spButton); - state->addButton(optionsButton); - state->addButton(exitButton); - state->removeButton("Controls"); - state->removeButton("Mouse"); - state->removeButton("Video"); - state->removeButton("Audio"); - state->removeButton("Multiplayer"); - state->removeAllListboxes(); - state->removeAllCheckboxes(); - state->removeAllSliders(); - state->removeAllTextboxes(); - state->removeButton("Back"); - } - private: - GuiAppState *state; - }; - */ - /*ControlsTab *controlsTab = new ControlsTab(state, this->gameManager, vector2d(gameManager->getWidth() / 4, gameManager->getHeight() / 10), vector2d(100, 50), "Controls", true); - MouseTab *mouseTab = new MouseTab(state, this->gameManager, vector2d(gameManager->getWidth() / 4, gameManager->getHeight() / 10 + 60), vector2d(100, 50), "Mouse", true); - VideoTab *videoTab = new VideoTab(state, this->gameManager, vector2d(gameManager->getWidth() / 4, gameManager->getHeight() / 10 + 120), vector2d(100, 50), "Video", true); - AudioTab *audioTab = new AudioTab(state, this->gameManager, vector2d(gameManager->getWidth() / 4, gameManager->getHeight() / 10 + 180), vector2d(100, 50), "Audio", true); - MultiplayerTab *mupltiplayerTab = new MultiplayerTab(state, this->gameManager, vector2d(gameManager->getWidth() / 4, gameManager->getHeight() / 10 + 240), vector2d(100, 50), "Multiplayer", true); - //ReturnButton *returnButton = new ReturnButton(state, this->gameManager, vector2d(50, gameManager->getHeight() - 150), vector2d(140, 50), "Back", true); - //state->addButton(returnButton); - mupltiplayerTab->moveText(-20, 0); - state->addButton(controlsTab); - state->addButton(mouseTab); - state->addButton(videoTab); - state->addButton(audioTab); - state->addButton(mupltiplayerTab); - state->removeButton("Exit"); - state->removeButton("Singleplayer"); - state->removeButton("Options");*/ GuiAppState *state; }; } diff --git a/projectile.cpp b/projectile.cpp index c834700..cee5620 100755 --- a/projectile.cpp +++ b/projectile.cpp @@ -32,13 +32,8 @@ namespace battleship{ this->rayLength=projectileData::length[id][weaponTypeId][weaponId]; GameManager *gm = GameManager::getSingleton(); - //this->node=node; if(!node){ - /* - mesh = smgr->getMesh(projectileData::meshPath[id][weaponTypeId]); - this->node = smgr->addAnimatedMeshSceneNode(mesh); - */ this->node = new Model((projectileData::meshPath[id][weaponTypeId])); Material *mat = new Material(Root::getSingleton()->getLibPath() + "texture"); mat->addBoolUniform("lightingEnabled", false); @@ -46,11 +41,6 @@ namespace battleship{ Texture *diffuseTexture = new Texture(f, 1, false); mat->addTexUniform("textures[0]", diffuseTexture, true); this->node->setMaterial(mat); - - /* - if (!diffuseTexture) - diffuseTexture = driver->getTexture(DEFAULT_TEXTURE); - */ } this->node->setPosition(pos); @@ -61,7 +51,6 @@ namespace battleship{ speed = projectileData::speed[id][weaponTypeId][weaponId]; float angle = dirVec.getAngleBetween(Vector3(0, 0, -1)); angle = Quaternion(angle, upVec) * Vector3(0, 0, -1) == dirVec ? angle : -angle; - //this->node->setRotation(vector3df(0, angle / PI * 180, 0)); string p1 = PATH + "Sounds/" + unitData::name[id] + "s/" + projectileData::name[id][weaponTypeId] + ".ogg"; string p2 = PATH + "Sounds/Explosions/explosion03" + to_string(rand() % 4) + ".ogg"; @@ -78,10 +67,6 @@ namespace battleship{ } Projectile::~Projectile(){ - /* - ISceneManager *smgr = GameManager::getSingleton()->getDevice()->getSceneManager(); - node->getParent()->removeChild(node); - */ } void Projectile::update() { @@ -92,13 +77,6 @@ namespace battleship{ } void Projectile::checkForCollision() { - //ISceneNode *collNode = castRay(GameManager::getSingleton()->getSceneManager(),pos,pos+dirVec*rayLength); - /* - Ray::castRay(pos, pos + dirVec, ); - - if (pos.y < -7 || (collNode&&collNode != unit->getNode())) - explode(collNode); - */ } void Projectile::explode(Node *collNode) { @@ -123,12 +101,6 @@ namespace battleship{ } void Projectile::debug(){ - /* - IVideoDriver *driver = GameManager::getSingleton()->getDevice()->getVideoDriver(); - driver->draw3DLine(pos,pos+dirVec,SColor(255,0,0,255)); - driver->draw3DLine(pos,pos+leftVec,SColor(255,255,0,0)); - driver->draw3DLine(pos,pos+upVec,SColor(255,0,255,0)); - */ } void Projectile::orientProjectile(Vector3 orientVec){ @@ -143,6 +115,5 @@ namespace battleship{ Quaternion rotQuat=Quaternion(projAngle/180*PI,leftVec); dirVec=rotQuat*dirVec; upVec=rotQuat*upVec; - //node->setRotation(vector3df(projAngle,rotAngle,0)); } } diff --git a/shell.cpp b/shell.cpp index eac3eb9..103606d 100755 --- a/shell.cpp +++ b/shell.cpp @@ -34,10 +34,5 @@ namespace battleship{ float tanAngle = -atan((speed * sin(angle) + g * time) / (speed * cos(angle))); Quaternion rotQuat = Quaternion(tanAngle, leftVec); dirVec = rotQuat*straightVec, upVec = rotQuat * Vector3(0, 1, 0); - /* - Vector3 rotVec = node->getOrientation(); - rotVec=vector3df(tanAngle/PI*180,rotVec.Y,rotVec.Z); - node->setRotation(rotVec); - */ } } diff --git a/tooltip.cpp b/tooltip.cpp index bab9172..a4d2681 100644 --- a/tooltip.cpp +++ b/tooltip.cpp @@ -6,23 +6,11 @@ using namespace vb01; namespace battleship{ Tooltip::Tooltip(Vector2 pos, string entry){ this->pos = pos; - /* - GameManager *gm = GameManager::getSingleton(); - text=new BitmapText(entry,pos,gm->getDevice()->getGUIEnvironment()->getFont(PATH + "Fonts/fontcourier.bmp")); - gm->attachBitmapText(text); - */ } Tooltip::~Tooltip(){ - //GameManager::getSingleton()->detachBitmapText(text); } void Tooltip::update(){ - /* - IVideoDriver *driver=GameManager::getSingleton()->getDevice()->getVideoDriver(); - dimension2d dim=text->getFont()->getDimension(text->getText().c_str()); - driver->draw2DRectangle(SColor(255,0,0,0),recti(pos.X,pos.Y,pos.X+dim.Width,pos.Y+dim.Height),nullptr); - driver->draw2DRectangleOutline(recti(pos-vector2di(1,1),dimension2df(dim.Width+1,dim.Height+1)),SColor(255,255,0,0)); - */ } } diff --git a/tooltip.h b/tooltip.h index 2939558..68b8020 100644 --- a/tooltip.h +++ b/tooltip.h @@ -11,7 +11,6 @@ namespace battleship{ void update(); private: vb01::Vector2 pos; - //BitmapText *text; }; } diff --git a/torpedo.h b/torpedo.h index 0da6e9a..b81f930 100755 --- a/torpedo.h +++ b/torpedo.h @@ -10,7 +10,6 @@ namespace battleship{ Torpedo(Unit*, vb01::Vector3, vb01::Vector3, vb01::Vector3, vb01::Vector3, int, int, int); ~Torpedo(){} void update(); - //void explode() }; } diff --git a/unit.cpp b/unit.cpp index 1b891c3..89f104c 100755 --- a/unit.cpp +++ b/unit.cpp @@ -49,12 +49,6 @@ namespace battleship{ root->getRootNode()->attachChild(model); placeUnit(pos); - /* - light = smgr->addLightSceneNode(node, vector3df(0, 2, 0), SColor(255, 255, 255, 255), lineOfSight); - light->setVisible(false); - model->setVisible(false); - */ - selectionSfxBuffer = new sf::SoundBuffer(); string p = PATH + "Sounds/" + unitData::name[id] + "s/selection.ogg"; @@ -83,12 +77,6 @@ namespace battleship{ } Unit::~Unit() { - /* - GameManager *gm = GameManager::getSingleton(); - driver->removeTexture(node->getMaterial(0).getTexture(0)); - node->removeChild(light); - node->getParent()->removeChild(node); - */ } void Unit::update() { @@ -110,7 +98,6 @@ namespace battleship{ if (selected) { displayUnitStats(); - drawCuboid(); } if (health <= 0) @@ -128,40 +115,6 @@ namespace battleship{ hpBackgroundNode->setPosition(Vector3(shiftedX, screenPos.y, .1)); } - void Unit::drawCuboid() { - /* - IVideoDriver *driver = GameManager::getSingleton()->getDevice()->getVideoDriver(); - driver->setTransform(ETS_WORLD, IdentityMatrix); - - for (int i = 0; i < 8; i++) { - vector3df vec = unitCornerPoints[id][i]; - vector3df yVec; - vec = leftVec * vec.X + upVec * vec.Y - dirVec * vec.Z; - if (0 <= i && i < 4) - yVec = vector3df(0, unitCuboidDimensions[id][i].Y, 0); - else if (i >= 4) - yVec = vector3df(0, -unitCuboidDimensions[id][i].Y, 0); - quaternion rotQuat = rotQuat.fromAngleAxis(PI / 2 * i, vector3df(0, 1, 0)); - vector3df vec1 = rotQuat * (-leftVec * unitCuboidDimensions[id][i].X), vec2 = rotQuat * (-dirVec * unitCuboidDimensions[id][i].Z); - driver->draw3DLine(pos + vec, pos + vec + vec1); - driver->draw3DLine(pos + vec, pos + vec + vec2); - driver->draw3DLine(pos + vec, pos + vec + yVec); - } - */ - } - - void Unit::debug() { - /* - IVideoDriver *driver = GameManager::getSingleton()->getDevice()->getVideoDriver(); - driver->setTransform(ETS_WORLD, IdentityMatrix); - driver->setMaterial(createLineMaterial()); - float length = unitAxisLength[id]; - driver->draw3DLine(pos, pos + dirVec * length, SColor(255, 0, 0, 255)); - driver->draw3DLine(pos, pos + leftVec * length, SColor(255, 255, 0, 0)); - driver->draw3DLine(pos, pos + upVec * length, SColor(255, 0, 255, 0)); - */ - } - void Unit::executeOrders() { if (orders.size() > 0) { Order order = orders[0]; @@ -300,7 +253,6 @@ namespace battleship{ Quaternion rotQuat = Quaternion(projAngle / 180 * PI, leftVec); dirVec = rotQuat * dirVec; upVec = rotQuat * upVec; - //node->setRotation(vector3df(projAngle,rotAngle,0)); } Vector3 Unit::getCorner(int i) { @@ -338,13 +290,5 @@ namespace battleship{ orderLineDispTime = getTime(); } - /* - SMaterial Unit::createLineMaterial() { - SMaterial mat; - mat.Lighting = false; - return mat; - } - */ - void Unit::addProjectile(Projectile *p) {((InGameAppState*)GameManager::getSingleton()->getStateManager()->getAppStateByType((int)AppStateType::IN_GAME_STATE))->addProjectile(p);} } diff --git a/unit.h b/unit.h index 198e949..77cac1c 100755 --- a/unit.h +++ b/unit.h @@ -53,7 +53,6 @@ namespace battleship{ ~Unit(); virtual void update(); virtual void blowUp(); - virtual void debug(); virtual void halt(); void toggleSelection(bool); void setOrder(Order); @@ -71,7 +70,6 @@ namespace battleship{ inline vb01::Vector2 getScreenPos(){return screenPos;} inline vb01::Vector3 getPos() {return pos;} inline vb01::Vector3* getPosPtr() {return &pos;} - //inline ILightSceneNode* getLight() {return light;} inline float getLineOfSight() {return lineOfSight;} inline float getWidth() {return width;} inline float getHeight() {return height;} @@ -92,7 +90,6 @@ namespace battleship{ inline int getNextPatrolPointId(int numPoints) {return patrolPointId == numPoints - 1 ? 0 : patrolPointId + 1;} inline bool canDisplayOrderLine(){return vb01::getTime() - orderLineDispTime < orderVecDispLength;} - //ILightSceneNode *light; const int orderVecDispLength = 2000; sf::SoundBuffer *selectionSfxBuffer; sf::Sound *selectionSfx = nullptr; @@ -102,7 +99,6 @@ namespace battleship{ protected: Player *player; MoveDir moveDir = MoveDir::FORWARD; - //vb01::Material createLineMaterial(); unitData::UNIT_TYPE type; vb01::Vector2 screenPos; std::vector orders; diff --git a/util.cpp b/util.cpp index ee75e42..2033f65 100755 --- a/util.cpp +++ b/util.cpp @@ -90,7 +90,6 @@ namespace battleship{ state->removeAllListboxes(); state->removeAllSliders(); state->removeAllTextboxes(); - //GameManager::getSingleton()->detachAllBitmapTexts(); makeTitlescreenButtons(state); state->removeButton("Play"); state->removeButton("Back"); @@ -106,12 +105,7 @@ namespace battleship{ difficulties.push_back("Hard"); factions.push_back("0"); factions.push_back("1"); - /* - gm->attachBitmapText(new BitmapText("Difficulty", vector2d(pos.X, pos.Y - 20), font)); - gm->attachBitmapText(new BitmapText("Faction", vector2d(pos.X + 110, pos.Y - 20), font)); - gm->attachBitmapText(new BitmapText("Player", vector2d(pos.X - 40, pos.Y), font)); - gm->attachBitmapText(new BitmapText("CPU", vector2d(pos.X - 20, pos.Y + 30), font)); - */ + string font = PATH + "Fonts/batang.ttf"; Listbox *cpuDifficulty = new Listbox(Vector2(pos.x, pos.y + 30), Vector2(100, 20), difficulties, 3, font); Listbox *cpuFaction = new Listbox(Vector2(pos.x + 110, pos.y + 30), Vector2(100, 20), factions, 2, font); @@ -238,28 +232,4 @@ namespace battleship{ spacePos = vec4(spacePos.x / spacePos.w, spacePos.y / spacePos.w, spacePos.z / spacePos.w, spacePos.w); return Vector3(spacePos.x, spacePos.y, spacePos.z); } - - /* - bool isWithinRect(vector3df c1,vector3df c2, vector3df p, vector3df dir){ - float mainAngle=getAngleBetween(c1-c2,dir); - float mainHyp=(c1-c2).getLength(); - float mainWidth=cos(mainAngle)*mainHyp,mainLength=sin(mainAngle)*mainHyp; - vector3df center=(c2-c1)/2+c1; - float angle=getAngleBetween(center-p,dir); - float hyp=(center-p).getLength(); - float width=cos(angle)*hyp,length=sin(angle)*hyp; - return width<=mainWidth/2&&length<=mainLength/2?true:false; - } - bool isWithinCuboid(vector3df c0, vector3df c1,vector3df c2,vector3df c3, vector3df p0){ - vector3df aVec=c1-c0,bVec=c2-c0,cVec=c3-c0,pVec=p0-c0; - float a=aVec.getLength(),b=bVec.getLength(),c=cVec.getLength(),p=pVec.getLength(); - float aAngle=getAngleBetween(pVec,aVec); - float bAngle=getAngleBetween(pVec,bVec); - float cAngle=getAngleBetween(pVec,cVec); - bool withinA=aAngle<=PI/2&&p*cos(aAngle)<=a; - bool withinB=bAngle<=PI/2&&p*cos(bAngle)<=b; - bool withinC=cAngle<=PI/2&&p*cos(cAngle)<=c; - return withinA&&withinB&&withinC; - } - */ } diff --git a/util.h b/util.h index 9dafd7c..4ec0181 100755 --- a/util.h +++ b/util.h @@ -27,10 +27,6 @@ namespace battleship{ void makeTitlescreenButtons(GuiAppState*); vb01::Vector2 spaceToScreen(vb01::Vector3); vb01::Vector3 screenToSpace(vb01::Vector2); - /* - bool isWithinRect(irr::core::vector3df,irr::core::vector3df,irr::core::vector3df,irr::core::vector3df); - bool isWithinCuboid(irr::core::vector3df,irr::core::vector3df,irr::core::vector3df,irr::core::vector3df,irr::core::vector3df); - */ } #endif diff --git a/vessel.cpp b/vessel.cpp index 9db558d..27adbbc 100755 --- a/vessel.cpp +++ b/vessel.cpp @@ -48,28 +48,6 @@ namespace battleship{ mantlets.push_back(mantlet); } - /* - fxNode=smgr->addParticleSystemSceneNode(false); - emitter=fxNode->createPointEmitter(dirVec, - 10,10, - SColor(0,255,255,255), - SColor(0,255,255,255), - 500,500,0, - dimension2df(5,5), - dimension2df(10,10)); - fxNode->setEmitter(emitter); - emitter->drop(); - affector=fxNode->createFadeOutParticleAffector(); - fxNode->addAffector(affector); - affector->drop(); - fxNode->setParent(turretMantletNodes[0]); - fxNode->setMaterialFlag(EMF_LIGHTING, false); - fxNode->setMaterialFlag(EMF_ZWRITE_ENABLE, false); - fxNode->setMaterialTexture(0, driver->getTexture(PATH+"Textures/Explosions/fire.bmp")); - fxNode->setMaterialType(EMT_TRANSPARENT_ADD_COLOR); - fxNode->setVisible(false); - */ - maxAngle = unitData::turretMaxAngle[unitId][turretId] / 180 * PI; rotationSpeed = unitData::turretRotationSpeed[unitId][turretId] / 180 * PI; @@ -85,32 +63,9 @@ namespace battleship{ } void Vessel::Turret::update() { - /* - Node *rootNode = Root::getSingleton()->getRootNode(); - Vector3 turretPosition = turret->localToGlobalPosition(Vector3::VEC_ZERO); - float hullAngle = PI / 180; - float turretAngle = PI / 180 * angle; - quaternion rotQuat = rotQuat.fromAngleAxis(hullAngle + turretAngle, vector3df(0, 1, 0)); - quaternion offsetQuat = offsetQuat.fromAngleAxis(PI / 180 * unitData::turretAngleOffset[unitId][turretId], vector3df(0, 1, 0)); - emitter->setDirection(dirVec); - if(getTime()-lastShotTime>30&&fxNode->isVisible()) - fxNode->setVisible(false); - */ dirVec = node->getGlobalAxis(2), leftVec = node->getGlobalAxis(0); } - void Vessel::Turret::debug() { - /* - float length = turretAxisLength[unitId][turretId]*0 + 1; - IVideoDriver *driver = GameManager::getSingleton()->getDevice()->getVideoDriver(); - driver->setTransform(ETS_WORLD, IdentityMatrix); - driver->setMaterial(mat); - driver->draw3DLine(turretPosition, turretPosition + dirVec*length, SColor(255, 0, 0, 255)); - driver->draw3DLine(turretPosition, turretPosition + leftVec*length, SColor(255, 255, 0, 0)); - driver->draw3DLine(turretPosition, turretPosition + upVec*length, SColor(255, 0, 255, 0)); - */ - } - Vector3 Vessel::Turret::getInitDir(int dirType){ Vector3 initDirs[3]; @@ -141,17 +96,6 @@ namespace battleship{ } void Vessel::Turret::fire() { - /* - fxNode->setVisible(true); - quaternion rotQuat = rotQuat.fromAngleAxis(barrelAngle / 180 * PI, leftVec); - int barId = 0; - vector3df startPos = vessel->getPos() + vessel->getLeftVec() * turretNode->getPosition().X + vessel->getUpVec() * turretNode->getPosition().Y - vessel->getDirVec() * turretNode->getPosition().Z; - startPos += rotQuat * (leftVec * turretMantletNodes[barId]->getPosition().X + upVec * turretMantletNodes[barId]->getPosition().Y + dirVec * turretMantletNodes[barId]->getPosition().Z); - startPos += rotQuat * (leftVec * turretBarrelNodes[barId]->getPosition().X + upVec * turretBarrelNodes[barId]->getPosition().Y + dirVec * turretBarrelNodes[barId]->getPosition().Z); - startPos += rotQuat * (leftVec * projectileData::pos[unitId][0][turretId].X + upVec * projectileData::pos[unitId][0][turretId].Y + dirVec * projectileData::pos[unitId][0][turretId].Z); - vessel->addProjectile(new Shell(vessel, startPos, rotQuat*dirVec, rotQuat*leftVec, rotQuat*upVec, unitId, 0, turretId)); - */ - if(sfx) sfx->play(); @@ -196,9 +140,4 @@ namespace battleship{ } } } - - void Vessel::debug() { - for (Turret *t : turrets) - t->debug(); - } } diff --git a/vessel.h b/vessel.h index 215c62f..13876a9 100755 --- a/vessel.h +++ b/vessel.h @@ -21,8 +21,6 @@ namespace battleship { protected: void attack(Order); private: - void debug(); - class Turret { public: struct Mantlet{ @@ -33,7 +31,6 @@ namespace battleship { void update(); void fire(); void rotate(double); - void debug(); vb01::Vector3 getInitDir(int); inline vb01::Vector3 getDirVec(){return dirVec;} inline vb01::Vector3 getLeftVec(){return leftVec;}