Code Search for Developers
 
 
  

resourceprovider.cc from The Nebula Device at Krugle


Show resourceprovider.cc syntax highlighted

//------------------------------------------------------------------------------
//  ceui/resourceprovider.cc
//  (c) 2006 Nebula2 Community
//------------------------------------------------------------------------------
#include "ceui/resourceprovider.h"
#include "kernel/nfile.h"
#include "kernel/nfileserver2.h"

namespace CEUI
{

//------------------------------------------------------------------------------
/**
*/
ResourceProvider::ResourceProvider() {
}

//------------------------------------------------------------------------------
/**
*/
ResourceProvider::~ResourceProvider() {
}

//------------------------------------------------------------------------------
/**
*/
void ResourceProvider::loadRawDataContainer(const CEGUI::String& fileName, CEGUI::RawDataContainer& output, const CEGUI::String& resGroup) {
    nFile* file = nFileServer2::Instance()->NewFileObject();
    n_verify(file->Open(getFinalFilename(fileName, resGroup).c_str(), "r"));
    int size = file->GetSize();
    uchar* data = n_new_array(uchar, size);
    file->Read(data, size);
    file->Close();
    file->Release();
    output.setSize(size);
    output.setData(data);
}

//------------------------------------------------------------------------------
/**
*/
void ResourceProvider::unloadRawDataContainer(CEGUI::RawDataContainer& data) {
    n_delete_array(data.getDataPtr());
    data.setData(0);
    data.setSize(0);
}

} // namespace CEUI




See more files for this project here

The Nebula Device

Realtime 3D game/visualization engine, written in C++, scriptable through Tcl/Tk, Python and Lua. Supports D3D and OpenGL for rendering, runs under Linux and Windows.

Project homepage: http://sourceforge.net/projects/nebuladevice
Programming language(s): C,C++,Python
License: other

  ceguitimesource.cc
  ceguitimesource.h
  logger.cc
  logger.h
  renderer.cc
  renderer.h
  resourceprovider.cc
  resourceprovider.h
  server.cc
  server.h
  texture.cc
  texture.h