Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Xenavar

Pages: [1] 2
1
General / "gdb.exe has stopped responding" codeblocks
« on: October 07, 2010, 06:04:12 pm »
I am having the same problem.. I was using an older version of C:B as well as SFML 1.5  but since I upgraded to the latest C:B (10.05) and SFML 1.6 the debugger won't work.

Any clue as to what causes this?

2
System / Thread prob
« on: August 27, 2010, 06:45:00 pm »
Heh, sorry for forcing you to repeat I am french and we don't use the same terms. But ive fixed my problem without using threads and its smooth.

Thank you very much again.

3
System / Thread prob
« on: August 27, 2010, 05:14:12 pm »
Thank you for your replys, its all working except when I try to call the thread in class "PC" I have the following error:

C:\Users\Steven\Desktop\RPG\PC.cpp|226|error: no matching function for call to `sf::Thread::Thread(void (PC::*)(void*, int), short int&)'|

Code is:

Code: [Select]

void PC::Handle_event(sf::Event Event, sf::RenderWindow &App)
{
   sf::Thread Thread(&PC::Start_Animation, Index);   <----------------------
}

void PC::Start_Animation(void* UserData, int Index)
{
    Attacks[Index]->Next(Sprite,Facing);
}


At first I tryed to remove the PC:: in front of the function but it told me to put it back (meaning sf::Thread Thread(&Start_Animation, Index);   doesn't work either)

What am I missing here?

4
System / Thread prob
« on: August 27, 2010, 06:10:26 am »
Hello,

I have been trying to call a thread in a class using a function from an inherited class like this:

Code: [Select]
sf::Thread Thread(&Attacks[Index].Start_Animation());

However, I get the following error:

Code: [Select]
C:\Users\Steven\Desktop\RPG\PC.cpp|225|error: request for member `Start_Animation' in `((PC*)this)->PC::Attacks[((int)Index)]', which is of non-class type `Attack*'|

Function works when its not in a thread, such as:

Code: [Select]
Attacks[Index].Start_Animation()

The 2 classes look like this (A caracter has x number of attacks)

Code: [Select]

class Attack
{
    protected:
    public:
              void Start_Animation(void* UserData);
};
class PC
{
    protected:
                 Attack *Attacks[10];
    public:
}

Any suggestion? I am pretty sure I am just missing a coma or something.

5
General discussions / Passing a render window to a class?
« on: June 01, 2010, 08:57:36 pm »
bump

6
General discussions / Passing a render window to a class?
« on: June 01, 2010, 09:36:55 am »
Is there a reason that when I pass a window to a class and then use events that use the window's elapsed time to make a sprite move, it has some lag spikes?

The first time I did it I had no classes at all and it worked perfecly fine on a normal function (in main)

7
General discussions / Passing a render window to a class?
« on: June 01, 2010, 05:21:53 am »
What is the correct syntax to do that? In both the .h and .cpp. because right now I am getting the following error:

C:\Users\Steven\Desktop\SFML-1.5\include\SFML\System\NonCopyable.hpp|57|error: `sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|

followed by:

C:\Users\Steven\Desktop\RPG\main.cpp|21|error:   initializing argument 2 of `void PC::Handle_event(sf::Event, sf::RenderWindow)'|

8
General / Pointer problem
« on: February 20, 2010, 02:12:10 am »
ElapsedTime? I can do that.

But are you saying I should use thos threads or not?

9
General / Pointer problem
« on: February 20, 2010, 01:47:49 am »
Well I figured I needed threads to run each caracter's animation as I am using Sleep() and sleep makes the main program fail.

10
General / Pointer problem
« on: February 19, 2010, 09:15:39 pm »
Thanks, your last clue fixed my problem. I have a question:

I am trying to use threads for my caracters, for their animations and stuff. Threads are not inside object classes, they are normal functions besides the main program. The problem I have right now is that if I declare let's say 10 threads with different TCaracter objects with different structure variables (inside the class) but using the same exact class and encapsulated variables, the threads lag alot. They are not in sync and it often crashes.

What does this? Do I need to declare threads in classes or do threads just not work like I thought they did?

11
General / Pointer problem
« on: February 19, 2010, 07:56:54 pm »
So now I have...

Code: [Select]
Caracter.H
Code:
class TCaracter
{
private:
sf::Sprite Sprite;
struct Move *Moule_move;
struct Move *Stand;
struct Move *Courant_move;
struct Move *Debut_move;

public:
Move* Get_MovePointer();
} ;


Caracter.Cpp

Move* TCaracter::Get_MovePointer()
{
return Courant_move;
}
 

Main.cpp

Code:
TCaracter Player1;
if (Player1.Get_MovePointer() == NULL)
{
}


Still the same error when I call it in main

12
General / Pointer problem
« on: February 19, 2010, 05:02:27 pm »
What would be the correct syntax to pass a pointer then?

13
General / Pointer problem
« on: February 19, 2010, 04:04:16 pm »
Lol, let's start this again.. I translated my variables to english (they were french) for you guys to understand better but I left some of them out so it just didn't make sense anymore.. this is my real code, with the same error:

Caracter.H
Code: [Select]
class TCaracter
{
private:
sf::Sprite Sprite;
struct Move *Moule_move;
struct Move *Stand;
struct Move *Courant_move;
struct Move *Debut_move;

public:
struct Move Get_MovePointer();
} ;


Caracter.Cpp

Code: [Select]
struct Move TCaracter::Get_MovePointer()
{
return *Courant_move;
}

Main.cpp

Code: [Select]
TCaracter Player1;
if (Player1.Get_MovePointer() == NULL)
{
}

14
General / Pointer problem
« on: February 19, 2010, 02:30:08 pm »
I removed string, but it still doesn't work  :?

15
General / Pointer problem
« on: February 19, 2010, 03:57:31 am »
I am having trouble returning a pointer in my class..

Caracter.H
class TCaracter
{
 private:
              sf::Sprite Sprite;
              struct Move *Moule_move;
              struct Move *Stand;
              struct Move *Courant_move;
              struct Move *Debut_move;
             
public:
               struct Move Get_MovePointer(string);
}

Caracter.Cpp

struct Move TPersonnage::Get_MovePointer()
{
    return *Courant_move;
}

Main.cpp

TCaracter Player1;
if (Player1.Get_MovePointer() == NULL)
                {
                }

The bolded sentence gives me an errow saying : Main.cpp|19|error: request for member `Get_MovePointer' in `Perso', which is of non-class type `TPersonnage*'|

Guessing its in the syntax. Any help?

Pages: [1] 2
anything