00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include <fstream>
00036 using namespace std;
00037
00038 #include "K3dStream.h"
00039
00040 K3dStream::K3dStream(K3dGameData *_pGameData)
00041 {
00042 m_pGameData = _pGameData;
00043
00044 m_pGameData->SetStream(this);
00045 }
00046
00047 K3dStream::~K3dStream(void)
00048 {
00049 }
00050
00054 bool K3dStream::LoadIni(const K3dString& _strFileName)
00055 {
00056 cout << "K3dStream::LoadIni()" << endl;
00057 cout << "Input filename = " << _strFileName.GetString( ) << endl;
00058
00059 if(_strFileName == "")
00060 {
00061 cerr << "void K3dStream::LoadIni() -- Error - Filename doesn`t exist" << endl;
00062 return false;
00063 }
00064
00065 K3dLua *pLua = m_pGameData->GetLua();
00066 if(pLua)
00067 {
00068 if(!pLua->LuaLoadFile(_strFileName.GetString().c_str()))
00069 {
00070 pLua->LuaError("void K3dStream::LoadIni() -- Error - cannot run configuration file: %s", pLua->LuaToString(-1));
00071 return false;
00072 }
00073 }
00074 else
00075 {
00076 cerr << "Error -- K3dStream::LoadIni() -- pLua doesn`t allocated !!" << endl;
00077 exit(1);
00078 }
00079 return true;
00080 }