itaboy wrote:Hello guys, someone has an example of how to write back to disk a RSC file, after it has been modified in memory (e.g. after having translated or modified parts of it)
itaboy wrote:My only problem is in writing back the modified rsc file to disk. I assume I am making some errors during the conversion of pointers to offests, as ThorstenOtto suggested... I'll double check for that!
itaboy wrote:What I am doing is writing a RSC file translator. That is a program that has the only specific purpose to be able to adapt the text within the existing objects in a given rsc file to a different language.
Then the attached routines might help. They are simplified versions of ones i used in other programs, and i did only a quick check after the modifications, but they look ok. There is almost no error checking except for a failed fopen(), and especially the rsc_write() function assumes that all pointers still point to some area in the originally allocated area.
What's left to be done is to convert the object coordinates.
itaboy wrote:OK, if any of you is curious, I have made a test program.
It is just a proof of concept, not a full fledged app... but it works.
You can load a RSC file, go through all the strings and change (translate) the ones you want.
When you're done you can save back to disk the new RSC file and use it...
Now it works... thanks Thorsten!
Can you please provide or is it the same as the gembind.h from DRI
your DRI reference is for Intel version
ThorstenOtto wrote:Can you please provide or is it the same as the gembind.h from DRI
In my case this was gem.h from gnu-c's gemlib, but you should be able to use other gem libraries too, as long as it defines the needed types (especially the CICONBLK structure might not be present in very old libraries).
What do you mean with DRI reference?
If you are interested the code can be found here
Users browsing this forum: No registered users and 6 guests