2024-05-10

Say hello to Far Cry on Linux!

There's no sound, some broken rendering, and in-game cutscenes don't play, but I can run around and shoot people! Minimum Viable Port, baby!

I want to thank whoever at CryTek added the setting so that rendering calls could be logged into a file, which helped me track down an uninitialized shader handle being used when rendering models. I also want to thank whoever decided to add an OpenGL renderer at all -by 2004, I think most PC game developers were starting to board the DX9 hype train.

The code to do all this hasn't been pushed yet - there's lots of hacks and debugging work I need to clean up so you won't see my more desperate efforts like this:

#if 1
#define BEGIN_ERROR int fuck = glGetError();\
while (fuck != 0)\
{\
	fuck = glGetError();\
}

#define END_ERROR fuck = glGetError();\
	if (fuck != 0)\
	{\
		printf("FUCK %s!!\n", __func__);\
	}
#else
#define BEGIN_ERROR
#define END_ERROR
#endif

The rendering code also still relies on the long deprecated Cg Toolkit, which is closed source. I'd like to eventually remove this - I think there are some projects that translate Cg shader code to GLSL.