Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : SGI/Unicode CFiles changes
New Topic New Poll Post Reply
Poster Message
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon SGI/Unicode CFiles changes (0)  
I finally got my SGI port/Unicode CFiles changes checked in. I did a new checkout, and DRODUtil and DROD are compiling clean. DRODUtil is broken, but Erik said he was redoing a lot of DRODUtil and not to worry.

There are a couple new things to keep in mind:
* When #include-ing files, use / instead of \\ - the SGI (and Linux) don\'t like \\, but the PC doesn\'t mind /.

* When adding anything new to the databases, be mindful of endianness. The SGI needs bytes swapped on shorts/ints/etc., and there are new functions to make it easy.

* If creating a WSTRING that will contain a pathname, use the constant SLASH which will be either \\ or / depending on the platform.

* For the databases to be loaded from WSTRING filenames, I had to make a new stream class that reads/writes the files. When the split databases code is uncommented, hopefully all will still work - I changed the commented code to work with my changes.

I\'m sure there\'s a million more things, but hey, you guys are smart and will figure it out. Or feel free ask me if there are problems or questions.

This coming week is looking busy, but as soon as I can I\'ll look into a couple of bugs I noticed while porting that I may or may not have caused.

Oh, I\'m also going to add some Visual Studio.NET project files soon - that\'s what I use at home and on my portable.


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
04-06-2003 at 05:35 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: SGI/Unicode CFiles changes (0)  
Schik wrote:
I finally got my SGI port/Unicode CFiles changes checked in.
By the sound of it, you\'ve done some good work! I can\'t wait to see the changes. You\'re the man!


____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
04-07-2003 at 09:00 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: Re: SGI/Unicode CFiles changes (0)  
mrimer wrote:
By the sound of it, you\'ve done some good work! I can\'t wait to see the changes. You\'re the man!
It felt like a good accomplishment, but then I run DROD and it\'s... exactly... the... same.

Hopefully I can do some other stuff soon that\'s more outwardly obvious.

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
04-07-2003 at 08:38 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: SGI/Unicode CFiles changes (0)  
Time to ask Schik, our new resident Unicode expert. The syntax used to represent Unicode strings, for example:

