About Store Forum Documentation Contact



Post Reply 
[SOLVED] Something is wrong with my gobj
Author Message
Dandruff Offline
Member

Post: #1
[SOLVED] Something is wrong with my gobj
I decided to tweak my updaters GUI but every time i load the modified GUI, the program just crashes. Thinking i did something wrong, i loaded the working GUI and saved it with a different name, without changing anything. I then go back to the source and the only thing i changed was from this
Code:
if(gui_updater.load("gui/obj/updater_menu.gobj"))
to this
Code:
if(gui_updater.load("gui/obj/updater_menu2.gobj"))

The error
[Image: 98zi4j.jpg]

The callstack
[Image: 6fmd6h.jpg]

The Disassembly
[Image: idhwyh.jpg]

I also tried the same with "10 - Extending and Loading Gui Objects": I loaded the gobj and saved it with a new name, but that ran without errors. So why does doing the same with my gobj make it crash? Thanks!

PHP Code:
/******************************************************************************/
#include "stdafx.h"
/******************************************************************************/
Image    image      ;
Pak       update      ;
Download download;

#define server    "clientupdate.servebeer.com/Client_Update/"
#define todl    "stuff.pak"
////////////////////////////////////////////GUI Declarations///////////////////////////////////////////////
GuiObjs   gui_updater;
Text          *updater_title;
Text          *updater_status;
Text          *updater_file;
Progress    *updater_progbar;
Button      *updater_ping;
Button     *updater_update;
//Button     *updater_check;

//button functions
void B_Ping(Ptr)
{

}

void B_Update(Ptr)
{
    
download.create(S+server+todl);
}

////////////////////////////////////////////InitPre
void InitPre()
{
   
App.name("Updater");
   
App.flag=APP_NO_FX;
   
IOPath("data");
   
Paks.add("../engine.pak");
   
D.mode(400,500,0).sync(true);
}

static 
void InitGui()
{
   
FontDefault.load("font/DirtyDarren.font");
   
Text_ds.scale*=1.2;
   
   
Gui.tds_button.scale*=1.3;
   
Gui.tds_button.shadow=0x44;

   if(
gui_updater.load("gui/obj/updater_menu.gobj"))
   {
      
Gui+=gui_updater;

      
updater_title=    &gui_updater.getText    ("updater_title"); 
      
updater_status=    &gui_updater.getText    ("updater_status");
      
updater_ping=        &gui_updater.getButton    ("updater_ping");    
      
updater_update=    &gui_updater.getButton
("updater_update");    
      
updater_progbar=    &gui_updater.getProgress("updater_progbar");
      
updater_file=        &gui_updater.getText    ("updater_file");


      
updater_ping->func(B_Ping); 
      
updater_update->func(B_Update);
   }

}

/******************************************************************************/
Bool Init()
{

   
InitGui();
   
Text_ds.color =BLACK;
   
Text_ds.shadow=0;

   return 
true;
}
/******************************************************************************/
void Shut()
{
   
download.del(); // delete downloader
}
/******************************************************************************/
Bool Update()
{
   if(
Kb.bp(KB_ESC))return false;
    
Gui.update();
   if(
download.state()==DWNL_DONE)
   {
       
updater_status -> set ("Finished Downloading .pak");
       
updater_file      -> set ("Extracting pak file..");
         
update.loadMem(download.data(),download.size());
        
FCopy(update,CurDir(),download.size(),0,true);
   }
   if(
download.state()==DWNL_DOWNLOAD)
   {
       
updater_status -> set ("Current File");
   }
   return 
true;
}
/******************************************************************************/
void Draw()
{
   
D.clear(GREY);
   
Gui.draw();

   
updater_progbar    ->set(download.done(),download.size());   
   
updater_file        ->set(+download.fileName());                 //   Str          fileName (                   ) {return _name        ;}     
   //D.text(0,    0,S+"Files " + update.rootFiles());

   
switch(download.state())
   {
      case 
DWNL_NONE    D.text(0,   -0.18,  "Waiting..."                                             ); break;
      case 
DWNL_WAIT    D.text(0,   -0.18,  "Awaiting connection.."                                 ); break;
      case 
DWNL_DOWNLOADD.text(0,   -0.18,S+"Downloading.. "+download.done()+'/'+download.size()     ); break;
      case 
DWNL_DONE    D.text(0,      -0.18,  "Done!"                                                 ); break;
      case 
DWNL_ERROR   D.text(0,   -0.18,  "Update server is down"                 ); break;
   }
}
/******************************************************************************/ 





Sorry, attaching the gobj now.
(This post was last modified: 11-13-2010 08:28 AM by Dandruff.)
11-12-2010 06:52 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Something is wrong with my gobj
you could paste some more codes and attach the .gobj file that crashes
11-12-2010 01:16 PM
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #3
RE: Something is wrong with my gobj
updated
11-12-2010 08:20 PM
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #4
RE: Something is wrong with my gobj
Damn it i found the problem. I forgot that my updater was in another directory, not the data folder in the editor, so that was why it crashes. Took sooooo long to find, gotta use the sync tool way more often now.

Problem fixed now smile
(This post was last modified: 11-13-2010 08:28 AM by Dandruff.)
11-13-2010 05:34 AM
Find all posts by this user Quote this message in a reply
Post Reply