events problem

edited November 2011 in Help request
Hi.. I have a problem...


orxSTATUS orxFASTCALL StandAlone::Init()
{
...

orxEvent_AddHandler(orxEVENT_TYPE_INPUT, StandAlone::EventHandler);
orxEvent_AddHandler(orxEVENT_TYPE_SOUND, StandAlone::EventHandler);

...

}

Why when i load another config file, events doesn't work anymore?


PD: Sorry for my bad english

Comments

  • edited November 2011
    Hi Luciano and welcome here!

    Don't worry about your English, it's perfectly understandable and mine is probably not better anyway. :)

    As for your problem, could you give us more details? What do you do for loading another config file?

    As long as your event handlers have been registered, they should stay registered unless you unregister them yourself or you exit from orx.
  • edited November 2011
    Hi Iarwain!. Thanks for answering :)

    To explain this I will use the google translator because I do not know how to explain it in English :P

    And Google says:

    I divided the game "levels". When I change one level for another, the game will automatically load a configuration file related to it.

    One level would be similar to a "room" of GameMaker.

    Example:

    Level 1
    name = 'Presentation'
    file = 'Presentation.ini'

    Level 2
    name = 'MainWindow'
    file = 'MainWindow.ini'

    I never delete a handler, but if I did not register handlers again doesn't work.
  • edited November 2011
    Hi Luciano,

    Can you show us the code you're using to actually do this? :)
  • edited November 2011
    Yes... this is my magic code :

    Main.cpp

    #include "Game/StandAlone.h"

    using namespace VirtualFufy;

    #ifdef __releaseWIN__
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    {
    // Inits and executes orx
    orx_WinExecute(StandAlone::Init, StandAlone::Run, StandAlone::Exit);

    // Done!
    return EXIT_SUCCESS;
    }
    #else
    int main( int argc, char** argv )
    {
    orx_Execute( argc, argv, StandAlone::Init, StandAlone::Run, StandAlone::Exit );

    return EXIT_SUCCESS;
    }
    #endif

    StandAlone.cpp
    ...
    orxSTATUS orxFASTCALL StandAlone::Init()
    {
    try
    {
    // Iniciar administrador
    orxLOG("Iniciando administrador...");
    admin = new Logic::Administrador();
    admin->Iniciar();
    orxLOG("OK");

    // Iniciar el engine
    orxLOG("Iniciando engine...");
    motor = new VirtualFufy::VirtualFufyGame();
    motor->Iniciar();
    orxLOG("OK");

    // Registramos manejadores de eventos
    //orxEvent_AddHandler(orxEVENT_TYPE_INPUT, StandAlone::EventHandler);
    //orxEvent_AddHandler(orxEVENT_TYPE_SOUND, StandAlone::EventHandler);

    // Registrar función de update
    orxCLOCK *pstClock;
    pstClock = orxClock_FindFirst(orx2F(-1.0f), orxCLOCK_TYPE_CORE);
    orxClock_Register(pstClock, Update, orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_NORMAL);

    // Success!
    return orxSTATUS_SUCCESS;
    }
    catch(std::exception &ex)
    {
    orxLOG(ex.what());
    return orxSTATUS_FAILURE;
    }
    catch(...)
    {
    return orxSTATUS_FAILURE;
    }
    }
    ...

    GameEngine.cpp
    ...
    void GameEngine::Update()
    {
    // Si se desea cambiar de nivel...
    if(nivelNuevo != nivel)
    {
    if(nivel != NULL)
    {
    std::vector<GameObject*>* persistentes = nivel->Finalizar();
    for(std::size_t i=0; i<persistentes->size(); ++i)
    {
    nivelNuevo->AgregarSobreviviente((*persistentes));
    }

    delete persistentes;
    }

    nivelNuevo->Cargar();
    nivelNuevo->Iniciar();
    nivel = nivelNuevo;
    }
    ...


    GameLevel.cpp

    namespace Engine
    {
    GameLevel::GameLevel()
    {
    this->nombre = "none";
    this->file = "none";
    this->viewport = orxNULL;
    }

    GameLevel::GameLevel(const string nombre, const string file)
    {
    this->nombre = nombre;
    this->file = file;
    this->viewport = orxNULL;
    }

    GameLevel::~GameLevel()
    {
    Liberar();
    }

    void GameLevel::Cargar()
    {
    string mensaje;
    mensaje = "Cargando nivel ";
    mensaje += nombre.c_str();
    mensaje += "...";
    orxLOG(mensaje.c_str());

    orxConfig_Load(file.c_str());
    orxInput_Load(orxSTRING_EMPTY);
    viewport = orxViewport_CreateFromConfig("Viewport");

    // Re-agregar el event handler????
    orxEvent_AddHandler(orxEVENT_TYPE_INPUT, VirtualFufy::StandAlone::EventHandler);
    orxEvent_AddHandler(orxEVENT_TYPE_SOUND, VirtualFufy::StandAlone::EventHandler);

    orxLOG("OK");
    }

    void GameLevel::Liberar()
    {
    for(GAMELEVEL_IT it = objetos.begin(); it != objetos.end(); it++)
    {
    GameObject* obj = it->second;
    delete obj;
    obj = NULL;
    }

    if(viewport != orxNULL)
    {
    orxViewport_Delete(viewport);
    viewport = orxNULL;
    }
    }

    ...

  • edited November 2011
    With a quick glance I don't see anything wrong with your code. What I'd recommend is to put a breakpoint in orx in orxEvent_RemoveHandler() and orxEvent_Exit(). If you hit any of those breakpoints you'll know the culprit.

    Btw, which version of orx are you using, the latest package or the svn? I'd advise using the svn as the latest package is getting pretty old now.

    If you still can't find the issue, don't hesitate to zip your project and send it to me so that I can have a look. I keep all sent projects private, of course. :)
  • edited November 2011
    "With a quick glance I don't see anything wrong with your code. What I'd recommend is to put a breakpoint in orx in orxEvent_RemoveHandler() and orxEvent_Exit(). If you hit any of those breakpoints you'll know the culprit."

    I have one problem... i don't have orx source code. i'm using the lastest package...

    "Btw, which version of orx are you using, the latest package or the svn? I'd advise using the svn as the latest package is getting pretty old now."

    I'll do it... how could compile "orx" to generate the corresponding libraries for Windows and Linux? or in svn is already compiled?

    "If you still can't find the issue, don't hesitate to zip your project and send it to me so that I can have a look. I keep all sent projects private, of course."

    If i can't find the error, i haven't problem ;)
  • edited November 2011
    mmm... Embedded Static vs Static? differences?
  • edited November 2011
    I'm using static debug, in my debug configuration..

    I could not compile my game. Then, i changed libs "sqlite3.lib orxd.lib" to "sqlite3.lib imporxd.lib orxd.lib" and now compile.

    My new problem: when i execute my application, this exit with an error.
  • edited November 2011
    You were too fast for me, so a bit late:

    Yes, you can compile orx from the SVN and it'll compile out of the box. But you already figured that out. :)

    Now for the config options, they're explained in the README. The ones you want are the embedded dynamic release/profile/debug.

    Embedded means that all the plugins are embedded at compile time, and not hotloaded at runtime (more efficient).

    You'll then find the .lib in /code/lib/dynamic. Don't forget to replace the runtime libraries (.dll) and include files (/code/include) for your own project or they won't be compatible with the new version you just compiled.
  • edited November 2011
    Mmm... I can't compile orx using embedded configuration.

    Embedded debug:

    Error 1 fatal error LNK1257: code generation failed orxLIB orxLIB

    Embedded release:

    IDEM

    mmm... output:
    1>------ Build started: Project: orxLIB, Configuration: Embedded Dynamic Release Win32 ------
    1>Compiling...
    1>orxAnim.c
    1>orxTree.c
    1>orxString.c
    1>orxLinkList.c
    1>orxHashTable.c
    1>orxSoundSystem.c
    1>orxSoundPointer.c
    1>orxSound.c
    1>orxViewport.c
    1>orxShaderPointer.c
    1>orxShader.c
    1>orxRender.c
    1>orxFXPointer.c
    1>orxFX.c
    1>orxCamera.c
    1>orxPlugin_EmbeddedList.cpp
    1>orxPlugin.c
    1>orxPhysics.c
    1>orxBody.c
    1>orxStructure.c
    1>Compiling...
    1>orxSpawner.c
    1>orxObject.c
    1>orxFrame.c
    1>orxMemory.c
    1>orxBank.c
    1>orxVector.c
    1>orxMath.c
    1>orxParam.c
    1>orxMouse.c
    1>orxKeyboard.c
    1>orxJoystick.c
    1>orxInput.c
    1>orxFile.c
    1>orxTexture.c
    1>orxText.c
    1>orxScreenshot.c
    1>orxGraphic.c
    1>orxFont.c
    1>orxDisplay.c
    1>orxProfiler.c
    1>Compiling...
    1>orxFPS.c
    1>orxDebug.c
    1>orxSystem.c
    1>orxLocale.c
    1>orxEvent.c
    1>orxConfig.c
    1>orxClock.c
    1>orxType.c
    1>orxModule.c
    1>orxAnimSet.c
    1>orxAnimPointer.c
    1>Linking...
    1>fatal error C1047: The object or library file '.Embedded Dynamic ReleaseorxAnim.obj' was created with an older compiler than other objects; rebuild old objects and libraries
    1>LINK : fatal error LNK1257: code generation failed
    1>Build log was saved at "file://c:UsersLuchoSvnorx-trunkcodeuildwindowsmsvs2008orxLIBEmbedded Dynamic ReleaseBuildLog.htm"
    1>orxLIB - 1 error(s), 0 warning(s)
    2>------ Build started: Project: orx, Configuration: Embedded Dynamic Release Win32 ------
    2>Compiling...
    2>orxMain.c
    2>Linking...
    2>Generating code
    2>Finished generating code
    2>Build log was saved at "file://c:UsersLuchoSvnorx-trunkcodeuildwindowsmsvs2008orxEmbedded Dynamic ReleaseBuildLog.htm"
    2>orx - 0 error(s), 0 warning(s)
    3>------ Skipped Build: Project: orxKeyboard_GLFW, Configuration: Embedded Dynamic Release Win32 ------
    3>Project not selected to build for this solution configuration 
    4>------ Skipped Build: Project: orxMouse_GLFW, Configuration: Embedded Dynamic Release Win32 ------
    4>Project not selected to build for this solution configuration 
    5>------ Skipped Build: Project: orxDisplay_GLFW, Configuration: Embedded Dynamic Release Win32 ------
    5>Project not selected to build for this solution configuration 
    6>------ Skipped Build: Project: orxSoundSystem_OpenAL, Configuration: Embedded Dynamic Release Win32 ------
    6>Project not selected to build for this solution configuration 
    7>------ Skipped Build: Project: orxKeyboard_SDL, Configuration: Embedded Dynamic Release Win32 ------
    7>Project not selected to build for this solution configuration 
    8>------ Skipped Build: Project: orxJoystick_SDL, Configuration: Embedded Dynamic Release Win32 ------
    8>Project not selected to build for this solution configuration 
    9>------ Skipped Build: Project: orxMouse_SDL, Configuration: Embedded Dynamic Release Win32 ------
    9>Project not selected to build for this solution configuration 
    10>------ Skipped Build: Project: orxDisplay_SDL, Configuration: Embedded Dynamic Release Win32 ------
    10>Project not selected to build for this solution configuration 
    11>------ Skipped Build: Project: orxJoystick_GLFW, Configuration: Embedded Dynamic Release Win32 ------
    11>Project not selected to build for this solution configuration 
    12>------ Build started: Project: Scroll, Configuration: Embedded Dynamic Release Win32 ------
    13>------ Build started: Project: Bounce, Configuration: Embedded Dynamic Release Win32 ------
    12>Compiling...
    13>Compiling...
    12>orxScroll.c
    13>orxBounce.c
    13>Linking...
    12>Linking...
    13>   Creating library ........inpluginsdemoBounce.lib and object ........inpluginsdemoBounce.exp
    13>Generating code
    13>Finished generating code
    12>   Creating library ........inpluginsdemoScroll.lib and object ........inpluginsdemoScroll.exp
    12>Generating code
    12>Finished generating code
    12>Build log was saved at "file://c:UsersLuchoSvnorx-trunkcodeuildwindowsmsvs2008ScrollEmbedded Dynamic ReleaseBuildLog.htm"
    12>Scroll - 0 error(s), 0 warning(s)
    13>Build log was saved at "file://c:UsersLuchoSvnorx-trunkcodeuildwindowsmsvs2008BounceEmbedded Dynamic ReleaseBuildLog.htm"
    13>Bounce - 0 error(s), 0 warning(s)
    14>------ Skipped Build: Project: orxJoystick_SFML, Configuration: Embedded Dynamic Release Win32 ------
    14>Project not selected to build for this solution configuration 
    15>------ Skipped Build: Project: orxRender_Home, Configuration: Embedded Dynamic Release Win32 ------
    15>Project not selected to build for this solution configuration 
    16>------ Skipped Build: Project: orxPhysics_Box2D, Configuration: Embedded Dynamic Release Win32 ------
    16>Project not selected to build for this solution configuration 
    17>------ Skipped Build: Project: orxMouse_SFML, Configuration: Embedded Dynamic Release Win32 ------
    17>Project not selected to build for this solution configuration 
    18>------ Skipped Build: Project: orxKeyboard_SFML, Configuration: Embedded Dynamic Release Win32 ------
    18>Project not selected to build for this solution configuration 
    19>------ Skipped Build: Project: orxDisplay_SFML, Configuration: Embedded Dynamic Release Win32 ------
    19>Project not selected to build for this solution configuration 
    20>------ Skipped Build: Project: orxSoundSystem_SFML, Configuration: Embedded Dynamic Release Win32 ------
    20>Project not selected to build for this solution configuration 
    ========== Build: 3 succeeded, 1 failed, 0 up-to-date, 16 skipped ==========
    
  • edited November 2011
    Another question! :P

    Looking at the source code, I found that I do things wrong.

    Example (see FreeConfig()):
    
    namespace Engine
    {
    	GameObject::GameObject()
    	{
    		myObject = orxNULL;
    		level = NULL;
    	}
    
    	GameObject::GameObject(const orxSTRING file)
    	{
    		LoadConfig(file);
    	}
    
    	GameObject::~GameObject()
    	{
    		orxLOG("Eliminando objeto <%s>.", GetNombre().c_str());
    		LiberarEventos();
    		FreeConfig();
    		orxLOG("OK");
    	}
    		
    	void GameObject::FreeConfig()
    	{
    		try
    		{
    			if(myObject != orxNULL)
    			{
    				orxObject_Delete(myObject); // THIS LINE
    				myObject = NULL;
    			}
    		}
    		catch(...)
    		{
    			orxLOG("Error al liberar un objeto.");
    		}
    	}		
    

    I should use "orxObject_SetLifeTime(myObject, orxFLOAT_0);" instead of "orxObject_Delete(myObject);"?


    Header: GameObject.h
    #ifndef __ENGINE_GAMEOBJECT_H__
    #define __ENGINE_GAMEOBJECT_H__
    
    #include <orx.h>
    #include <string>
    
    namespace Engine
    {
    	class GameEngine;
    	class GameLevel;
    
    	/**
    	 * @class GameObject
    	 * @author Luciano Rasente
    	 * @date 22/10/11
    	 * @file GameObject.h
    	 * @brief 
    	 */
    	class GameObject
    	{
    		private:
    			orxVECTOR myPosition;
    			bool persistente;
    			
    		protected:
    			orxOBJECT *myObject;
    			GameLevel* level;
    			GameEngine* motor;
    			std::string nombre;
    			
    		public:
    
    			GameObject();
    			GameObject(const orxSTRING file);
    			virtual ~GameObject();
    			
    			/**
    			 * @brief Carga la configuración ORX del objeto.
    			 * @param file Archivo de configuración.
    			 */
    			void LoadConfig(const orxSTRING file);
    			
    			/**
    			 * @brief Libera la configuración ORX del objeto.
    			 */
    			void FreeConfig();
    
    			/**
    			 * @brief Obtiene la persistencia del objeto.
    			 * @return true si el objeto es persistente.
    			 */
    			bool GetPersistente();
    			
    			/**
    			 * @brief Establece la persistencia del objeto.
    			 * @param value Persistencia.
    			 */
    			void SetPersistente(bool value);
    
    			/**
    			 * @brief Devuelve el nivel en el que se encuentra actualmente el objeto.
    			 * @return Nivel.
    			 */
    			GameLevel* GetNivel();
    			
    			/**
    			 * @brief Registra el objeto a un evento.
    			 * @param evento Código del evento.
    			 * @param args Argumentos.
    			 */
    			void RegistrarEvento(const std::string evento, void* args);
    						
    			/**
    			 * @brief Registra el objeto a un evento.
    			 * @param evento Código del evento.
    			 */
    			void RegistrarEvento(const std::string evento);
    			
    			/**
    			 * @brief Solicita el cambio de nivel.
    			 * @param nivel Nombre del nivel nuevo.
    			 */
    			void SetNivel(const std::string& nivel);	
    
    			/**
    			 * @brief Desasocia el objeto de todos sus eventos registrados.
    			 */
    			void LiberarEventos();
    
    			/** 
    			 * @brief Obtiene el nombre del objeto.
    			 * @return Nombre del objeto.
    			 */
    			std::string GetNombre();
    
    			// EVENTOS
    			/**
    			 * @brief Al crear una nueva instancia del objeto.
    			 */
    			virtual void OnCreate() {}
    			
    			/**
    			 * @brief Al actualizar el objeto.
    			 * Se ejecuta por cada actualización de frame.
    			 */
    			virtual void OnUpdate() {}
    			
    			/**
    			 * @brief Al destruir la instancia.
    			 */
    			virtual void OnDestroy() {}
    			
    			/**
    			 * @brief Al iniciar el nivel.
    			 */
    			virtual void OnLevelInit() {}
    			
    			/**
    			 * @brief Al finalizar el nivel.
    			 */
    			virtual void OnLevelEnd() {}
    			
    			/**
    			 * @brief Al finalizar el juego.
    			 */
    			virtual void OnGameEnd() {}
    			
    			/**
    			 * @brief Al ocurrir una llamada de evento.
    			 */
    			virtual void OnCallEvent(const std::string& evento, void* args) {}
    			
    #ifndef USING_GCC
    		friend GameLevel;
    #else
    		friend class GameLevel;
    #endif
    	};
    };
    
    #endif // __ENGINE_GAMEOBJECT_H__
    
    
  • edited November 2011
    luciano wrote:
    1>fatal error C1047: The object or library file '.Embedded Dynamic ReleaseorxAnim.obj' was created with an older compiler than other objects; rebuild old objects and libraries

    Have you tried to clean/rebuild?

    Also which version of visual studio are you using? 2008?
  • edited November 2011
    Have you tried to clean/rebuild?
    yes

    and yes, i'm using vs2008

    Rebuild:
    1>------ Rebuild All started: Project: orxLIB, Configuration: Embedded Dynamic Debug Win32 ------
    1>Deleting intermediate and output files for project 'orxLIB', configuration 'Embedded Dynamic Debug|Win32'
    1>Compiling...
    1>orxAnimPointer.c
    1>orxAnimSet.c
    1>orxModule.c
    1>orxType.c
    1>orxClock.c
    1>orxConfig.c
    1>orxEvent.c
    1>orxLocale.c
    1>orxSystem.c
    1>orxDebug.c
    1>orxFPS.c
    1>orxProfiler.c
    1>orxDisplay.c
    1>orxFont.c
    1>orxGraphic.c
    1>orxScreenshot.c
    1>orxText.c
    1>orxTexture.c
    1>orxFile.c
    1>orxInput.c
    1>Generating Code...
    1>Compiling...
    1>orxJoystick.c
    1>orxKeyboard.c
    1>orxMouse.c
    1>orxParam.c
    1>orxMath.c
    1>orxVector.c
    1>orxBank.c
    1>orxMemory.c
    1>orxFrame.c
    1>orxObject.c
    1>orxSpawner.c
    1>orxStructure.c
    1>orxBody.c
    1>orxPhysics.c
    1>orxPlugin.c
    1>orxPlugin_EmbeddedList.cpp
    1>orxCamera.c
    1>orxFX.c
    1>orxFXPointer.c
    1>orxRender.c
    1>Generating Code...
    1>Compiling...
    1>orxShader.c
    1>orxShaderPointer.c
    1>orxViewport.c
    1>orxSound.c
    1>orxSoundPointer.c
    1>orxSoundSystem.c
    1>orxHashTable.c
    1>orxLinkList.c
    1>orxString.c
    1>orxTree.c
    1>orxAnim.c
    1>Generating Code...
    1>Linking...
    1>fatal error C1900: Il mismatch between 'P1' version '20080116' and 'P2' version '20070207'
    1>LINK : fatal error LNK1257: code generation failed
    1>Build log was saved at "file://c:UsersLuchoSvnorx-trunkcodeuildwindowsmsvs2008orxLIBEmbedded Dynamic DebugBuildLog.htm"
    1>orxLIB - 1 error(s), 0 warning(s)
    2>------ Rebuild All started: Project: orx, Configuration: Embedded Dynamic Debug Win32 ------
    2>Deleting intermediate and output files for project 'orx', configuration 'Embedded Dynamic Debug|Win32'
    2>Compiling...
    2>orxMain.c
    2>Linking...
    2>LINK : ........inorxd.exe not found or not built by the last incremental link; performing full link
    2>LINK : fatal error LNK1104: cannot open file 'orxd.lib'
    2>Build log was saved at "file://c:UsersLuchoSvnorx-trunkcodeuildwindowsmsvs2008orxEmbedded Dynamic DebugBuildLog.htm"
    2>orx - 1 error(s), 0 warning(s)
    3>------ Skipped Rebuild All: Project: orxKeyboard_GLFW, Configuration: Embedded Dynamic Debug Win32 ------
    3>Project not selected to build for this solution configuration 
    4>------ Skipped Rebuild All: Project: orxMouse_GLFW, Configuration: Embedded Dynamic Debug Win32 ------
    4>Project not selected to build for this solution configuration 
    5>------ Skipped Rebuild All: Project: orxDisplay_GLFW, Configuration: Embedded Dynamic Debug Win32 ------
    5>Project not selected to build for this solution configuration 
    6>------ Skipped Rebuild All: Project: orxSoundSystem_OpenAL, Configuration: Embedded Dynamic Debug Win32 ------
    6>Project not selected to build for this solution configuration 
    7>------ Skipped Rebuild All: Project: orxKeyboard_SDL, Configuration: Embedded Dynamic Debug Win32 ------
    7>Project not selected to build for this solution configuration 
    8>------ Skipped Rebuild All: Project: orxJoystick_SDL, Configuration: Embedded Dynamic Debug Win32 ------
    8>Project not selected to build for this solution configuration 
    9>------ Skipped Rebuild All: Project: orxMouse_SDL, Configuration: Embedded Dynamic Debug Win32 ------
    9>Project not selected to build for this solution configuration 
    10>------ Skipped Rebuild All: Project: orxDisplay_SDL, Configuration: Embedded Dynamic Debug Win32 ------
    10>Project not selected to build for this solution configuration 
    11>------ Skipped Rebuild All: Project: orxJoystick_GLFW, Configuration: Embedded Dynamic Debug Win32 ------
    11>Project not selected to build for this solution configuration 
    12>------ Rebuild All started: Project: Scroll, Configuration: Embedded Dynamic Debug Win32 ------
    12>Deleting intermediate and output files for project 'Scroll', configuration 'Embedded Dynamic Debug|Win32'
    12>Compiling...
    13>------ Rebuild All started: Project: Bounce, Configuration: Embedded Dynamic Debug Win32 ------
    13>Deleting intermediate and output files for project 'Bounce', configuration 'Embedded Dynamic Debug|Win32'
    13>Compiling...
    12>orxScroll.c
    13>orxBounce.c
    13>Linking...
    13>LINK : ........inpluginsdemoBounced.dll not found or not built by the last incremental link; performing full link
    13>LINK : fatal error LNK1104: cannot open file 'orxd.lib'
    12>Linking...
    13>Build log was saved at "file://c:UsersLuchoSvnorx-trunkcodeuildwindowsmsvs2008BounceEmbedded Dynamic DebugBuildLog.htm"
    13>Bounce - 1 error(s), 0 warning(s)
    14>------ Skipped Rebuild All: Project: orxJoystick_SFML, Configuration: Embedded Dynamic Debug Win32 ------
    14>Project not selected to build for this solution configuration 
    15>------ Skipped Rebuild All: Project: orxRender_Home, Configuration: Embedded Dynamic Debug Win32 ------
    15>Project not selected to build for this solution configuration 
    16>------ Skipped Rebuild All: Project: orxPhysics_Box2D, Configuration: Embedded Dynamic Debug Win32 ------
    16>Project not selected to build for this solution configuration 
    17>------ Skipped Rebuild All: Project: orxMouse_SFML, Configuration: Embedded Dynamic Debug Win32 ------
    17>Project not selected to build for this solution configuration 
    18>------ Skipped Rebuild All: Project: orxKeyboard_SFML, Configuration: Embedded Dynamic Debug Win32 ------
    18>Project not selected to build for this solution configuration 
    19>------ Skipped Rebuild All: Project: orxDisplay_SFML, Configuration: Embedded Dynamic Debug Win32 ------
    19>Project not selected to build for this solution configuration 
    20>------ Skipped Rebuild All: Project: orxSoundSystem_SFML, Configuration: Embedded Dynamic Debug Win32 ------
    20>Project not selected to build for this solution configuration 
    12>LINK : ........inpluginsdemoScrolld.dll not found or not built by the last incremental link; performing full link
    12>LINK : fatal error LNK1104: cannot open file 'orxd.lib'
    12>Build log was saved at "file://c:UsersLuchoSvnorx-trunkcodeuildwindowsmsvs2008ScrollEmbedded Dynamic DebugBuildLog.htm"
    12>Scroll - 1 error(s), 0 warning(s)
    ========== Rebuild All: 0 succeeded, 4 failed, 16 skipped ==========
    
    
  • edited November 2011
    It depends from where you're going to call FreeConfig(). If it's from an event handler, yes it's not safe to use orxObject_Delete(). Otherwise you're fine.
  • edited November 2011
    iarwain wrote:
    It depends from where you're going to call FreeConfig(). If it's from an event handler, yes it's not safe to use orxObject_Delete(). Otherwise you're fine.

    Aaah, ok! I still I can't make me friend of "orx philosophy" :P

    I'm calling FreeConfig in
    void orxFASTCALL StandAlone::Update( const orxCLOCK_INFO* clockInfo, void* context )
    	{
    		motor->Update(); // <--- here
    	}
    
  • edited November 2011
    PD: forgive me for send a lot of posts!
  • edited November 2011
    Then you're fine. Unless you're doing it while going through the collection of orxOBJECTs, as with any collection it's unsafe to delete one item while traversing the collection.
    When you get the svn version compiled, in debug, you'll get an assert if you call the delete function from an event handler.
  • edited November 2011
    luciano wrote:
    PD: forgive me for send a lot of posts!

    No worries, we're here for that and it's better to ask questions than staying stuck. :)
  • edited November 2011
    iarwain wrote:
    Then you're fine. Unless you're doing it while going through the collection of orxOBJECTs, as with any collection it's unsafe to delete one item while traversing the collection.
    When you get the svn version compiled, in debug, you'll get an assert if you call the delete function from an event handler.

    Ahh, now i understand ;)
  • edited November 2011
    luciano wrote:
    1>fatal error C1900: Il mismatch between 'P1' version '20080116' and 'P2' version '20070207'
    1>LINK : fatal error LNK1257: code generation failed

    And that means we're not using the same version of vs2008. Apparently yours is older than mine. You'll have to recompile orx's external dependencies.
    They're all in the /extern folder.

    The one you need for windows are: glfw, Box2D, openal-soft, SOIL and libsndfile.
  • edited November 2011
    Very dificul'! said Tevez :P On Thursday I will try to compile orx from the pc of my girlfriend, she has VS2010. Also, that day I will try to compile orx from linux (using CodeLite).

    Thank you very much for your help! and see you on Thursday! :)
  • edited November 2011
    Ahah, another option would be to get the latest 2008 version too. ;)
    You should have less trouble on linux though, including 64b, as long as you have libsndfile/openal installed on your distribution (orx use the vanilla ones on linux, the modified ones are only for windows).
    See you on Thursday! :)
  • edited February 2012
    Thursday never came :P Why do not you upload a compilation of the latest version of orx on http://orx-project.org/?
  • edited February 2012
    Hehe, yeah, some days just never happen and sometimes you wish some other wouldn't have happened. ;)

    What do you mean by latest versions? The latest source is always available from the SVN and it's changing too often for me to keep updated source packages.

    As for binary packages, I don't make them more than once a year as it takes me 6-8 hours to generate them. :)
  • edited February 2012
    I understand ... And if I give you my e-mail you send me the compiled version you have? :) Because I tried in linux and windows, but i failed.
  • edited February 2012
    Sure, you can contact me in PM is you want.

    Though I'd like to help you to compile orx on your own, this way you'll be able to do it any time you need a newer version!

    Can you give me more details on what went wrong when compiling?
  • edited February 2012
    My problem is:
    	
    Build started: Project: orxLIB, Configuration: Embedded Dynamic Debug|Win32
    
    (...)
    
    Generating Code...
    Linking...
    fatal error C1900: Il mismatch between 'P1' version '20080116' and 'P2' version '20070207'
    LINK : fatal error LNK1257: code generation failed
    

    I attached "buildlog.htm"
  • edited February 2012
    My problem is:
    	
    Build started: Project: orxLIB, Configuration: Embedded Dynamic Debug|Win32
    
    (...)
    
    Generating Code...
    Linking...
    fatal error C1900: Il mismatch between 'P1' version '20080116' and 'P2' version '20070207'
    LINK : fatal error LNK1257: code generation failed
    

    I attached "buildlog.htm" https://forum.orx-project.org/uploads/legacy/fbfiles/files/BuildLog.txt
  • edited February 2012
    Ah ok, I thought you tried on linux or with mingw, that's why I asked.

    The issue is that even if I send you a binary made with my vs2008, it will still not work for you as you'll get the same error message when linking your game.

    Your only option is to compile orx's dependencies in the orx/extern folder.

    There are vs2008 solutions for all of them, the ones you need to recompile are:
    - Box2D_2.1.3
    - glfw-2.7
    - openal-soft
    - SOIL

    Let me know if that works for you! :)
  • edited February 2012
    There are vs2008 solutions for all of them, the ones you need to recompile are:
    1- Box2D_2.1.3
    2- glfw-2.7
    3- openal-soft
    4- SOIL
    

    Compiling:
    1- OK
    2- OK
    3- Error, missing dsound.h
    4- OK

    Searching on google... Founded! Problem: missing DXSDK.

    Downloading DXSDK...
    (3 years later...)

    Downloaded!

    Installing...
    Installed!

    Compiling 3 again...
    Not founded!

    Referencing DXSDK include dir...

    Compiling again... YES!!

    I write this way because I find it difficult to explain the process of what I did.


    Compiling ORX... YES, COMPILED!! :D

    Now, what? jeje :P

    edit:What is that plugin? SFML and others?
  • edited February 2012
    Nice!

    Don't pay attention to the SDL and SFML plugins, the most recent ones are GLFW.

    Also if you compile orx with the "embedded" configurations, the plugins will be inside orx.lib, so you don't have to worry about them at all.

    Well now you have your own version of orx, the headers are in orx/code/include and the compiled libraries are in orx/code/library/dynamic (both .lib and .dll). That's all you need for developing your game. :)
Sign In or Register to comment.