Commit 738954d3 authored by bitplane's avatar bitplane

Renamed setResizeable to setResizable (!)

Tidied the Xcode project some more and fixed compiling. Didn't implement CIrrDeviceOSX::minimizeWindow yet

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2264 dfc29bdd-3216-0410-991c-e03cc46cb475
parent bee75f48
......@@ -2,7 +2,7 @@ Changes in 1.6
- Added SGI RGB file reader by Gary Conway, for loading Silicon Graphics .rgb, .rgba, .sgi, .int and .inta textures
- Renamed setResizeAble to setResizeable
- Renamed setResizeAble to setResizable
- Added new device method minimizeWindow which minimizes the window (just as if the minimize button has been clicked).
......
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_IRRLICHT_DEVICE_H_INCLUDED__
#define __I_IRRLICHT_DEVICE_H_INCLUDED__
#include "IReferenceCounted.h"
#include "dimension2d.h"
#include "IVideoDriver.h"
#include "EDriverTypes.h"
#include "IEventReceiver.h"
#include "ICursorControl.h"
#include "IVideoModeList.h"
#include "ITimer.h"
#include "IOSOperator.h"
namespace irr
{
class ILogger;
class IEventReceiver;
namespace io {
class IFileSystem;
} // end namespace io
namespace gui {
class IGUIEnvironment;
} // end namespace gui
namespace scene {
class ISceneManager;
} // end namespace scene
//! The Irrlicht device. You can create it with createDevice() or createDeviceEx().
/** This is the most important class of the Irrlicht Engine. You can access everything
in the engine if you have a pointer to an instance of this class.
There should be only one instance of this class at any time.
*/
class IrrlichtDevice : public virtual IReferenceCounted
{
public:
//! Runs the device.
/** Also increments the virtual timer by calling
ITimer::tick();. You can prevent this
by calling ITimer::stop(); before and ITimer::start() after
calling IrrlichtDevice::run(). Returns false if device wants
to be deleted. Use it in this way:
\code
while(device->run())
{
// draw everything here
}
\endcode
If you want the device to do nothing if the window is inactive
(recommended), use the slightly enhanced code shown at isWindowActive().
Note if you are running Irrlicht inside an external, custom
created window: Calling Device->run() will cause Irrlicht to
dispatch windows messages internally.
If you are running Irrlicht in your own custom window, you can
also simply use your own message loop using GetMessage,
DispatchMessage and whatever and simply don't use this method.
But note that Irrlicht will not be able to fetch user input
then. See irr::SIrrlichtCreationParameters::WindowId for more
informations and example code.
*/
virtual bool run() = 0;
//! Cause the device to temporarily pause execution and let other processes run.
/** This should bring down processor usage without major
performance loss for Irrlicht */
virtual void yield() = 0;
//! Pause execution and let other processes to run for a specified amount of time.
/** It may not wait the full given time, as sleep may be interrupted
\param timeMs: Time to sleep for in milisecs.
\param pauseTimer: If true, pauses the device timer while sleeping
*/
virtual void sleep(u32 timeMs, bool pauseTimer=false) = 0;
//! Provides access to the video driver for drawing 3d and 2d geometry.
/** \return Pointer the video driver. */
virtual video::IVideoDriver* getVideoDriver() = 0;
//! Provides access to the virtual file system.
/** \return Pointer to the file system. */
virtual io::IFileSystem* getFileSystem() = 0;
//! Provides access to the 2d user interface environment.
/** \return Pointer to the gui environment. */
virtual gui::IGUIEnvironment* getGUIEnvironment() = 0;
//! Provides access to the scene manager.
/** \return Pointer to the scene manager. */
virtual scene::ISceneManager* getSceneManager() = 0;
//! Provides access to the cursor control.
/** \return Pointer to the mouse cursor control interface. */
virtual gui::ICursorControl* getCursorControl() = 0;
//! Provides access to the message logger.
/** \return Pointer to the logger. */
virtual ILogger* getLogger() = 0;
//! Gets a list with all video modes available.
/** If you are confused now, because you think you have to
create an Irrlicht Device with a video mode before being able
to get the video mode list, let me tell you that there is no
need to start up an Irrlicht Device with EDT_DIRECT3D8,
EDT_OPENGL or EDT_SOFTWARE: For this (and for lots of other
reasons) the null driver, EDT_NULL exists.
\return Pointer to a list with all video modes supported
by the gfx adapter. */
virtual video::IVideoModeList* getVideoModeList() = 0;
//! Provides access to the operation system operator object.
/** The OS operator provides methods for
getting system specific informations and doing system
specific operations, such as exchanging data with the clipboard
or reading the operation system version.
\return Pointer to the OS operator. */
virtual IOSOperator* getOSOperator() = 0;
//! Provides access to the engine's timer.
/** The system time can be retrieved by it as
well as the virtual time, which also can be manipulated.
\return Pointer to the ITimer object. */
virtual ITimer* getTimer() = 0;
//! Sets the caption of the window.
/** \param text: New text of the window caption. */
virtual void setWindowCaption(const wchar_t* text) = 0;
//! Returns if the window is active.
/** If the window is inactive,
nothing needs to be drawn. So if you don't want to draw anything
when the window is inactive, create your drawing loop this way:
\code
while(device->run())
{
if (device->isWindowActive())
{
// draw everything here
}
else
device->yield();
}
\endcode
\return True if window is active. */
virtual bool isWindowActive() const = 0;
//! Checks if the Irrlicht window has focus
/** \return True if window has focus. */
virtual bool isWindowFocused() const = 0;
//! Checks if the Irrlicht window is minimized
/** \return True if window is minimized. */
virtual bool isWindowMinimized() const = 0;
//! Checks if the Irrlicht window is running in fullscreen mode
/** \return True if window is fullscreen. */
virtual bool isFullscreen() const = 0;
//! Get the current color format of the window
/** \return Color format of the window. */
virtual video::ECOLOR_FORMAT getColorFormat() const = 0;
//! Notifies the device that it should close itself.
/** IrrlichtDevice::run() will always return false after closeDevice() was called. */
virtual void closeDevice() = 0;
//! Get the version of the engine.
/** The returned string
will look like this: "1.2.3" or this: "1.2".
\return String which contains the version. */
virtual const c8* getVersion() const = 0;
//! Sets a new user event receiver which will receive events from the engine.
/** Return true in IEventReceiver::OnEvent to prevent the event from continuing along
the chain of event receivers. The path that an event takes through the system depends
on its type. See irr::EEVENT_TYPE for details.
\param receiver New receiver to be used. */
virtual void setEventReceiver(IEventReceiver* receiver) = 0;
//! Provides access to the current event receiver.
/** \return Pointer to the current event receiver. Returns 0 if there is none. */
virtual IEventReceiver* getEventReceiver() = 0;
//! Sends a user created event to the engine.
/** Is is usually not necessary to use this. However, if you
are using an own input library for example for doing joystick
input, you can use this to post key or mouse input events to
the engine. Internally, this method only delegates the events
further to the scene manager and the GUI environment. */
virtual bool postEventFromUser(const SEvent& event) = 0;
//! Sets the input receiving scene manager.
/** If set to null, the main scene manager (returned by
GetSceneManager()) will receive the input
\param sceneManager New scene manager to be used. */
virtual void setInputReceivingSceneManager(scene::ISceneManager* sceneManager) = 0;
//! Sets if the window should be resizeable in windowed mode.
/** The default is false. This method only works in windowed
mode.
\param resize Flag whether the window should be resizeable. */
virtual void setResizeable(bool resize=false) = 0;
//! Minimizes the window if possible.
virtual void minimizeWindow() =0;
//! Activate any joysticks, and generate events for them.
/** Irrlicht contains support for joysticks, but does not generate joystick events by default,
as this would consume joystick info that 3rd party libraries might rely on. Call this method to
activate joystick support in Irrlicht and to receive irr::SJoystickEvent events.
\param joystickInfo On return, this will contain an array of each joystick that was found and activated.
\return true if joysticks are supported on this device and _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
is defined, false if joysticks are not supported or support is compiled out.
*/
virtual bool activateJoysticks(core::array<SJoystickInfo>& joystickInfo) =0;
//! Set the current Gamma Value for the Display
virtual bool setGammaRamp(f32 red, f32 green, f32 blue,
f32 relativebrightness, f32 relativecontrast) =0;
//! Get the current Gamma Value for the Display
virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
f32 &brightness, f32 &contrast) =0;
};
} // end namespace irr
#endif
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_IRRLICHT_DEVICE_H_INCLUDED__
#define __I_IRRLICHT_DEVICE_H_INCLUDED__
#include "IReferenceCounted.h"
#include "dimension2d.h"
#include "IVideoDriver.h"
#include "EDriverTypes.h"
#include "IEventReceiver.h"
#include "ICursorControl.h"
#include "IVideoModeList.h"
#include "ITimer.h"
#include "IOSOperator.h"
namespace irr
{
class ILogger;
class IEventReceiver;
namespace io {
class IFileSystem;
} // end namespace io
namespace gui {
class IGUIEnvironment;
} // end namespace gui
namespace scene {
class ISceneManager;
} // end namespace scene
//! The Irrlicht device. You can create it with createDevice() or createDeviceEx().
/** This is the most important class of the Irrlicht Engine. You can access everything
in the engine if you have a pointer to an instance of this class.
There should be only one instance of this class at any time.
*/
class IrrlichtDevice : public virtual IReferenceCounted
{
public:
//! Runs the device.
/** Also increments the virtual timer by calling
ITimer::tick();. You can prevent this
by calling ITimer::stop(); before and ITimer::start() after
calling IrrlichtDevice::run(). Returns false if device wants
to be deleted. Use it in this way:
\code
while(device->run())
{
// draw everything here
}
\endcode
If you want the device to do nothing if the window is inactive
(recommended), use the slightly enhanced code shown at isWindowActive().
Note if you are running Irrlicht inside an external, custom
created window: Calling Device->run() will cause Irrlicht to
dispatch windows messages internally.
If you are running Irrlicht in your own custom window, you can
also simply use your own message loop using GetMessage,
DispatchMessage and whatever and simply don't use this method.
But note that Irrlicht will not be able to fetch user input
then. See irr::SIrrlichtCreationParameters::WindowId for more
informations and example code.
*/
virtual bool run() = 0;
//! Cause the device to temporarily pause execution and let other processes run.
/** This should bring down processor usage without major
performance loss for Irrlicht */
virtual void yield() = 0;
//! Pause execution and let other processes to run for a specified amount of time.
/** It may not wait the full given time, as sleep may be interrupted
\param timeMs: Time to sleep for in milisecs.
\param pauseTimer: If true, pauses the device timer while sleeping
*/
virtual void sleep(u32 timeMs, bool pauseTimer=false) = 0;
//! Provides access to the video driver for drawing 3d and 2d geometry.
/** \return Pointer the video driver. */
virtual video::IVideoDriver* getVideoDriver() = 0;
//! Provides access to the virtual file system.
/** \return Pointer to the file system. */
virtual io::IFileSystem* getFileSystem() = 0;
//! Provides access to the 2d user interface environment.
/** \return Pointer to the gui environment. */
virtual gui::IGUIEnvironment* getGUIEnvironment() = 0;
//! Provides access to the scene manager.
/** \return Pointer to the scene manager. */
virtual scene::ISceneManager* getSceneManager() = 0;
//! Provides access to the cursor control.
/** \return Pointer to the mouse cursor control interface. */
virtual gui::ICursorControl* getCursorControl() = 0;
//! Provides access to the message logger.
/** \return Pointer to the logger. */
virtual ILogger* getLogger() = 0;
//! Gets a list with all video modes available.
/** If you are confused now, because you think you have to
create an Irrlicht Device with a video mode before being able
to get the video mode list, let me tell you that there is no
need to start up an Irrlicht Device with EDT_DIRECT3D8,
EDT_OPENGL or EDT_SOFTWARE: For this (and for lots of other
reasons) the null driver, EDT_NULL exists.
\return Pointer to a list with all video modes supported
by the gfx adapter. */
virtual video::IVideoModeList* getVideoModeList() = 0;
//! Provides access to the operation system operator object.
/** The OS operator provides methods for
getting system specific informations and doing system
specific operations, such as exchanging data with the clipboard
or reading the operation system version.
\return Pointer to the OS operator. */
virtual IOSOperator* getOSOperator() = 0;
//! Provides access to the engine's timer.
/** The system time can be retrieved by it as
well as the virtual time, which also can be manipulated.
\return Pointer to the ITimer object. */
virtual ITimer* getTimer() = 0;
//! Sets the caption of the window.
/** \param text: New text of the window caption. */
virtual void setWindowCaption(const wchar_t* text) = 0;
//! Returns if the window is active.
/** If the window is inactive,
nothing needs to be drawn. So if you don't want to draw anything
when the window is inactive, create your drawing loop this way:
\code
while(device->run())
{
if (device->isWindowActive())
{
// draw everything here
}
else
device->yield();
}
\endcode
\return True if window is active. */
virtual bool isWindowActive() const = 0;
//! Checks if the Irrlicht window has focus
/** \return True if window has focus. */
virtual bool isWindowFocused() const = 0;
//! Checks if the Irrlicht window is minimized
/** \return True if window is minimized. */
virtual bool isWindowMinimized() const = 0;
//! Checks if the Irrlicht window is running in fullscreen mode
/** \return True if window is fullscreen. */
virtual bool isFullscreen() const = 0;
//! Get the current color format of the window
/** \return Color format of the window. */
virtual video::ECOLOR_FORMAT getColorFormat() const = 0;
//! Notifies the device that it should close itself.
/** IrrlichtDevice::run() will always return false after closeDevice() was called. */
virtual void closeDevice() = 0;
//! Get the version of the engine.
/** The returned string
will look like this: "1.2.3" or this: "1.2".
\return String which contains the version. */
virtual const c8* getVersion() const = 0;
//! Sets a new user event receiver which will receive events from the engine.
/** Return true in IEventReceiver::OnEvent to prevent the event from continuing along
the chain of event receivers. The path that an event takes through the system depends
on its type. See irr::EEVENT_TYPE for details.
\param receiver New receiver to be used. */
virtual void setEventReceiver(IEventReceiver* receiver) = 0;
//! Provides access to the current event receiver.
/** \return Pointer to the current event receiver. Returns 0 if there is none. */
virtual IEventReceiver* getEventReceiver() = 0;
//! Sends a user created event to the engine.
/** Is is usually not necessary to use this. However, if you
are using an own input library for example for doing joystick
input, you can use this to post key or mouse input events to
the engine. Internally, this method only delegates the events
further to the scene manager and the GUI environment. */
virtual bool postEventFromUser(const SEvent& event) = 0;
//! Sets the input receiving scene manager.
/** If set to null, the main scene manager (returned by
GetSceneManager()) will receive the input
\param sceneManager New scene manager to be used. */
virtual void setInputReceivingSceneManager(scene::ISceneManager* sceneManager) = 0;
//! Sets if the window should be resizable in windowed mode.
/** The default is false. This method only works in windowed
mode.
\param resize Flag whether the window should be resizable. */
virtual void setResizable(bool resize=false) = 0;
//! Minimizes the window if possible.
virtual void minimizeWindow() =0;
//! Activate any joysticks, and generate events for them.
/** Irrlicht contains support for joysticks, but does not generate joystick events by default,
as this would consume joystick info that 3rd party libraries might rely on. Call this method to
activate joystick support in Irrlicht and to receive irr::SJoystickEvent events.
\param joystickInfo On return, this will contain an array of each joystick that was found and activated.
\return true if joysticks are supported on this device and _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
is defined, false if joysticks are not supported or support is compiled out.
*/
virtual bool activateJoysticks(core::array<SJoystickInfo>& joystickInfo) =0;
//! Set the current Gamma Value for the Display
virtual bool setGammaRamp(f32 red, f32 green, f32 blue,
f32 relativebrightness, f32 relativecontrast) =0;
//! Get the current Gamma Value for the Display
virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
f32 &brightness, f32 &contrast) =0;
};
} // end namespace irr
#endif
//! Copyright (C) 2009 Gary Conway
//! This file is part of the "Irrlicht Engine".
//! For conditions of distribution and use, see copyright notice in irrlicht.h
/*
Author: Gary Conway (Viper) - co-author of the ZIP file format, Feb 1989,
see the story at http://www.idcnet.us/ziphistory.html
Website: http://idcnet.us
Email: codeslinger@vipergc.com
Created: March 1, 2009
Version: 1.0
Updated:
This module will load SGI .rgb files (along with the other extensions). The module complies
with version 1.0 of the SGI Image File Format by Paul Haeberli of Silicon Graphics Computer Systems
The module handles BW, RGB and RGBA images.
RGB images are stored with either 8 bits per COLOR VALUE, one each for red,green,blue (24bpp)
or 16 bits per COLOR VALUE, again one each for red,green,blue (48 bpp), not including the alpha channel
OPTIONS NOT SUPPORTED
1. 16 bit COLOR VALUES (48bpp modes)
2. COLORMAP = DITHERED mode
For non- run length encoded files, this is the structure
The Header
The Image Data
If the image is run length encoded, this is the structure:
The Header
The Offset Tables
The Image Data
The header consists of the following:
Size | Type | Name | Description
2 bytes | short | MAGIC | IRIS image file magic number
1 byte | char | STORAGE | Storage format
1 byte | char | BPC | Number of bytes per pixel channel
2 bytes | ushort | DIMENSION | Number of dimensions
2 bytes | ushort | XSIZE | X size in pixels
2 bytes | ushort | YSIZE | Y size in pixels
2 bytes | ushort | ZSIZE | Number of channels
4 bytes | long | PIXMIN | Minimum pixel value
4 bytes | long | PIXMAX | Maximum pixel value
4 bytes | char | DUMMY | Ignored
80 bytes | char | IMAGENAME | Image name
4 bytes | long | COLORMAP | Colormap ID
404 bytes | char | DUMMY | Ignored
Here is a description of each field in the image file header:
MAGIC - This is the decimal value 474 saved as a short. This identifies the file as an SGI image file.
STORAGE - specifies whether the image is stored using run length encoding (RLE) or not (VERBATIM).
If RLE is used, the value of this byte will be 1. Otherwise the value of this byte will
be 0. The only allowed values for this field are 0 or 1.
BPC - describes the precision that is used to store each channel of an image. This is the number of
bytes per pixel component. The majority of SGI image files use 1 byte per pixel component,
giving 256 levels. Some SGI image files use 2 bytes per component. The only allowed values
for this field are 1 or 2.
DIMENSION - described the number of dimensions in the data stored in the image file.
The only allowed values are 1, 2, or 3. If this value is 1, the image file
consists of only 1 channel and only 1 scanline (row). The length of this
scanline is given by the value of XSIZE below. If this value is 2, the file
consists of a single channel with a number of scanlines. The width and height
of the image are given by the values of XSIZE and YSIZE below.
If this value is 3, the file consists of a number of channels.
The width and height of the image are given by the values of XSIZE and YSIZE below.
The number of channels is given by the value of ZSIZE below.
XSIZE - The width of the image in pixels
YSIZE - The height of the image in pixels
ZSIZE - The number of channels in the image. B/W (greyscale) images are stored as 2 dimensional
images with a ZSIZE of 1. RGB color images are stored as 3 dimensional images with a
ZSIZE of 3. An RGB image with an ALPHA channel is stored as a 3 dimensional image with
a ZSIZE of 4. There are no inherent limitations in the SGI image file format that would
preclude the creation of image files with more than 4 channels.
PINMIN - The minimum pixel value in the image. The value of 0 may be used if no pixel has a value
that is smaller than 0.
PINMAX - The maximum pixel value in the image. The value of 255 may be used if no pixel has a
value that is greater than 255. This is the value that is considered to be full
brightness in the image.
DUMMY - This 4 bytes of data should be set to 0.
IMAGENAME - An null terminated ascii string of up to 79 characters terminated by a null may be
included here. This is not commonly used.
COLORMAP - This controls how the pixel values in the file should be interpreted. It can have one
of these four values:
0: NORMAL - The data in the channels represent B/W values for images with 1 channel, RGB values
for images with 3 channels, and RGBA values for images with 4 channels. Almost all
the SGI image files are of this type.
1: DITHERED - The image will have only 1 channel of data. For each pixel, RGB data is packed
into one 8 bit value. 3 bits are used for red and green, while blue uses 2 bits.
Red data is found in bits[2..0], green data in bits[5..3], and blue data in
bits[7..6]. This format is obsolete.
2: SCREEN - The image will have only 1 channel of data. This format was used to store
color-indexed pixels. To convert the pixel values into RGB values a colormap
must be used. The appropriate color map varies from image to image. This format is obsolete.
3: COLORMAP - The image is used to store a color map from an SGI machine. In this case the
image is not displayable in the conventional sense.
DUMMY - This 404 bytes of data should be set to 0. This makes the header exactly 512 bytes.
*/
#include "CImageLoaderRGB.h"
#ifdef _IRR_COMPILE_WITH_RGB_LOADER_
#include "IReadFile.h"
#include "SColor.h"
#include "CColorConverter.h"
#include "CImage.h"
#include "os.h"
#include "irrString.h"
namespace irr
{
namespace video
{
//! constructor
CImageLoaderRGB::CImageLoaderRGB()
{
#ifdef _DEBUG
setDebugName("CImageLoaderRGB");
#endif
}
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extensions listed here
bool CImageLoaderRGB::isALoadableFileExtension(const irr::core::stringc &fileName) const
{
return core::hasFileExtension( fileName, "rgb", "rgba", "sgi" ) ||
core::hasFileExtension( fileName, "int", "inta", "bw" );
}
//! returns true if the file maybe is able to be loaded by this class
bool CImageLoaderRGB::isALoadableFileFormat(io::IReadFile* file) const
{
rgbStruct *rgb = new rgbStruct;
bool retVal = checkFormat(file, rgb);
delete rgb;
return retVal;
}
/*
The main entry point, read and format the image file.
RETURNS: pointer to the image data on success
null pointer on fail
*/
//! creates a surface from the file
IImage* CImageLoaderRGB::loadImage(io::IReadFile* file) const
{
IImage* image = 0;
s32* paletteData = 0;
rgbStruct *rgb = new rgbStruct(); // construct our structure for holding data
// read header information
if (checkFormat(file, rgb))
{
// 16 bits per COLOR VALUE, not supported, this is 48bpp mode
if (rgb->header.BPC != 1)
{
os::Printer::log("Only one byte per pixel RGB files are supported", file->getFileName(), ELL_ERROR);
}
else if (rgb->header.Colormap != 0)
{
os::Printer::log("Dithered, Screen and Colormap RGB files are not supported", file->getFileName(), ELL_ERROR);
}
else if (rgb->header.Storage == 1 && !readOffsetTables(file, rgb))
{
os::Printer::log("Failed to read RLE table in RGB file", file->getFileName(), ELL_ERROR);
}
else if (!rgb->allocateTemps())
{
os::Printer::log("Out of memory in RGB file loader", file->getFileName(), ELL_ERROR);
}
else
{
// read and process the file to rgbData
processFile(rgb, file);
/*
ZSIZE Description
1 BW (grayscale) image
3 RGB image
4 RGBa image with one alpha channel
When the Alpha channel is present, I am not sure with RGB files if
it's a precomputed RGB color or it needs to be completely calculated. My guess
would be that it's not precomputed for two reasons.
1. the loss of precision when calculating the fraction, then storing the result as an int
2. the loss of the original color data when the image might be composited with another. Yes
the original color data could be computed, however, not without another loss in precision
Also, I don't know where to find the background color
Pixmin and Pixmax are apparently the min and max alpha blend values (0-100%)
Complete Alpha blending computation
The actual resulting merged color is computed this way:
(image color × alpha) + (background color × (100% - alpha)).
Using precomputed blending
(image color) + (background color × (100% - alpha)).
Alternatively, the RGB files could use another blending technique entirely
*/
switch (rgb->header.Zsize)
{
case 1:
// BW (grayscale) image
paletteData = new s32[256];
for (int n=0; n<256; n++)
paletteData[n] = n;
image = new CImage(ECF_A1R5G5B5, core::dimension2d<u32>(rgb->header.Xsize, rgb->header.Ysize));
if (image)
CColorConverter::convert8BitTo16Bit(rgb->rgbData, (s16*)image->lock(), rgb->header.Xsize, rgb->header.Ysize, paletteData, 0, true);
break;
case 3:
// RGB image
// one byte per COLOR VALUE, eg, 24bpp
image = new CImage(ECF_R8G8B8, core::dimension2d<u32>(rgb->header.Xsize, rgb->header.Ysize));
if (image)
CColorConverter::convert24BitTo24Bit(rgb->rgbData, (u8*)image->lock(), rgb->header.Xsize, rgb->header.Ysize, 0, true, false);
break;
case 4:
// RGBa image with one alpha channel (32bpp)
// image is stored in rgbData as RGBA
converttoARGB(rgb->rgbData, rgb);
image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(rgb->header.Xsize, rgb->header.Ysize));
if (image)
CColorConverter::convert32BitTo32Bit((s32*)rgb->rgbData, (s32*)image->lock(), rgb->header.Xsize, rgb->header.Ysize, 0, true);
break;
default:
// Format unknown
os::Printer::log("Unsupported pixel format in RGB file", file->getFileName(), ELL_ERROR);
}
if (image)
image->unlock();
}
}
// and tidy up allocated memory
if (paletteData)
delete [] paletteData;
if (rgb)
delete rgb;
return image;
}
// returns true on success
bool CImageLoaderRGB::readHeader(io::IReadFile* file, rgbStruct* rgb) const
{
if ( file->read(&rgb->header, sizeof(rgb->header)) < sizeof(rgb->header) )
return false;
// test for INTEL or BIG ENDIAN processor
// if INTEL, then swap the byte order on 16 bit INT's to make them BIG ENDIAN
// because that is the native format for the .rgb file
#ifndef __BIG_ENDIAN__
rgb->header.Magic = os::Byteswap::byteswap(rgb->header.Magic);
rgb->header.Storage = os::Byteswap::byteswap(rgb->header.Storage);
rgb->header.Dimension = os::Byteswap::byteswap(rgb->header.Dimension);
rgb->header.Xsize = os::Byteswap::byteswap(rgb->header.Xsize);
rgb->header.Ysize = os::Byteswap::byteswap(rgb->header.Ysize);
rgb->header.Zsize = os::Byteswap::byteswap(rgb->header.Zsize);
rgb->header.Pixmin = os::Byteswap::byteswap(rgb->header.Pixmin);
rgb->header.Pixmax = os::Byteswap::byteswap(rgb->header.Pixmax);
rgb->header.Colormap = os::Byteswap::byteswap(rgb->header.Colormap);
#endif
// calculate the size of the buffer needed: XSIZE * YSIZE * ZSIZE * BPC
rgb->ImageSize = (rgb->header.Xsize)*(rgb->header.Ysize)*(rgb->header.Zsize)*(rgb->header.BPC);
// allocate our buffer
//if( !(rgb->rgbData = new u8 [rgb->ImageSize]) )
// return false;
return true;
}
bool CImageLoaderRGB::checkFormat(io::IReadFile* file, rgbStruct* rgb) const
{
if (!readHeader(file, rgb))
return false;
if (rgb->header.Magic == 0x1DA)
return true;
else
return false;
}
/*
If the image is stored using run length encoding, offset tables follow the header that
describe what the file offsets are to the RLE for each scanline. This information only
applies if the value for STORAGE above is 1.
Size | Type | Name | Description
tablen longs | long | STARTTAB | Start table
tablen longs | long | LENGTHTAB | Length table
One entry in each table is needed for each scanline of RLE data. The total number of scanlines in the image (tablen) is determined by the product of the YSIZE and ZSIZE. There are two tables of longs that are written. Each consists of tablen longs of data. The first table has the file offsets to the RLE data for each scanline in the image. In a file with more than 1 channel (ZSIZE > 1) this table first has all the offsets for the scanlines in the first channel, followed be offsets for the scanlines in the second channel, etc. The second table has the RLE data length for each scanline in the image. In a file with more than 1 channel (ZSIZE > 1) this table first has all the RLE data lengths for the scanlines in the first channel, followed be RLE data lengths for the scanlines in the second channel, etc.
To find the the file offset, and the number of bytes in the RLE data for a particular scanline, these
two arrays may be read in and indexed as follows:
To read in the tables:
unsigned long *starttab, *lengthtab;
tablen = YSIZE*ZSIZE*sizeof(long);
starttab = (unsigned long *)mymalloc(tablen);
lengthtab = (unsigned long *)mymalloc(tablen);
fseek(rgb->inf,512,SEEK_SET);
readlongtab(rgb->inf,starttab);
readlongtab(rgb->inf,lengthtab);
To find the file offset and RLE data length for a scanline:
rowno is an integer in the range 0 to YSIZE-1 channo is an integer in the range 0 to ZSIZE-1
rleoffset = starttab[rowno+channo*YSIZE]
rlelength = lengthtab[rowno+channo*YSIZE]
It is possible for two identical rows (scanlines) to share compressed data. A completely
white image could be written as a single compressed row and having all table entries point
to that row. Another little hack that should work is if you are writing out a RGB RLE file,
and a particular scanline is achromatic (greyscale), you could just make the r, g and b rows
point to the same data!!
RETURNS: on success true, else returns false
*/
bool CImageLoaderRGB::readOffsetTables(io::IReadFile* file, rgbStruct *rgb) const
{
u32 x;
rgb->TableLen = rgb->header.Ysize * rgb->header.Zsize ; // calc size of tables
// return error if unable to allocate tables
if ( !(rgb->StartTable = new u32[rgb->TableLen]) )
return false;
if ( !(rgb->LengthTable = new u32[rgb->TableLen]) )
return false;
file->seek(512);
file->read(rgb->StartTable, rgb->TableLen* sizeof(u32));
file->read(rgb->LengthTable, rgb->TableLen* sizeof(u32));
// if we are on an INTEL platform, swap the bytes
#ifndef __BIG_ENDIAN__
x= rgb->TableLen * sizeof(u32);
convertLong(rgb->StartTable, (long) (x/sizeof(u32)));
convertLong((u32 *)rgb->LengthTable, (long) (x/sizeof(u32)));
#endif
return true;
}
/*
The header has already been read into rgb structure
The Tables have been read if necessary
Now process the actual data
*/
void CImageLoaderRGB::processFile(rgbStruct *rgb, io::IReadFile* file) const
{
u8 *ptr;
int i, j;
u16 *tempShort;
// calculate the size of the buffer needed: XSIZE * YSIZE * ZSIZE * BPC
rgb->rgbData = new u8 [(rgb->header.Xsize)*(rgb->header.Ysize)*(rgb->header.Zsize)*(rgb->header.BPC)];
ptr = rgb->rgbData;
// cycle through all scanlines
#ifdef _IRR_RGB_FILE_INVERTED_IMAGE_
// preserve the image as stored, eg, inverted
for (i = 0; i < (int)(rgb->header.Ysize); i++)
#else
// invert the image to make it upright
for (i = (int)(rgb->header.Ysize)-1; i>=0; i--)
#endif
{
// check the number of channels and read a row of data
if( rgb->header.Zsize >= 1 )
readRGBrow( rgb->tmpR, i, 0, file, rgb);
if( rgb->header.Zsize >= 2 )
readRGBrow( rgb->tmpG, i, 1, file, rgb);
if( rgb->header.Zsize >= 3 )
readRGBrow( rgb->tmpB, i, 2, file, rgb);
if( rgb->header.Zsize >= 4 )
readRGBrow( rgb->tmpA, i, 3, file, rgb);
// cycle thru all values for this row
for (j = 0; j < (int)(rgb->header.Xsize); j++)
{
if(rgb->header.BPC == 1)
{
// ONE byte per color
if( rgb->header.Zsize >= 1 ) *ptr++ = *(rgb->tmpR + j);
if( rgb->header.Zsize >= 2 ) *ptr++ = *(rgb->tmpG + j);
if( rgb->header.Zsize >= 3 ) *ptr++ = *(rgb->tmpB + j);
if( rgb->header.Zsize >= 4 ) *ptr++ = *(rgb->tmpA + j);
}
else
{
// TWO bytes per color
if( rgb->header.Zsize >= 1 )
{
// two bytes of color data
tempShort = (u16 *) (ptr);
*tempShort = *( (u16 *) (rgb->tmpR) + j);
tempShort++;
ptr = ( u8 *)(tempShort);
}
if( rgb->header.Zsize >= 2 )
{
tempShort = ( u16 *) (ptr);
*tempShort = *( ( u16 *) (rgb->tmpG) + j);
tempShort++;
ptr = ( u8 *) (tempShort);
}
if( rgb->header.Zsize >= 3 )
{
tempShort = ( u16 *) (ptr);
*tempShort = *( ( u16 *) (rgb->tmpB) + j);
tempShort++;
ptr = ( u8 *)(tempShort);
}
if( rgb->header.Zsize >= 4 )
{
tempShort = ( u16 *) (ptr);
*tempShort = *( ( u16 *) (rgb->tmpA) + j);
tempShort++;
ptr = ( u8 *)(tempShort);
}
} // end if(rgb->header.BPC == 1)
} // end for
// // pad the image width with blanks to bring it up to the rounded width.
// for(;j<width;++j) *ptr++ = 0;
} // end for
}
/*
This information only applies if the value for STORAGE is 1. If the image is
stored using run length encoding, the image data follows the offset/length tables.
The RLE data is not in any particular order. The offset tables are used to
locate the rle data for any scanline.
The RLE data must be read in from the file and expanded into pixel data in the following manner:
If BPC is 1, then there is one byte per pixel. In this case the RLE data should be
read into an array of chars. To expand data, the low order seven bits of the first
byte: bits[6..0] are used to form a count. If the high order bit of the first byte
is 1: bit[7], then the count is used to specify how many bytes to copy from the RLE
data buffer to the destination. Otherwise, if the high order bit of the first byte
is 0: bit[7], then the count is used to specify how many times to repeat the value
of the following byte, in the destination. This process continues until a count
of 0 is found. This should decompress exactly XSIZE pixels.
One entry in each table is needed for each scanline of RLE data. The total number of
scanlines in the image (tablen) is determined by the product of the YSIZE and ZSIZE.
There are two tables of longs that are written. Each consists of tablen longs of data.
The first table has the file offsets to the RLE data for each scanline in the image. In
a file with more than 1 channel (ZSIZE > 1) this table first has all the offsets for the
scanlines in the first channel, followed be offsets for the scanlines in the second
channel, etc. The second table has the RLE data length for each scanline in the image.
In a file with more than 1 channel (ZSIZE > 1) this table first has all the RLE data
lengths for the scanlines in the first channel, followed be RLE data lengths for the
scanlines in the second channel, etc.
Return a row of data, expanding RLE compression if necessary
*/
void CImageLoaderRGB::readRGBrow(u8 *buf, int y, int z, io::IReadFile* file, rgbStruct* rgb) const
{
u8 *iPtr, *oPtr;
u16 pixel;
int count;
bool done = false;
u16 *tempShort;
if (rgb->header.Storage != 1)
{
// stored VERBATIM
file->seek(512+(y*rgb->header.Xsize * rgb->header.BPC)+(z* rgb->header.Xsize * rgb->header.Ysize * rgb->header.BPC));
file->read((char*)buf, rgb->header.Xsize * rgb->header.BPC);
#ifndef __BIG_ENDIAN__
if (rgb->header.BPC != 1)
convertShort( (u16 *)(buf), rgb->header.Xsize);
#endif
return;
}
// the file is stored as Run Length Encoding (RLE)
// each sequence is stored as 0x80 NumRepeats ByteToRepeat
// get the file offset from StartTable and SEEK
// then read the data
file->seek((long) rgb->StartTable[y+z * rgb->header.Ysize]);
file->read((char*) rgb->tmp, (unsigned int)rgb->LengthTable[y+z * rgb->header.Ysize]);
// rgb->tmp has the data
iPtr = rgb->tmp;
oPtr = buf;
while (!done)
{
// if BPC = 1, then one byte per pixel
if (rgb->header.BPC == 1)
{
pixel = *iPtr++;
}
else
{
// BPC = 2, so two bytes per pixel
tempShort = (u16 *) iPtr;
pixel = *tempShort;
tempShort++;
iPtr = (u8 *) tempShort;
}
if (rgb->header.BPC != 1)
convertShort(&pixel, 1);
count = (int)(pixel & 0x7F);
// limit the count value to the remiaing row size
if (oPtr + count*rgb->header.BPC > buf + rgb->header.Xsize * rgb->header.BPC)
{
count = ( (buf + rgb->header.Xsize * rgb->header.BPC) - oPtr ) / rgb->header.BPC;
}
if (count<=0)
{
done = true;
return;
}
if (pixel & 0x80)
{
// repeat the byte pointed to by iPtr, count times
while (count--)
{
if(rgb->header.BPC == 1)
{
*oPtr++ = *iPtr++;
}
else
{
tempShort = (u16 *) (iPtr);
pixel = *tempShort;
tempShort++;
iPtr = (u8 *) (tempShort);
convertShort(&pixel, 1);
tempShort = (u16 *) (oPtr);
*tempShort = pixel;
tempShort++;
oPtr = (u8 *) (tempShort);
}
}
}
else
{
if (rgb->header.BPC == 1)
{
pixel = *iPtr++;
}
else
{
tempShort = (u16 *) (iPtr);
pixel = *tempShort;
tempShort++;
iPtr = (u8 *) (tempShort);
}
if (rgb->header.BPC != 1)
convertShort(&pixel, 1);
while (count--)
{
if(rgb->header.BPC == 1)
{
*oPtr++ = (char) pixel;
}
else
{
tempShort = (u16 *) (oPtr);
*tempShort = pixel;
tempShort++;
oPtr = (u8 *) (tempShort);
}
}
} // else if (pixel & 0x80)
} // while (!done)
}
#ifndef __BIG_ENDIAN__
//todo: replace with os::byteswap
/*
In the following description a notation like bits[7..0] is used to denote a
range of bits in a binary value. Bit 0 is the lowest order bit in the value.
All short values are represented by 2 bytes. The first byte stores the
high order 8 bits of the value: bits[15..8]. The second byte stores the
low order 8 bits of the value: bits[7..0].
*/
void CImageLoaderRGB::convertShort(u16 *array, long length) const
{
unsigned long b1, b2;
unsigned char *ptr;
ptr = (unsigned char *)array;
while (length--)
{
b1 = *ptr++;
b2 = *ptr++;
*array++ = (u16) ((b1 << 8) | (b2));
}
}
/*
All long values are represented by 4 bytes. The first byte stores the
high order 8 bits of the value: bits[31..24]. The second byte stores
bits[23..16]. The third byte stores bits[15..8]. The forth byte stores
the low order 8 bits of the value: bits[7..0].
And this function will read a long value from the file:
*/
void CImageLoaderRGB::convertLong(u32 *array, long length) const
{
unsigned long b1, b2, b3, b4;
unsigned char *ptr;
ptr = (unsigned char *)array;
while (length--)
{
b1 = *ptr++;
b2 = *ptr++;
b3 = *ptr++;
b4 = *ptr++;
*array++ = (b1 << 24) | (b2 << 16) | (b3 << 8) | (b4);
}
}
#endif
// we have 1 byte per COLOR VALUE, eg 24bpp and 1 alpha channel
// calculate the color values based on the alpha values
// color values are stored as R,G,B,A
// todo: replace with CColorConverter method
void CImageLoaderRGB::converttoARGB(u8* in, rgbStruct *rgb) const
{
u32 cnt=0;
u8 tmp;
// (image color × alpha) + (background color × (100% - alpha)).
for ( int y=0; y < rgb->header.Ysize; y++)
{
for ( int x=0; x < rgb->header.Xsize; x++)
{
tmp = in[cnt+3];
in[cnt+3] = in[cnt+2];
in[cnt+2] = in[cnt+1];
in[cnt+1] = in[cnt];
in[cnt] = tmp;
in +=4;
}
}
}
//! creates a loader which is able to load windows bitmaps
IImageLoader* createImageLoaderRGB()
{
return new CImageLoaderRGB;
}
} // end namespace video
} // end namespace irr
#endif
//! Copyright (C) 2009 Gary Conway
//! This file is part of the "Irrlicht Engine".
//! For conditions of distribution and use, see copyright notice in irrlicht.h
/*
Author: Gary Conway (Viper) - co-author of the ZIP file format, Feb 1989,
see the story at http://www.idcnet.us/ziphistory.html
Website: http://idcnet.us
Email: codeslinger@vipergc.com
Created: March 1, 2009
Version: 1.0
Updated:
This module will load SGI .rgb files (along with the other extensions). The module complies
with version 1.0 of the SGI Image File Format by Paul Haeberli of Silicon Graphics Computer Systems
The module handles BW, RGB and RGBA images.
RGB images are stored with either 8 bits per COLOR VALUE, one each for red,green,blue (24bpp)
or 16 bits per COLOR VALUE, again one each for red,green,blue (48 bpp), not including the alpha channel
OPTIONS NOT SUPPORTED
1. 16 bit COLOR VALUES (48bpp modes)
2. COLORMAP = DITHERED mode
For non- run length encoded files, this is the structure
The Header
The Image Data
If the image is run length encoded, this is the structure:
The Header
The Offset Tables
The Image Data
The header consists of the following:
Size | Type | Name | Description
2 bytes | short | MAGIC | IRIS image file magic number
1 byte | char | STORAGE | Storage format
1 byte | char | BPC | Number of bytes per pixel channel
2 bytes | ushort | DIMENSION | Number of dimensions
2 bytes | ushort | XSIZE | X size in pixels
2 bytes | ushort | YSIZE | Y size in pixels
2 bytes | ushort | ZSIZE | Number of channels
4 bytes | long | PIXMIN | Minimum pixel value
4 bytes | long | PIXMAX | Maximum pixel value
4 bytes | char | DUMMY | Ignored
80 bytes | char | IMAGENAME | Image name
4 bytes | long | COLORMAP | Colormap ID
404 bytes | char | DUMMY | Ignored
Here is a description of each field in the image file header:
MAGIC - This is the decimal value 474 saved as a short. This identifies the file as an SGI image file.
STORAGE - specifies whether the image is stored using run length encoding (RLE) or not (VERBATIM).
If RLE is used, the value of this byte will be 1. Otherwise the value of this byte will
be 0. The only allowed values for this field are 0 or 1.
BPC - describes the precision that is used to store each channel of an image. This is the number of
bytes per pixel component. The majority of SGI image files use 1 byte per pixel component,
giving 256 levels. Some SGI image files use 2 bytes per component. The only allowed values
for this field are 1 or 2.
DIMENSION - described the number of dimensions in the data stored in the image file.
The only allowed values are 1, 2, or 3. If this value is 1, the image file
consists of only 1 channel and only 1 scanline (row). The length of this
scanline is given by the value of XSIZE below. If this value is 2, the file
consists of a single channel with a number of scanlines. The width and height
of the image are given by the values of XSIZE and YSIZE below.
If this value is 3, the file consists of a number of channels.
The width and height of the image are given by the values of XSIZE and YSIZE below.
The number of channels is given by the value of ZSIZE below.
XSIZE - The width of the image in pixels
YSIZE - The height of the image in pixels
ZSIZE - The number of channels in the image. B/W (greyscale) images are stored as 2 dimensional
images with a ZSIZE of 1. RGB color images are stored as 3 dimensional images with a
ZSIZE of 3. An RGB image with an ALPHA channel is stored as a 3 dimensional image with
a ZSIZE of 4. There are no inherent limitations in the SGI image file format that would
preclude the creation of image files with more than 4 channels.
PINMIN - The minimum pixel value in the image. The value of 0 may be used if no pixel has a value
that is smaller than 0.
PINMAX - The maximum pixel value in the image. The value of 255 may be used if no pixel has a
value that is greater than 255. This is the value that is considered to be full
brightness in the image.
DUMMY - This 4 bytes of data should be set to 0.
IMAGENAME - An null terminated ascii string of up to 79 characters terminated by a null may be
included here. This is not commonly used.
COLORMAP - This controls how the pixel values in the file should be interpreted. It can have one
of these four values:
0: NORMAL - The data in the channels represent B/W values for images with 1 channel, RGB values
for images with 3 channels, and RGBA values for images with 4 channels. Almost all
the SGI image files are of this type.
1: DITHERED - The image will have only 1 channel of data. For each pixel, RGB data is packed
into one 8 bit value. 3 bits are used for red and green, while blue uses 2 bits.
Red data is found in bits[2..0], green data in bits[5..3], and blue data in
bits[7..6]. This format is obsolete.
2: SCREEN - The image will have only 1 channel of data. This format was used to store
color-indexed pixels. To convert the pixel values into RGB values a colormap
must be used. The appropriate color map varies from image to image. This format is obsolete.
3: COLORMAP - The image is used to store a color map from an SGI machine. In this case the
image is not displayable in the conventional sense.
DUMMY - This 404 bytes of data should be set to 0. This makes the header exactly 512 bytes.
*/
#include "CImageLoaderRGB.h"
#ifdef _IRR_COMPILE_WITH_RGB_LOADER_
#include "IReadFile.h"
#include "SColor.h"
#include "CColorConverter.h"
#include "CImage.h"
#include "os.h"
#include "irrString.h"
namespace irr
{
namespace video
{
//! constructor
CImageLoaderRGB::CImageLoaderRGB()
{
#ifdef _DEBUG
setDebugName("CImageLoaderRGB");
#endif
}
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extensions listed here
bool CImageLoaderRGB::isALoadableFileExtension(const irr::core::stringc &fileName) const
{
return core::hasFileExtension( fileName, "rgb", "rgba", "sgi" ) ||
core::hasFileExtension( fileName, "int", "inta", "bw" );
}
//! returns true if the file maybe is able to be loaded by this class
bool CImageLoaderRGB::isALoadableFileFormat(io::IReadFile* file) const
{
rgbStruct *rgb = new rgbStruct;
bool retVal = checkFormat(file, rgb);
delete rgb;
return retVal;
}
/*
The main entry point, read and format the image file.
RETURNS: pointer to the image data on success
null pointer on fail
*/
//! creates a surface from the file
IImage* CImageLoaderRGB::loadImage(io::IReadFile* file) const
{
IImage* image = 0;
s32* paletteData = 0;
rgbStruct *rgb = new rgbStruct(); // construct our structure for holding data
// read header information
if (checkFormat(file, rgb))
{
// 16 bits per COLOR VALUE, not supported, this is 48bpp mode
if (rgb->header.BPC != 1)
{
os::Printer::log("Only one byte per pixel RGB files are supported", file->getFileName(), ELL_ERROR);
}
else if (rgb->header.Colormap != 0)
{
os::Printer::log("Dithered, Screen and Colormap RGB files are not supported", file->getFileName(), ELL_ERROR);
}
else if (rgb->header.Storage == 1 && !readOffsetTables(file, rgb))
{
os::Printer::log("Failed to read RLE table in RGB file", file->getFileName(), ELL_ERROR);
}
else if (!rgb->allocateTemps())
{
os::Printer::log("Out of memory in RGB file loader", file->getFileName(), ELL_ERROR);
}
else
{
// read and process the file to rgbData
processFile(rgb, file);
/*
ZSIZE Description
1 BW (grayscale) image
3 RGB image
4 RGBa image with one alpha channel
When the Alpha channel is present, I am not sure with RGB files if
it's a precomputed RGB color or it needs to be completely calculated. My guess
would be that it's not precomputed for two reasons.
1. the loss of precision when calculating the fraction, then storing the result as an int
2. the loss of the original color data when the image might be composited with another. Yes
the original color data could be computed, however, not without another loss in precision
Also, I don't know where to find the background color
Pixmin and Pixmax are apparently the min and max alpha blend values (0-100%)
Complete Alpha blending computation
The actual resulting merged color is computed this way:
(image color ◊ alpha) + (background color ◊ (100% - alpha)).
Using precomputed blending
(image color) + (background color ◊ (100% - alpha)).
Alternatively, the RGB files could use another blending technique entirely
*/
switch (rgb->header.Zsize)
{
case 1:
// BW (grayscale) image
paletteData = new s32[256];
for (int n=0; n<256; n++)
paletteData[n] = n;
image = new CImage(ECF_A1R5G5B5, core::dimension2d<u32>(rgb->header.Xsize, rgb->header.Ysize));
if (image)
CColorConverter::convert8BitTo16Bit(rgb->rgbData, (s16*)image->lock(), rgb->header.Xsize, rgb->header.Ysize, paletteData, 0, true);
break;
case 3:
// RGB image
// one byte per COLOR VALUE, eg, 24bpp
image = new CImage(ECF_R8G8B8, core::dimension2d<u32>(rgb->header.Xsize, rgb->header.Ysize));
if (image)
CColorConverter::convert24BitTo24Bit(rgb->rgbData, (u8*)image->lock(), rgb->header.Xsize, rgb->header.Ysize, 0, true, false);
break;
case 4:
// RGBa image with one alpha channel (32bpp)
// image is stored in rgbData as RGBA
converttoARGB(rgb->rgbData, rgb);
image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(rgb->header.Xsize, rgb->header.Ysize));
if (image)
CColorConverter::convert32BitTo32Bit((s32*)rgb->rgbData, (s32*)image->lock(), rgb->header.Xsize, rgb->header.Ysize, 0, true);
break;
default:
// Format unknown
os::Printer::log("Unsupported pixel format in RGB file", file->getFileName(), ELL_ERROR);
}
if (image)
image->unlock();
}
}
// and tidy up allocated memory
if (paletteData)
delete [] paletteData;
if (rgb)
delete rgb;
return image;
}
// returns true on success
bool CImageLoaderRGB::readHeader(io::IReadFile* file, rgbStruct* rgb) const
{
if ( file->read(&rgb->header, sizeof(rgb->header)) < sizeof(rgb->header) )
return false;
// test for INTEL or BIG ENDIAN processor
// if INTEL, then swap the byte order on 16 bit INT's to make them BIG ENDIAN
// because that is the native format for the .rgb file
#ifndef __BIG_ENDIAN__
rgb->header.Magic = os::Byteswap::byteswap(rgb->header.Magic);
rgb->header.Storage = os::Byteswap::byteswap(rgb->header.Storage);
rgb->header.Dimension = os::Byteswap::byteswap(rgb->header.Dimension);
rgb->header.Xsize = os::Byteswap::byteswap(rgb->header.Xsize);
rgb->header.Ysize = os::Byteswap::byteswap(rgb->header.Ysize);
rgb->header.Zsize = os::Byteswap::byteswap(rgb->header.Zsize);
rgb->header.Pixmin = os::Byteswap::byteswap(rgb->header.Pixmin);
rgb->header.Pixmax = os::Byteswap::byteswap(rgb->header.Pixmax);
rgb->header.Colormap = os::Byteswap::byteswap(rgb->header.Colormap);
#endif
// calculate the size of the buffer needed: XSIZE * YSIZE * ZSIZE * BPC
rgb->ImageSize = (rgb->header.Xsize)*(rgb->header.Ysize)*(rgb->header.Zsize)*(rgb->header.BPC);
// allocate our buffer
//if( !(rgb->rgbData = new u8 [rgb->ImageSize]) )
// return false;
return true;
}
bool CImageLoaderRGB::checkFormat(io::IReadFile* file, rgbStruct* rgb) const
{
if (!readHeader(file, rgb))
return false;
if (rgb->header.Magic == 0x1DA)
return true;
else
return false;
}
/*
If the image is stored using run length encoding, offset tables follow the header that
describe what the file offsets are to the RLE for each scanline. This information only
applies if the value for STORAGE above is 1.
Size | Type | Name | Description
tablen longs | long | STARTTAB | Start table
tablen longs | long | LENGTHTAB | Length table
One entry in each table is needed for each scanline of RLE data. The total number of scanlines in the image (tablen) is determined by the product of the YSIZE and ZSIZE. There are two tables of longs that are written. Each consists of tablen longs of data. The first table has the file offsets to the RLE data for each scanline in the image. In a file with more than 1 channel (ZSIZE > 1) this table first has all the offsets for the scanlines in the first channel, followed be offsets for the scanlines in the second channel, etc. The second table has the RLE data length for each scanline in the image. In a file with more than 1 channel (ZSIZE > 1) this table first has all the RLE data lengths for the scanlines in the first channel, followed be RLE data lengths for the scanlines in the second channel, etc.
To find the the file offset, and the number of bytes in the RLE data for a particular scanline, these
two arrays may be read in and indexed as follows:
To read in the tables:
unsigned long *starttab, *lengthtab;
tablen = YSIZE*ZSIZE*sizeof(long);
starttab = (unsigned long *)mymalloc(tablen);
lengthtab = (unsigned long *)mymalloc(tablen);
fseek(rgb->inf,512,SEEK_SET);
readlongtab(rgb->inf,starttab);
readlongtab(rgb->inf,lengthtab);
To find the file offset and RLE data length for a scanline:
rowno is an integer in the range 0 to YSIZE-1 channo is an integer in the range 0 to ZSIZE-1
rleoffset = starttab[rowno+channo*YSIZE]
rlelength = lengthtab[rowno+channo*YSIZE]
It is possible for two identical rows (scanlines) to share compressed data. A completely
white image could be written as a single compressed row and having all table entries point
to that row. Another little hack that should work is if you are writing out a RGB RLE file,
and a particular scanline is achromatic (greyscale), you could just make the r, g and b rows
point to the same data!!
RETURNS: on success true, else returns false
*/
bool CImageLoaderRGB::readOffsetTables(io::IReadFile* file, rgbStruct *rgb) const
{
u32 x;
rgb->TableLen = rgb->header.Ysize * rgb->header.Zsize ; // calc size of tables
// return error if unable to allocate tables
if ( !(rgb->StartTable = new u32[rgb->TableLen]) )
return false;
if ( !(rgb->LengthTable = new u32[rgb->TableLen]) )
return false;
file->seek(512);
file->read(rgb->StartTable, rgb->TableLen* sizeof(u32));
file->read(rgb->LengthTable, rgb->TableLen* sizeof(u32));
// if we are on an INTEL platform, swap the bytes
#ifndef __BIG_ENDIAN__
x= rgb->TableLen * sizeof(u32);
convertLong(rgb->StartTable, (long) (x/sizeof(u32)));
convertLong((u32 *)rgb->LengthTable, (long) (x/sizeof(u32)));
#endif
return true;
}
/*
The header has already been read into rgb structure
The Tables have been read if necessary
Now process the actual data
*/
void CImageLoaderRGB::processFile(rgbStruct *rgb, io::IReadFile* file) const
{
u8 *ptr;
int i, j;
u16 *tempShort;
// calculate the size of the buffer needed: XSIZE * YSIZE * ZSIZE * BPC
rgb->rgbData = new u8 [(rgb->header.Xsize)*(rgb->header.Ysize)*(rgb->header.Zsize)*(rgb->header.BPC)];
ptr = rgb->rgbData;
// cycle through all scanlines
#ifdef _IRR_RGB_FILE_INVERTED_IMAGE_
// preserve the image as stored, eg, inverted
for (i = 0; i < (int)(rgb->header.Ysize); i++)
#else
// invert the image to make it upright
for (i = (int)(rgb->header.Ysize)-1; i>=0; i--)
#endif
{
// check the number of channels and read a row of data
if( rgb->header.Zsize >= 1 )
readRGBrow( rgb->tmpR, i, 0, file, rgb);
if( rgb->header.Zsize >= 2 )
readRGBrow( rgb->tmpG, i, 1, file, rgb);
if( rgb->header.Zsize >= 3 )
readRGBrow( rgb->tmpB, i, 2, file, rgb);
if( rgb->header.Zsize >= 4 )
readRGBrow( rgb->tmpA, i, 3, file, rgb);
// cycle thru all values for this row
for (j = 0; j < (int)(rgb->header.Xsize); j++)
{
if(rgb->header.BPC == 1)
{
// ONE byte per color
if( rgb->header.Zsize >= 1 ) *ptr++ = *(rgb->tmpR + j);
if( rgb->header.Zsize >= 2 ) *ptr++ = *(rgb->tmpG + j);
if( rgb->header.Zsize >= 3 ) *ptr++ = *(rgb->tmpB + j);
if( rgb->header.Zsize >= 4 ) *ptr++ = *(rgb->tmpA + j);
}
else
{
// TWO bytes per color
if( rgb->header.Zsize >= 1 )
{
// two bytes of color data
tempShort = (u16 *) (ptr);
*tempShort = *( (u16 *) (rgb->tmpR) + j);
tempShort++;
ptr = ( u8 *)(tempShort);
}
if( rgb->header.Zsize >= 2 )
{
tempShort = ( u16 *) (ptr);
*tempShort = *( ( u16 *) (rgb->tmpG) + j);
tempShort++;
ptr = ( u8 *) (tempShort);
}
if( rgb->header.Zsize >= 3 )
{
tempShort = ( u16 *) (ptr);
*tempShort = *( ( u16 *) (rgb->tmpB) + j);
tempShort++;
ptr = ( u8 *)(tempShort);
}
if( rgb->header.Zsize >= 4 )
{
tempShort = ( u16 *) (ptr);
*tempShort = *( ( u16 *) (rgb->tmpA) + j);
tempShort++;
ptr = ( u8 *)(tempShort);
}
} // end if(rgb->header.BPC == 1)
} // end for
// // pad the image width with blanks to bring it up to the rounded width.
// for(;j<width;++j) *ptr++ = 0;
} // end for
}
/*
This information only applies if the value for STORAGE is 1. If the image is
stored using run length encoding, the image data follows the offset/length tables.
The RLE data is not in any particular order. The offset tables are used to
locate the rle data for any scanline.
The RLE data must be read in from the file and expanded into pixel data in the following manner:
If BPC is 1, then there is one byte per pixel. In this case the RLE data should be
read into an array of chars. To expand data, the low order seven bits of the first
byte: bits[6..0] are used to form a count. If the high order bit of the first byte
is 1: bit[7], then the count is used to specify how many bytes to copy from the RLE
data buffer to the destination. Otherwise, if the high order bit of the first byte
is 0: bit[7], then the count is used to specify how many times to repeat the value
of the following byte, in the destination. This process continues until a count
of 0 is found. This should decompress exactly XSIZE pixels.
One entry in each table is needed for each scanline of RLE data. The total number of
scanlines in the image (tablen) is determined by the product of the YSIZE and ZSIZE.
There are two tables of longs that are written. Each consists of tablen longs of data.
The first table has the file offsets to the RLE data for each scanline in the image. In
a file with more than 1 channel (ZSIZE > 1) this table first has all the offsets for the
scanlines in the first channel, followed be offsets for the scanlines in the second
channel, etc. The second table has the RLE data length for each scanline in the image.
In a file with more than 1 channel (ZSIZE > 1) this table first has all the RLE data
lengths for the scanlines in the first channel, followed be RLE data lengths for the
scanlines in the second channel, etc.
Return a row of data, expanding RLE compression if necessary
*/
void CImageLoaderRGB::readRGBrow(u8 *buf, int y, int z, io::IReadFile* file, rgbStruct* rgb) const
{
u8 *iPtr, *oPtr;
u16 pixel;
int count;
bool done = false;
u16 *tempShort;
if (rgb->header.Storage != 1)
{
// stored VERBATIM
file->seek(512+(y*rgb->header.Xsize * rgb->header.BPC)+(z* rgb->header.Xsize * rgb->header.Ysize * rgb->header.BPC));
file->read((char*)buf, rgb->header.Xsize * rgb->header.BPC);
#ifndef __BIG_ENDIAN__
if (rgb->header.BPC != 1)
convertShort( (u16 *)(buf), rgb->header.Xsize);
#endif
return;
}
// the file is stored as Run Length Encoding (RLE)
// each sequence is stored as 0x80 NumRepeats ByteToRepeat
// get the file offset from StartTable and SEEK
// then read the data
file->seek((long) rgb->StartTable[y+z * rgb->header.Ysize]);
file->read((char*) rgb->tmp, (unsigned int)rgb->LengthTable[y+z * rgb->header.Ysize]);
// rgb->tmp has the data
iPtr = rgb->tmp;
oPtr = buf;
while (!done)
{
// if BPC = 1, then one byte per pixel
if (rgb->header.BPC == 1)
{
pixel = *iPtr++;
}
else
{
// BPC = 2, so two bytes per pixel
tempShort = (u16 *) iPtr;
pixel = *tempShort;
tempShort++;
iPtr = (u8 *) tempShort;
}
#ifndef __BIG_ENDIAN__
if (rgb->header.BPC != 1)
convertShort(&pixel, 1);
#endif
count = (int)(pixel & 0x7F);
// limit the count value to the remiaing row size
if (oPtr + count*rgb->header.BPC > buf + rgb->header.Xsize * rgb->header.BPC)
{
count = ( (buf + rgb->header.Xsize * rgb->header.BPC) - oPtr ) / rgb->header.BPC;
}
if (count<=0)
{
done = true;
return;
}
if (pixel & 0x80)
{
// repeat the byte pointed to by iPtr, count times
while (count--)
{
if(rgb->header.BPC == 1)
{
*oPtr++ = *iPtr++;
}
else
{
tempShort = (u16 *) (iPtr);
pixel = *tempShort;
tempShort++;
iPtr = (u8 *) (tempShort);
#ifndef __BIG_ENDIAN__
convertShort(&pixel, 1);
#endif
tempShort = (u16 *) (oPtr);
*tempShort = pixel;
tempShort++;
oPtr = (u8 *) (tempShort);
}
}
}
else
{
if (rgb->header.BPC == 1)
{
pixel = *iPtr++;
}
else
{
tempShort = (u16 *) (iPtr);
pixel = *tempShort;
tempShort++;
iPtr = (u8 *) (tempShort);
}
#ifndef __BIG_ENDIAN__
if (rgb->header.BPC != 1)
convertShort(&pixel, 1);
#endif
while (count--)
{
if(rgb->header.BPC == 1)
{
*oPtr++ = (char) pixel;
}
else
{
tempShort = (u16 *) (oPtr);
*tempShort = pixel;
tempShort++;
oPtr = (u8 *) (tempShort);
}
}
} // else if (pixel & 0x80)
} // while (!done)
}
#ifndef __BIG_ENDIAN__
//todo: replace with os::byteswap
/*
In the following description a notation like bits[7..0] is used to denote a
range of bits in a binary value. Bit 0 is the lowest order bit in the value.
All short values are represented by 2 bytes. The first byte stores the
high order 8 bits of the value: bits[15..8]. The second byte stores the
low order 8 bits of the value: bits[7..0].
*/
void CImageLoaderRGB::convertShort(u16 *array, long length) const
{
unsigned long b1, b2;
unsigned char *ptr;
ptr = (unsigned char *)array;
while (length--)
{
b1 = *ptr++;
b2 = *ptr++;
*array++ = (u16) ((b1 << 8) | (b2));
}
}
/*
All long values are represented by 4 bytes. The first byte stores the
high order 8 bits of the value: bits[31..24]. The second byte stores
bits[23..16]. The third byte stores bits[15..8]. The forth byte stores
the low order 8 bits of the value: bits[7..0].
And this function will read a long value from the file:
*/
void CImageLoaderRGB::convertLong(u32 *array, long length) const
{
unsigned long b1, b2, b3, b4;
unsigned char *ptr;
ptr = (unsigned char *)array;
while (length--)
{
b1 = *ptr++;
b2 = *ptr++;
b3 = *ptr++;
b4 = *ptr++;
*array++ = (b1 << 24) | (b2 << 16) | (b3 << 8) | (b4);
}
}
#endif
// we have 1 byte per COLOR VALUE, eg 24bpp and 1 alpha channel
// calculate the color values based on the alpha values
// color values are stored as R,G,B,A
// todo: replace with CColorConverter method
void CImageLoaderRGB::converttoARGB(u8* in, rgbStruct *rgb) const
{
u32 cnt=0;
u8 tmp;
// (image color ◊ alpha) + (background color ◊ (100% - alpha)).
for ( int y=0; y < rgb->header.Ysize; y++)
{
for ( int x=0; x < rgb->header.Xsize; x++)
{
tmp = in[cnt+3];
in[cnt+3] = in[cnt+2];
in[cnt+2] = in[cnt+1];
in[cnt+1] = in[cnt];
in[cnt] = tmp;
in +=4;
}
}
}
//! creates a loader which is able to load windows bitmaps
IImageLoader* createImageLoaderRGB()
{
return new CImageLoaderRGB;
}
} // end namespace video
} // end namespace irr
#endif
......@@ -182,21 +182,19 @@ private:
bool readHeader(io::IReadFile* file, rgbStruct* rgb) const;
void readRGBrow( u8 *buf, int y, int z, io::IReadFile* file, rgbStruct* rgb) const;
void convertLong(u32 *array, long length) const;
void convertShort(u16 *array, long length) const;
void processFile(rgbStruct *rgb, io::IReadFile *file) const;
bool checkFormat(io::IReadFile *file, rgbStruct *rgb) const;
bool readOffsetTables(io::IReadFile* file, rgbStruct *rgb) const;
void converttoARGB(u8* in, rgbStruct *rgb) const;
#ifndef __BIG_ENDIAN__
void convertLong(u32 *array, long length) const;
void convertShort(u16 *array, long length) const;
#endif
};
} // end namespace video
} // end namespace irr
#endif
#endif
#endif // _IRR_COMPILE_WITH_RGB_LOADER_
#endif // __C_IMAGE_LOADER_RGB_H_INCLUDED__
......@@ -406,8 +406,8 @@ void CIrrDeviceConsole::closeDevice()
IsDeviceRunning = false;
}
//! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceConsole::setResizeable(bool resize)
//! Sets if the window should be resizable in windowed mode.
void CIrrDeviceConsole::setResizable(bool resize)
{
// do nothing
}
......
......@@ -75,8 +75,8 @@ namespace irr
//! notifies the device that it should close itself
virtual void closeDevice();
//! Sets if the window should be resizeable in windowed mode.
virtual void setResizeable(bool resize=false);
//! Sets if the window should be resizable in windowed mode.
virtual void setResizable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
......
......@@ -1050,8 +1050,8 @@ video::ECOLOR_FORMAT CIrrDeviceLinux::getColorFormat() const
}
//! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceLinux::setResizeable(bool resize)
//! Sets if the window should be resizable in windowed mode.
void CIrrDeviceLinux::setResizable(bool resize)
{
#ifdef _IRR_COMPILE_WITH_X11_
if (CreationParams.DriverType == video::EDT_NULL)
......
......@@ -87,8 +87,8 @@ namespace irr
//! supported by the gfx adapter.
video::IVideoModeList* getVideoModeList();
//! Sets if the window should be resizeable in windowed mode.
virtual void setResizeable(bool resize=false);
//! Sets if the window should be resizable in windowed mode.
virtual void setResizable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
......
......@@ -45,7 +45,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
Screen((SDL_Surface*)param.WindowId), SDL_Flags(SDL_HWSURFACE|SDL_ANYFORMAT),
MouseX(0), MouseY(0), MouseButtonStates(0),
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
Close(0), Resizeable(false),
Close(0), Resizable(false),
WindowHasFocus(false), WindowMinimized(false)
{
#ifdef _DEBUG
......@@ -660,10 +660,10 @@ video::IVideoModeList* CIrrDeviceSDL::getVideoModeList()
}
//! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceSDL::setResizeable(bool resize)
//! Sets if the window should be resizable in windowed mode.
void CIrrDeviceSDL::setResizable(bool resize)
{
if (resize != Resizeable)
if (resize != Resizable)
{
if (resize)
SDL_Flags |= SDL_RESIZABLE;
......@@ -672,7 +672,7 @@ void CIrrDeviceSDL::setResizeable(bool resize)
if (Screen)
SDL_FreeSurface(Screen);
Screen = SDL_SetVideoMode( Width, Height, CreationParams.Bits, SDL_Flags );
Resizeable = resize;
Resizable = resize;
}
}
......
......@@ -64,8 +64,8 @@ namespace irr
//! \return Returns a pointer to a list with all video modes supported
video::IVideoModeList* getVideoModeList();
//! Sets if the window should be resizeable in windowed mode.
virtual void setResizeable(bool resize=false);
//! Sets if the window should be resizable in windowed mode.
virtual void setResizable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
......@@ -185,7 +185,7 @@ namespace irr
u32 Width, Height;
bool Close;
bool Resizeable;
bool Resizable;
bool WindowHasFocus;
bool WindowMinimized;
......
......@@ -892,8 +892,8 @@ void CIrrDeviceWin32::OnResized()
Resized = true;
}
//! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceWin32::setResizeable(bool resize)
//! Sets if the window should be resizable in windowed mode.
void CIrrDeviceWin32::setResizable(bool resize)
{
if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen)
return;
......
......@@ -66,8 +66,8 @@ namespace irr
//! Notifies the device, that it has been resized
void OnResized();
//! Sets if the window should be resizeable in windowed mode.
virtual void setResizeable(bool resize=false);
//! Sets if the window should be resizable in windowed mode.
virtual void setResizable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
......
......@@ -741,8 +741,8 @@ void CIrrDeviceWinCE::OnResized()
}
//! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceWinCE::setResizeable(bool resize)
//! Sets if the window should be resizable in windowed mode.
void CIrrDeviceWinCE::setResizable(bool resize)
{
if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen)
return;
......
......@@ -66,8 +66,8 @@ namespace irr
//! Notifies the device, that it has been resized
void OnResized();
//! Sets if the window should be resizeable in windowed mode.
virtual void setResizeable(bool resize=false);
//! Sets if the window should be resizable in windowed mode.
virtual void setResizable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
......
......@@ -52,7 +52,7 @@
- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize
{
if (_device->isResizeAble())
if (_device->isResizable())
return proposedFrameSize;
else
return [window frame].size;
......
......@@ -63,10 +63,13 @@ namespace irr
virtual void closeDevice();
//! Sets if the window should be resizable in windowed mode.
virtual void setResizeAble(bool resize);
virtual void setResizable(bool resize);
//! Returns true if the window is resizable, false if not
virtual bool isResizeAble() const;
virtual bool isResizable() const;
//! Minimizes the window if possible
virtual void minimizeWindow();
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
......@@ -76,8 +79,8 @@ namespace irr
virtual video::IVideoModeList* getVideoModeList();
void flush();
void setMouseLocation(int x,int y);
void setResize(int width,int height);
void setMouseLocation(int x, int y);
void setResize(int width, int height);
void setCursorVisible(bool visible);
private:
......
......@@ -369,7 +369,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
if (CreationParams.DriverType != video::EDT_NULL)
createWindow();
setResizeAble(false);
setResizable(false);
CursorControl = new CCursorControl(CreationParams.WindowSize, this);
createDriver();
......@@ -1085,17 +1085,21 @@ void CIrrDeviceMacOSX::initKeycodes()
//! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceMacOSX::setResizeAble(bool resize)
//! Sets if the window should be resizable in windowed mode.
void CIrrDeviceMacOSX::setResizable(bool resize)
{
IsResizable = resize;
}
bool CIrrDeviceMacOSX::isResizeAble() const
bool CIrrDeviceMacOSX::isResizable() const
{
return IsResizable;
}
void CIrrDeviceMacOSX::minimizeWindow()
{
// todo: implement
}
bool CIrrDeviceMacOSX::present(video::IImage* surface, void* windowId, core::rect<s32>* src )
{
......
......@@ -2021,63 +2021,16 @@
0910BA810D1F6BB800D46B04 /* gui */ = {
isa = PBXGroup;
children = (
34FFD9CB0F6601AC00420884 /* element */,
4C53DEE60A484C220014E966 /* BuiltInFont.h */,
5DD480580C7D945800728AA9 /* CDefaultGUIElementFactory.cpp */,
5DD480590C7D945800728AA9 /* CDefaultGUIElementFactory.h */,
4C53DF2E0A484C230014E966 /* CGUIButton.cpp */,
4C53DF2F0A484C230014E966 /* CGUIButton.h */,
4C53DF300A484C230014E966 /* CGUICheckBox.cpp */,
4C53DF310A484C230014E966 /* CGUICheckBox.h */,
5DD4805E0C7D947B00728AA9 /* CGUIColorSelectDialog.cpp */,
5DD4805F0C7D947B00728AA9 /* CGUIColorSelectDialog.h */,
4C53DF320A484C230014E966 /* CGUIComboBox.cpp */,
4C53DF330A484C230014E966 /* CGUIComboBox.h */,
4C53DF340A484C230014E966 /* CGUIContextMenu.cpp */,
4C53DF350A484C230014E966 /* CGUIContextMenu.h */,
4C53DF360A484C230014E966 /* CGUIEditBox.cpp */,
4C53DF370A484C230014E966 /* CGUIEditBox.h */,
4C53DF380A484C230014E966 /* CGUIEnvironment.cpp */,
4C53DF390A484C230014E966 /* CGUIEnvironment.h */,
4C53DF3A0A484C230014E966 /* CGUIFileOpenDialog.cpp */,
4C53DF3B0A484C230014E966 /* CGUIFileOpenDialog.h */,
4C53DF3C0A484C230014E966 /* CGUIFont.cpp */,
4C53DF3D0A484C230014E966 /* CGUIFont.h */,
4C53DF3E0A484C230014E966 /* CGUIImage.cpp */,
4C53DF3F0A484C230014E966 /* CGUIImage.h */,
3484C4DF0F48D1B000C81F60 /* CGUIImageList.h */,
3484C4E00F48D1B000C81F60 /* CGUIImageList.cpp */,
4C53DF400A484C230014E966 /* CGUIInOutFader.cpp */,
4C53DF410A484C230014E966 /* CGUIInOutFader.h */,
4C53DF420A484C230014E966 /* CGUIListBox.cpp */,
4C53DF430A484C230014E966 /* CGUIListBox.h */,
4C53DF440A484C230014E966 /* CGUIMenu.cpp */,
4C53DF450A484C230014E966 /* CGUIMenu.h */,
4C53DF460A484C230014E966 /* CGUIMeshViewer.cpp */,
4C53DF470A484C230014E966 /* CGUIMeshViewer.h */,
4C53DF480A484C230014E966 /* CGUIMessageBox.cpp */,
4C53DF490A484C230014E966 /* CGUIMessageBox.h */,
4C53DF4A0A484C230014E966 /* CGUIModalScreen.cpp */,
4C53DF4B0A484C230014E966 /* CGUIModalScreen.h */,
4C53DF4C0A484C230014E966 /* CGUIScrollBar.cpp */,
4C53DF4D0A484C230014E966 /* CGUIScrollBar.h */,
4C53DF4E0A484C230014E966 /* CGUISkin.cpp */,
4C53DF4F0A484C230014E966 /* CGUISkin.h */,
5DD480600C7D947B00728AA9 /* CGUISpinBox.cpp */,
5DD480610C7D947B00728AA9 /* CGUISpinBox.h */,
5DD480620C7D947B00728AA9 /* CGUISpriteBank.cpp */,
5DD480630C7D947B00728AA9 /* CGUISpriteBank.h */,
4C53DF500A484C230014E966 /* CGUIStaticText.cpp */,
4C53DF510A484C230014E966 /* CGUIStaticText.h */,
4C53DF520A484C230014E966 /* CGUITabControl.cpp */,
4C53DF530A484C230014E966 /* CGUITabControl.h */,
0910B9DA0D1F5D4100D46B04 /* CGUITable.cpp */,
0910B9DB0D1F5D4100D46B04 /* CGUITable.h */,
4C53DF540A484C230014E966 /* CGUIToolBar.cpp */,
4C53DF550A484C230014E966 /* CGUIToolBar.h */,
3484C4EC0F48D3A100C81F60 /* CGUITreeView.h */,
3484C4ED0F48D3A100C81F60 /* CGUITreeView.cpp */,
4C53DF560A484C230014E966 /* CGUIWindow.cpp */,
4C53DF570A484C230014E966 /* CGUIWindow.h */,
);
name = gui;
sourceTree = "<group>";
......@@ -2085,31 +2038,14 @@
0910BA820D1F6C3900D46B04 /* io */ = {
isa = PBXGroup;
children = (
4C53E0030A484C250014E966 /* CZipReader.cpp */,
4C53E0040A484C250014E966 /* CZipReader.h */,
4C53DEEF0A484C220014E966 /* CAttributeImpl.h */,
4C53DEF00A484C220014E966 /* CAttributes.cpp */,
4C53DEF10A484C220014E966 /* CAttributes.h */,
34FFD9CA0F66018500420884 /* xml */,
34FFD9C90F66014200420884 /* file */,
34FFD9C80F66012D00420884 /* attributes */,
34FFD9C70F66011C00420884 /* archive */,
4C53DF260A484C230014E966 /* CFileList.cpp */,
4C53DF270A484C230014E966 /* CFileList.h */,
4C53DF280A484C230014E966 /* CFileSystem.cpp */,
4C53DF290A484C230014E966 /* CFileSystem.h */,
4C53DF6E0A484C230014E966 /* CLimitReadFile.cpp */,
4C53DF6F0A484C230014E966 /* CLimitReadFile.h */,
3484C4FB0F48D4CB00C81F60 /* CMemoryFile.h */,
3484C4FC0F48D4CB00C81F60 /* CMemoryFile.cpp */,
4C43EEBE0A74A5C800F942FC /* CPakReader.cpp */,
4C43EEBF0A74A5C800F942FC /* CPakReader.h */,
4C53DFA70A484C240014E966 /* CReadFile.cpp */,
4C53DFA80A484C240014E966 /* CReadFile.h */,
4C53DFF20A484C250014E966 /* CWriteFile.cpp */,
4C53DFF30A484C250014E966 /* CWriteFile.h */,
4C53DFFA0A484C250014E966 /* CXMLReader.cpp */,
4C53DFFB0A484C250014E966 /* CXMLReader.h */,
4C53DFFC0A484C250014E966 /* CXMLReaderImpl.h */,
4C53DFFD0A484C250014E966 /* CXMLWriter.cpp */,
4C53DFFE0A484C250014E966 /* CXMLWriter.h */,
4C53E00E0A484C250014E966 /* irrXML.cpp */,
);
name = io;
sourceTree = "<group>";
......@@ -2117,16 +2053,7 @@
0910BA830D1F6CA600D46B04 /* irr */ = {
isa = PBXGroup;
children = (
34EC243A0F59272E0037BC3A /* CIrrDeviceConsole.h */,
34EC243B0F59272E0037BC3A /* CIrrDeviceConsole.cpp */,
4C53DF660A484C230014E966 /* CIrrDeviceLinux.cpp */,
4C53DF670A484C230014E966 /* CIrrDeviceLinux.h */,
5DD480C40C7DA66800728AA9 /* CIrrDeviceSDL.cpp */,
5DD480C30C7DA66800728AA9 /* CIrrDeviceSDL.h */,
4C53DF680A484C230014E966 /* CIrrDeviceStub.cpp */,
4C53DF690A484C230014E966 /* CIrrDeviceStub.h */,
4C53DF6A0A484C230014E966 /* CIrrDeviceWin32.cpp */,
4C53DF6B0A484C230014E966 /* CIrrDeviceWin32.h */,
34FFD9C60F6600DA00420884 /* device */,
4C53DF720A484C230014E966 /* CLogger.cpp */,
4C53DF730A484C230014E966 /* CLogger.h */,
4C53DF990A484C240014E966 /* COSOperator.cpp */,
......@@ -2613,6 +2540,138 @@
name = loader;
sourceTree = "<group>";
};
34FFD9C50F6600A900420884 /* libraries */ = {
isa = PBXGroup;
children = (
4C53E1710A484C2C0014E966 /* zlib */,
4C53E0130A484C250014E966 /* jpeglib */,
09293C2B0ED31FF8003B8C9C /* libpng */,
);
name = libraries;
sourceTree = "<group>";
};
34FFD9C60F6600DA00420884 /* device */ = {
isa = PBXGroup;
children = (
4C53E14A0A484C2C0014E966 /* MacOSX */,
34EC243A0F59272E0037BC3A /* CIrrDeviceConsole.h */,
34EC243B0F59272E0037BC3A /* CIrrDeviceConsole.cpp */,
4C53DF660A484C230014E966 /* CIrrDeviceLinux.cpp */,
4C53DF670A484C230014E966 /* CIrrDeviceLinux.h */,
5DD480C40C7DA66800728AA9 /* CIrrDeviceSDL.cpp */,
5DD480C30C7DA66800728AA9 /* CIrrDeviceSDL.h */,
4C53DF680A484C230014E966 /* CIrrDeviceStub.cpp */,
4C53DF690A484C230014E966 /* CIrrDeviceStub.h */,
4C53DF6A0A484C230014E966 /* CIrrDeviceWin32.cpp */,
4C53DF6B0A484C230014E966 /* CIrrDeviceWin32.h */,
);
name = device;
sourceTree = "<group>";
};
34FFD9C70F66011C00420884 /* archive */ = {
isa = PBXGroup;
children = (
4C53E0030A484C250014E966 /* CZipReader.cpp */,
4C53E0040A484C250014E966 /* CZipReader.h */,
4C43EEBE0A74A5C800F942FC /* CPakReader.cpp */,
4C43EEBF0A74A5C800F942FC /* CPakReader.h */,
);
name = archive;
sourceTree = "<group>";
};
34FFD9C80F66012D00420884 /* attributes */ = {
isa = PBXGroup;
children = (
4C53DEEF0A484C220014E966 /* CAttributeImpl.h */,
4C53DEF00A484C220014E966 /* CAttributes.cpp */,
4C53DEF10A484C220014E966 /* CAttributes.h */,
);
name = attributes;
sourceTree = "<group>";
};
34FFD9C90F66014200420884 /* file */ = {
isa = PBXGroup;
children = (
4C53DFA70A484C240014E966 /* CReadFile.cpp */,
4C53DFA80A484C240014E966 /* CReadFile.h */,
4C53DFF20A484C250014E966 /* CWriteFile.cpp */,
4C53DFF30A484C250014E966 /* CWriteFile.h */,
4C53DF6E0A484C230014E966 /* CLimitReadFile.cpp */,
4C53DF6F0A484C230014E966 /* CLimitReadFile.h */,
3484C4FB0F48D4CB00C81F60 /* CMemoryFile.h */,
3484C4FC0F48D4CB00C81F60 /* CMemoryFile.cpp */,
);
name = file;
sourceTree = "<group>";
};
34FFD9CA0F66018500420884 /* xml */ = {
isa = PBXGroup;
children = (
4C53DFFA0A484C250014E966 /* CXMLReader.cpp */,
4C53DFFB0A484C250014E966 /* CXMLReader.h */,
4C53DFFC0A484C250014E966 /* CXMLReaderImpl.h */,
4C53DFFD0A484C250014E966 /* CXMLWriter.cpp */,
4C53DFFE0A484C250014E966 /* CXMLWriter.h */,
4C53E00E0A484C250014E966 /* irrXML.cpp */,
);
name = xml;
sourceTree = "<group>";
};
34FFD9CB0F6601AC00420884 /* element */ = {
isa = PBXGroup;
children = (
4C53DF2E0A484C230014E966 /* CGUIButton.cpp */,
4C53DF2F0A484C230014E966 /* CGUIButton.h */,
4C53DF300A484C230014E966 /* CGUICheckBox.cpp */,
4C53DF310A484C230014E966 /* CGUICheckBox.h */,
5DD4805E0C7D947B00728AA9 /* CGUIColorSelectDialog.cpp */,
5DD4805F0C7D947B00728AA9 /* CGUIColorSelectDialog.h */,
4C53DF320A484C230014E966 /* CGUIComboBox.cpp */,
4C53DF330A484C230014E966 /* CGUIComboBox.h */,
4C53DF340A484C230014E966 /* CGUIContextMenu.cpp */,
4C53DF350A484C230014E966 /* CGUIContextMenu.h */,
4C53DF360A484C230014E966 /* CGUIEditBox.cpp */,
4C53DF370A484C230014E966 /* CGUIEditBox.h */,
4C53DF380A484C230014E966 /* CGUIEnvironment.cpp */,
4C53DF390A484C230014E966 /* CGUIEnvironment.h */,
4C53DF3A0A484C230014E966 /* CGUIFileOpenDialog.cpp */,
4C53DF3B0A484C230014E966 /* CGUIFileOpenDialog.h */,
4C53DF3E0A484C230014E966 /* CGUIImage.cpp */,
4C53DF3F0A484C230014E966 /* CGUIImage.h */,
3484C4DF0F48D1B000C81F60 /* CGUIImageList.h */,
3484C4E00F48D1B000C81F60 /* CGUIImageList.cpp */,
4C53DF400A484C230014E966 /* CGUIInOutFader.cpp */,
4C53DF410A484C230014E966 /* CGUIInOutFader.h */,
4C53DF420A484C230014E966 /* CGUIListBox.cpp */,
4C53DF430A484C230014E966 /* CGUIListBox.h */,
4C53DF440A484C230014E966 /* CGUIMenu.cpp */,
4C53DF450A484C230014E966 /* CGUIMenu.h */,
4C53DF460A484C230014E966 /* CGUIMeshViewer.cpp */,
4C53DF470A484C230014E966 /* CGUIMeshViewer.h */,
4C53DF480A484C230014E966 /* CGUIMessageBox.cpp */,
4C53DF490A484C230014E966 /* CGUIMessageBox.h */,
4C53DF4A0A484C230014E966 /* CGUIModalScreen.cpp */,
4C53DF4B0A484C230014E966 /* CGUIModalScreen.h */,
4C53DF4C0A484C230014E966 /* CGUIScrollBar.cpp */,
4C53DF4D0A484C230014E966 /* CGUIScrollBar.h */,
5DD480600C7D947B00728AA9 /* CGUISpinBox.cpp */,
5DD480610C7D947B00728AA9 /* CGUISpinBox.h */,
4C53DF500A484C230014E966 /* CGUIStaticText.cpp */,
4C53DF510A484C230014E966 /* CGUIStaticText.h */,
4C53DF520A484C230014E966 /* CGUITabControl.cpp */,
4C53DF530A484C230014E966 /* CGUITabControl.h */,
0910B9DA0D1F5D4100D46B04 /* CGUITable.cpp */,
0910B9DB0D1F5D4100D46B04 /* CGUITable.h */,
4C53DF540A484C230014E966 /* CGUIToolBar.cpp */,
4C53DF550A484C230014E966 /* CGUIToolBar.h */,
3484C4EC0F48D3A100C81F60 /* CGUITreeView.h */,
3484C4ED0F48D3A100C81F60 /* CGUITreeView.cpp */,
4C53DF560A484C230014E966 /* CGUIWindow.cpp */,
4C53DF570A484C230014E966 /* CGUIWindow.h */,
);
name = element;
sourceTree = "<group>";
};
4C00546D0A48470500C844C2 /* examples */ = {
isa = PBXGroup;
children = (
......@@ -2757,11 +2816,8 @@
4C53DEE50A484C220014E966 /* Irrlicht */ = {
isa = PBXGroup;
children = (
09293C2B0ED31FF8003B8C9C /* libpng */,
34FFD9C50F6600A900420884 /* libraries */,
4C6DC9960A486B110017A6E5 /* Engine */,
4C53E14A0A484C2C0014E966 /* MacOSX */,
4C53E0130A484C250014E966 /* jpeglib */,
4C53E1710A484C2C0014E966 /* zlib */,
);
name = Irrlicht;
path = ..;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment