Thanks another_commander and Ahruman.
So far the NO_SHADERS define and IRIX are going nowhere fast. I apologise for the verbose nature of this post but I think it's best that I show you everything that I've done so you can point out my obvious mistake
I'm using GNUStep from the Startup 0.20.0, I'm using the SGI development libraries and foundation 1.3, GNU Make 3.81 and I'm compiling with GCC 3.4.6.
Our first stumbling block is the GNUMakefile. I have to add -std=c99 to the CFLAGS and of course -DNO_SHADERS to both CFLAGS and OBJCFLAGS. Then I tweaked the GNUMake.postamble to sort the object file locations. Finally we're ready to
And we hit a problem almost immediately, an undeclared isShadered in PlanetEntity.m
Code: Select all
Compiling file src/Core/Entities/PlanetEntity.m ...
src/Core/Entities/PlanetEntity.m: In function `-[PlanetEntity initAsSunWithColor:]':
src/Core/Entities/PlanetEntity.m:153: error: `isShadered' undeclared (first use in this function)
src/Core/Entities/PlanetEntity.m:153: error: (Each undeclared identifier is reported only once
src/Core/Entities/PlanetEntity.m:153: error: for each function it appears in.)
src/Core/Entities/PlanetEntity.m: In function `-[PlanetEntity initAsAtmosphereForPlanet:dictionary:]':
src/Core/Entities/PlanetEntity.m:357: error: `isShadered' undeclared (first use in this function)
src/Core/Entities/PlanetEntity.m: In function `-[PlanetEntity drawEntity::]':
src/Core/Entities/PlanetEntity.m:1357: error: `isShadered' undeclared (first use in this function)
To get round this I adjusted the defines in PlanetEntity.h to :
Code: Select all
BOOL isShadered;
#ifndef NO_SHADERS
GLhandleARB shader_program;
#endif
We then trundle through the code until we reach...
Code: Select all
Compiling file src/Core/Universe.m ...
In file included from src/Core/Universe.m:40:
src/Core/OOCPUInfo.h:78:2: #error Neither OOLITE_BIG_ENDIAN nor OOLITE_LITTLE_ENDIAN is defined as nonzero!
make[1]: *** [obj/Universe.o] Error 1
make: *** [oolite.all.objc-program.variables] Error 2
Which I fixed with a quick bodge to OOCPUInfo.h
Code: Select all
#if !defined(OOLITE_BIG_ENDIAN) && !defined(OOLITE_LITTLE_ENDIAN)
#if defined(__i386__) || defined(__amd64__) || defined(__x86_64__)
#define OOLITE_LITTLE_ENDIAN 1
#endif
// Matches for IRIX
#if defined(__sgi__) || defined(__mips__)
#define OOLITE_BIG_ENDIAN 1
#endif
Next up is OOMesh.m
Code: Select all
Compiling file src/Core/OOMesh.m ...
src/Core/OOMesh.m: In function `-[OOMesh(Private) setUpMaterialsWithMaterialsDictionary:shadersDictionary:shaderMacros:shaderBindingTarget:]':
src/Core/OOMesh.m:527: error: `OOShaderMaterial' undeclared (first use in this function)
src/Core/OOMesh.m:527: error: (Each undeclared identifier is reported only once
src/Core/OOMesh.m:527: error: for each function it appears in.)
make[1]: *** [obj/OOMesh.o] Error 1
make: *** [oolite.all.objc-program.variables] Error 2
This one is tricky and I'm not sure my solution is particularly good (read as : wrong)
Code: Select all
- (void)setUpMaterialsWithMaterialsDictionary:(NSDictionary *)materialDict
shadersDictionary:(NSDictionary *)shadersDict
shaderMacros:(NSDictionary *)macros
shaderBindingTarget:(id<OOWeakReferenceSupport>)target
{
OOMeshMaterialCount i;
OOMaterial *material = nil;
if (materialCount != 0)
{
for (i = 0; i != materialCount; ++i)
{
material = [OOMaterial materialWithName:materialKeys[i]
forModelNamed:baseFile
materialDictionary:materialDict
shadersDictionary:shadersDict
macros:macros
bindingTarget:target
forSmoothedMesh:isSmoothShaded];
#ifndef NO_SHADERS
if (material!=nil)
{
materials[i] = [material retain];
}
else
{
materials[i] = [[OOShaderMaterial placeholderMaterial] retain];
}
#else
if (material!=nil)
{
materials[i] = [material retain];
}
#endif
}
}
// else
// {
// material = [[OOShaderMaterial placeholderMaterial] retain];
// }
}
It compiles, so that means it must work right?
Next up is a simple case of IRIX not having an M_PI definition
Code: Select all
Compiling file src/Core/OOOpenGL.m ...
src/Core/OOOpenGL.m: In function `GLDrawBallBillboard':
src/Core/OOOpenGL.m:97: error: `M_PI' undeclared (first use in this function)
src/Core/OOOpenGL.m:97: error: (Each undeclared identifier is reported only once
src/Core/OOOpenGL.m:97: error: for each function it appears in.)
src/Core/OOOpenGL.m: In function `GLDrawOvalPoints':
src/Core/OOOpenGL.m:121: error: `M_PI' undeclared (first use in this function)
make[1]: *** [obj/OOOpenGL.o] Error 1
make: *** [oolite.all.objc-program.variables] Error 2
A quick define in OOOpenGL.h will help with that
Code: Select all
#if !M_PI
#define M_PI 3.14159265358979323846 // Close enough
#endif
#define NULL_SHADER ((GLhandleARB)0)
And that's it, we're compiled. Time to run that bad boy and...
Code: Select all
2008-09-02 04:06:47.562 oolite[5738] [log.header]: Opening log for Oolite version 1.71.2 (<unknown big-endian architecture> test release) under Linux at 2008-09-02 04:06:47 -0700.
1 processors detected.
Note that the contents of the log file can be adjusted by editing logcontrol.plist.
2008-09-02 04:06:47.569 oolite[5738] [unclassified.MyOpenGLView]: initialising SDL
2008-09-02 04:06:47.598 oolite[5738] [unclassified.JoystickHandler]: init: numSticks=0
2008-09-02 04:06:47.600 oolite[5738] [unclassified.MyOpenGLView]: CREATING MODE LIST
2008-09-02 04:06:47.658 oolite[5738] [unclassified.MyOpenGLView]: drawRect calling initialiseGLWithSize
2008-09-02 04:06:47.659 oolite[5738] [unclassified.MyOpenGLView]: Creating a new surface of 800 x 600
2008-09-02 04:06:47.681 oolite[5738] [unclassified.MyOpenGLView]: no universe, clearning surface
2008-09-02 04:06:47.685 oolite[5738] [rendering.opengl.version]: OpenGL renderer version: 1.1.0 ("1.1 Irix 6.5")
Vendor: SGI
Renderer: IMPACT/1/1/4
2008-09-02 04:06:47.686 oolite[5738] [rendering.opengl.extensions]: OpenGL extensions (27):
GL_EXT_abgr GL_EXT_blend_color GL_EXT_blend_logic_op GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_convolution GL_EXT_copy_texture GL_EXT_histogram GL_EXT_packed_pixels GL_EXT_polygon_offset GL_EXT_subtexture GL_EXT_texture GL_EXT_texture3D GL_EXT_texture_object GL_EXT_vertex_array GL_SGI_color_matrix GL_SGI_color_table GL_SGI_texture_color_table GL_SGIS_texture_filter4 GL_SGIS_detail_texture GL_SGIS_texture_border_clamp GL_SGIS_texture_select GL_SGIS_texture_lod GL_SGIX_list_priority GL_SGIX_pixel_texture GL_SGIX_texture_multi_buffer
2008-09-02 04:06:47.688 oolite[5738] [dataCache.notFound]: No data cache found, starting from scratch.
2008-09-02 04:06:47.698 oolite[5738] Failed to recurse into directory 'AddOns' - No such file or directory
2008-09-02 04:06:47.699 oolite[5738] Failed to recurse into directory '/.Oolite/AddOns' - No such file or directory
2008-09-02 04:06:47.700 oolite[5738] [searchPaths.dumpAll]: ---> OXP search paths:
("/home/oolite-dev-source-1.71.2/oolite.app/Resources", AddOns, "/.Oolite/AddOns")
2008-09-02 04:06:48.935 oolite[5738] [startup.exception]: ***** Unhandled exception during startup: NSInternalInconsistencyException (Unable to detach thread (last error No such file or directory)).
Unfortunately when I try to run it through gdb it only identifies an unrecognised signal and seems to stuff itself into a perpetual loop.
Any ideas?
Just as a passing shot, although NO_SHADERS will go partially to solving the problem I'm of the opinion that I also really need to produce an OXP with massively trimmed textures, a mechanism for disabling the nebula clouds (or examine their rendering technique). I also need to have serious look at the planet/atmosphere texturing.