More on the WinROTT port...

by Codewiz51 November 30, 2008 17:56

Update: Check out my wiki page for the latest download of WinROTT.

I'm making progress moving all extern declarations to header files and removing externs from any cpp files. I have been able to process about 50% of the CPP files.  By getting all of the declarations worked out, it will allow me to have modules consisting of a standalone header file (.h) and implementation file (.cpp). I'm also able to see declarations that belong in different modules. For instance, several variables are declared in WinROTT, but are only used in one other module and not used in WinROTT. It's generally better to  move the declarations and get rid of any global declarations.

Why do all of this? Once I get the modules properly divided up, I can begin to move code into class declarations. It will also make it easier to isolate OS and hardware specific code into separate dlls, rather than a monolithic program. It also helps me to become familiar with the code. I've already noticed several places where I can improve network code.

I'm also thinking it might be better to implement the game using a peer-to-peer protocol. Even though I am not a Microsoft fan, it might make sense to use their peer-to-peer protocol for WinROTT. I'd appreciate any comments on this. I'm interested in the MS P2P as a chance to become familiar with the protocol.

Gene

This stuff scares me...

by Codewiz51 November 29, 2008 10:49

It looks like an activist judge is trying to rewrite internet law. This article explains what is happening. Public pressure over cyber-bullying is going to over-react, criminalizing all sorts of behavior. Believe me, this is important to all of us.

An Amicus Brief: Issues in the Cyberbullying Case That Affect You

An interesting and hard to catch bug in WinROTT...

by Codewiz51 November 29, 2008 10:07

Update: Check out my wiki page for the latest download of WinROTT

While moving the WinROTT file w_wad.c to w_wad.cpp, I ran into the most interesting bug. It was very difficult to catch. The problem was only apparent when the game was compiled in Release mode. After inserting a lot of logging statements, I was able to trace the problem down to this routine.

int     W_CheckNumForName (char *name)
{
        char    name8[9];
        int             v1,v2;
        lumpinfo_t      *lump_p;
        lumpinfo_t      *endlump;

// make the name into two integers for easy compares

        strncpy (name8,name,8);
        name8[9] = 0;                   // in case the name was a fill 8 chars
        strupr (name8);                 // case insensitive

        v1 = *(int *)name8;
        v2 = *(int *)&name8[4];


// scan backwards so patch lump files take precedence

        lump_p = lumpinfo;
        endlump = lumpinfo + numlumps;

        while (lump_p != endlump)
           {
           if ( *(int *)lump_p->name == v1 && *(int *)&lump_p->name[4] == v2)
              return lump_p - lumpinfo;
           lump_p++;
           }


        return -1;
}

More...

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen | Modified by Mooglegiant




Disclaimer

This blog represents my personal hobby, observations and views. It does not represent the views of my employer, clients, especially my wife, children, in-laws, clergy, the dog, the cats or my daughter's horse. In fact, I am not even sure it represents my views when I take the time to reread postings.

© Copyright 2008