Who's Online |
94 user(s) are online ( 55 user(s) are browsing Forums)
Members: 0
Guests: 94
more...
|
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/3/1 22:06
#601
|
Quite a regular
|
@freddix no one know ?
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: New version of Quake (v2.40) available
|
Posted on: 2009/3/1 21:25
#602
|
Quite a regular
|
I always get problems with rez higher than 1024x768 on my SAM ... More to this, it's not impossible to change display resolution during game with menus ...
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/3/1 0:26
#603
|
Quite a regular
|
@Gazelle ok. Now I understand how the pointer in struc works. Thank you Gazelle. When compiling, I also get some errors on things I'read here for example : definition :
typedef struct Object3DType{
...
};
Object3DType *Allocate3DObject( int ObjectID ){
...
}
Basic3D.c:48: error: expeted '=', ',', ';', 'asm' or '__attribute__' before '*' token and
void Free3DObject( Object3DType *OldObject ){
...
}
Basic3D.c:71: error: expected ')' before '*' token Why ? I use exactly what was adviced to me here in this post ... Kindest Regards, Freddix
Edited by freddix on 2009/3/1 10:55:00
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/2/28 21:33
#604
|
Quite a regular
|
I encounter another problem with structures. I've made this with the book help :
struct Basic3DStructType{
int *LastCreatedObject;
};
struct Basic3DStructType Basic3D;
struct Object3DType{
int *PreviousObject, *NextObject;
};
void BASIC3D_Destructor( void ){
struct ObjectType *NewObject = Basic3D.LastCreatedObject;
struct Object3DType *NextToDelete = NewObject.PreviousObject;
}
I've removed other lines to just show what is wrong ... I get an error on this line : Quote: struct Object3DType *NextToDelete = NewObject.PreviousObject; BAsic3D.c:64: error: request for member 'PreviousObject' in something not a structure or union Why ? I tried to change struc to these : Quote: struct Object3DType{ int PreviousObject, NextObject; }; Same Result ... Any info ?
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/2/27 18:33
#605
|
Quite a regular
|
@all : Thank you for all these precious informations. When I'll get something to show, I'll post a sample ;)
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/2/26 17:21
#606
|
Quite a regular
|
@LiveForIt Thank you.
A friend just sent me an e-mail explaining linked-list too. now I understand what I must do to handle objects dynamically.
Thank you all.
Kindest Regards, Freddix
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/2/26 13:58
#607
|
Quite a regular
|
@xeron Do you think that handling the list per ranges can be good ?
For example : Default is defined with 512 entries, If more than 512, directly re-allocate 1024 entries, if more than 1024, directly re-allocate 1536 entries, if more than 1536, directly re-allocate to 2048 entries, etc ...
Good idea ?
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/2/26 0:00
#608
|
Quite a regular
|
@Gazelle I've modified. is it correct now ?
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: MiniGL - Switch mode : fullscreen & windowed
|
Posted on: 2009/2/25 22:01
#609
|
Quite a regular
|
@afxgroup: Why didn't you create directly a new fresh post for your problem ?
It may have been more "clear" and you can get better visibility on your question with a dedicaced post.
Kindest Regards, Freddix
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, resize dynamically an array. Possible ?
|
Posted on: 2009/2/25 21:17
#610
|
Quite a regular
|
@Rigo: I already own the Developer CD :p In fact, my need is to handle a list that can contain from approx 1 element to 65535 elements.
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, resize dynamically an array. Possible ?
|
Posted on: 2009/2/25 20:55
#611
|
Quite a regular
|
@salass00 Thank you for these clean explanations :) Now I have all informations to continue my project (until the next question :p)
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, resize dynamically an array. Possible ?
|
Posted on: 2009/2/25 20:06
#612
|
Quite a regular
|
@salass00 Thank you :)
So, I can use this function for Array resizing then ?
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/2/25 19:37
#613
|
Quite a regular
|
@salass00 It's what I supposed .... but wasn't sure ... Thank you. If I'm not wrong, all this should be correct :
typedef struct{
BOOL Exist;
int Type;
BOOL Hidden, Culling, Transparency, WireFrame, Fog, Ambient, Lights, Filtering;
float XPos, YPos, YPos;
float XRot, YRot, ZRot;
float XScale, YScale, ZScale;
float RGBRed, RGBGreen, RGBBlue;
}Object3DType;
static Object3DType *Allocate3DObject( void );
static void Free3DObject( Object3DType *OldObject );
Object3DType *Allocate3DObject( void ){
Object3DType *NewObject = NULL;
NewObject = IExec -> AllocVecTags( sizeof( Object3DType ), TAG_DONE );
if ( !NewObject ){
return NULL;
}
return NewObject;
}
void Free3DObject( Object3DType *OldObject ){
if ( obj != NULL ){
IExec -> FreeVec( OldObject );
}
}
Right ?
Edited by freddix on 2009/2/25 23:51:35
|
All we have to decide is what to do with the time that is given to us.
|
|
|
GCC, resize dynamically an array. Possible ?
|
Posted on: 2009/2/25 19:27
#614
|
Quite a regular
|
Hi All,
I've checked my entire C book concerning arrays and I did find nothing related to resizing an array.
Is it possible to directly change the size of an array inside a program ?
(post that kind of questions will probably makes me be considered as a noob ... it's a risk ... but progress nevers happen without risks ;) )
Kindest Regards, Freddix
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Dynamic structure creation method ?
|
Posted on: 2009/2/25 19:14
#615
|
Quite a regular
|
@xeron Thank you for this small function. I imagine that if I want to delete this object from memory, I'll have to do something like this :
*FreeObject( NewObjectType ){
if ( NewObjectType <> 0 ){
IExec->FreeVec( NewObjectType );
}
}
Am I wrong ?
|
All we have to decide is what to do with the time that is given to us.
|
|
|
GCC, Dynamic structure creation method ?
|
Posted on: 2009/2/25 18:29
#616
|
Quite a regular
|
Hi, In fact, I want to create dynamically objects that uses a structure. Imagine a structure like this one :
typedef struct{
BOOL Exist;
float XPos, YPos, ZPos;
float XRot, YRot, ZRot;
float FOV;
BOOL Backdrop;
float RangeNear, RangeFar;
float Left, Top, Right, Bottom;
}ObjectType;
I want to have a function in my program that allocate a small memory for an object that'll use this structure and, the function must return the pointer to the freshly created object structure. I'm not enough skilled in C to imagine how to do this. Any one got an idea about this ? Thank you. Kindest Regards, Freddix
Edited by freddix on 2009/2/25 19:21:59
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: new Hyperion Site
|
Posted on: 2009/2/25 17:57
#617
|
Quite a regular
|
I've re-registered an account onto the new website: Ok. Registered Amiga OS 4.1 for Sam440ep: Ok. Download section : 2 updates for Amiga OS 4.1: Ok.
New Hyperion website work perfectly for me :p
@HANS : I'm now waiting for your MiniGL beta release :p
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Switch( condition ) & Case
|
Posted on: 2009/2/24 17:57
#618
|
Quite a regular
|
@tonyw: I only compare boolean to TRUE or FALSE. ;) I never compare to TRUE/FALSE for integer and others data ...
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Switch( condition ) & Case
|
Posted on: 2009/2/23 18:17
#619
|
Quite a regular
|
@LiveForIt yes, it's what was explained before, I've understood, in the last statements, it was an error from me to not modify this in the post.
|
All we have to decide is what to do with the time that is given to us.
|
|
|
Re: GCC, Switch( condition ) & Case
|
Posted on: 2009/2/23 3:16
#620
|
Quite a regular
|
@ssolie It's not wrong ... but it's not perfect ;)
|
All we have to decide is what to do with the time that is given to us.
|
|
|