mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
Merge pull request #199 from devZoGok/bf-197-gui-bugfixes
Bf 197 gui bugfixes
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
Size = {x = 150, y = 40}
|
||||
|
||||
music = {
|
||||
loop = true,
|
||||
shuffle = false,
|
||||
delay = 2000,
|
||||
tracks = {'defeat.ogg'}
|
||||
}
|
||||
|
||||
res = graphics.resolution
|
||||
overlaySize = {x = 600, y = 450}
|
||||
overlayPos = {x = .5 * (res.x - overlaySize.x), y = 200, z = 0}
|
||||
buttonSize = {x = 150, y = 40}
|
||||
buttonInitPos = {x = .5 * (res.x - buttonSize.x), y = 350, z = .1}
|
||||
|
||||
gui = {
|
||||
{
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'Defeat',
|
||||
name = 'D',
|
||||
pos = {x = 100, y = 100, z = 0},
|
||||
pos = {x = overlayPos.x + 20, y = overlayPos.y + 75, z = .1},
|
||||
scale = 1,
|
||||
font = 'batang.ttf',
|
||||
fontFirstChar = 0,
|
||||
@@ -20,17 +25,16 @@ gui = {
|
||||
},
|
||||
{
|
||||
guiType = GuiType.GUI_RECTANGLE,
|
||||
pos = {x = 100, y = 200, z = .1},
|
||||
size = {x = 600, y = 600},
|
||||
pos = overlayPos,
|
||||
size = overlaySize,
|
||||
color = {x = 0, y = 0, z = 0, w = 0.1}
|
||||
},
|
||||
{
|
||||
pos = {x = 110, y = 350, z = 0},
|
||||
size = Size,
|
||||
pos = buttonInitPos,
|
||||
size = buttonSize,
|
||||
guiType = GuiType.BUTTON,
|
||||
name = 'Leave',
|
||||
buttonType = ButtonType.STATISTICS,
|
||||
trigger = -1,
|
||||
--imagePath = ''
|
||||
}
|
||||
trigger = -1
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
headerHeight = 150
|
||||
statsInitHeight = 120
|
||||
statsSpace = 100
|
||||
fontName = 'batang.ttf'
|
||||
|
||||
gui = {
|
||||
{
|
||||
guiType = GuiType.TEXT,
|
||||
@@ -6,7 +11,7 @@ gui = {
|
||||
pos = {x = 850, y = 100, z = 0},
|
||||
zIndex = 0,
|
||||
scale = 0.5,
|
||||
font = 'batang.ttf',
|
||||
font = fontName,
|
||||
fontFirstChar = 0,
|
||||
fontLastChar = 256,
|
||||
color = {x = 1, y = 1, z = 1, w = 1}
|
||||
@@ -15,10 +20,10 @@ gui = {
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'Player',
|
||||
name = 'pl',
|
||||
pos = {x = 50, y = 200, z = 0},
|
||||
pos = {x = 50, y = headerHeight, z = 0},
|
||||
zIndex = 0,
|
||||
scale = 0.3,
|
||||
font = 'batang.ttf',
|
||||
font = fontName,
|
||||
fontFirstChar = 0,
|
||||
fontLastChar = 256,
|
||||
color = {x = 1, y = 1, z = 1, w = 1}
|
||||
@@ -27,10 +32,10 @@ gui = {
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'Vehicles built',
|
||||
name = 'vb',
|
||||
pos = {x = 150, y = 200, z = 0},
|
||||
pos = {x = 150, y = headerHeight, z = 0},
|
||||
zIndex = 0,
|
||||
scale = 0.3,
|
||||
font = 'batang.ttf',
|
||||
font = fontName,
|
||||
fontFirstChar = 0,
|
||||
fontLastChar = 256,
|
||||
color = {x = 1, y = 1, z = 1, w = 1}
|
||||
@@ -39,10 +44,10 @@ gui = {
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'Vehicles destroyed',
|
||||
name = 'vd',
|
||||
pos = {x = 450, y = 200, z = 0},
|
||||
pos = {x = 450, y = headerHeight, z = 0},
|
||||
zIndex = 0,
|
||||
scale = 0.3,
|
||||
font = 'batang.ttf',
|
||||
font = fontName,
|
||||
fontFirstChar = 0,
|
||||
fontLastChar = 256,
|
||||
color = {x = 1, y = 1, z = 1, w = 1}
|
||||
@@ -51,10 +56,10 @@ gui = {
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'Vehicles lost',
|
||||
name = 'vl',
|
||||
pos = {x = 850, y = 200, z = 0},
|
||||
pos = {x = 850, y = headerHeight, z = 0},
|
||||
zIndex = 0,
|
||||
scale = 0.3,
|
||||
font = 'batang.ttf',
|
||||
font = fontName,
|
||||
fontFirstChar = 0,
|
||||
fontLastChar = 256,
|
||||
color = {x = 1, y = 1, z = 1, w = 1}
|
||||
@@ -63,10 +68,10 @@ gui = {
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'Structures built',
|
||||
name = 'sb',
|
||||
pos = {x = 1050, y = 200, z = 0},
|
||||
pos = {x = 1050, y = headerHeight, z = 0},
|
||||
zIndex = 0,
|
||||
scale = 0.3,
|
||||
font = 'batang.ttf',
|
||||
font = fontName,
|
||||
fontFirstChar = 0,
|
||||
fontLastChar = 256,
|
||||
color = {x = 1, y = 1, z = 1, w = 1}
|
||||
@@ -75,10 +80,10 @@ gui = {
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'Structures destroyed',
|
||||
name = 'sd',
|
||||
pos = {x = 1350, y = 200, z = 0},
|
||||
pos = {x = 1350, y = headerHeight, z = 0},
|
||||
zIndex = 0,
|
||||
scale = 0.3,
|
||||
font = 'batang.ttf',
|
||||
font = fontName,
|
||||
fontFirstChar = 0,
|
||||
fontLastChar = 256,
|
||||
color = {x = 1, y = 1, z = 1, w = 1}
|
||||
@@ -87,7 +92,7 @@ gui = {
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'Structures lost',
|
||||
name = 'sl',
|
||||
pos = {x = 1720, y = 200, z = 0},
|
||||
pos = {x = 1720, y = headerHeight, z = 0},
|
||||
zIndex = 0,
|
||||
scale = 0.3,
|
||||
font = 'batang.ttf',
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
Size = {x = 150, y = 40}
|
||||
|
||||
music = {
|
||||
loop = true,
|
||||
shuffle = false,
|
||||
delay = 2000,
|
||||
tracks = {'victory.ogg'}
|
||||
}
|
||||
|
||||
res = graphics.resolution
|
||||
overlaySize = {x = 600, y = 450}
|
||||
overlayPos = {x = .5 * (res.x - overlaySize.x), y = 200, z = 0}
|
||||
buttonSize = {x = 150, y = 40}
|
||||
buttonInitPos = {x = .5 * (res.x - buttonSize.x), y = 350, z = .1}
|
||||
|
||||
gui = {
|
||||
{
|
||||
guiType = GuiType.TEXT,
|
||||
text = 'VICTORY!!!',
|
||||
name = 'V',
|
||||
pos = {x = 100, y = 100, z = 0},
|
||||
zIndex = 0,
|
||||
pos = {x = overlayPos.x + 20, y = overlayPos.y + 75, z = .1},
|
||||
scale = 1,
|
||||
font = 'batang.ttf',
|
||||
fontFirstChar = 0,
|
||||
@@ -21,25 +25,23 @@ gui = {
|
||||
},
|
||||
{
|
||||
guiType = GuiType.GUI_RECTANGLE,
|
||||
pos = {x = 100, y = 200, z = 0},
|
||||
zIndex = 1,
|
||||
size = {x = 600, y = 600},
|
||||
pos = overlayPos,
|
||||
size = overlaySize,
|
||||
color = {x = 0, y = 0, z = 0, w = 0.1}
|
||||
},
|
||||
{
|
||||
pos = {x = 100, y = 350, z = 0},
|
||||
size = Size,
|
||||
pos = buttonInitPos,
|
||||
size = buttonSize,
|
||||
guiType = GuiType.BUTTON,
|
||||
name = 'Resume',
|
||||
buttonType = ButtonType.RESUME
|
||||
},
|
||||
{
|
||||
pos = {x = 110, y = 400, z = 0},
|
||||
size = Size,
|
||||
pos = {x = buttonInitPos.x, y = buttonInitPos.y + buttonSize.y + 10, z = buttonInitPos.z},
|
||||
size = buttonSize,
|
||||
guiType = GuiType.BUTTON,
|
||||
name = 'Leave',
|
||||
buttonType = ButtonType.STATISTICS,
|
||||
trigger = -1,
|
||||
--imagePath = ''
|
||||
trigger = -1
|
||||
}
|
||||
}
|
||||
|
||||
+8
-4
@@ -120,15 +120,18 @@ namespace battleship{
|
||||
|
||||
void ActiveGameState::onAttached() {
|
||||
AbstractAppState::onAttached();
|
||||
vector<Button*> buttons = guiButtons;
|
||||
buttons.insert(buttons.end(), unitButtons.begin(), unitButtons.end());
|
||||
|
||||
ConcreteGuiManager::getSingleton()->readLuaScreenScript(
|
||||
"activeGameState.lua",
|
||||
vector<Button*>{},
|
||||
buttons,
|
||||
vector<Listbox*>{},
|
||||
vector<Checkbox*>{},
|
||||
vector<Slider*>{},
|
||||
vector<Textbox*>{},
|
||||
vector<Node*>{},
|
||||
vector<Text*>{},
|
||||
guiRects,
|
||||
guiTexts,
|
||||
"music = generateFactionMusic(" + to_string(mainPlayer->getFaction()) + ")"
|
||||
);
|
||||
|
||||
@@ -375,7 +378,6 @@ namespace battleship{
|
||||
ufCtr->removeGameObjectFrames();
|
||||
ufCtr->toggleFrameTransformations(false, false, false);
|
||||
|
||||
unitGuiScreen = "";
|
||||
ConcreteGuiManager::getSingleton()->readLuaScreenScript("activeGameState.lua");
|
||||
}
|
||||
|
||||
@@ -499,6 +501,8 @@ namespace battleship{
|
||||
vector<Unit*> selUnits = mainPlayer->getSelectedUnits();
|
||||
|
||||
for (Unit *u : units) {
|
||||
if(u->isVehicle() && ((Vehicle*)u)->getGarrisonable()) continue;
|
||||
|
||||
Node *model = u->getModel();
|
||||
|
||||
if (u->getPlayer()->getTeam() == mainPlayer->getTeam()){
|
||||
|
||||
@@ -81,7 +81,6 @@ namespace battleship{
|
||||
CursorState cursorState = CursorState::NORMAL;
|
||||
Player *mainPlayer;
|
||||
GuiAppState *guiState;
|
||||
std::string unitGuiScreen = "";
|
||||
GameObject *gameObjHoveredOn = nullptr;
|
||||
vb01::Vector2 clickPoint;
|
||||
std::vector<Unit*> unitGroups[9], prevSelectedUnits;
|
||||
|
||||
@@ -39,18 +39,13 @@ namespace battleship{
|
||||
StateManager *sm = GameManager::getSingleton()->getStateManager();
|
||||
sm->dettachAppState(sm->getAppStateByType(AppStateType::ACTIVE_STATE));
|
||||
|
||||
togglePause();
|
||||
|
||||
string endGameScreen = (victory ? "victory.lua" : "defeat.lua");
|
||||
ConcreteGuiManager::getSingleton()->readLuaScreenScript(endGameScreen);
|
||||
ConcreteGuiManager::getSingleton()->parseLuaScript(victory ? "victory.lua" : "defeat.lua");
|
||||
}
|
||||
|
||||
void Game::update(){
|
||||
updateLuaPlayers(false);
|
||||
sol::state_view SOL_LUA_VIEW = generateView();
|
||||
|
||||
for(int i = 0; i < players.size(); i++)
|
||||
SOL_LUA_VIEW["game"]["players"][i + 1] = players[i];
|
||||
|
||||
for(int i = 0; i < players.size(); i++)
|
||||
if(players[i]->isCpuPlayer()){
|
||||
string plStr = "game.players[" + to_string(i + 1) + "]";
|
||||
@@ -81,6 +76,15 @@ namespace battleship{
|
||||
FxManager::getSingleton()->update();
|
||||
}
|
||||
|
||||
void Game::updateLuaPlayers(bool resetBehaviour){
|
||||
sol::state_view SOL_LUA_VIEW = generateView();
|
||||
|
||||
for(int i = 0; i < players.size(); i++)
|
||||
SOL_LUA_VIEW["game"]["players"][i + 1] = players[i];
|
||||
|
||||
if(resetBehaviour)
|
||||
SOL_LUA_VIEW.script_file(GameManager::getSingleton()->getPath() + "Scripts/Core/playerInit.lua");
|
||||
}
|
||||
|
||||
void Game::removeAllElements(){
|
||||
generateView().script("game.players = {}");
|
||||
@@ -101,14 +105,17 @@ namespace battleship{
|
||||
|
||||
if (!paused) {
|
||||
gm->getStateManager()->dettachAppState(activeState);
|
||||
guiManager->readLuaScreenScript("gamePaused.lua", activeState->getGuiButtons());
|
||||
guiManager->parseLuaScript("gamePaused.lua");
|
||||
}
|
||||
else {
|
||||
for(string f : configData::scripts)
|
||||
generateView().script_file(gm->getPath() + f);
|
||||
|
||||
guiManager->readLuaScreenScript("inGame.lua", activeState->getGuiButtons());
|
||||
sol::state_view SOL_LUA_VIEW = generateView();
|
||||
|
||||
for(string f : configData::scripts)
|
||||
SOL_LUA_VIEW.script_file(gm->getPath() + f);
|
||||
|
||||
updateLuaPlayers(true);
|
||||
guiManager->readLuaScreenScript("inGame.lua", activeState->getGuiButtons());
|
||||
|
||||
string gop = SOL_LUA_VIEW["gameObjPrefix"], vfxp = SOL_LUA_VIEW["vfxPrefix"];
|
||||
AssetManager::getSingleton()->load(gm->getPath() + gop, true);
|
||||
AssetManager::getSingleton()->load(gm->getPath() + vfxp, true);
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace battleship{
|
||||
public:
|
||||
static Game* getSingleton();
|
||||
void update();
|
||||
void updateLuaPlayers(bool);
|
||||
void togglePause();
|
||||
void removeAllElements();
|
||||
void changeUnitPlayer(Unit*, Player*);
|
||||
|
||||
+4
-2
@@ -1,8 +1,9 @@
|
||||
#include "gameObject.h"
|
||||
#include "gameManager.h"
|
||||
#include "defConfigs.h"
|
||||
#include "unit.h"
|
||||
#include "player.h"
|
||||
#include "game.h"
|
||||
#include "unit.h"
|
||||
|
||||
#include <solUtil.h>
|
||||
|
||||
@@ -29,6 +30,7 @@ namespace battleship{
|
||||
Box *hbMesh = (Box*)hitbox->getMesh(0);
|
||||
hbMesh->setSize(Vector3(width, height, length));
|
||||
hbMesh->updateVerts(hbMesh->getMeshBase());
|
||||
hitbox->setVisible(Game::getSingleton()->isDebug());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +70,7 @@ namespace battleship{
|
||||
|
||||
hitbox = new Node(Vector3(offsetPosTable["x"], offsetPosTable["y"], offsetPosTable["z"]));
|
||||
hitbox->attachMesh(box);
|
||||
hitbox->setVisible(true);
|
||||
hitbox->setVisible(Game::getSingleton()->isDebug());
|
||||
model->attachChild(hitbox);
|
||||
}
|
||||
|
||||
|
||||
+2
-9
@@ -68,21 +68,14 @@ namespace battleship{
|
||||
cam->setPosition(Map::getSingleton()->getSpawnPoint(playerId) + Vector3(1, 1, 1) * configData::CAMERA_DISTANCE);
|
||||
cam->lookAt(Vector3(0, -1, -1).norm(), Vector3(0, 1, -1).norm());
|
||||
|
||||
mainPlayer = Game::getSingleton()->getPlayer(playerId);
|
||||
|
||||
GameManager *gm = GameManager::getSingleton();
|
||||
StateManager *stateManager = gm->getStateManager();
|
||||
GuiAppState *guiState = ((GuiAppState*)stateManager->getAppStateByType((int)AppStateType::GUI_STATE));
|
||||
activeState = new ActiveGameState(guiState, playerId);
|
||||
stateManager->attachAppState(activeState);
|
||||
|
||||
sol::state_view SOL_LUA_VIEW = generateView();
|
||||
vector<Player*> players = Game::getSingleton()->getPlayers();
|
||||
|
||||
for(int i = 0; i < players.size(); i++)
|
||||
SOL_LUA_VIEW["game"]["players"][i + 1] = players[i];
|
||||
|
||||
SOL_LUA_VIEW.script_file(gm->getPath() + "Scripts/Core/playerInit.lua");
|
||||
Game::getSingleton()->updateLuaPlayers(true);
|
||||
Map::Minimap::getSingleton()->updateImage();
|
||||
}
|
||||
|
||||
void InGameAppState::onDettached() {
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace battleship{
|
||||
private:
|
||||
bool isMainMenuActive = false;
|
||||
std::vector<std::string> modelPaths;
|
||||
Player *mainPlayer;
|
||||
int playerId;
|
||||
std::string mapName = "";
|
||||
ActiveGameState* activeState;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "map.h"
|
||||
#include "util.h"
|
||||
#include "vehicle.h"
|
||||
#include "game.h"
|
||||
#include "player.h"
|
||||
#include "gameObject.h"
|
||||
@@ -56,13 +57,16 @@ namespace battleship{
|
||||
}
|
||||
|
||||
Map::Minimap::~Minimap(){
|
||||
Node *guiNode = Root::getSingleton()->getGuiNode();
|
||||
|
||||
for(Node *node : depositIcons){
|
||||
Root::getSingleton()->getGuiNode()->dettachChild(node);
|
||||
guiNode->dettachChild(node);
|
||||
delete node;
|
||||
}
|
||||
|
||||
depositIcons.clear();
|
||||
|
||||
guiNode->dettachChild(camIcon);
|
||||
delete camIcon;
|
||||
}
|
||||
|
||||
@@ -93,11 +97,13 @@ namespace battleship{
|
||||
|
||||
Node *node = new Node(minimapPos + Vector3(iconPos.x, iconPos.y, .1) - .5 * iconSize);
|
||||
node->attachMesh(quad);
|
||||
node->setVisible(false);
|
||||
root->getGuiNode()->attachChild(node);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
//TODO add a flag to Player::getUnits* whether to include garrisoned units
|
||||
void Map::Minimap::updateImage(){
|
||||
GameManager *gm = GameManager::getSingleton();
|
||||
Map *map = Map::getSingleton();
|
||||
@@ -116,6 +122,8 @@ namespace battleship{
|
||||
vector<Unit*> units = pl->getUnits();
|
||||
|
||||
for(Unit *u : units){
|
||||
if(u->isVehicle() && ((Vehicle*)u)->getGarrisonable()) continue;
|
||||
|
||||
Vector2 coords = Vector2(
|
||||
int(u->getPos().x / mapSize.x * width),
|
||||
int(-u->getPos().z / mapSize.z * height)
|
||||
@@ -190,6 +198,9 @@ namespace battleship{
|
||||
}
|
||||
|
||||
void Map::Minimap::load(){
|
||||
for(Node *node : depositIcons)
|
||||
node->setVisible(true);
|
||||
|
||||
AssetManager *am = AssetManager::getSingleton();
|
||||
string minimapPath = GameManager::getSingleton()->getPath() + "Models/Maps/" + Map::getSingleton()->getMapName() + "/minimap.jpg";
|
||||
|
||||
@@ -203,6 +214,9 @@ namespace battleship{
|
||||
}
|
||||
|
||||
void Map::Minimap::unload(){
|
||||
for(Node *node : depositIcons)
|
||||
node->setVisible(false);
|
||||
|
||||
delete[] oldImageData;
|
||||
}
|
||||
|
||||
|
||||
+7
-4
@@ -6,6 +6,7 @@
|
||||
#include "map.h"
|
||||
|
||||
#include <stateManager.h>
|
||||
#include <solUtil.h>
|
||||
|
||||
namespace battleship{
|
||||
using namespace std;
|
||||
@@ -30,7 +31,9 @@ namespace battleship{
|
||||
ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton();
|
||||
Vector3 plCol = player->getColor();
|
||||
Root *root = Root::getSingleton();
|
||||
string fontPath = GameManager::getSingleton()->getPath() + "Fonts/batang.ttf";
|
||||
sol::state_view SOL_STATE_VIEW = generateView();
|
||||
float statsInitHeight = SOL_STATE_VIEW["statsInitHeight"], statsSpace = SOL_STATE_VIEW["statsSpace"];
|
||||
string fontName = SOL_STATE_VIEW["fontName"];
|
||||
|
||||
for(int i = 0; i < numPairs; i++){
|
||||
Text *category = guiManager->getText(unitDataPairs[i].first);
|
||||
@@ -39,11 +42,11 @@ namespace battleship{
|
||||
categoryMat->addBoolUniform("texturingEnabled", false);
|
||||
categoryMat->addVec4Uniform("diffuseColor", Vector4(plCol.x, plCol.y, plCol.z, 1));
|
||||
|
||||
Text *categoryVal = new Text(fontPath, unitDataPairs[i].second);
|
||||
Text *categoryVal = new Text(GameManager::getSingleton()->getPath() + "Fonts/" + fontName, unitDataPairs[i].second);
|
||||
categoryVal->setScale(category->getScale());
|
||||
categoryVal->setMaterial(categoryMat);
|
||||
|
||||
Node *categoryValNode = new Node(category->getNode()->getPosition() + Vector3(0, 100 * playerId, 0));
|
||||
Node *categoryValNode = new Node(category->getNode()->getPosition() + Vector3(0, statsInitHeight + statsSpace * playerId, 0));
|
||||
categoryValNode->addText(categoryVal);
|
||||
root->getGuiNode()->attachChild(categoryValNode);
|
||||
|
||||
@@ -64,7 +67,7 @@ namespace battleship{
|
||||
Game *game = Game::getSingleton();
|
||||
int numPlayers = game->getNumPlayers();
|
||||
|
||||
for(int i = 1; i < numPlayers; i++)
|
||||
for(int i = 0; i < numPlayers; i++)
|
||||
addPlayerDataGuiElements(i);
|
||||
|
||||
game->removeAllElements();
|
||||
|
||||
@@ -523,7 +523,7 @@ namespace battleship{
|
||||
ActiveGameState *activeState = (ActiveGameState*)GameManager::getSingleton()->getStateManager()->getAppStateByType(AppStateType::ACTIVE_STATE);
|
||||
|
||||
if(activeState && activeState->getPlayer())
|
||||
Map::Minimap::getSingleton()->updateImage();
|
||||
Map::Minimap::getSingleton()->updateImage();
|
||||
}
|
||||
|
||||
vector<Player*> Unit::getSelectingPlayers(){
|
||||
|
||||
+2
-9
@@ -22,16 +22,10 @@ using namespace std;
|
||||
namespace battleship{
|
||||
Vehicle::Vehicle(Player *player, int id, Vector3 pos, Quaternion rot, Unit::State state) : Unit(player, id, pos, rot, state){
|
||||
initProperties();
|
||||
|
||||
debugMat = new Material(Root::getSingleton()->getLibPath() + "texture");
|
||||
debugMat->addBoolUniform("lightingEnabled", false);
|
||||
debugMat->addBoolUniform("texturingEnabled", false);
|
||||
debugMat->addVec4Uniform("diffuseColor", Vector4::VEC_IJKL);
|
||||
}
|
||||
|
||||
Vehicle::~Vehicle(){
|
||||
removeAllPathpoints();
|
||||
delete debugMat;
|
||||
}
|
||||
|
||||
void Vehicle::update(){
|
||||
@@ -237,13 +231,12 @@ namespace battleship{
|
||||
pathPoints.push_back(pointPos);
|
||||
|
||||
Box *b = new Box(Vector3::VEC_IJK);
|
||||
b->setMaterial(debugMat);
|
||||
b->setMaterial(player->getColorMaterial());
|
||||
|
||||
Node *n = new Node(pointPos);
|
||||
n->attachMesh(b);
|
||||
|
||||
n->setVisible(Game::getSingleton()->isDebug());
|
||||
Root::getSingleton()->getRootNode()->attachChild(n);
|
||||
|
||||
debugPathPoints.push_back(n);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user