Samapico Posted December 18, 2009 Report Posted December 18, 2009 Ok, I want to make a module to handle LVZ files. I'm making this topic for any kind of questions I'll have along the way, especially to keep the design of the module consistent with the rest. For the moment I just skimmed real quick through the other available modules. I'm guessing the modules I'll need to reference are: UniqueImage, Animations, Level, ...Though I'm not exactly sure which would be for what purpose. Do you draw the entire map virtually, and some module will handle the actual rendering? Or do you have somewhere where you refresh the whole screen to draw stuff? Edit: On a side note, I hate eclipse... What's the difference between .so files and .dll's? I'm guessing VS will build dll's, can they coexist with the other .so modules already built? Edit2: lol wtf... f***** thing raped my folders. Import screwed up badly. Can't even delete that shit, filenames too long Yeah... switching to VS Edit3: Managed to get rid of these folders... it involved renaming folders to 'a' to make the path shorter, and cut/pasting a part of it to the root of the drive
Bak Posted December 18, 2009 Report Posted December 18, 2009 Uh that path is definitely wrong (svn did that?) If you copy the selfship module, make SURE that you delete the .svn folder, as it will be invalid. You can then readd the correct folder to the repository using "svn add " and it will create the proper .svn folder. Give eclipse another chance it's wonderful. .so and .dll are the same exact thing. Having two different extensions was pointless and only caused more trouble. For LVZ, I would use the SettingsHandler->updateSetting function to add settings in the [Animation] and [uniqueImage] section as it expects (look in the default config file for animations settings), and then use the Animations module exclusively which will load from the settings you create (treating static images as 1 frame animations, much like I suspect continuum does). One thing I noticed that Animations doesn't support yet is screen coordinates (ScreenObjects). Mapobjects seem doable now though. I don't think you need to mess with Level*. You'll probably want to use Utilities to decompress the .lvz file.
Samapico Posted December 18, 2009 Author Report Posted December 18, 2009 The path crap was when I did something with eclipse, tried to import a project, or something like that... it decided to import it recursively or something. Thanks for the heads up
Samapico Posted December 19, 2009 Author Report Posted December 19, 2009 hmmm, I think I'm starting to get the hang of eclipse a bit;but I'm wondering, with Visual Studio you could make a huge "Solution" that contains every project, and you could mass-build them, or work them individually. Is there a way to do the same with eclipse? Or do I need to get another junk to use the makefile thing? ---------------------- And is there any reason why you're not using classes entirely? Correct me if I'm wrong: Each module has a class with the public functions (declared as function pointers), and the functions are defined in the .cpp as a public function, and these functions are assigned to the function pointers when the module is initialized...Why not simply use classes, with public functions for interface, and private for the rest? Is it easier to do some part (maybe memory protection?) if all the data is simply public? ---------------------- Callbacks... basically they're events that a module can trigger, and another module could "listen" for a specific callback and do something about it, right? For example, I could have a callback that says a specific LVZ file is done loading (or all lvz's requested are loaded, or they didn't load right), and whatever module loads the map/graphics when entering an arena will have to wait for this before loading stuff, cause the lvz might override graphics. (Or not, since it would just be a function call, no delay involved) I'll also need to somehow listen for the objon/off/set/move packets, and mess with the animations. I think I seen some code that told the Net module to pass on every packet about "something", or something like that... Anyway, I'll start by unpacking some lvz's ---------------------- If I understand it right, I'd use SettingsHandler to add [Animations] (these settings are regenerated entirely for each arena, correct?)Then I'd use UniqueImage because some images can belong to thousands of animations.Then I'd start/stop the animations through the Animation interface. That makes sense? This will be able to handle 65000 map objects? ---------------------- I see you use BOOL's and bool's, any reason for this, or it just depends on your mood?
Bak Posted December 20, 2009 Report Posted December 20, 2009 hmmm, I think I'm starting to get the hang of eclipse a bit;but I'm wondering, with Visual Studio you could make a huge "Solution" that contains every project, and you could mass-build them, or work them individually. Is there a way to do the same with eclipse? Or do I need to get another junk to use the makefile thing?Eclipse has a notion of a workspace, which contains projects. Try to change your current workspace (use file menu) to the Modules folder; there should be an eclipse workspace file there with all the modules included (if I added it to the svn). If not, tell me and I'll add it. You can then build all projects (which, for me, is faster than build solution in VC++, by the way), or build individual projects. And is there any reason why you're not using classes entirely? Correct me if I'm wrong: Each module has a class with the public functions (declared as function pointers), and the functions are defined in the .cpp as a public function, and these functions are assigned to the function pointers when the module is initialized...Why not simply use classes, with public functions for interface, and private for the rest? Is it easier to do some part (maybe memory protection?) if all the data is simply public? The way dll export works is in plain C (see the expansion of the DLLEXPORT macro), so using anything public functions and such is out of the question. Maybe that's not a perfect answer because I don't understand dynamic loading completely. This was the way MervBot and ASSS did it, so it's the way I do it. If you want to use classes within a specific module to better organize your code, feel free. Callbacks... basically they're events that a module can trigger, and another module could "listen" for a specific callback and do something about it, right? For example, I could have a callback that says a specific LVZ file is done loading (or all lvz's requested are loaded, or they didn't load right), and whatever module loads the map/graphics when entering an arena will have to wait for this before loading stuff, cause the lvz might override graphics. (Or not, since it would just be a function call, no delay involved) I'll also need to somehow listen for the objon/off/set/move packets, and mess with the animations. I think I seen some code that told the Net module to pass on every packet about "something", or something like that... Anyway, I'll start by unpacking some lvz's Yes callbacks are events you listen to, which are sort of like interrupts. Rather than periodically polling if a player has died, it's much cleaner to simply say "call this function when a player dies". This is the idea with callbacks. For the packets, however, you'll want to do the following: register and wait for the CB_REGPACKETS callback to occur, then call Net::regPacketFunc for any packets they wish to handle. regPacketFunc takes in a string for the type of packet you want to listen for and a callback-like function. The packet types and relevant fields are defined in conf/modules/net.conf in the [Packet Templates] section. grep for regPacketFunc to see some examples. If I understand it right, I'd use SettingsHandler to add [Animations] (these settings are regenerated entirely for each arena, correct?)Then I'd use UniqueImage because some images can belong to thousands of animations.Then I'd start/stop the animations through the Animation interface. That makes sense? This will be able to handle 65000 map objects?You are correct, yes there is no limit to the number of map objects save the computer's memory (also, don't reuse animation names and/or unique image names, obviously). I see you use BOOL's and bool's, any reason for this, or it just depends on your mood?Ideally I should use bools everywhere except in interface functions (since they get exported as C, although honestly I don't think it matters). I didn't pay too much attention to this, admittedly.
Samapico Posted December 21, 2009 Author Report Posted December 21, 2009 Holy crap, I just used a union for the first time in my life (to make something useful, that is) typedef struct LvzObjectDefinition { unsigned isMapObject :1; unsigned objectID :15; union /* Unnamed union */ { struct { signed xCoord :16; signed yCoord :16; }mapObjectCoord; struct { unsigned xReference :4; //Coordinate reference in x signed xCoord :12; //X coordinate unsigned yReference :4; //Coordinate reference in y signed yCoord :12; //Y coordinate }screenObjectCoord; //Only used for CLV2 screenobjects }; unsigned imageNumber :8; unsigned objectLayer :8; unsigned displayTime :12; unsigned displayMode :4; } LvzObjectDefinition;
Samapico Posted December 21, 2009 Author Report Posted December 21, 2009 I hate the STL lists and crap... I feel like copy-pasting Mervbot's implementation of linked list... so much easier to use
Samapico Posted December 21, 2009 Author Report Posted December 21, 2009 Ok, it's kinda late, it's probably nothing but... Trying to load my LVZ module; placed it in bin\modules\lvz, added it in modules.conf,and when I run discretion.bat, I get: Using debug terminal trick... (cskinviewer ..\main.cpp, line 1788)Zone description does not contain update site!SUCCESS: CHECK FOR UPDATES SUCCEEDED!SEGFAULT - debug information printed to bin/errorlog.txt Do I need to hack out some security check or something? (and wtf is the debug terminal trick?)
Bak Posted December 21, 2009 Report Posted December 21, 2009 debug terminal trick is having SDL print to the terminal, which normally I would need to recompile SDL since the normal output goes into .txt files (look at the FrontEnd/cskinviewer project near the start of main if you're interested). There is no security check for what you are doing, your module is simply crashing (segment fault = crash). You might check the bin/errorlog.txt file which may or may not contain useful information. If you can't find it attach your code and I'll take a look.
Samapico Posted December 21, 2009 Author Report Posted December 21, 2009 ok thanks... I didn't assign the interface function pointers properly in the init... works now. I think I'm almost done with step 1: Open a lvz file and scan all the data in it (easy) step 2: Save the files somewhere (easy) step 3: Open the lvz files after they were downloaded, while loading the level (medium) (Does ASSS already sends the lvz files to it? Or does the client have to request them?) step 4: Create UniqueImages and Animations for the mapobjects (hard) step 5: Make Animations support screenobjects (easy I guess) step 6: Make it override default graphics with the files in the lvz's (no idea)
Samapico Posted December 21, 2009 Author Report Posted December 21, 2009 Gotta love that debugging phase where you keep getting one step working at a time... adding printf's everywhere, then the console is clogged with crap Getting somewhere... Opening LVZ file 'castleobj2.lvz'Lvz file 'castleobj2.lvz' added18 sections in LVZSection 0: 'Tour1-2 torche.bmp', 21515 -> 47158File section 'Tour1-2 torche.bmp'File 'Tour1-2 torche.bmp' addedSection 1: 'Tour1-1.bmp', 226205 -> 447030File section 'Tour1-1.bmp'File 'Tour1-1.bmp' addedSection 2: 'Tour1-2.bmp', 44151 -> 120374File section 'Tour1-2.bmp'File 'Tour1-2.bmp' addedSection 3: 'Tour1-FU1.bmp', 8428 -> 140854File section 'Tour1-FU1.bmp'File 'Tour1-FU1.bmp' addedSection 4: 'Tour1-FU2.bmp', 3507 -> 75062File section 'Tour1-FU2.bmp'File 'Tour1-FU2.bmp' addedSection 5: 'Tour1-FU3.bmp', 8049 -> 123958File section 'Tour1-FU3.bmp'File 'Tour1-FU3.bmp' addedSection 6: 'Tour2-1.bmp', 226086 -> 447030File section 'Tour2-1.bmp'File 'Tour2-1.bmp' addedSection 7: 'Tour2-2.bmp', 42707 -> 120374File section 'Tour2-2.bmp'File 'Tour2-2.bmp' addedSection 8: 'Tour2-FU1.bmp', 8945 -> 140854File section 'Tour2-FU1.bmp'File 'Tour2-FU1.bmp' addedSection 9: 'Tour2-FU2.bmp', 3448 -> 75062File section 'Tour2-FU2.bmp'File 'Tour2-FU2.bmp' addedSection 10: 'Tour2-FU3.bmp', 7746 -> 109494File section 'Tour2-FU3.bmp'File 'Tour2-FU3.bmp' addedSection 11: 'MainFOO.bmp', 2830 -> 7990File section 'MainFOO.bmp'File 'MainFOO.bmp' addedSection 12: 'MainFO.bmp', 78718 -> 216374File section 'MainFO.bmp'File 'MainFO.bmp' addedSection 13: 'MainFU.bmp', 51104 -> 216374File section 'MainFU.bmp'File 'MainFU.bmp' addedSection 14: 'MurOuest.bmp', 8611 -> 14134File section 'MurOuest.bmp'File 'MurOuest.bmp' addedSection 15: 'MurOuest-FU.bmp', 863 -> 14134File section 'MurOuest-FU.bmp'File 'MurOuest-FU.bmp' addedSection 16: 'floor1.bmp', 53460 -> 92598File section 'floor1.bmp'File 'floor1.bmp' addedSection 17: '', 335 -> 894Object definition section: 196608 objects, 0 imagesOpened LVZ file 'castleobj2.lvz', success=1 Only problem is, there isn't 196608 objects in that LVZ, and there isn't 0 image definitions either I was fread'ing from the file that part, but it was already read and decompressed in a byte buffer... bleh.
Samapico Posted December 21, 2009 Author Report Posted December 21, 2009 Almost there... D:\Sam\Prog Projects\Discretion\client\trunk\disc_client\bin>discretion.batUsing debug terminal trick... (cskinviewer ..\main.cpp, line 1788)Zone description does not contain update site!SUCCESS: CHECK FOR UPDATES SUCCEEDED!Opening LVZ file 'castleobj2.lvz'Lvz file 'castleobj2.lvz' added18 sections in LVZSection 0: 'Tour1-2 torche.bmp', 21515 -> 47158File section 'Tour1-2 torche.bmp'File 'Tour1-2 torche.bmp' addedSection 1: 'Tour1-1.bmp', 226205 -> 447030File section 'Tour1-1.bmp'File 'Tour1-1.bmp' addedSection 2: 'Tour1-2.bmp', 44151 -> 120374File section 'Tour1-2.bmp'File 'Tour1-2.bmp' addedSection 3: 'Tour1-FU1.bmp', 8428 -> 140854File section 'Tour1-FU1.bmp'File 'Tour1-FU1.bmp' addedSection 4: 'Tour1-FU2.bmp', 3507 -> 75062File section 'Tour1-FU2.bmp'File 'Tour1-FU2.bmp' addedSection 5: 'Tour1-FU3.bmp', 8049 -> 123958File section 'Tour1-FU3.bmp'File 'Tour1-FU3.bmp' addedSection 6: 'Tour2-1.bmp', 226086 -> 447030File section 'Tour2-1.bmp'File 'Tour2-1.bmp' addedSection 7: 'Tour2-2.bmp', 42707 -> 120374File section 'Tour2-2.bmp'File 'Tour2-2.bmp' addedSection 8: 'Tour2-FU1.bmp', 8945 -> 140854File section 'Tour2-FU1.bmp'File 'Tour2-FU1.bmp' addedSection 9: 'Tour2-FU2.bmp', 3448 -> 75062File section 'Tour2-FU2.bmp'File 'Tour2-FU2.bmp' addedSection 10: 'Tour2-FU3.bmp', 7746 -> 109494File section 'Tour2-FU3.bmp'File 'Tour2-FU3.bmp' addedSection 11: 'MainFOO.bmp', 2830 -> 7990File section 'MainFOO.bmp'File 'MainFOO.bmp' addedSection 12: 'MainFO.bmp', 78718 -> 216374File section 'MainFO.bmp'File 'MainFO.bmp' addedSection 13: 'MainFU.bmp', 51104 -> 216374File section 'MainFU.bmp'File 'MainFU.bmp' addedSection 14: 'MurOuest.bmp', 8611 -> 14134File section 'MurOuest.bmp'File 'MurOuest.bmp' addedSection 15: 'MurOuest-FU.bmp', 863 -> 14134File section 'MurOuest-FU.bmp'File 'MurOuest-FU.bmp' addedSection 16: 'floor1.bmp', 53460 -> 92598File section 'floor1.bmp'File 'floor1.bmp' addedSection 17: '', 335 -> 894Object definition section: 48 objects, 20 imagesMapObject added, image 0MapObject added, image 1ScreenObject added, image 215MapObject added, image 60ScreenObject added, image 19MapObject added, image 0MapObject added, image 1ScreenObject added, image 215MapObject added, image 244ScreenObject added, image 19MapObject added, image 0MapObject added, image 1ScreenObject added, image 215MapObject added, image 0ScreenObject added, image 5MapObject added, image 0ScreenObject added, image 1ScreenObject added, image 224MapObject added, image 96ScreenObject added, image 17MapObject added, image 0ScreenObject added, image 1ScreenObject added, image 0ScreenObject added, image 144ScreenObject added, image 2MapObject added, image 0ScreenObject added, image 1ScreenObject added, image 112ScreenObject added, image 104ScreenObject added, image 6MapObject added, image 0ScreenObject added, image 1ScreenObject added, image 32ScreenObject added, image 192ScreenObject added, image 16MapObject added, image 0ScreenObject added, image 1ScreenObject added, image 224ScreenObject added, image 240ScreenObject added, image 18MapObject added, image 117ScreenObject added, image 46ScreenObject added, image 111MapObject added, image 101ScreenObject added, image 84MapObject added, image 104MapObject added, image 0ScreenObject added, image 99Image definition '☺' added (28002,112,1)Image definition '1-1.bmp' added (100,28500,29301)Image definition 'Tour1-2.bmp' added (1,1,100)Image definition 'Tour1-FU1.bmp' added (1,1,100)Image definition 'Tour1-FU2.bmp' added (1,1,100)Image definition 'Tour1-FU3.bmp' added (1,1,100)Image definition 'Tour2-1.bmp' added (1,1,100)Image definition 'Tour2-2.bmp' added (1,1,100)Image definition 'Tour2-FU1.bmp' added (1,1,100)Image definition 'Tour2-FU2.bmp' added (1,1,100)Image definition 'Tour2-FU3.bmp' added (1,1,100)Image definition 'MainFOO.bmp' added (1,1,100)Image definition 'MainFO.bmp' added (1,1,100)Image definition 'MainFU.bmp' added (1,1,100)Image definition 'MurOuest.bmp' added (1,1,100)Image definition 'MurOuest-FU.bmp' added (1,1,100)Image definition 'floor1.bmp' added (1,1,100)Image definition 'ð☺♥' added (0,894,0)Image definition '' added (72,0,23700)Image definition '' added (4864,0,512)Opened LVZ file 'castleobj2.lvz', success=1 It skipped about 4 image definitions at the beginning, so it messed up at the end too... hmm... I hope fread()'ing a struct with unions in it works fine...It seems this LVZ doesn't even have screenobjects, so there's definitely something wrong in there Oh well... c++ is dumb... sizeof(a struct with unions) = combined size of the unionswadafak? typedef struct { unsigned isMapObject :1; unsigned objectID :15; union /* Unnamed union */ { struct { signed xCoord :16; signed yCoord :16; }mapObjectCoord; struct { unsigned xReference :4; //Coordinate reference in x, see LvzScreenObjectReference signed xCoord :12; //X coordinate unsigned yReference :4; //Coordinate reference in y, see LvzScreenObjectReference signed yCoord :12; //Y coordinate }screenObjectCoord; //Only used for CLV2 screenobjects }; unsigned imageNumber :8; unsigned objectLayer :8; unsigned displayTime :12; unsigned displayMode :4; } LvzObjectDefinition;Aren't the 2 32bits structs in the union supposed to share the same memory space?I also tried to typedef the union on its own, then use a field of that type in the big struct, but got the same result. sizeof(LvzObjectDefinition) gives me 12 bytes instead of 10
Bak Posted December 21, 2009 Report Posted December 21, 2009 two notes: the way you're doing it you probably need to #pragma pack(1) to make sure there's no bytes buffering structures, which I suspect is what is happening. However, that method not compatible across platforms (And pragma pack is the devil), so is there anyway you could manually read a u32 and pick out the bits by hand and store them in the appropriate structure? It's not much more work but it's full proof in terms of compatibility across platforms. So for example something like u8 rawData[10]; while (fread(rawData, sizeof(rawData),1, f)) { LvzObjectDefinition l; l.isMapObject = (rawData[9] & 0x80) ? 1 : 0; l.objectId = ((rawData[9] & 0x7F) << | rawData[8]; ... myInteralDataStructure.push_back(l); } Open the lvz files after they were downloaded, while loading the level (medium) (Does ASSS already sends the lvz files to it? Or does the client have to request them?) Yes all files will be downloaded correctly, including lvz files. It will be put in the zone's path. I believe UniqueImage will check the zone's path when looking for images, which override the default graphics path.
Samapico Posted December 21, 2009 Author Report Posted December 21, 2009 hmmm, is the padding only at the end of the whole struct? Could I just do: for (ii = 0; ii < objHeader.objectCount; ii++) { addObjectDefinition(currentLvzFile, (LvzObjectDefinition*)dataPtr, objSectionType); dataPtr += 10; //instead of += sizeof(LvzObjectDefinition); }?? I got the data already in a larger byte buffer, I don't even need to fread() them individually.I hate using a magic number (10) in there, but it would be so much easier
Samapico Posted December 21, 2009 Author Report Posted December 21, 2009 And now that I think about it... another struct I use has 3 i16 fields, and its sizeof() comes out as 6... so why can't this one be 10? The bitfields messing it up?
Bak Posted December 22, 2009 Report Posted December 22, 2009 gcc supports pragma pack, use this one if you want: #pragma pack(push, 1) struct LvzObjectDefinition { unsigned isMapObject :1; unsigned objectID :15; union /* Unnamed union */ { struct { signed xCoord :16; signed yCoord :16; }mapObjectCoord; struct { unsigned xReference :4; //Coordinate reference in x, see LvzScreenObjectReference signed xCoord :12; //X coordinate unsigned yReference :4; //Coordinate reference in y, see LvzScreenObjectReference signed yCoord :12; //Y coordinate }screenObjectCoord; //Only used for CLV2 screenobjects }; unsigned imageNumber :8; unsigned objectLayer :8; unsigned displayTime :12; unsigned displayMode :4; }; #pragma pack(pop) My concern is that fread on a structure (or casting from a byte array) will vary depending on the endianness of the architecture. http://www.gamedev.net/reference/articles/article2091.asp . Then again, I'm pretty sure I fread a structure when reading in the tileset, so it may not be a huge deal; up to you.
Samapico Posted December 22, 2009 Author Report Posted December 22, 2009 (I thought I posted this, but apparently I didn't hit the big button)I don't need to fread the struct, cause the block is read as one byte block of a definite size, uncompressed, and only then I know it's a bunch of object definitions. So I just scroll through the byte buffer.But thanks, that pack push, pop thing seems to work fine
Samapico Posted December 22, 2009 Author Report Posted December 22, 2009 Some projects use SDL/... includes. It gives me unresolved inclusion errors. I can see where the required files are at, but what's the trick to get eclipse to look for them?
»jabjabjab Posted December 22, 2009 Report Posted December 22, 2009 So Im guessing Samapico is officially a programmer for Discretion?
Samapico Posted December 22, 2009 Author Report Posted December 22, 2009 Nothing much official here, buddy I still don't have write access to the SVN, so I guess I'm not official yet lol A quick question... my brain is starting to think about the UniqueImages and Animation and settings... The keys in the settings don't need to be the filename, right? Cause otherwise, that will give me some problems... LVZ's can have multiple image definitions from the same file
Bak Posted December 22, 2009 Report Posted December 22, 2009 SDL/... includes download the sdl development library: http://www.libsdl.org/download-1.2.php . That should have one dealy full of header files, and one with library files. Copy the contents of the lib folder into "MinGW\lib", copy the SDL folder (from the include folder) into "MinGW\include". Otherwise, you can add custom paths on a per project basis if you prefer, but the method I mentioned is easier. The settings for unique image look like this;;; This section defines additional images for UniqueImage to Use [images] TurretPath = turret TurretFrames = (10, 4) The name of the UniqueImage here would be "Turret", path specifies the path to use (should first check zone folder, than default graphics folder, also automatically figures out the extension). Frames specifies the number of frames in the image (turret.png is a tiled image with 40 frames, 10 wide 4 high) you can then use uniqueImage->getImageHandle to get a handle for the image given the name ("turret"). Afterwards, if you want to draw static images (you'll instead use the animations interface to do it for you), you can register a callback CB_PRERENDER (which is called every frame), and within it call graphics->drawImage(int imageHandle, int xPixel, int yPixel, int frame, int layer, int blend) to draw it on the screen. However, you'll want to instead use the animations interface and not uniqueimage/graphics directly. Animations, behind the scenes, will use uniqueImage and graphics as I described above. The settings for animation are ;;; This section defines the named animations used by the Animations Module. ;;; This allows you to create a unique image for the animation you want, and specify it in a common format, then use it in code by it's name, ;;; which is much easier than worrying about timing and image handles, and since it uses a UniqueImage there won't be memory issues [Animations] ;<anim name> Unique Image = Flag ;<anim name> Frame Offset = 0 ;<anim name> Frame Count = 20 ;<anim name> Animation Milliseconds = <int> ;<anim name> Animation Offset Milliseconds = <int> Warp Unique Image = Warp Warp Animation Milliseconds = 500 RedExhaust Unique Image = Exhaust RedExhaust Frame Offset = 0 RedExhaust Frame Count = 19 RedExhaust Animation Milliseconds = 500 Here, the animation is called "RedExhaust". It will use the image from UniqueImage "Exhaust" (which in turn defines a path for the actual file). Here, the animation also defines the frame offset and count (you should know what these are), and an animation time for one cycle of the animation. Notice that with warp, the entire image is used (which I think is always true for lvz animations, so you can actually omit frame offset and frame count when defining the settings). The functions you'll want to use are in the animations interface/** * Play an animation that will loop until we tell it to stop using stopLoopingAnimation * @param name the name used to identify the animation int the [Animations] section of hte settings * @param xPixel the x pixel of the animation * @param yPixel the y pixel of the animation * @param centered is this a centered animation? (false = top left corner was specified) * @param layer the later to draw it on * @return a const Animation* index you can use to stop the animation, or move it around (through this interface) */ Animation* (*playLoopingAnimation)(const char* name, int xPixel, int yPixel, bool centered, int layer); /** * Stop a looping animation (a is invalid after the function finishes), you don't need to stop single animations * @param a the animation returned by playLoopingAnimation which we're stopping */ void (*stopLoopingAnimation)(Animation* a); You'll probably want to add a function into the animations interface like playTimedLoopingAnimation which takes in a milliseconds parameters for the time to display the animation. The implementation will be almost identical to that of animations->playSingleAnimation Samapico is officially a programmer for Discretion Samp is the first person to honestly try to make a module :))))))))))))))
Samapico Posted December 22, 2009 Author Report Posted December 22, 2009 hmmm, how do you plan to handle zones with multiple subarenas using different graphics? Can the uniqueimage module handle folders? The zone folders could get quite messy otherwise...
Bak Posted December 22, 2009 Report Posted December 22, 2009 Right now the way it looks for paths is on a per-zone basis. Ideally, it would also have subfolders for each arena as continuum does. Right now per-zone is fine. In the future, I'll expand it to be unique for each arena (a lot of other things also need to be upgraded to handle multiple arenas). So the short answer is, don't worry about it.
Samapico Posted December 22, 2009 Author Report Posted December 22, 2009 Ideally, it would also have subfolders for each arena as continuum does.Actually it doesn't... But it keeps the lvz's packed, so files cannot be in conflict Some projects have this:#include "SDL.h"#include "SDL_thread.h" While others have the SDL/ folder in front... shouldn't they all have the SDL/ ? Also, SDL_image.h and SDL_net.h seem to be missing in my install... I have a bunch of other stuff, but not these 2 I downloaded this one: SDL-devel-1.2.14-mingw32.tar.gz (Mingw32)
Recommended Posts