Habn problem, da ich ja in meiner Engine auch erwähnt werden will, will ich ein logo 3sekunden lang anzeigen lassen, hab also in der Video-Klasse eine instanz der Image-Klasse erstellt, und die dann nach der Video-Initialisierung aufgerufen, doch beim kompilieren kommen diese fehler:
Code:
[codemasta@Pasqual lingfx]$ make
g++ `sdl-config --cflags` `sdl-config --libs` -lSDL_image -lSDL_mixer -lSDL_net lingfx.cpp main.cpp -o lingfx
In file included from lingfx.cpp:13:
lingfx.h:76: field `m_imgLogo' has incomplete type
lingfx.cpp: In constructor `lgfxVIDEO::lgfxVIDEO()':
lingfx.cpp:67: `class lgfxVIDEO' has no member named `m_imgLogo'
lingfx.cpp: In member function `bool lgfxVIDEO::Init(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int, bool)':
lingfx.cpp:118: `class lgfxVIDEO' has no member named `m_imgLogo'
In file included from main.cpp:14:
lingfx.h:76: field `m_imgLogo' has incomplete type
lingfx.h: In function `int main(int, char**)':
lingfx.h:35: too few arguments to function `bool Init(bool, bool, bool, bool)'
main.cpp:37: at this point in file
make: *** [all] Fehler 1
der code dazu sieht so aus:
Code:
//----------------------------------------------------------
// File : lingfx.h
// Author : Pasqual Brettner
// Date : Die Okt 22 2002
// Copyright: (C) 2002 by Pasqual Brettner
// E-Mail : pasqualb@web.de
//----------------------------------------------------------
#ifndef __LINGFX_H_
#define __LINGFX_H_
//----------------------------------------------------------
// I N C L U D E S
//----------------------------------------------------------
#include <iostream>
#include <string>
using namespace std;
#include "SDL.h"
#include "SDL_image.h"
#include "SDL_mixer.h"
#include "SDL_net.h"
//----------------------------------------------------------
// D E F I N I T I O N S
//----------------------------------------------------------
//----------------------------------------------------------
// F U N C T I O N S
//----------------------------------------------------------
bool Init(bool bVideo, bool bTimer, bool bAudio, bool bJoystick);
void Kill(void);
//----------------------------------------------------------
// C L A S S E S
//----------------------------------------------------------
class lgfxIMAGE;
//SDL-Class, to init SDL and use SDL
class lgfxVIDEO
{
public:
lgfxVIDEO(void);
~lgfxVIDEO(void);
bool Init(string sT, int iW, int iH, int iB, bool bF);
void InitStates(Uint8 uiC[4]);
void Free(void);
void Flip(void);
inline SDL_Surface *getSurface(void) { return m_pSurface; }
inline bool getMode(void) { return m_bFullscreen; }
inline int getWidth(void) { return m_iWidth; }
inline int getHeight(void) { return m_iHeight; }
inline int getBpp(void) { return m_iBpp; }
private:
SDL_Surface *m_pSurface;
bool m_bFullscreen;
int m_iWidth;
int m_iHeight;
int m_iBpp;
Uint32 m_uiVideoFlags;
Uint32 m_uiClearColor;
lgfxIMAGE m_imgLogo;
};
//SDL_image-Class, to load Images with Colorkeys and render them.
class lgfxIMAGE
{
public:
lgfxIMAGE(void);
~lgfxIMAGE(void);
bool Init(string sF, bool bWC, Uint8 uiR, Uint8 uiG, Uint8 B, Uint8 uiA);
void Render(int iX, int iY, float fR, lgfxVIDEO &pVideo);
private:
SDL_Surface *m_pImage;
Uint32 m_uiColorkey;
bool m_bWithColorkey;
string m_strFilename;
};
#endif
hoffe ihr könnt mir helfen!
mfg headi
Lesezeichen