Skip to content

Commit 5bbadef

Browse files
Borrado codigo en desuso (#254)
1 parent 38e19cd commit 5bbadef

14 files changed

+15
-64
lines changed

src/SourceFiles/ClientState.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ void ClientState::render()
7878
SpritePacket sprite;
7979
while (!spritesToRender_.empty()) {
8080
sprite = spritesToRender_.front();
81-
//SDL_Game::instance()->getTexturesMngr()->getTexture(sprite.textureId)->render({sprite.posX,sprite.posY,sprite.width,sprite.height},sprite.rotationDegrees,sprite.frameNumberX,sprite.frameNumberY,sprite.flip);
8281
SDL_Game::instance()->getTexturesMngr()->getTexture(sprite.textureId)->render({ sprite.posX, sprite.posY, sprite.width, sprite.height }, (double)sprite.rotationDegrees, (us)sprite.frameNumberX, (us)sprite.frameNumberY, (SDL_RendererFlip)sprite.flip);
8382
spritesToRender_.pop();
8483
}

src/SourceFiles/Entity.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Entity::Entity(EntityManager* mngr) :
55
}
66

77
Entity::~Entity() {
8-
//cout << "Entity destroyed" << endl;
98
}
109

1110
void Entity::update()

src/SourceFiles/FireBallGenerator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ void FireBallGenerator::init() {
1212
particleEmitter_ = GETCMP1_(ParticleEmitter);
1313
boilerViewer_ = entity_->getComponent<AnimatedViewer>(ComponentType::Viewer);
1414
pos_ = col_->getPos();
15-
radius = sqrt(pow(col_->getH(0), 2) + pow(col_->getW(0), 2))/*+0.5*/; //JAJA he hecho una hipotenusa despues del instiuto
16-
//cout << "radius " << radius << endl;
15+
radius = sqrt(pow(col_->getH(0), 2) + pow(col_->getW(0), 2)); //JAJA he hecho una hipotenusa despues del instiuto
1716

1817
//initialize constants
1918
minCd_ = CONST(int, "FBGEN_MIN_COOLDOWN");

src/SourceFiles/GameState.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ void GameState::DebugInput() {
3939
InputHandler* ih = SDL_Game::instance()->getInputHandler();
4040
for (int i = 0; i < ih->getNumControllers(); i++)
4141
{
42-
/*cout << "----------------" << endl;
43-
cout << "Mando " << i << endl;
44-
cout << "----------------" << endl;*/
45-
4642
if (ih->isButtonJustDown(i, SDL_CONTROLLER_BUTTON_A)) {
4743
cout << "just pressed A" << endl;
4844
}
@@ -63,7 +59,7 @@ void GameState::DebugInput() {
6359
}
6460
b2Vec2 vI = ih->getStickDir(i, InputHandler::GAMEPADSTICK::LEFTSTICK);
6561
b2Vec2 vD = ih->getStickDir(i, InputHandler::GAMEPADSTICK::RIGHTSTICK);
66-
/*
62+
6763
if (vI.Length() != 0 || vD.Length() != 0) {
6864
cout << "STICKS" << "--------" << endl;
6965
b2Vec2 vI = ih->getStickDir(i, InputHandler::LEFTSTICK);
@@ -72,7 +68,7 @@ void GameState::DebugInput() {
7268
cout << "Der: " << vD.x << " " << vD.y << endl;
7369
cout << endl;
7470
}
75-
*/
71+
7672
double tD = ih->getTrigger(i, InputHandler::GAMEPADTRIGGER::RIGHTTRIGGER);
7773
double tI = ih->getTrigger(i, InputHandler::GAMEPADTRIGGER::LEFTTRIGGER);
7874
if (tD != 0 || tI != 0) {

src/SourceFiles/InputHandler.cpp

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ void InputHandler::clearJoysticks()
8484
for (auto& ctrl : m_gameControllers) {
8585
SDL_GameControllerClose(ctrl);
8686
}
87-
//for (unsigned int i = 0; i < SDL_NumJoysticks();
88-
// i++)
89-
//{
90-
// SDL_GameControllerClose(m_gameControllers[i]);
91-
//}
9287
}
9388
}
9489

@@ -258,10 +253,6 @@ void InputHandler::onJoyAxisChange(SDL_Event& event) {
258253
{
259254
*m_triggerValues[whichOne].first = abs(event.jaxis.value);
260255
}
261-
//else if (event.jaxis.value < -m_joystickDeadZone)
262-
//{
263-
// m_joystickValues[whichOne].first->setY(-1);
264-
//}
265256
else
266257
{
267258
*m_triggerValues[whichOne].first = 0;
@@ -305,10 +296,6 @@ void InputHandler::onJoyAxisChange(SDL_Event& event) {
305296
{
306297
*m_triggerValues[whichOne].second = abs(event.jaxis.value);
307298
}
308-
//else if (event.jaxis.value < -m_joystickDeadZone)
309-
//{
310-
// m_joystickValues[whichOne].first->setY(-1);
311-
//}
312299
else
313300
{
314301
*m_triggerValues[whichOne].second = 0;
@@ -356,14 +343,9 @@ bool InputHandler::mapJoystick(SDL_GameController* ctrl, json mapData) {
356343
SDL_Joystick* joy = SDL_GameControllerGetJoystick(ctrl);
357344
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joy), guid, bits);
358345

359-
cout << "looking for " << guid << " mapString" << endl;
360346
if (!(mapData[guid]).is_null()) {
361-
cout << "found " << guid << " mapString" << endl;
362347
string mapString = mapData[guid];
363-
cout << SDL_GameControllerMappingForGUID(SDL_JoystickGetGUID(joy)) << endl;
364348
int res = SDL_GameControllerAddMapping(mapString.c_str());
365-
cout << "-----------------------------" << endl;
366-
cout << SDL_GameControllerMappingForGUID(SDL_JoystickGetGUID(joy)) << endl;
367349

368350
return res == 1;
369351
}
@@ -380,7 +362,6 @@ inline void InputHandler::onControllerAddedEvent(const SDL_Event& event)
380362
int idOnExit = m_gameControllers.size();//su id fisica sera el lugar en el que lo inicialice SDL
381363
int gameId; //Su id del juego sera el id que lea de la id fisica
382364
if (disconnectedGameControllers_.empty()) {
383-
//cout << "Nueva conexion de mando " << m_gameControllers.size() << endl;
384365
initialiseNewController(event.cdevice.which);
385366

386367
//si es un mando nuevo, se corresponden
@@ -389,7 +370,6 @@ inline void InputHandler::onControllerAddedEvent(const SDL_Event& event)
389370
else {
390371
debugFlag_ReconectedController = true;
391372
int id = disconnectedGameControllers_.front();
392-
//cout << "Reconectado mando " << id << " en sistema" << m_gameControllers.size() << endl;
393373
initialiseNewController(event.cdevice.which);
394374
disconnectedGameControllers_.pop();
395375

@@ -400,8 +380,6 @@ inline void InputHandler::onControllerAddedEvent(const SDL_Event& event)
400380
systemToGameCtrlId.emplace(idOnExit, gameId);
401381
gameToSystemCtrlId[gameId] = idOnExit;
402382
}
403-
else
404-
cout << "No puede haber mas de 4 jugadores, desconecta un mando si quieres conectar este" << endl;
405383
}
406384

407385
inline void InputHandler::onControllerRemovedEvent(const SDL_Event& event)
@@ -413,7 +391,10 @@ inline void InputHandler::onControllerRemovedEvent(const SDL_Event& event)
413391
disconnectedGameControllers_.push(it->second);
414392
systemToGameCtrlId.erase(it);
415393
}
416-
else throw "Se ha desconectado un mando no inicializado";
394+
else {
395+
//se ha desconectado un mando no inicializado
396+
//eso es malo.
397+
}
417398
}
418399

419400
inline void InputHandler::initialiseNewController(int idOnEnter)

src/SourceFiles/MenuState.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
////////////////////////////////////////////////
2+
/////////////// IN MEMORIAM ////////////////////
3+
//Cuando todo era más simple y no había online//
4+
///////////////////////////////////////////////
5+
6+
17
/*#include "MenuState.h"
28
#include "InputHandler.h"
39
#include "SDL_Game.h"

src/SourceFiles/MidGameState.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ void MidGameState::update()
135135
if (playerRockets_[roundWinner_]->getPosUIElement().x > rocketXPositionObjective_) {
136136
currentState = waitingButton;
137137
continueText->setActive(true);
138-
//frameZoomStateEnds_ = currentFrame + zoomStateDuration_;
139138
}
140139
break;
141140

src/SourceFiles/OptionsMenuState.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ void OptionsMenuState::init()
3838

3939
OptionsText->addComponent<UIViewer>(Resources::OptionsText, b2Vec2((CONST(int, "WINDOW_WIDTH") / 2) - 340, (CONST(int, "WINDOW_HEIGHT") / 2) - 310), 2.5, 0);
4040

41-
//btns_.push_back(resumeText->addComponent<UIViewer>(Resources::ResumeText, b2Vec2((CONST(int, "WINDOW_WIDTH") / 2) - 260, (CONST(int, "WINDOW_HEIGHT") / 2) + offsetBetweenButtons_ * -1), 1.5, 0));
4241
btns_.push_back(musicText->addComponent<UIViewer>(Resources::MusicText, b2Vec2((CONST(int, "WINDOW_WIDTH") / 2 - SDL_Game::instance()->getTexturesMngr()->getTexture(Resources::MusicText)->getFrameWidth() * 1.5),
4342
(CONST(int, "WINDOW_HEIGHT") / 2) + offsetBetweenButtons_ * 0), 1.5, 0));
4443
btns_.push_back(effectsText->addComponent<UIViewer>(Resources::EffectsText, b2Vec2((CONST(int, "WINDOW_WIDTH") / 2 - SDL_Game::instance()->getTexturesMngr()->getTexture(Resources::EffectsText)->getFrameWidth() * 1.5),

src/SourceFiles/PCE_Project.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,11 @@ int main(int argc, char* argv[]) {
1717
//Colocar antes del constructor de SDL_Game
1818
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
1919

20-
/*if (SDLNet_Init() < 0) {
21-
throw;
22-
}
23-
24-
IPaddress ip;
25-
if (SDLNet_ResolveHost(&ip, nullptr, 2000) < 0) {
26-
throw;
27-
}
28-
TCPsocket masterSocket = SDLNet_TCP_Open(&ip);
29-
30-
if (!masterSocket) {
31-
throw;
32-
}*/
33-
34-
cout << sizeof(SpritePacket) << endl;
3520

3621
SDL_Game::instance()->start();
3722

3823
//descomentar para depurar
24+
//cuando todo era simple
3925
//while (true) {};
4026
return 0;
4127
}

src/SourceFiles/PlayerController.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ void PlayerController::handleInput()
103103
impulseForce_ = 0;
104104
if (kBinder_ != nullptr) kBinder_->grabbed = false;
105105
impulseCooldownTimer_ = 0;
106-
107-
//HAY QUE BORRAR-----------------------------------------------------------
108-
//viewer_->startAnimation(0, 0, -1, 1);
109-
//HAY QUE BORRAR-----------------------------------------------------------
110106
}
111107

112108
if (ib->releaseGrab()) {

0 commit comments

Comments
 (0)