Posted: Sun Jun 10, 2012 5:35 pm
Cool, thanks! I've got Tiled installed from their repo, but I wonder if I can get by on just compiling the plug-ins rather than the whole thing...
Sega Megadrive/Genesis development
http://gendev.spritesmind.net/forum/
http://gendev.spritesmind.net/forum/viewtopic.php?f=8&t=1090
Chilly Willy wrote:Cool, thanks! I've got Tiled installed from their repo, but I wonder if I can get by on just compiling the plug-ins rather than the whole thing...
Actually, it's not bad at all. It's well made.Chilly Willy wrote:Well, I guess it can't be as bad as some of the things I've compiled before.
Just built the 0.8.1 code... yeah, it wasn't a problem at all. The compiled binary works fine. Found the Flare plugin code - there doesn't seem to be anything platform specific in the plugins, so unless your plugin code makes Windows calls, it should just be a matter of copying the new plugin directory, changing the makefile, and recompiling.djcouchycouch wrote:Actually, it's not bad at all. It's well made.Chilly Willy wrote:Well, I guess it can't be as bad as some of the things I've compiled before.
Chilly Willy wrote:Well, I can run it in the debugger, but there's no debug symbols. I can't find any way of compiling with debug symbols in the qmake files, or the generated makefiles.
That's strange. I didn't have to do that and I can debug it. Hmmm.Chilly Willy wrote:That sets the debugger for QT Creator - I need to known how to turn on debugging symbols IN THE PROJECT. It's got to be some kind of build option... not that I can find one. Somehow, when qmake runs, it adds -DQT_NO_DEBUG to all generated makefiles.
EDIT: Figured it out... you need to add "CONFIG += qt debug" to tiled.pri in the root directory.
I created the project by importing an existing project and editing the build step to add a qmake step before the make step. But with an imported project, there are no separate debug or release versions, there's just the project, period. Maybe if I had separate debug/release versions, it would automatically include the flag. Just not sure how to do that for an imported project.djcouchycouch wrote:That's strange. I didn't have to do that and I can debug it. Hmmm.Chilly Willy wrote:That sets the debugger for QT Creator - I need to known how to turn on debugging symbols IN THE PROJECT. It's got to be some kind of build option... not that I can find one. Somehow, when qmake runs, it adds -DQT_NO_DEBUG to all generated makefiles.
EDIT: Figured it out... you need to add "CONFIG += qt debug" to tiled.pri in the root directory.
Are you opening the project directly into QT Creator or using the QT Creator plugin in Visual Studio? Also, are you running it on Windows?I created the project by importing an existing project and editing the build step to add a qmake step before the make step. But with an imported project, there are no separate debug or release versions, there's just the project, period. Maybe if I had separate debug/release versions, it would automatically include the flag. Just not sure how to do that for an imported project.
Anywho, I did get it to build and debug with symbols and all, so I can run it in the debugger with source.
I am indeed using bounding boxes for collision detection between two objects. What else could I be using?As to collision detection, that's why some games are more sloppy that others... to speed up collision detection. Have you tried a simple bounding box? Not very accurate, but DAMN FAST!
I tried to think about a solution using that idea, but nothing I'm happy with. Concerns are:Combine that with a table of what is in every 16x16 block in the map (ORd as bits) and you should be able to check tons of stuff each frame.
Code: Select all
if (collisionFunction(*tempFirstList, *tempSecondList))
{
(*tempFirstList)->collisionFunction(*tempFirstList, *tempSecondList);
(*tempSecondList)->collisionFunction(*tempSecondList, *tempFirstList);
}
Code: Select all
u16 SquareSquareCollision(ObjectStruct* firstObject, ObjectStruct* secondObject)
{
if (firstObject->x + firstObject->rectLeft > secondObject->x + secondObject->rectRight) return 0;
if (firstObject->x + firstObject->rectRight < secondObject->x + secondObject->rectLeft) return 0;
if (firstObject->y + firstObject->rectTop > secondObject->y + secondObject->rectBottom) return 0;
if (firstObject->y + firstObject->rectBottom < secondObject->y + secondObject->rectTop) return 0;
return 1;
}
Code: Select all
if (!((*tempFirstList)->x + (*tempFirstList)->rectLeft > (*tempSecondList)->x + (*tempSecondList)->rectRight ||
(*tempFirstList)->x + (*tempFirstList)->rectRight < (*tempSecondList)->x + (*tempSecondList)->rectLeft ||
(*tempFirstList)->y + (*tempFirstList)->rectTop > (*tempSecondList)->y + (*tempSecondList)->rectBottom ||
(*tempFirstList)->y + (*tempFirstList)->rectBottom < (*tempSecondList)->y + (*tempSecondList)->rectTop))
{
(*tempFirstList)->collisionFunction(*tempFirstList, *tempSecondList);
(*tempSecondList)->collisionFunction(*tempSecondList, *tempFirstList);
}