mirror of
https://github.com/glest/glest-source.git
synced 2025-10-03 10:51:55 +02:00
Added more debugging and option to disable new streflop usage.
This commit is contained in:
@@ -13,8 +13,7 @@
|
||||
#ifndef _SHARED_GRAPHICS_VEC_H_
|
||||
#define _SHARED_GRAPHICS_VEC_H_
|
||||
|
||||
#include "streflop_cond.h"
|
||||
//#include <cmath>
|
||||
#include "math_wrapper.h"
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
@@ -127,7 +126,11 @@ public:
|
||||
}
|
||||
|
||||
float length() const{
|
||||
#ifdef USE_STREFLOP
|
||||
return static_cast<float>(streflop::sqrt(static_cast<float>(x*x + y*y)));
|
||||
#else
|
||||
return static_cast<float>(sqrt(static_cast<float>(x*x + y*y)));
|
||||
#endif
|
||||
}
|
||||
|
||||
void normalize(){
|
||||
@@ -266,7 +269,11 @@ public:
|
||||
}
|
||||
|
||||
float length() const{
|
||||
#ifdef USE_STREFLOP
|
||||
return static_cast<float>(streflop::sqrt(x*x + y*y + z*z));
|
||||
#else
|
||||
return static_cast<float>(sqrt(x*x + y*y + z*z));
|
||||
#endif
|
||||
}
|
||||
|
||||
void normalize(){
|
||||
|
@@ -108,15 +108,15 @@ private:
|
||||
int lastMouseX[3];
|
||||
int lastMouseY[3];
|
||||
|
||||
static int64 lastMouseEvent; /** for use in mouse hover calculations */
|
||||
static unsigned int lastMouseEvent; /** for use in mouse hover calculations */
|
||||
static MouseState mouseState;
|
||||
static Vec2i mousePos;
|
||||
static bool isKeyPressedDown;
|
||||
static bool isFullScreen;
|
||||
static SDL_keysym keystate;
|
||||
|
||||
static void setLastMouseEvent(int64 lastMouseEvent) {Window::lastMouseEvent = lastMouseEvent;}
|
||||
static int64 getLastMouseEvent() {return Window::lastMouseEvent;}
|
||||
static void setLastMouseEvent(unsigned int lastMouseEvent) {Window::lastMouseEvent = lastMouseEvent;}
|
||||
static unsigned int getLastMouseEvent() {return Window::lastMouseEvent;}
|
||||
|
||||
static const MouseState &getMouseState() {return Window::mouseState;}
|
||||
static void setMouseState(MouseButton b, bool state) {Window::mouseState.set(b, state);}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// ==============================================================
|
||||
// This file is part of Glest Shared Library (www.glest.org)
|
||||
//
|
||||
// Copyright (C) 2001-2008 Marti<EFBFBD>o Figueroa
|
||||
// Copyright (C) 2001-2008 Martio Figueroa
|
||||
//
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
|
@@ -15,10 +15,10 @@
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include "thread.h"
|
||||
//#include "thread.h"
|
||||
|
||||
using std::string;
|
||||
using namespace Shared::Platform;
|
||||
//using namespace Shared::Platform;
|
||||
|
||||
namespace Shared{ namespace Util{
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
this->fileStream = NULL;
|
||||
this->debugLogFileName = "";
|
||||
this->fileStreamOwner = false;
|
||||
this->mutex = NULL;
|
||||
//this->mutex = NULL;
|
||||
}
|
||||
SystemFlagsType(DebugType debugType) {
|
||||
this->debugType = debugType;
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
this->fileStream = NULL;
|
||||
this->debugLogFileName = "";
|
||||
this->fileStreamOwner = false;
|
||||
this->mutex = NULL;
|
||||
//this->mutex = NULL;
|
||||
}
|
||||
SystemFlagsType(DebugType debugType,bool enabled,
|
||||
std::ofstream *fileStream,std::string debugLogFileName) {
|
||||
@@ -62,14 +62,14 @@ public:
|
||||
this->fileStream = fileStream;
|
||||
this->debugLogFileName = debugLogFileName;
|
||||
this->fileStreamOwner = false;
|
||||
this->mutex = mutex;
|
||||
//this->mutex = mutex;
|
||||
}
|
||||
|
||||
bool enabled;
|
||||
std::ofstream *fileStream;
|
||||
std::string debugLogFileName;
|
||||
bool fileStreamOwner;
|
||||
Mutex *mutex;
|
||||
//Mutex *mutex;
|
||||
};
|
||||
|
||||
protected:
|
||||
@@ -122,6 +122,7 @@ template<typename T>
|
||||
void deleteMapValues(T beginIt, T endIt){
|
||||
for(T it= beginIt; it!=endIt; ++it){
|
||||
delete it->second;
|
||||
it->second = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user