Windows Rise of the Triad (WinROTT) port to C++

by Codewiz51 November 02, 2008 22:29

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

I've been working for several months on a port of the first person shooter game WinROTT. I ran into an interesting problem while porting a low level module. It's a case of gotcha's and an odd variable initalization problem. The problem manifested itself with this statement:

// boolean is defined as: typedef unsigned char boolean;
boolean StrechScreen = true;

The problem I ran across was that VS 2008 would not initialize this variable properly if it followed an extern "C" { ... } block. I discovered the problem while single stepping through a routine that flipped pages while displaying animation. A comparison of StretchScreen returned false when it should have returned true. I was able to move the declaration before the extern "C" block and all was well. Go figure...

Tags: , ,

Comments are closed

Powered by BlogEngine.NET 1.6.0.0
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-2011