Yes, my friend, sadly, it is time for an upgrade.
Tvspelsfreak and I have both upgraded our devving environments to the latest 'n' greatest.
First of all, you're going to need a
lot of space on your hard drive. You need a Linux shell (Cygwin) to build to Dreamcast executable.
The very best method is going to be using the DC Dev ISO. It's an ISO that you burn to a CD and run the wizard. It pretty much sets the whole thing up.
You're going to have to learn to use makefiles from now on, and alot of stuff is much harder with this setup, but it's alot easier.
If you need any help, we're both here. I'm going to be getting back into DC Devving shortly (read the topic in General/Off-topic and you'll know what I mean).
On the subject of linked lists, I didn't use the standard template library with templates or vectors, just straight up linked lists.
I'll show you some code.
Particlez.h
Code: Select all
void CreatePart(int x, int y, double angle, int intensity, uint8 max_partlife, uint16 size, uint8 color, uint8 a, uint8 r, uint8 g, uint8 b, uint32 &onscreen);
void UpdatePart(float gravity, uint32 &onscreen); //Updates particle physics
void DrawPart(uint8 max_partlife); //Draws particles
void CleanupPart();
class Part {
public:
Part() {
next = NULL;
prev = NULL;
}
void Draw();
void Update();
float x, y;
float xvel, yvel;
int life, size;
uint8 color, a, r, g, b;
Part *next;
Part *prev;
};
Part *first_part, *last_part;
Particlez.cpp
Code: Select all
void CreatePart(int x, int y, double angle, int intensity, uint8 max_partlife, uint16 size, uint8 color, uint8 a, uint8 r, uint8 g, uint8 b, uint32 &onscreen) {
Part *part;
double relative_angle;
for(int i = 0; i < intensity; i++) {
part = NULL;
part = new Part;
if(!first_part) {
first_part = part;
part->prev = NULL;
} else {
last_part->next = part;
part->prev = last_part;
}
last_part = part;
part->next = NULL;
}
}
void UpdatePart(float gravity, uint32 &onscreen) {
Part *part;
Part *nextpart;
for(part = first_part; part;) {
if(!part) break;
nextpart = part->next;
if(part->life <= 0) {
if (part == first_part && part == last_part) {
first_part = NULL;
last_part = NULL;
} else {
if (part == first_part) {
first_part = part->next;
} else if(part == last_part) {
last_part = part->prev;
}
}
if(part->prev) part->prev->next = part->next;
if(part->next) part->next->prev = part->prev;
part->next = NULL;
part->prev = NULL;
delete part;
part = NULL;
onscreen--;
} else {
//Update the particle, it's still alive
}
part = nextpart;
}
}
I tried to not post the irrelevent crap. I'm sure that's really hard to understand as is, because it isn't really commented or anything. But that is the particle engine (minus the draw function, cleanup function, and "particle" related things like adjusting velocities, setting colors and crap).