osggraph: Avoid including car.h on header files

car.h defines a bunch of macros with a leading underscore (e.g.: _name)
that can clash with symbols from other projects.

More specifically, the _name macro was causing header files from
OpenSceneGraph to break, since they already used _name for other
purposes.
This commit is contained in:
Xavier Del Campo Romero 2025-01-17 14:27:20 +01:00
parent ec61c3700e
commit 05060efeb9
Signed by: xavi
GPG key ID: 84FF3612A9BF43F2
10 changed files with 37 additions and 13 deletions

View file

@ -45,6 +45,8 @@
#include "OsgShader.h"
#include "OsgReflectionMapping.h"
#include "OsgNodeMask.h"
#include <car.h>
#include <raceman.h>
namespace osggraph {

View file

@ -19,17 +19,19 @@
#ifndef _OSGCAR_H_
#define _OSGCAR_H_
#include <car.h>
#include <raceman.h>
#include <vector>
#include <osg/TextureCubeMap>
#include <osg/LOD>
#include "OsgLoader.h"
#include "OsgWheel.h"
//#include "OsgBackFire.h"
#include "OsgCarLight.h"
struct CarElt;
typedef struct CarElt tCarElt;
namespace osggraph {
class SDCarShader;

View file

@ -38,6 +38,8 @@
#include "OsgHUD.h"
#include "OsgParticles.h"
#include <raceman.h> //tSituation
namespace osggraph {
//extern osg::Timer m_timer;

View file

@ -21,7 +21,11 @@
#include <camera.h>
#include <graphic.h>
#include <raceman.h> //tSituation
#include <track.h>
#include <tgf.h>
struct Situation;
typedef struct Situation tSituation;
namespace osggraph {

View file

@ -24,6 +24,12 @@
#include <osg/Matrix>
#include <osg/ValueObject>
#include "OsgCamera.h"
#include "OsgView.h"
#include "OsgScenery.h"
#include "OsgMain.h"
#include "OsgNodeMask.h"
#include <car.h>
#include <raceman.h>
#include <robottools.h>
@ -32,12 +38,6 @@
#include <guiscreen.h>
#include <graphic.h>
#include "OsgCamera.h"
#include "OsgView.h"
#include "OsgScenery.h"
#include "OsgMain.h"
#include "OsgNodeMask.h"
namespace osggraph {
static char path[1024];
@ -2621,4 +2621,3 @@ void SDCameras::loadSpanValues()
}
} // namespace osggraph

View file

@ -20,9 +20,15 @@
#define _OSGCAMERA_H_
#include <osg/Vec3>
#include <tgf.h>
#include <vector>
#include <camera.h>
struct CarElt;
struct Situation;
typedef struct CarElt tCarElt;
typedef struct Situation tSituation;
namespace osggraph {
#define GR_ZOOM_IN 0

View file

@ -38,6 +38,7 @@
#include "OsgMain.h"
#include "OsgCar.h"
#include "OsgHUD.h"
#include <raceman.h> //tSituation
namespace osggraph {

View file

@ -18,13 +18,15 @@
#ifndef _OSGSCREENS_H_
#define _OSGSCREENS_H_
#include <raceman.h> //tSituation
#include <vector>
#include <osg/Group>
#include "OsgView.h"
struct Situation;
typedef struct Situation tSituation;
namespace osggraph {
class SDDebugHUD;

View file

@ -30,6 +30,9 @@
#include "OsgCar.h"
#include "OsgNodeMask.h"
#include <raceman.h> //tSituation
#include <car.h> //tCarElt
namespace osggraph {
static char buf[1024];

View file

@ -19,13 +19,16 @@
#define _OSGVIEWER_H_
#include <camera.h>
#include <raceman.h> //tSituation
#include <car.h> //tCarElt
#include "OsgCamera.h" //SDCameras
#include <osg/FrontFace>
struct Situation;
struct CarElt;
typedef struct CarElt tCarElt;
typedef struct Situation tSituation;
namespace osggraph {
class SDFrameInfo;