![]() |
Re: HL1 For other platforms?
I thought the palette size was 256*3. If it is 256*2, then the format would be RRRRRGGGGGGBBBBB. That is a little bit more complicated to convert. It would be like this:
red = ((entry >> 9) * 255 / 31; green = ((entry << 5) >> 10) * 255 / 63; blue = ((entry << 11) >> 11) * 255 / 31; BTW, some textures are in WADs. It appears that the ones in WADs have no offset. |
Re: HL1 For other platforms?
I think it means 256 entries of 3 bytes, but thats working now I have a pointer to the palette.
The only problem now is converting it to a bitmap, I have next to no experience with images so this will take me a bit longer to figure out. I think its something like... u32 Pixel = SDL_MapRGB( format, palette[ pixel_data[ i ] ], palette[ pixel_data[ i + 1 ] ], palette[ pixel_data[ i + 2 ] ] ); Btw, this is in a seperate app now as I want to make sure it works before trying it in quake. Unfortunately I get nothing but garbage in the screen. |
Re: HL1 For other platforms?
Damn it happened again!
Anyway, use the data of a texture to look up an entry in the palette. Make sure you do it three times; one for each color. Then just copy it into wherever it needs to go. Also, make sure that you aren't accidentally mixing up length and width. I've done that before. |
Re: HL1 For other platforms?
Well, the darkplaces engine supports both half-life BSPs and wad3 files aswell as some pretty nice rendering enhancements like bloom, realtime lighting, ect...
I really should have looked harder to find a pre-made engine to use lol. |
Re: HL1 For other platforms?
Quote:
[edit] I just tried an esf map with Nexuiz (a game which uses the darkplaces engine) and it worked :) Well the skybox was missing, but maybe I had to copy another file. |
Re: HL1 For other platforms?
The really big problem which stands in the way of this working is quakec...
Important entities such as multi_manager have custom key/value pairs which get ignored by the engine. I added in something to call a quakec function when an unrecognized key/value pair was found but I could not figure out how to pass in strings to quakec as parameters to the function. Also, a HUGE problem is the half-life mdl format which is extremely undocumented and you can't use valve's code in the sdk due to licensing issues. It was really cool to see a hl map running under the quake engine and even having a healthcharger working but without model support this isn't going anywhere. |
Re: HL1 For other platforms?
Are you using the stock QuakeC compiler? I think there is a better one out there.
|
Re: HL1 For other platforms?
I can't remember which one I used but it was definately a custom one.
That isn't the problem though, inorder to use something like a multi_manager which has upto 16 custom key/value pairs for the target entity and firing delay you need seperate structures/memory for each type of entity. As far as I know all you get in quakec is the entvars_t structure unlike hl where you got pvPrivateData for classes, ect... One idea would be to rip out quakec entirely and put a new native system in place but that makes it really tempting to use the HL system. All the code is there but is unusable to anything but valve products so you'd have to re-create everything including porting over the basic entities from quakec. But model support is the real killer here, everything else is possible to re-create. |
Re: HL1 For other platforms?
The funny thing is, I was planning to convert Quake to use something similar to HL's system. I guess I'll have to do something else now.
Anyway, to figure it out, I would try to look at the lumps and see what looks like this structure, what looks like that structure, and what is it divisible by. Also, check to see if they are valid as floats or not. |
Re: HL1 For other platforms?
Reverse engineering the half-life model format may be too complicated for me :/
Although, I did just reverse engineer the pak file format from q1/q2. I know its opensource but I wanted to see how difficult it would be to reverse an entire file format. It was actually pretty easy and oddly enough, fun. Code:
const int PAK_IDENTITY = ( int ) ( 'K' << 24 ) + ( 'C' << 16 ) + ( 'A' << 8 ) + ( 'P' ); |
All times are GMT +2. The time now is 19:04. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.