Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Some questions about the code  (Read 3906 times)

Codaxio

  • Bay Watcher
    • View Profile
Some questions about the code
« on: August 17, 2013, 04:26:56 pm »

Hello !

I'm currently doing a french translation of Liberal Crime Squad so I started look inside the source code, but I have a few problems. Firstly because the grammar and syntax are different in english and french I need to adapt some sentences this is not very difficult. But I met a problem when I wanted to add a word before the name of an encounter in the file “fight.cpp” line 589,  if I want to add “The ENCOUNTER_NAME” it doesn't work and I don't know why.
    
Code: [Select]
   strcat(str," The "); //Nothing is displayed before the name of the encounter
   strcpy(str,a.name);
   strcat(str," ");
   if(mistake)strcat(str,"MISTAKENLY ");


And my second problem are the accents, because we use them very often in french language like 'é' 'è' or 'à' and I would like to know if there is a way to display them. I saw in the file “cursesgraphics.h” that it is possible to have some special characters with some kind of hack or something like that, I don't really understand this part, so I just followed the instructions to activate this one è “SMALL_LETTER_E_WITH_GRAVE”

Code: [Select]
* If a character were to be "turned on" do the following:
*
* 1. Uncomment the macro for the code for CP437
*   2. Uncomment the macro for ASCII_HACK and provide an alternative character.
*   3. Uncomment the macro for the code for Unicode
*   4. For the entry in gchar do:
* a) Remove "0,"
* b) Uncomment the macro
* c) Delete the "Not Used" Comment.

But it doesn't work too if I try to display this for example : addstr(“Très bien merci”);

So if someone know the solution to my problems please tell me, thanks.
Oh and I precise that I'm working on the last revision (r712) with the changes made by Liberal Elitist.

P.S. : Sorry if my english is not perfect.
« Last Edit: August 19, 2013, 04:54:14 am by Codaxio »
Logged

Carlos Gustavos

  • Bay Watcher
    • View Profile
Re: Somes questions about the code
« Reply #1 on: August 18, 2013, 03:30:05 pm »

For the first thing, you have the strcpy and strcat in the wrong order. When creating a sentence from pieces you start with strcpy to copy in the first word(s) and then use strcat every time you add on more (concatenate).
Code: [Select]
   strcpy(str," The ");
   strcat(str,a.name);
   strcat(str," ");
   if(mistake)strcat(str,"MISTAKENLY ");

I might look at the second thing later.
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Somes questions about the code
« Reply #2 on: August 18, 2013, 11:20:31 pm »

I am not sure. You see, a DOS box or a Win32 Console Application in Windows uses the Terminal font, with an OEM character set. The OEM character set for people in the United States is Code Page 437 (which is notable for all of its line-drawing symbols). It is a 256-character character set introduced by IBM back when the first IBM PCs came out, and is generally just used in computers with a United States English locale. If your computer is French and you purchased it in France, a Win32 Console Application will by default use a different OEM code page, I think the one for Western Europe, probably Code Page 850. Or maybe that is just for DOS boxes, since I have heard everything in Windows XP and later (or maybe Windows 2000 and later) internally uses UTF-16 Unicode character encoding. Liberal Crime Squad uses Code Page 437 though, although it is also supposed to be able to use Unicode. I am not exactly sure how this works, especially if someone's computer is a non-U.S. English locale. I would need a European computer to experiment with this, one of the ones with the official European Union-endorsed versions of Windows. You should try and find a French programmer who can answer this question, they would probably know how to deal with this sort of thing. By the way, English and French computers use the SAME character set for Windows programs that are NOT console applications: Code Page 1252. However, because Liberal Crime Squad runs as a Win32 Console Application using the Terminal font, Code Page 437, this complicates things. I'm pretty sure that Windows includes the Terminal font with Code Page 437 on all language versions, however, Code Page 437 is only the default for the United States locale. It can probably still be used in other versions of Windows but only if the program specifies to use code Page 437, or if Unicode is used to address the characters. But I'm not 100% sure.

