mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 21:51:17 +02:00
- more code cleanup from things found in valgrind
This commit is contained in:
@@ -45,6 +45,12 @@ GraphicComponent::GraphicComponent(std::string containerName, std::string objNam
|
|||||||
enabled = true;
|
enabled = true;
|
||||||
editable = true;
|
editable = true;
|
||||||
visible = true;
|
visible = true;
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
w = 0;
|
||||||
|
h = 0;
|
||||||
|
text = "";
|
||||||
|
font = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicComponent::clearRegisteredComponents(std::string containerName) {
|
void GraphicComponent::clearRegisteredComponents(std::string containerName) {
|
||||||
|
@@ -44,6 +44,9 @@ CoreData::~CoreData() {
|
|||||||
|
|
||||||
void CoreData::load() {
|
void CoreData::load() {
|
||||||
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
||||||
|
if(data_path != "") {
|
||||||
|
endPathWithSlash(data_path);
|
||||||
|
}
|
||||||
|
|
||||||
const string dir = data_path + "data/core";
|
const string dir = data_path + "data/core";
|
||||||
Logger::getInstance().add("Core data");
|
Logger::getInstance().add("Core data");
|
||||||
|
@@ -65,6 +65,7 @@ SurfaceCell::SurfaceCell() {
|
|||||||
normal= Vec3f(0.f, 1.f, 0.f);
|
normal= Vec3f(0.f, 1.f, 0.f);
|
||||||
surfaceType= -1;
|
surfaceType= -1;
|
||||||
surfaceTexture= NULL;
|
surfaceTexture= NULL;
|
||||||
|
nearSubmerged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceCell::~SurfaceCell() {
|
SurfaceCell::~SurfaceCell() {
|
||||||
|
@@ -655,7 +655,7 @@ TextureGl::~TextureGl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TextureGl::~TextureGl() {
|
TextureGl::~TextureGl() {
|
||||||
// Need some work to get extensions properly working in Windows (use Glew lib)
|
// Need some work to get extensions properly working in Windows (use Glew lib)
|
||||||
if(glGenFramebuffersEXT) {
|
if(glGenFramebuffersEXT) {
|
||||||
if(renderBufferId != 0) {
|
if(renderBufferId != 0) {
|
||||||
glDeleteRenderbuffersEXT(1, &renderBufferId);
|
glDeleteRenderbuffersEXT(1, &renderBufferId);
|
||||||
@@ -748,7 +748,7 @@ void Texture1DGl::end(bool deletePixelBuffer) {
|
|||||||
assertGl();
|
assertGl();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Texture1DGl::end(bool deletePixelBuffer) {
|
void Texture1DGl::end(bool deletePixelBuffer) {
|
||||||
if(inited == true) {
|
if(inited == true) {
|
||||||
assertGl();
|
assertGl();
|
||||||
glDeleteTextures(1, &handle);
|
glDeleteTextures(1, &handle);
|
||||||
@@ -854,7 +854,7 @@ void Texture2DGl::end(bool deletePixelBuffer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Texture2DGl::end(bool deletePixelBuffer) {
|
void Texture2DGl::end(bool deletePixelBuffer) {
|
||||||
if(inited == true) {
|
if(inited == true) {
|
||||||
//printf("==> Deleting GL Texture [%s] handle = %d\n",getPath().c_str(),handle);
|
//printf("==> Deleting GL Texture [%s] handle = %d\n",getPath().c_str(),handle);
|
||||||
assertGl();
|
assertGl();
|
||||||
glDeleteTextures(1, &handle);
|
glDeleteTextures(1, &handle);
|
||||||
@@ -929,7 +929,7 @@ void Texture3DGl::end(bool deletePixelBuffer) {
|
|||||||
assertGl();
|
assertGl();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Texture3DGl::end(bool deletePixelBuffer) {
|
void Texture3DGl::end(bool deletePixelBuffer) {
|
||||||
if(inited == true) {
|
if(inited == true) {
|
||||||
assertGl();
|
assertGl();
|
||||||
glDeleteTextures(1, &handle);
|
glDeleteTextures(1, &handle);
|
||||||
|
@@ -37,17 +37,18 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
* of the xmlbuffer is reached. */
|
* of the xmlbuffer is reached. */
|
||||||
static int parseatt(struct xmlparser * p)
|
static int parseatt(struct xmlparser * p)
|
||||||
{
|
{
|
||||||
const char * attname;
|
const char * attname = 0;
|
||||||
int attnamelen;
|
int attnamelen = 0;
|
||||||
const char * attvalue;
|
const char * attvalue = 0;
|
||||||
int attvaluelen;
|
int attvaluelen = 0;
|
||||||
|
char sep = 0;
|
||||||
while(p->xml < p->xmlend)
|
while(p->xml < p->xmlend)
|
||||||
{
|
{
|
||||||
if(*p->xml=='/' || *p->xml=='>')
|
if(*p->xml=='/' || *p->xml=='>')
|
||||||
return 0;
|
return 0;
|
||||||
if( !IS_WHITE_SPACE(*p->xml) )
|
if( !IS_WHITE_SPACE(*p->xml) )
|
||||||
{
|
{
|
||||||
char sep;
|
sep = 0;
|
||||||
attname = p->xml;
|
attname = p->xml;
|
||||||
attnamelen = 0;
|
attnamelen = 0;
|
||||||
while(*p->xml!='=' && !IS_WHITE_SPACE(*p->xml) )
|
while(*p->xml!='=' && !IS_WHITE_SPACE(*p->xml) )
|
||||||
@@ -108,8 +109,8 @@ static int parseatt(struct xmlparser * p)
|
|||||||
* call the callback functions when needed... */
|
* call the callback functions when needed... */
|
||||||
static void parseelt(struct xmlparser * p)
|
static void parseelt(struct xmlparser * p)
|
||||||
{
|
{
|
||||||
int i;
|
int i = 0;
|
||||||
const char * elementname;
|
const char * elementname = 0;
|
||||||
while(p->xml < (p->xmlend - 1))
|
while(p->xml < (p->xmlend - 1))
|
||||||
{
|
{
|
||||||
if((p->xml)[0]=='<' && (p->xml)[1]!='?')
|
if((p->xml)[0]=='<' && (p->xml)[1]!='?')
|
||||||
|
Reference in New Issue
Block a user