WCHAR wszLeft[] = {\'[\',\' \',0};

in several spots looks kinda clunky. Can this just be replaced with

WCHAR wszLeft[] = L\"[ \";

? Or do these not give the same result from what you\'ve seen?

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
04-13-2003 at 05:20 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: Re: SGI/Unicode CFiles changes (0)  
mrimer wrote:
Time to ask Schik, our new resident Unicode expert. The syntax used to represent Unicode strings, for example:

WCHAR wszLeft[] = {\'[\',\' \',0};

in several spots looks kinda clunky. Can this just be replaced with

WCHAR wszLeft[] = L\"[ \";

? Or do these not give the same result from what you\'ve seen?

I was having some problems with this on the SGI, as my compiler doesn\'t seem to support Unicode very well. For instance, my wchar_t is 4 bytes instead of two, which would screw a lot of stuff up. That\'s why we\'re using WCHAR instead of wchar_t and WSTRING instead of wstring. All filenames are kept as Unicode, but on any platform not having HAS_UNICODE defined will convert filenames to plain ol\' ascii to open the files.

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
04-13-2003 at 05:27 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Am I going crazy? (0)  
I get email notifications, and I saw a couple messages from Mike about Debug build not working and heap errors... when I click on the link in the emails, it comes to this thread, but I don\'t see the comments. I can\'t find them in any other threads either. This has happened a couple times before. Am I insane?

If my mind didn\'t completely fabricate those emails - my answer is that the Debug and Release builds are both working fine for me. When I get back to work on Monday I can try running it through Purify to see if it\'s catching any weird errors.

[Edited by Schik on 04-12-2003 at 10:32 PM GMT]

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
04-13-2003 at 05:30 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Am I going crazy? (0)  
Schik wrote:
I get email notifications, and I saw a couple messages from Mike about Debug build not working and heap errors... when I click on the link in the emails, it comes to this thread, but I don\'t see the comments. I can\'t find them in any other threads either. This has happened a couple times before. Am I insane?
Wow, I didn\'t know about email notifications. Yeah, I posted those messages, and then in desperation did a clean build, and that fixed it. So I deleted my inaccurate posts. So be assured that all is well (until next time) ;)

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
04-13-2003 at 05:35 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: Re: Am I going crazy? (0)  
mrimer wrote:
So I deleted my inaccurate posts.
And I didn\'t even know until now that you could delete posts. Ahh.. there it is.

Oh, and I updated to the new fmod and got your changes and it still works :glasses



____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
04-13-2003 at 05:40 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: SGI/Unicode CFiles changes (0)  
Schik wrote:
I finally got my SGI port/Unicode CFiles changes checked in. I did a new checkout, and DRODUtil and DROD are compiling clean. DRODUtil is broken, but Erik said he was redoing a lot of DRODUtil and not to worry.
In order to get on with some tasks, I added Unicode support to DRODUtil. If no one has a problem with me having done that, I\'ll check it in after a few days.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
04-15-2003 at 07:33 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Gah! File read problems! (0)  
I think fgetWs() has a bug. I think the fread(...) line in the loop should be replaced with

const int numread = fread( &c, sizeof(WCHAR), 1, pFile );
if (numread == 0)
{
//Reached end of file data.
*(wszWrite++) = \'\\0\'; //null terminate string
break;
}

Otherwise, fread keeps reading the same character (not null) when it gets to the end of file! (I noticed that DROD wasn\'t reading in dataPath.txt correctly, and had to \"fix the path\" every time it started.) This change seems to work.

If this looks right, I\'ll check it in.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
04-18-2003 at 12:20 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Unicode in the DB (0)  
Okay, here\'s a question for anyone who\'s up on the DB. Now that we have everything being done in Unicode, how do we change the DB and message text strings to support Unicode? This is the last hurdle in the data structures keeping us from making DROD multi-lingual.

On a related note, should the text strings used in CDbRoom::GetLevelPositionDescription() be moved to the DB? I would think so...

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
04-18-2003 at 01:06 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: Gah! File read problems! (0)  
mrimer wrote:
I think fgetWs() has a bug. I think the fread(...) line in the loop should be replaced with
Looks good to me - sorry about that. I know I originally had a similar problem with another function which I fixed before checking in, but I missed that one...



____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
04-18-2003 at 02:10 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: Unicode in the DB (0)  
mrimer wrote:
Okay, here\'s a question for anyone who\'s up on the DB. Now that we have everything being done in Unicode, how do we change the DB and message text strings to support Unicode? This is the last hurdle in the data structures keeping us from making DROD multi-lingual.
I thought the DB had Unicode strings in it. I know I had to muck around with WCHAR* CDbPackedVars::GetVar() to get the strings from the DB to be drawn correctly. I ended up having to not convert them from little to big endian though, looking at the code. But the fact that changing that particular GetVar() changed the output, I\'m led to believe the strings (at least some?) are already in Unicode. But I may be wrong.
On a related note, should the text strings used in CDbRoom::GetLevelPositionDescription() be moved to the DB? I would think so...
I guess I don\'t see why not, but I\'ve still been trying to avoid delving too deeply into the database - the weird syntax confuses my little brain.


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
04-18-2003 at 02:27 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Re: Unicode in the DB (0)  
Schik wrote:I\'ve still been trying to avoid delving too deeply into the database - the weird syntax confuses my little brain.
Heh, yeah I know what you mean. While Erik was down in Paraguay making big bucks, I had to figure out how all that database interface stuff worked to implement multiple player records, multiple holds, the level editor stuff, etc.

Hmm...so all those text strings that get added into the DB in DRODUtil are already Unicode, eh? Okay, thanks. I\'ll take another look at it.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
04-18-2003 at 05:56 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Re: Unicode in the DB (0)  
Schik wrote:
mrimer wrote:
Okay, here\'s a question for anyone who\'s up on the DB. Now that we have everything being done in Unicode, how do we change the DB and message text strings to support Unicode? This is the last hurdle in the data structures keeping us from making DROD multi-lingual.
I thought the DB had Unicode strings in it.
That\'s right. Texts are stored in unicode already. You must populate the database with messages in the different languages, then calling (I think) CdbBase::SetCurrentLanguage() will let you change languages at run-time.

mrimer wrote: On a related note, should the text strings used in CDbRoom::GetLevelPositionDescription() be moved to the DB? I would think so...
It probably doesn\'t help anything to move them into the database because the grammar rules needed to format the text will differ from language to language. You have to concatenate the string literals in different ways depending on the lanugage. This is why there is a GetLevelPositionDescription_English() function. A separate function is meant to be written for each supported language. Okay, maybe some of that text benefits from being localized, but its no big deal to keep them as string literals.

Keyword-search for \"_English(\" in all files and you should turn up at least one other place where this thinking is used.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
04-19-2003 at 04:02 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Unicode in the DB (0)  
erikh2000 wrote:
It probably doesn\'t help anything to move them into the database because the grammar rules needed to format the text will differ from language to language. You have to concatenate the string literals in different ways depending on the lanugage. This is why there is a GetLevelPositionDescription_English() function. A separate function is meant to be written for each supported language. Okay, maybe some of that text benefits from being localized, but its no big deal to keep them as string literals.
Yeah, I see what you mean. But the problem is that you can\'t TYPE other alphabets into the code if they aren\'t in ASCII. So I think we\'re going to have to put the text for this into the DB, and retain a function that references the MIDs and puts the grammar together the right way for each language.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
04-21-2003 at 04:46 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: Unicode in the DB (0)  
mrimer wrote:
Yeah, I see what you mean. But the problem is that you can\'t TYPE other alphabets into the code if they aren\'t in ASCII. So I think we\'re going to have to put the text for this into the DB, and retain a function that references the MIDs and puts the grammar together the right way for each language.
Oh, right.

No problem to put it in the database. Also, the arrays that go like \"UCHAR wczText[] = {\'D\', \'o\', \'g\', 0};\" can take numbers for elements, i.e. \"UCHAR wczText[] = {432, 12, 1027, 0};\".

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
04-21-2003 at 06:40 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : SGI/Unicode CFiles changes
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.