Anyway, your computer's keyboard layout and the code page you use to edit documents are different from the code page used in the program. So if you want a letter with an accent over it, the code for it (a number between 0 and 255) is different. This is unfortunately a mess. That is why there is Unicode. Oh, and, I just looked this up, you should set the program to use the TrueType font Lucida Console rather than the raster font Terminal, so that Unicode will work. That ought to at least get things to display properly. But as for coding the special characters such as letters with accents over them, I don't quite know what to do, the only computers I have are United States computers with U.S. editions of Windows, so their OEM font will be Code Page 437, the same one used by Liberal Crime Squad. Sorry, I don't have access to any computers whose default OEM Code Page is different from the one Liberal Crime Squad uses so I can't solve your problem, you'll have to experiment with the code and find something that works on YOUR computer.

En français (Google Translate):

Je ne suis pas sûr. Vous voyez, une fenêtre DOS ou une application console Win32 sous Windows utilise la police Terminal, avec un jeu de caractères OEM. Le jeu de caractères OEM pour les personnes aux États-Unis est le code Page 437 (ce qui est remarquable pour l'ensemble de ses symboles de dessin au trait). Il s'agit d'un jeu de caractères à 256 caractères introduite par IBM en arrière quand les premiers PC d'IBM est sorti, et il est généralement peu utilisée dans les ordinateurs avec les Etats-Unis English locale. Si votre ordinateur est français et il a été acheté en France, une application console Win32 utilisera par défaut une page de code OEM différent, je pense que celui de l'Europe occidentale, Code probablement Page 850. Ou peut-être que c'est juste pour les boîtes DOS, puisque j'ai tout entendu dans Windows XP et versions ultérieures (ou peut-être Windows 2000 et versions ultérieures) utilise en interne Unicode UTF-16 codage de caractères. Liberal Crime Squad utilise le code page 437 que, même si elle est également censé être en mesure d'utiliser Unicode. Je ne sais pas exactement comment cela fonctionne, surtout si l'ordinateur de quelqu'un est une version localisée anglaise non américaine. J'aurais besoin d'un ordinateur européen à expérimenter cela, l'un de ceux ayant européennes les versions officielles Union avalisé de Windows. Vous devriez essayer de trouver un programmeur français qui peuvent répondre à cette question, ils auraient probablement savoir comment faire face à ce genre de chose. Par ailleurs, les ordinateurs français et en anglais utilisent le jeu de caractères identique pour les programmes Windows qui ne sont PAS consolent applications: page de code 1252. Toutefois, en raison libéral Crime Squad s'exécute comme une application console Win32 en utilisant la police Terminal, Code Page 437, ce qui complique les choses. Je suis assez sûr que Windows inclut la police Terminal avec le code Page 437 sur toutes les versions linguistiques, cependant, la page de code 437 est seulement la valeur par défaut pour les Etats-Unis locale. Il peut sans doute encore être utilisé dans d'autres versions de Windows, mais seulement si le programme prévoit d'utiliser le code page 437, ou si Unicode est utilisé pour traiter les caractères. Mais je ne suis pas sûr à 100%.

Quoi qu'il en soit, la disposition du clavier de votre ordinateur et la page de code que vous utilisez pour modifier des documents sont différents de la page de code utilisée dans le programme. Donc, si vous souhaitez une lettre avec un accent dessus, le code pour elle (un nombre entre 0 et 255) est différent. C'est malheureusement un gâchis. C'est pourquoi il est Unicode. Oh, et je viens de regarder ça, vous devez configurer le programme pour utiliser la police TrueType Lucida Console plutôt que le terminal de police raster, de sorte que Unicode fonctionnera. Cela devrait au moins faire avancer les choses pour s'afficher correctement. Mais comme pour le codage des caractères spéciaux tels que des lettres accentuées sur eux, je ne sais pas trop quoi faire, les seuls ordinateurs que j'ai sont les ordinateurs des États-Unis avec les éditions américaines de Windows, de sorte que leur police d'OEM sera la page de code 437, le même que celui utilisé par le libéral Crime Squad. Désolé, je n'ai pas accès à tous les ordinateurs dont la page de codes OEM par défaut est différent de celui Crime Squad libéral utilise donc je ne peux pas résoudre votre problème, vous aurez à expérimenter avec le code et trouver quelque chose qui fonctionne sur votre ordinateur.
« Last Edit: August 18, 2013, 11:29:50 pm by Liberal Elitist »
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Codaxio

  • Bay Watcher
    • View Profile
Re: Some questions about the code
« Reply #3 on: August 19, 2013, 05:09:43 am »

Thanks for the answers, the new code solved my first problem Carlos Gustavos ! Plus I now understand how to use strcat or strcpy, I thought that they were the same function. And what about addstr ? It is used only when you want to place a sentence somewhere with move(x,y) ?

About the accents thanks for your very detailed answer Liberal Elitist, it seems very complicated to display special characters in LCS. And and maybe the fact that U.S computers use the CP430 and europeans ones the CP850 is the reason why the newspaper is not like the one in the wiki ?

 
 

I have some weird accents 'Ì' instead of black blocks. I changed the font for a TrueType one but the result is the same, I will continue my tests. And you indirectly solved another problem about the size of the window which was to small, I changed some settings and now I almost have a fullscreen LCS !
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Some questions about the code
« Reply #4 on: August 19, 2013, 09:32:43 am »



That definitely looks messed up. Just like I thought. That is what things look like on any computer in Western Europe if people try to play Liberal Crime Squad. But how to fix it? We need to use Unicode. But I don't know how to program something to use Unicode, or whether it is compatible with the Curses library that displays the text. This requires further research.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Codaxio

  • Bay Watcher
    • View Profile
Re: Some questions about the code
« Reply #5 on: August 20, 2013, 03:46:04 pm »

For the moment and until I find a solution I make the translation without accents. Now I meet another problem, because in french grammar there is sometimes (it's depending of the tense and of the verb) differents conjugations for the verb if the subject is masculine or feminine.
So I need to know, if a sentence begin with the name of the liberal (for example) if it's a male or female in order to have the right conjugation (you are so lucky to don't have to bother with this kind of problems in the english language !).
I made some change in the code and I need to know if this is gonna work.

Code: [Select]
clearmessagearea();
            set_color(COLOR_CYAN,COLOR_BLACK,1);
            move(16,1);
            addstr(activesquad->squad[p]->name, gamelog);
            switch(encounter[0].type)
            {
            case CREATURE_COP:
            if (activesquad->squad[p]->gender_liberal == GENDER_FEMALE) addstr(" est saisie, ", gamelog); //The original string was : is seized
            else addstr(" est saisi, ", gamelog); //I will consider the intersex gender as a male

The compilation is ok but this will really return the gender of this liberal "activesquad->squad[p]->name" ? And are there other ways to get the gender of a liberal ?
There seems to have some pointers here because of the -> instead of a dot but if this line "addstr(activesquad->squad[p]->name, gamelog);" was not here I would probably never guess how to do this. Thanks.
« Last Edit: August 20, 2013, 03:51:35 pm by Codaxio »
Logged

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: Some questions about the code
« Reply #6 on: August 20, 2013, 03:52:40 pm »

I made some change in the code and I need to know if this is gonna work.

Code: [Select]
clearmessagearea();
            set_color(COLOR_CYAN,COLOR_BLACK,1);
            move(16,1);
            addstr(activesquad->squad[p]->name, gamelog);
            switch(encounter[0].type)
            {
            case CREATURE_COP:
            if (activesquad->squad[p]->gender_liberal == GENDER_FEMALE) addstr(" est saisie, ", gamelog); //The original string was : is seized
            else addstr(" est saisi, ", gamelog); //I will consider the intersex gender as a male

The compilation is ok but this will really return the gender of this liberal "activesquad->squad[p]->name" ? And are there other ways to get the gender of a liberal ?

That looks precisely correct to me.
Logged

Codaxio

  • Bay Watcher
    • View Profile
Re: Some questions about the code
« Reply #7 on: August 20, 2013, 04:01:41 pm »

Thank you Jonathan S. Fox ! By the way do you have an idea about this accent problem ?
Logged

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: Some questions about the code
« Reply #8 on: August 20, 2013, 04:08:34 pm »

Thank you Jonathan S. Fox ! By the way do you have an idea about this accent problem ?

I concur that unicode support is required, and also don't know the best way to go about accomplishing that.
Logged

Codaxio

  • Bay Watcher
    • View Profile
Re: Some questions about the code
« Reply #9 on: August 21, 2013, 02:48:39 am »

Ok, at least your answer gave me a solution to another problem this one :



Now I found how to get black blocks instead of some of these accents. You need to change the language for non unicode programs, so I changed french into english (U.S.A) and it's worked ! Here is a link which explain how to do this if someone want to try : http://www.7tutorials.com/changing-display-language-used-non-unicode-programs

@Liberal Elitist : I suppose  that if you change the language into french (France) you should have the same problem as me about these newspaper headlines. Of course I immediatly tried the accents but the result is still the same exept that this time the other characters displayed are differents. But at least, I think I'm on the right way.
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Some questions about the code
« Reply #10 on: August 21, 2013, 05:53:04 am »

Ah, I've found a way to set the console code page (link to MSDN, Microsoft Development Network, article about the SetConsoleOutputCP() function:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms686036%28v=vs.85%29.aspx

So, if Liberal Crime Squad calls this function when running on the Win32 platform, it will ensure that the console is in Code Page 437, the U.S. English code page that IBM developed for DOS sometime around the year 1980 (maybe late 70s, maybe early 80s). Unfortunately it will only work for TrueType fonts for the console (i.e. Lucida Console), not raster fonts (i.e. Terminal).

Now I found how to get black blocks instead of some of these accents. You need to change the language for non unicode programs, so I changed french into english (U.S.A) and it's worked ! Here is

Changing that setting in Windows (default language for non-Unicode programs) appears to be the way to ensure the program displays properly regardless of font (probably even works with the raster font Terminal).

This will only work on Windows 2000 and later (not Windows 9x). However Windows 9x has something called the Microsoft Layer for Unicode, basically the .DLL file unicows.dll, which can handle the same stuff, probably. So if people on Windows 9x want to play the game, and they have unicows.dll in their C:\WINDOWS\SYSTEM directory (NOT system32 like in NT-based OSes), it will PROBABLY work. Regardless, Windows 9x is not the priority, I am just mentioning this to say that if people have the proper .DLL file installed on Windows 9x it will probably work there too and we don't really need to worry about it, we can go ahead and implement this call to SetConsoleOutputCP() to set the correct code page and it will most likely work on all 32-bit versions of Windows except for Windows NT 3.x and Windows NT 4.0 but who cares about those, nobody does, that's who.

So I'll see about using SetConsoleOutputCP().

Oh, and I'll experiment with changing MY default language for non-Unicode programs to a different language, and see if I am able to OVERRIDE that setting. Yes, thanks to Codaxio for showing me that setting, now I know how to test for this bug on a U.S. English version of Windows, all I have to do is change that setting and Windows will run Liberal Crime Squad and other non-Unicode applications in a different language. Now I'll be able to fix this, is the point.

So, expect it to get fixed soon. Yes, I will fix it, I know what to do now.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Codaxio

  • Bay Watcher
    • View Profile
Re: Some questions about the code
« Reply #11 on: August 21, 2013, 07:16:32 am »

Wow it's great Liberal Elitist !

So if I understand, you want to change the code page of LCS by the CP437 by default with the help of this function SetConsoleOutputCP(). This will solve the newspaper and accents problems ?
Because according to MSDN the function  “affects how extended characters (ASCII value greater than 127) are displayed in a console window” (even if a TrueType font is needed it's not a big deal), and 'é' for example has the value 0233 in ASCII, so I wonder if the console will be able to display it correctly instead of something like this 'Ͱ®'.

By the way I don't understand how LCS is encoded ? Is it UTF-8, ASCII or Unicode (probably not this last one).
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Some questions about the code
« Reply #12 on: August 21, 2013, 10:56:57 am »

Wow it's great Liberal Elitist !

So if I understand, you want to change the code page of LCS by the CP437 by default with the help of this function SetConsoleOutputCP(). This will solve the newspaper and accents problems ?
Because according to MSDN the function  “affects how extended characters (ASCII value greater than 127) are displayed in a console window” (even if a TrueType font is needed it's not a big deal), and 'é' for example has the value 0233 in ASCII, so I wonder if the console will be able to display it correctly instead of something like this 'Ͱ®'.

By the way I don't understand how LCS is encoded ? Is it UTF-8, ASCII or Unicode (probably not this last one).

It is now fixed in revision 715! See here: http://sourceforge.net/p/lcsgame/code/715/ Now you will get correct display of extended characters if you use Lucida Console or another TrueType font for your console display, regardless of what language your version of Windows is set to use.

If your console display is using Raster Fonts (i.e. Terminal), however, you will need to either switch to Lucida Console, or if you really want to use Raster Fonts and get correct display you can go to Control Panel, International and Language Settings, then change the Default Language for Non-Unicode Applications to be U.S. English, Code Page 437.

As for the question of which code page LCS is in, if you are using it on Microsoft Windows, it is in U.S. English, Code Page 437. Sometimes people call this ASCII but that is incorrect, ASCII is 7-bit (consisting of 128 characters) and Code Page 437 is 8-bit (consisting of 256 characters). However on some other operating systems like Linux and Mac OS X, LCS uses UTF-8 / Unicode instead if there is support for it. But it does not use UTF-8 or any other form of Unicode on Windows.

Anyway I have fixed the problem with extended character display in non-U.S. English versions of Windows, as of Revision 715. Just be sure to either use Lucida Console (the easy solution) or set the default code page for non-Unicode applications to Code Page 437 (U.S. English) in the Windows Control Panel's international and language settings (the harder solution). Whatever you set as the default code page for non-Unicode applications in Control Panel will be used in all console windows that use raster fonts like Terminal instead of TrueType fonts like Lucida Console. It is impossible for any program to override this setting. That is a bug in Windows that Microsoft has no intention of fixing because they don't care. Linux and Mac OS X do not have this bug, and console windows on them can use any code page along with raster fonts without having to change an operating system-wide setting. Hopefully Liberal Crime Squad is taking advantage of that ability in Linux and Mac OS X, I am not sure whether the code for those operating systems is up to par with the LCS code written for Windows. It needs more testing on those platforms.

One more thing: you may notice some visual artifacts on the screen when using a TrueType font in a console window program like Liberal Crime Squad. This is another bug in Windows and can be fixed by turning off ClearType font smoothing. Standard font smoothing works much better with console applications. So I recommend having it set to Lucida Console, with Standard (NOT ClearType) font smoothing enabled. This bug with ClearType displaying wrong in Win32 console applications definitely occurs in Windows XP, I am not sure if it has been fixed in any of the more recent versions such as Windows Vista, Windows 7, or Windows 8. The visual artifacts in question are thin vertical lines on the right and left edges of characters. It is quite distracting. The screenshot you uploaded has those vertical lines in it:



All thanks to bugs in ClearType. Thanks Microsoft! Luckily you can turn it off and set your computer to standard font smoothing and the bug with vertical lines goes away. The setting for standard font smoothing is very hard to find in Windows 7 and later, apparently. Luckily there is a utility here that lets you have standard font smoothing (rather than ClearType or no font smoothing at all). That utility works on Windows Vista and later. On Windows XP, you just go to Control Panel, Display, Appearance, Effects, and then there's a checkbox that says "Use the following method to smooth edges of screen fonts" with 2 options, Standard and ClearType. Now let's say you actually LIKE ClearType. Well then you can turn it off when you run Liberal Crime Squad, and turn it back on when Liberal Crime Squad is finished.

Technically I could add a feature to the program (optional of course) that would temporarily disable ClearType while Liberal Crime Squad is running, then set it back to its previous setting when you exit the program. This could be toggled in init.txt. Because I tend to like ClearType for most of my programs (such as web browsing), but it messes up Liberal Crime Squad. Windows can turn it on or off quite quickly. This would be a good way to eliminate the visual artifacts, those awful vertical lines, that appear in Liberal Crime Squad when you are set to use Lucida Console (or another TrueType font if you have hacked Windows to give you more options) and ClearType is enabled.
« Last Edit: August 21, 2013, 01:26:20 pm by Liberal Elitist »
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Codaxio

  • Bay Watcher
    • View Profile
Re: Some questions about the code
« Reply #13 on: August 21, 2013, 02:26:48 pm »

Sir Liberal Elitist ! You're a genious, I really don't know how you did it so fast, that's amazing. You solved the newspapers problem but as you said the Raster font is still broken, but with a TrueType font it works like a charm. Plus and this is the most important to me :

 

Here is the famous 'é' so useful in french language !

But it's not so easy to display it, I had to do some tricky things before. Here is some explanations, at first in Code::Blocks when I typed 'é' the result was 'Θ' (the greek letter theta) TrueType font or not the result was still thesame.
Then I realized that 'Θ' has the place #233 (in ASCII) and the Alt-code ALT+0233 gives you an 'é', I thought that the program has confounded the two characters. I tried differents characters in order to find the right one but unsuccessfuly. And then I remember that I saw a few days ago on a forum a strange way to display characters. You write a backslash plus a number, so I tried \130 at first it gave me an 'X', then 133 a '[' so I searched in the ascii table here http://www.table-ascii.com/ and saw that was the number of the character not in decimal but in octal ! So I have converted 130(dec) into octal base (202) and it worked !

I really really don't know why the octal base, why the ascii table but I know that works !
So I think I'm gonna use all the accents normally and at the end of a file I use the function find and replace all the accents by their respective figure in octal base.

Sorry for my english (it must be awful to read) this answer was most difficult for me to write than the others I don't know why.

P.S : I've just seen your solution for these lines.

Thanks again !
« Last Edit: August 21, 2013, 02:29:01 pm by Codaxio »
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Some questions about the code
« Reply #14 on: August 21, 2013, 06:01:16 pm »

It is very good to hear your positive feedback! Now, I have dealt with another annoying problem. When ClearType is enabled in Windows XP or later, it messes up the display of Liberal Crime Squad if you are using a TrueType font such as Lucida Console instead of a raster font. And since using a TrueType font instead of a raster font is necessary on non-U.S. English versions of Windows to get the right characters displayed, the messed up display needs to be fixed for all of you international users. You know what I mean, the vertical lines that are different colors, you see them when there is a newspaper for instance. Well I have fixed this problem as well. Revision 716 now has an option in the init.txt file called "fixcleartype" that temporarily disables ClearType while Liberal Crime Squad is running, then restores your previous settings once the game is over. I have a rather long description of the change here on the revision 716 page.

You should include these changes in your French version of the game! Then everything will look much better on the screen. Of course, a little warning: if the game crashes or you close it by Alt-F4 or clicking the X in the corner instead of exiting the game normally, your previous font smoothing settings will not be restored, since those settings only get restored if you exit the game properly.

Anyway, this new option is off by default. To enable it, you have to enable "fixcleartype" in the init.txt file. Also, this new option does not affect Linux, Mac OS X, or pre-Windows XP versions of Windows at all, and all the code about it is completely ignored on those platforms. The "fixcleartype" option only has any effect on platforms that have ClearType as a feature: Windows XP and later (any version of Windows with an internal version greater than or equal to 5.1). And since it is off by default and can only be enabled by tinkering with the init.txt file, only people who know what they are doing will be able to turn this feature on. I can say that personally I will be playing the game with the "fixcleartype" feature enabled so that I can use Lucida Console without any graphic glitches. Most users of non-United States versions of Windows will probably also want this enabled, assuming they use Lucida Console rather than changing the default language for non-Unicode programs to U.S. English just so they can use raster fonts.

And since every single bit of code that is part of this option is surrounded by #ifdef WIN32 compiler flags, it won't cause any trouble for the Linux and Mac OS X users of the world.

For people who are not bothered by the vertical lines or who use raster fonts or don't use ClearType, they can just leave this "fixcleartype" option off, like it is by default. This option will probably work in Windows Vista, 7, and 8 as well. I should probably check and see if those versions of Windows still have this bug in ClearType like Windows XP does. Since Windows XP is only getting security updates at this point, and no longer getting non-security-related bug fixes, there is no chance of Microsoft fixing this bug in Windows XP. So this workaround will be necessary, at least as long as people keep using Windows XP. I am not sure whether or not it is necessary on newer versions of Windows though. On Microsoft's websites, they claim to have made improvements in ClearType in each version of Windows that has come out since XP. So there is a good chance that this bug was fixed in Windows Vista or Windows 7 (but if it didn't get fixed in EITHER of those, there's no way it would have gotten fixed in Windows 8). I will have to check and see, on the Windows 7 computer that I just happen to have lying around downstairs, that doesn't actually belong to me, but I'm going to use it anyway to test this out.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL
Pages: [1] 2