Info line, event handling and winking miniatures

Hey all! 🙂

First of all, let me show you the most significant progress of the week! Then I’ll talk about our present difficulties.

So, the new things is the so-called ‘info line’:

It’s the brown strip on the top of the panel at the bottom of the screen, showing ‘Wacek’  – the name of our hero. 🙂 (Arnaud decided to call him Vincent in the English translation, since that’s the closest name we’ve got to the original.) The purpose of this line is very common in adventure games: it shows the name of the thing which the player is hovering his mouse over at the moment.

What I left out from my last post: you may also notice that the face of our protagonist at the bottom left corner of the screen is now in color. I can tell you that the small icon is also animated now: it winks and makes various faces. (You can check this in motion in my last video.) As I perceived, it’s intended to display which one is the currently active character in the game, and you will be able to switch between them by clicking on their icons. (Since in the first screen you only got Vincent, only his portrait can be active.)

Now my problems:
As you can see, the misplacement of numerous objects is still a great problem. Also as I implemented the info line, which checks the screen and the coordinates of objects on it, it turned out (not unexpectedly) that the wrong handling of the z dimension manifests there also. Even worse, as I implemented the event handling of the mouse, the problem (also not so unexpectedly) came to the surface again. So now I am pretty much stuck because of that. But everything has a bright side: I also discovered what might be utterly wrong. I have a very strong suspicion that the problem is not with the numeric representation of the coordinates (that I use doubles for storing the values instead of fixed-point integers, as the original did), but with the loading of them.

Let me show you it in more depth! The problem is, that CGE2 uses some – currently a little bit mythical – reference coordinates called “eyes” in almost every function which computes the final coordinates of objects. All I could found about what this eye supposed to be is a comment in one of the original sources which calls it “camera”. So I suppose it’s purpose is to center the view of each scene at a particular point. And THAT’S THE PROBLEM. The original has this code for the loading of the “eye” value for each room:

static void LoadTab (void)
{
  int i;
  V2D::SetEye(Text[240]);
  for (i = 0; i < CAVE_MAX; i ++) EyeTab[i] = V2D::Eye;
  INI_FILE f(TAB_NAME);
  if (!f.Error) f.Read(EyeTab, sizeof(EyeTab));
}

To understand the problem fully, here’s also the declaration of EyeTab:

V3D    EyeTab[CAVE_MAX];

And since the original stores the coordinates in V3D in the form of three FXP’s (the fixed-point integer representation which we can’t reimplement because we don’t have the full source code of it), I wasn’t able to manage to mimic it correctly. The best I’ve got so long is that I set all values of EyeTab to V2D::Eye which is stored plainly as numbers in a source file, like this:

240=160, 100, -200 ; camera

(See? The “camera” comment!)

…and use this one for every screen. But, as you may see, this causes all of the coordinate computations to go wrong, and here we are: I am stuck.

So, my most urgent task currently is to fix this loading (with help from Arnaud and Paul). Then, I’ll have to find the point where the event triggered which gets Vincent out of his seat, and then… Who knows? Hopefully there won’t be much to stop me anymore from rapid progress… 🙂