Commit 2b067aab authored by hybrid's avatar hybrid

Some more whitespace adjustment.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4502 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9f7227b7
...@@ -391,9 +391,9 @@ namespace scene ...@@ -391,9 +391,9 @@ namespace scene
EAMT_STILL, EAMT_STILL,
//! From Start to End, then Stop ( Limited Line ) //! From Start to End, then Stop ( Limited Line )
EAMT_WAYPOINT, EAMT_WAYPOINT,
//! Linear Cycling Animation ( Sawtooth ) //! Linear Cycling Animation ( Sawtooth )
EAMT_LOOPING, EAMT_LOOPING,
//! Linear bobbing ( Triangle ) //! Linear bobbing ( Triangle )
EAMT_PINGPONG EAMT_PINGPONG
}; };
......
...@@ -56,7 +56,7 @@ namespace scene ...@@ -56,7 +56,7 @@ namespace scene
virtual IMeshBuffer* getMeshBuffer(u32 nr) const; virtual IMeshBuffer* getMeshBuffer(u32 nr) const;
//! Returns pointer to a mesh buffer which fits a material //! Returns pointer to a mesh buffer which fits a material
/** \param material: material to search for /** \param material: material to search for
\return Returns the pointer to the mesh buffer or \return Returns the pointer to the mesh buffer or
NULL if there is no such mesh buffer. */ NULL if there is no such mesh buffer. */
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const; virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const;
......
...@@ -660,14 +660,14 @@ public: ...@@ -660,14 +660,14 @@ public:
ret.Normal.X = Count > 0 ? ValueF[0] : 0.0f; ret.Normal.X = Count > 0 ? ValueF[0] : 0.0f;
ret.Normal.Y = Count > 1 ? ValueF[1] : 0.0f; ret.Normal.Y = Count > 1 ? ValueF[1] : 0.0f;
ret.Normal.Z = Count > 2 ? ValueF[2] : 0.0f; ret.Normal.Z = Count > 2 ? ValueF[2] : 0.0f;
ret.D = Count > 3 ? ValueF[3] : 0.0f; ret.D = Count > 3 ? ValueF[3] : 0.0f;
} }
else else
{ {
ret.Normal.X = Count > 0 ? (f32)ValueI[0] : 0.0f; ret.Normal.X = Count > 0 ? (f32)ValueI[0] : 0.0f;
ret.Normal.Y = Count > 1 ? (f32)ValueI[1] : 0.0f; ret.Normal.Y = Count > 1 ? (f32)ValueI[1] : 0.0f;
ret.Normal.Z = Count > 2 ? (f32)ValueI[2] : 0.0f; ret.Normal.Z = Count > 2 ? (f32)ValueI[2] : 0.0f;
ret.D = Count > 3 ? (f32)ValueI[3] : 0.0f; ret.D = Count > 3 ? (f32)ValueI[3] : 0.0f;
} }
return ret; return ret;
......
...@@ -66,7 +66,7 @@ public: ...@@ -66,7 +66,7 @@ public:
//! \param readCurrentElementOnly: If set to true, reading only works if current element has the name 'attributes'. //! \param readCurrentElementOnly: If set to true, reading only works if current element has the name 'attributes'.
//! IF set to false, the first appearing list attributes are read. //! IF set to false, the first appearing list attributes are read.
virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false, virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false,
const wchar_t* nonDefaultElementName = 0); const wchar_t* nonDefaultElementName = 0);
//! Write these attributes into a xml file //! Write these attributes into a xml file
virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* nonDefaultElementName=0); virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* nonDefaultElementName=0);
......
...@@ -40,9 +40,9 @@ public: ...@@ -40,9 +40,9 @@ public:
//! Sets the widths of the top and bottom edges of the billboard independently. //! Sets the widths of the top and bottom edges of the billboard independently.
virtual void setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWidth); virtual void setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWidth);
//! gets the size of the billboard //! gets the size of the billboard
virtual const core::dimension2d<f32>& getSize() const; virtual const core::dimension2d<f32>& getSize() const;
//! Gets the widths of the top and bottom edges of the billboard. //! Gets the widths of the top and bottom edges of the billboard.
virtual void getSize(f32& height, f32& bottomEdgeWidth, f32& topEdgeWidth) const; virtual void getSize(f32& height, f32& bottomEdgeWidth, f32& topEdgeWidth) const;
......
...@@ -465,7 +465,7 @@ static void RenderLine16_Blend(video::IImage *t, ...@@ -465,7 +465,7 @@ static void RenderLine16_Blend(video::IImage *t,
d -= c; d -= c;
} }
run -= 1; run -= 1;
} while (run>=0); } while (run>=0);
t->unlock(); t->unlock();
} }
...@@ -1060,7 +1060,7 @@ static inline tExecuteBlit getBlitter2( eBlitter operation,const video::IImage * ...@@ -1060,7 +1060,7 @@ static inline tExecuteBlit getBlitter2( eBlitter operation,const video::IImage *
// bounce clipping to texture // bounce clipping to texture
inline void setClip ( AbsRectangle &out, const core::rect<s32> *clip, inline void setClip ( AbsRectangle &out, const core::rect<s32> *clip,
const video::IImage * tex, s32 passnative ) const video::IImage * tex, s32 passnative )
{ {
if ( clip && 0 == tex && passnative ) if ( clip && 0 == tex && passnative )
{ {
...@@ -1228,7 +1228,7 @@ static void drawRectangle(video::IImage* img, const core::rect<s32>& rect, const ...@@ -1228,7 +1228,7 @@ static void drawRectangle(video::IImage* img, const core::rect<s32>& rect, const
//! draws a line from to with color //! draws a line from to with color
static void drawLine(video::IImage* img, const core::position2d<s32>& from, static void drawLine(video::IImage* img, const core::position2d<s32>& from,
const core::position2d<s32>& to, const video::SColor &color) const core::position2d<s32>& to, const video::SColor &color)
{ {
AbsRectangle clip; AbsRectangle clip;
GetClip(clip, img); GetClip(clip, img);
......
...@@ -106,8 +106,8 @@ namespace video ...@@ -106,8 +106,8 @@ namespace video
IDirect3DIndexBuffer9* indexBuffer; IDirect3DIndexBuffer9* indexBuffer;
u32 vertexBufferSize; u32 vertexBufferSize;
u32 indexBufferSize; u32 indexBufferSize;
}; };
bool updateVertexHardwareBuffer(SHWBufferLink_d3d9 *HWBuffer); bool updateVertexHardwareBuffer(SHWBufferLink_d3d9 *HWBuffer);
bool updateIndexHardwareBuffer(SHWBufferLink_d3d9 *HWBuffer); bool updateIndexHardwareBuffer(SHWBufferLink_d3d9 *HWBuffer);
......
...@@ -68,7 +68,7 @@ protected: ...@@ -68,7 +68,7 @@ protected:
LPD3DXBUFFER* ppErrorMsgs); LPD3DXBUFFER* ppErrorMsgs);
HRESULT stubD3DXAssembleShaderFromFile(LPCSTR pSrcFile, HRESULT stubD3DXAssembleShaderFromFile(LPCSTR pSrcFile,
CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags,
LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs); LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs);
HRESULT stubD3DXCompileShader(LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, HRESULT stubD3DXCompileShader(LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines,
......
...@@ -44,7 +44,7 @@ namespace gui ...@@ -44,7 +44,7 @@ namespace gui
virtual u32 addItem(const wchar_t* text, s32 commandid, virtual u32 addItem(const wchar_t* text, s32 commandid,
bool enabled, bool hasSubMenu, bool checked, bool autoChecking); bool enabled, bool hasSubMenu, bool checked, bool autoChecking);
//! Insert a menu item at specified position. //! Insert a menu item at specified position.
virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId, bool enabled, virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId, bool enabled,
bool hasSubMenu, bool checked, bool autoChecking); bool hasSubMenu, bool checked, bool autoChecking);
......
...@@ -128,9 +128,8 @@ namespace gui ...@@ -128,9 +128,8 @@ namespace gui
//! set global itemHeight //! set global itemHeight
virtual void setItemHeight( s32 height ); virtual void setItemHeight( s32 height );
//! Sets whether to draw the background //! Sets whether to draw the background
virtual void setDrawBackground(bool draw); virtual void setDrawBackground(bool draw);
private: private:
......
...@@ -38,9 +38,9 @@ namespace gui ...@@ -38,9 +38,9 @@ namespace gui
//! Updates the absolute position. //! Updates the absolute position.
virtual void updateAbsolutePosition(); virtual void updateAbsolutePosition();
//! Modalscreen is not a typical element, but rather acts like a state for it's children. //! Modalscreen is not a typical element, but rather acts like a state for it's children.
//! isVisible is overriden to give this a useful behavior, so that a modal will no longer //! isVisible is overriden to give this a useful behavior, so that a modal will no longer
//! be active when its parent is invisible or all its children are invisible. //! be active when its parent is invisible or all its children are invisible.
virtual bool isVisible() const; virtual bool isVisible() const;
//! Modals are infinite so every point is inside //! Modals are infinite so every point is inside
...@@ -52,8 +52,8 @@ namespace gui ...@@ -52,8 +52,8 @@ namespace gui
//! Reads attributes of the element //! Reads attributes of the element
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
protected: protected:
virtual bool canTakeFocus(IGUIElement* target) const; virtual bool canTakeFocus(IGUIElement* target) const;
private: private:
......
...@@ -50,18 +50,18 @@ namespace gui ...@@ -50,18 +50,18 @@ namespace gui
//! Sets whether the window is draggable //! Sets whether the window is draggable
virtual void setDraggable(bool draggable); virtual void setDraggable(bool draggable);
//! Set if the window background will be drawn //! Set if the window background will be drawn
virtual void setDrawBackground(bool draw); virtual void setDrawBackground(bool draw);
//! Get if the window background will be drawn //! Get if the window background will be drawn
virtual bool getDrawBackground() const; virtual bool getDrawBackground() const;
//! Set if the window titlebar will be drawn //! Set if the window titlebar will be drawn
//! Note: If the background is not drawn, then the titlebar is automatically also not drawn //! Note: If the background is not drawn, then the titlebar is automatically also not drawn
virtual void setDrawTitlebar(bool draw); virtual void setDrawTitlebar(bool draw);
//! Get if the window titlebar will be drawn //! Get if the window titlebar will be drawn
virtual bool getDrawTitlebar() const; virtual bool getDrawTitlebar() const;
//! Returns the rectangle of the drawable area (without border and without titlebar) //! Returns the rectangle of the drawable area (without border and without titlebar)
virtual core::rect<s32> getClientRect() const; virtual core::rect<s32> getClientRect() const;
...@@ -85,8 +85,8 @@ namespace gui ...@@ -85,8 +85,8 @@ namespace gui
core::position2d<s32> DragStart; core::position2d<s32> DragStart;
bool Dragging, IsDraggable; bool Dragging, IsDraggable;
bool DrawBackground; bool DrawBackground;
bool DrawTitlebar; bool DrawTitlebar;
bool IsActive; bool IsActive;
}; };
......
...@@ -53,15 +53,15 @@ public: ...@@ -53,15 +53,15 @@ public:
private: private:
#ifdef _IRR_COMPILE_WITH_LIBJPEG_ #ifdef _IRR_COMPILE_WITH_LIBJPEG_
// several methods used via function pointers by jpeglib // several methods used via function pointers by jpeglib
/* Receives control for a fatal error. Information sufficient to /* Receives control for a fatal error. Information sufficient to
generate the error message has been stored in cinfo->err; call generate the error message has been stored in cinfo->err; call
output_message to display it. Control must NOT return to the caller; output_message to display it. Control must NOT return to the caller;
generally this routine will exit() or longjmp() somewhere. generally this routine will exit() or longjmp() somewhere.
Typically you would override this routine to get rid of the exit() Typically you would override this routine to get rid of the exit()
default behavior. Note that if you continue processing, you should default behavior. Note that if you continue processing, you should
clean up the JPEG object with jpeg_abort() or jpeg_destroy(). clean up the JPEG object with jpeg_abort() or jpeg_destroy().
*/ */
static void error_exit (j_common_ptr cinfo); static void error_exit (j_common_ptr cinfo);
...@@ -69,35 +69,35 @@ private: ...@@ -69,35 +69,35 @@ private:
/* output error messages via Irrlicht logger. */ /* output error messages via Irrlicht logger. */
static void output_message(j_common_ptr cinfo); static void output_message(j_common_ptr cinfo);
/* Initialize source. This is called by jpeg_read_header() before any /* Initialize source. This is called by jpeg_read_header() before any
data is actually read. Unlike init_destination(), it may leave data is actually read. Unlike init_destination(), it may leave
bytes_in_buffer set to 0 (in which case a fill_input_buffer() call bytes_in_buffer set to 0 (in which case a fill_input_buffer() call
will occur immediately). */ will occur immediately). */
static void init_source (j_decompress_ptr cinfo); static void init_source (j_decompress_ptr cinfo);
/* This is called whenever bytes_in_buffer has reached zero and more /* This is called whenever bytes_in_buffer has reached zero and more
data is wanted. In typical applications, it should read fresh data data is wanted. In typical applications, it should read fresh data
into the buffer (ignoring the current state of next_input_byte and into the buffer (ignoring the current state of next_input_byte and
bytes_in_buffer), reset the pointer & count to the start of the bytes_in_buffer), reset the pointer & count to the start of the
buffer, and return TRUE indicating that the buffer has been reloaded. buffer, and return TRUE indicating that the buffer has been reloaded.
It is not necessary to fill the buffer entirely, only to obtain at It is not necessary to fill the buffer entirely, only to obtain at
least one more byte. bytes_in_buffer MUST be set to a positive value least one more byte. bytes_in_buffer MUST be set to a positive value
if TRUE is returned. A FALSE return should only be used when I/O if TRUE is returned. A FALSE return should only be used when I/O
suspension is desired (this mode is discussed in the next section). */ suspension is desired (this mode is discussed in the next section). */
static boolean fill_input_buffer (j_decompress_ptr cinfo); static boolean fill_input_buffer (j_decompress_ptr cinfo);
/* Skip num_bytes worth of data. The buffer pointer and count should /* Skip num_bytes worth of data. The buffer pointer and count should
be advanced over num_bytes input bytes, refilling the buffer as be advanced over num_bytes input bytes, refilling the buffer as
needed. This is used to skip over a potentially large amount of needed. This is used to skip over a potentially large amount of
uninteresting data (such as an APPn marker). In some applications uninteresting data (such as an APPn marker). In some applications
it may be possible to optimize away the reading of the skipped data, it may be possible to optimize away the reading of the skipped data,
but it's not clear that being smart is worth much trouble; large but it's not clear that being smart is worth much trouble; large
skips are uncommon. bytes_in_buffer may be zero on return. skips are uncommon. bytes_in_buffer may be zero on return.
A zero or negative skip count should be treated as a no-op. */ A zero or negative skip count should be treated as a no-op. */
static void skip_input_data (j_decompress_ptr cinfo, long num_bytes); static void skip_input_data (j_decompress_ptr cinfo, long num_bytes);
/* Terminate source --- called by jpeg_finish_decompress() after all /* Terminate source --- called by jpeg_finish_decompress() after all
data has been read. Often a no-op. */ data has been read. Often a no-op. */
static void term_source (j_decompress_ptr cinfo); static void term_source (j_decompress_ptr cinfo);
// Copy filename to have it around for error-messages // Copy filename to have it around for error-messages
......
...@@ -25,15 +25,15 @@ class CImageLoaderPng : public IImageLoader ...@@ -25,15 +25,15 @@ class CImageLoaderPng : public IImageLoader
{ {
public: public:
//! returns true if the file maybe is able to be loaded by this class //! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".png") //! based on the file extension (e.g. ".png")
virtual bool isALoadableFileExtension(const io::path& filename) const; virtual bool isALoadableFileExtension(const io::path& filename) const;
//! returns true if the file maybe is able to be loaded by this class //! returns true if the file maybe is able to be loaded by this class
virtual bool isALoadableFileFormat(io::IReadFile* file) const; virtual bool isALoadableFileFormat(io::IReadFile* file) const;
//! creates a surface from the file //! creates a surface from the file
virtual IImage* loadImage(io::IReadFile* file) const; virtual IImage* loadImage(io::IReadFile* file) const;
}; };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
/* /*
Author: Gary Conway (Viper) - co-author of the ZIP file format, Feb 1989, Author: Gary Conway (Viper) - co-author of the ZIP file format, Feb 1989,
see the story at http://www.idcnet.us/ziphistory.html see the story at http://www.idcnet.us/ziphistory.html
Website: http://idcnet.us Website: http://idcnet.us
Email: codeslinger@vipergc.com Email: codeslinger@vipergc.com
Created: March 1, 2009 Created: March 1, 2009
...@@ -60,12 +60,11 @@ namespace video ...@@ -60,12 +60,11 @@ namespace video
typedef struct _RGBdata typedef struct _RGBdata
{ {
u8 *tmp, u8 *tmp;
*tmpR, u8 *tmpR;
*tmpG, u8 *tmpG;
*tmpB, u8 *tmpB;
*tmpA; u8 *tmpA;
u32 *StartTable; // compressed data table, holds file offsets u32 *StartTable; // compressed data table, holds file offsets
u32 *LengthTable; // length for the above data, hold lengths for above u32 *LengthTable; // length for the above data, hold lengths for above
......
...@@ -69,7 +69,7 @@ namespace irr ...@@ -69,7 +69,7 @@ namespace irr
virtual bool isWindowMinimized() const; virtual bool isWindowMinimized() const;
//! returns current window position (not supported for this device) //! returns current window position (not supported for this device)
virtual core::position2di getWindowPosition() virtual core::position2di getWindowPosition()
{ {
return core::position2di(-1, -1); return core::position2di(-1, -1);
} }
...@@ -212,8 +212,8 @@ namespace irr ...@@ -212,8 +212,8 @@ namespace irr
core::position2d<s32> CursorPos; core::position2d<s32> CursorPos;
core::dimension2d<u32> WindowSize; core::dimension2d<u32> WindowSize;
core::dimension2d<f32> InvWindowSize; core::dimension2d<f32> InvWindowSize;
bool IsVisible, bool IsVisible;
UseReferenceRect; bool UseReferenceRect;
core::rect<s32> ReferenceRect; core::rect<s32> ReferenceRect;
}; };
......
...@@ -64,7 +64,7 @@ namespace irr ...@@ -64,7 +64,7 @@ namespace irr
virtual void restoreWindow(); virtual void restoreWindow();
//! returns current window position (not supported for this device) //! returns current window position (not supported for this device)
virtual core::position2di getWindowPosition() virtual core::position2di getWindowPosition()
{ {
return core::position2di(-1, -1); return core::position2di(-1, -1);
} }
......
...@@ -77,9 +77,9 @@ namespace irr ...@@ -77,9 +77,9 @@ namespace irr
//! Restores the window size. //! Restores the window size.
virtual void restoreWindow(); virtual void restoreWindow();
//! Get the position of this window on screen //! Get the position of this window on screen
virtual core::position2di getWindowPosition(); virtual core::position2di getWindowPosition();
//! Activate any joysticks, and generate events for them. //! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo); virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
......
...@@ -140,8 +140,8 @@ namespace irr ...@@ -140,8 +140,8 @@ namespace irr
BOOL gotCursorInfo = GetCursorInfo(&info); BOOL gotCursorInfo = GetCursorInfo(&info);
while ( gotCursorInfo ) while ( gotCursorInfo )
{ {
if ( (visible && info.flags == CURSOR_SHOWING) // visible if ( (visible && info.flags == CURSOR_SHOWING) // visible
|| (!visible && info.flags == 0 ) ) // hidden || (!visible && info.flags == 0 ) ) // hidden
{ {
break; break;
} }
...@@ -190,7 +190,7 @@ namespace irr ...@@ -190,7 +190,7 @@ namespace irr
if (UseReferenceRect) if (UseReferenceRect)
{ {
SetCursorPos(ReferenceRect.UpperLeftCorner.X + x, SetCursorPos(ReferenceRect.UpperLeftCorner.X + x,
ReferenceRect.UpperLeftCorner.Y + y); ReferenceRect.UpperLeftCorner.Y + y);
} }
else else
{ {
...@@ -263,23 +263,23 @@ namespace irr ...@@ -263,23 +263,23 @@ namespace irr
/** Used to notify the cursor that the window resizable settings changed. */ /** Used to notify the cursor that the window resizable settings changed. */
void updateBorderSize(bool fullscreen, bool resizable) void updateBorderSize(bool fullscreen, bool resizable)
{ {
if (!fullscreen) if (!fullscreen)
{ {
if (resizable) if (resizable)
{ {
BorderX = GetSystemMetrics(SM_CXSIZEFRAME); BorderX = GetSystemMetrics(SM_CXSIZEFRAME);
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYSIZEFRAME); BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYSIZEFRAME);
} }
else else
{ {
BorderX = GetSystemMetrics(SM_CXDLGFRAME); BorderX = GetSystemMetrics(SM_CXDLGFRAME);
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME); BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME);
} }
} }
else else
{ {
BorderX = BorderY = 0; BorderX = BorderY = 0;
} }
} }
...@@ -298,10 +298,10 @@ namespace irr ...@@ -298,10 +298,10 @@ namespace irr
//! replace the given cursor icon. //! replace the given cursor icon.
virtual void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon); virtual void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon);
//! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work. //! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.
virtual core::dimension2di getSupportedIconSize() const; virtual core::dimension2di getSupportedIconSize() const;
void update(); void update();
private: private:
...@@ -339,7 +339,7 @@ namespace irr ...@@ -339,7 +339,7 @@ namespace irr
} }
} }
CIrrDeviceWin32* Device; CIrrDeviceWin32* Device;
core::position2d<s32> CursorPos; core::position2d<s32> CursorPos;
core::dimension2d<u32> WindowSize; core::dimension2d<u32> WindowSize;
core::dimension2d<f32> InvWindowSize; core::dimension2d<f32> InvWindowSize;
......
...@@ -54,7 +54,7 @@ namespace irr ...@@ -54,7 +54,7 @@ namespace irr
virtual bool isWindowMinimized() const; virtual bool isWindowMinimized() const;
//! returns current window position (not supported for this device) //! returns current window position (not supported for this device)
virtual core::position2di getWindowPosition() virtual core::position2di getWindowPosition()
{ {
return core::position2di(-1, -1); return core::position2di(-1, -1);
} }
...@@ -155,7 +155,7 @@ namespace irr ...@@ -155,7 +155,7 @@ namespace irr
if (UseReferenceRect) if (UseReferenceRect)
{ {
SetCursorPos(ReferenceRect.UpperLeftCorner.X + x, SetCursorPos(ReferenceRect.UpperLeftCorner.X + x,
ReferenceRect.UpperLeftCorner.Y + y); ReferenceRect.UpperLeftCorner.Y + y);
} }
else else
{ {
...@@ -217,7 +217,7 @@ namespace irr ...@@ -217,7 +217,7 @@ namespace irr
InvWindowSize.Width = 1.0f / size.Width; InvWindowSize.Width = 1.0f / size.Width;
else else
InvWindowSize.Width = 0.f; InvWindowSize.Width = 0.f;
if (size.Height!=0) if (size.Height!=0)
InvWindowSize.Height = 1.0f / size.Height; InvWindowSize.Height = 1.0f / size.Height;
else else
......
...@@ -15,7 +15,7 @@ namespace irr ...@@ -15,7 +15,7 @@ namespace irr
namespace io namespace io
{ {
/*! /*!
Class for reading from memory. Class for reading from memory.
*/ */
class CMemoryReadFile : public IReadFile class CMemoryReadFile : public IReadFile
......
...@@ -27,12 +27,12 @@ public: ...@@ -27,12 +27,12 @@ public:
//! Recalculates all normals of the mesh. //! Recalculates all normals of the mesh.
/** \param mesh: Mesh on which the operation is performed. /** \param mesh: Mesh on which the operation is performed.
\param smooth: Whether to use smoothed normals. */ \param smooth: Whether to use smoothed normals. */
virtual void recalculateNormals(scene::IMesh* mesh, bool smooth = false, bool angleWeighted = false) const; virtual void recalculateNormals(scene::IMesh* mesh, bool smooth = false, bool angleWeighted = false) const;
//! Recalculates all normals of the mesh buffer. //! Recalculates all normals of the mesh buffer.
/** \param buffer: Mesh buffer on which the operation is performed. /** \param buffer: Mesh buffer on which the operation is performed.
\param smooth: Whether to use smoothed normals. */ \param smooth: Whether to use smoothed normals. */
virtual void recalculateNormals(IMeshBuffer* buffer, bool smooth = false, bool angleWeighted = false) const; virtual void recalculateNormals(IMeshBuffer* buffer, bool smooth = false, bool angleWeighted = false) const;
//! Clones a static IMesh into a modifiable SMesh. //! Clones a static IMesh into a modifiable SMesh.
......
...@@ -21,7 +21,7 @@ public: ...@@ -21,7 +21,7 @@ public:
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_) #if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
COSOperator(const core::stringc& osversion, CIrrDeviceLinux* device); COSOperator(const core::stringc& osversion, CIrrDeviceLinux* device);
#endif #endif
COSOperator(const core::stringc& osversion); COSOperator(const core::stringc& osversion);
//! returns the current operation system version as string. //! returns the current operation system version as string.
virtual const core::stringc& getOperatingSystemVersion() const; virtual const core::stringc& getOperatingSystemVersion() const;
...@@ -49,7 +49,7 @@ private: ...@@ -49,7 +49,7 @@ private:
core::stringc OperatingSystem; core::stringc OperatingSystem;
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_) #if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
CIrrDeviceLinux * IrrDeviceLinux; CIrrDeviceLinux * IrrDeviceLinux;
#endif #endif
}; };
......
...@@ -33,12 +33,12 @@ namespace irr ...@@ -33,12 +33,12 @@ namespace irr
namespace video namespace video
{ {
class COpenGLCallBridge; class COpenGLCallBridge;
class COpenGLTexture; class COpenGLTexture;
class COpenGLDriver : public CNullDriver, public IMaterialRendererServices, public COpenGLExtensionHandler class COpenGLDriver : public CNullDriver, public IMaterialRendererServices, public COpenGLExtensionHandler
{ {
friend class COpenGLCallBridge; friend class COpenGLCallBridge;
friend class COpenGLTexture; friend class COpenGLTexture;
public: public:
...@@ -280,15 +280,15 @@ namespace video ...@@ -280,15 +280,15 @@ namespace video
bool resetAllRenderstates) bool resetAllRenderstates)
{ {
setBasicRenderStates(material, lastmaterial, resetAllRenderstates, true); setBasicRenderStates(material, lastmaterial, resetAllRenderstates, true);
setTextureRenderStates(material, resetAllRenderstates, true); setTextureRenderStates(material, resetAllRenderstates, true);
} }
//! Can be called by an IMaterialRenderer to make its work easier. //! Can be called by an IMaterialRenderer to make its work easier.
virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastmaterial, virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastmaterial,
bool resetAllRenderstates, bool fixedPipeline); bool resetAllRenderstates, bool fixedPipeline);
//! Compare in SMaterial doesn't check texture parameters, so we should call this on each OnRender call. //! Compare in SMaterial doesn't check texture parameters, so we should call this on each OnRender call.
virtual void setTextureRenderStates(const SMaterial& material, bool resetAllRenderstates, bool fixedPipeline); virtual void setTextureRenderStates(const SMaterial& material, bool resetAllRenderstates, bool fixedPipeline);
//! Get a vertex shader constant index. //! Get a vertex shader constant index.
virtual s32 getVertexShaderConstantID(const c8* name); virtual s32 getVertexShaderConstantID(const c8* name);
...@@ -417,12 +417,12 @@ namespace video ...@@ -417,12 +417,12 @@ namespace video
//! Get ZBuffer bits. //! Get ZBuffer bits.
GLenum getZBufferBits() const; GLenum getZBufferBits() const;
//! Get current material. //! Get current material.
const SMaterial& getCurrentMaterial() const; const SMaterial& getCurrentMaterial() const;
//! Get bridge calls. //! Get bridge calls.
COpenGLCallBridge* getBridgeCalls() const; COpenGLCallBridge* getBridgeCalls() const;
//! Get Cg context //! Get Cg context
#ifdef _IRR_COMPILE_WITH_CG_ #ifdef _IRR_COMPILE_WITH_CG_
...@@ -475,7 +475,7 @@ namespace video ...@@ -475,7 +475,7 @@ namespace video
scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType); scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType);
// Bridge calls. // Bridge calls.
COpenGLCallBridge* BridgeCalls; COpenGLCallBridge* BridgeCalls;
core::stringw Name; core::stringw Name;
core::matrix4 Matrices[ETS_COUNT]; core::matrix4 Matrices[ETS_COUNT];
...@@ -603,7 +603,7 @@ namespace video ...@@ -603,7 +603,7 @@ namespace video
//! Built-in 2D quad for 2D rendering. //! Built-in 2D quad for 2D rendering.
S3DVertex Quad2DVertices[4]; S3DVertex Quad2DVertices[4];
u16 Quad2DIndices[6]; u16 Quad2DIndices[6];
u16 Line2DIndices[2]; u16 Line2DIndices[2];
#ifdef _IRR_WINDOWS_API_ #ifdef _IRR_WINDOWS_API_
HDC HDc; // Private GDI Device Context HDC HDc; // Private GDI Device Context
...@@ -629,14 +629,14 @@ namespace video ...@@ -629,14 +629,14 @@ namespace video
E_DEVICE_TYPE DeviceType; E_DEVICE_TYPE DeviceType;
}; };
//! This bridge between Irlicht pseudo OpenGL calls //! This bridge between Irlicht pseudo OpenGL calls
//! and true OpenGL calls. //! and true OpenGL calls.
class COpenGLCallBridge class COpenGLCallBridge
{ {
public: public:
COpenGLCallBridge(COpenGLDriver* driver); COpenGLCallBridge(COpenGLDriver* driver);
// Alpha calls. // Alpha calls.
...@@ -659,29 +659,29 @@ namespace video ...@@ -659,29 +659,29 @@ namespace video
void setCullFaceFunc(GLenum mode); void setCullFaceFunc(GLenum mode);
void setCullFace(bool enable); void setCullFace(bool enable);
// Depth calls. // Depth calls.
void setDepthFunc(GLenum mode); void setDepthFunc(GLenum mode);
void setDepthMask(bool enable); void setDepthMask(bool enable);
void setDepthTest(bool enable); void setDepthTest(bool enable);
// Matrix calls. // Matrix calls.
void setMatrixMode(GLenum mode); void setMatrixMode(GLenum mode);
// Texture calls. // Texture calls.
void setActiveTexture(GLenum texture); void setActiveTexture(GLenum texture);
void setClientActiveTexture(GLenum texture); void setClientActiveTexture(GLenum texture);
void setTexture(u32 stage, bool fixedPipeline); void setTexture(u32 stage, bool fixedPipeline);
private: private:
COpenGLDriver* Driver; COpenGLDriver* Driver;
GLenum AlphaMode; GLenum AlphaMode;
GLclampf AlphaRef; GLclampf AlphaRef;
...@@ -698,19 +698,19 @@ namespace video ...@@ -698,19 +698,19 @@ namespace video
GLenum CullFaceMode; GLenum CullFaceMode;
bool CullFace; bool CullFace;
GLenum DepthFunc; GLenum DepthFunc;
bool DepthMask; bool DepthMask;
bool DepthTest; bool DepthTest;
GLenum MatrixMode; GLenum MatrixMode;
GLenum ActiveTexture; GLenum ActiveTexture;
GLenum ClientActiveTexture; GLenum ClientActiveTexture;
const ITexture* Texture[MATERIAL_MAX_TEXTURES]; const ITexture* Texture[MATERIAL_MAX_TEXTURES];
bool TextureFixedPipeline[MATERIAL_MAX_TEXTURES]; bool TextureFixedPipeline[MATERIAL_MAX_TEXTURES];
}; };
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
......
...@@ -35,13 +35,12 @@ public: ...@@ -35,13 +35,12 @@ public:
virtual void OnUnsetBaseMaterial() virtual void OnUnsetBaseMaterial()
{ {
} }
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype)
{ {
Driver->setTextureRenderStates(Driver->getCurrentMaterial(), false, true); Driver->setTextureRenderStates(Driver->getCurrentMaterial(), false, true);
return true;
return true; }
}
protected: protected:
...@@ -249,12 +248,12 @@ public: ...@@ -249,12 +248,12 @@ public:
Driver->getBridgeCalls()->setAlphaTest(false); Driver->getBridgeCalls()->setAlphaTest(false);
} }
//! Returns if the material is transparent. //! Returns if the material is transparent.
/** Is not always transparent, but mostly. */ /** Is not always transparent, but mostly. */
virtual bool isTransparent() const virtual bool isTransparent() const
{ {
return true; return true;
} }
}; };
......
...@@ -194,8 +194,8 @@ public: ...@@ -194,8 +194,8 @@ public:
virtual void clearParticles(); virtual void clearParticles();
//! Do manually update the particles. //! Do manually update the particles.
//! This should only be called when you want to render the node outside the scenegraph, //! This should only be called when you want to render the node outside the scenegraph,
//! as the node will care about this otherwise automatically. //! as the node will care about this otherwise automatically.
virtual void doParticleSystem(u32 time); virtual void doParticleSystem(u32 time);
//! Writes attributes of the scene node. //! Writes attributes of the scene node.
......
...@@ -25,7 +25,7 @@ namespace scene ...@@ -25,7 +25,7 @@ namespace scene
//! constructor //! constructor
CQ3LevelMesh(io::IFileSystem* fs, scene::ISceneManager* smgr, CQ3LevelMesh(io::IFileSystem* fs, scene::ISceneManager* smgr,
const quake3::Q3LevelLoadParameter &loadParam); const quake3::Q3LevelLoadParameter &loadParam);
//! destructor //! destructor
virtual ~CQ3LevelMesh(); virtual ~CQ3LevelMesh();
...@@ -105,7 +105,7 @@ namespace scene ...@@ -105,7 +105,7 @@ namespace scene
} }
//! Returns pointer to a mesh buffer which fits a material //! Returns pointer to a mesh buffer which fits a material
/** \param material: material to search for /** \param material: material to search for
\return Pointer to the mesh buffer or 0 if there is no such mesh buffer. */ \return Pointer to the mesh buffer or 0 if there is no such mesh buffer. */
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const
{ {
......
...@@ -40,8 +40,9 @@ public: ...@@ -40,8 +40,9 @@ public:
virtual bool isALoadableFileFormat(io::IReadFile *file) const; virtual bool isALoadableFileFormat(io::IReadFile *file) const;
//! Loads the scene into the scene manager. //! Loads the scene into the scene manager.
virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0, virtual bool loadScene(io::IReadFile* file,
ISceneNode* rootNode=0); ISceneUserDataSerializer* userDataSerializer=0,
ISceneNode* rootNode=0);
private: private:
......
...@@ -298,12 +298,12 @@ namespace scene ...@@ -298,12 +298,12 @@ namespace scene
//! creates a fly circle animator //! creates a fly circle animator
/** Lets the attached scene node fly around a center. /** Lets the attached scene node fly around a center.
\param center Center relative to node origin \param center Center relative to node origin
\param speed: The orbital speed, in radians per millisecond. \param speed: The orbital speed, in radians per millisecond.
\param direction: Specifies the upvector used for alignment of the mesh. \param direction: Specifies the upvector used for alignment of the mesh.
\param startPosition: The position on the circle where the animator will \param startPosition: The position on the circle where the animator will
begin. Value is in multiples of a circle, i.e. 0.5 is half way around. begin. Value is in multiples of a circle, i.e. 0.5 is half way around.
\return The animator. Attach it to a scene node with ISceneNode::addAnimator() \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
*/ */
virtual ISceneNodeAnimator* createFlyCircleAnimator( virtual ISceneNodeAnimator* createFlyCircleAnimator(
const core::vector3df& center=core::vector3df(0.f, 0.f, 0.f), const core::vector3df& center=core::vector3df(0.f, 0.f, 0.f),
f32 radius=100.f, f32 speed=0.001f, f32 radius=100.f, f32 speed=0.001f,
......
...@@ -61,7 +61,7 @@ namespace scene ...@@ -61,7 +61,7 @@ namespace scene
virtual IMeshBuffer* getMeshBuffer(u32 nr) const; virtual IMeshBuffer* getMeshBuffer(u32 nr) const;
//! Returns pointer to a mesh buffer which fits a material //! Returns pointer to a mesh buffer which fits a material
/** \param material: material to search for /** \param material: material to search for
\return Returns the pointer to the mesh buffer or \return Returns the pointer to the mesh buffer or
NULL if there is no such mesh buffer. */ NULL if there is no such mesh buffer. */
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const; virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const;
......
...@@ -258,10 +258,8 @@ namespace scene ...@@ -258,10 +258,8 @@ namespace scene
core::aabbox3df BoundingBox; core::aabbox3df BoundingBox;
core::array<f64> LODDistanceThreshold; core::array<f64> LODDistanceThreshold;
}; };
virtual void preRenderCalculationsIfNeeded();
virtual void preRenderCalculationsIfNeeded();
virtual void preRenderLODCalculations(); virtual void preRenderLODCalculations();
virtual void preRenderIndicesCalculations(); virtual void preRenderIndicesCalculations();
......
...@@ -82,8 +82,10 @@ namespace scene ...@@ -82,8 +82,10 @@ namespace scene
video::SColor FootColor; // Color at the source video::SColor FootColor; // Color at the source
video::SColor TailColor; // Color at the end. video::SColor TailColor; // Color at the end.
core::vector3df LightDimensions; // LightDimensions.Y Distance of shooting -- Length of beams // LightDimensions.Y Distance of shooting -- Length of beams
// LightDimensions.X and LightDimensions.Z determine the size/dimension of the plane // LightDimensions.X and LightDimensions.Z determine the
// size/dimension of the plane
core::vector3df LightDimensions;
}; };
} // end namespace scene } // end namespace scene
......
...@@ -467,8 +467,8 @@ private: ...@@ -467,8 +467,8 @@ private:
while(*P && !cDataEnd) while(*P && !cDataEnd)
{ {
if (*P == L'>' && if (*P == L'>' &&
(*(P-1) == L']') && (*(P-1) == L']') &&
(*(P-2) == L']')) (*(P-2) == L']'))
{ {
cDataEnd = P - 2; cDataEnd = P - 2;
} }
...@@ -566,8 +566,9 @@ private: ...@@ -566,8 +566,9 @@ private:
long size = callback->getSize(); long size = callback->getSize();
if (size<0) if (size<0)
return false; return false;
size += 4; // We need four terminating 0's at the end. // We need four terminating 0's at the end.
// For ASCII we need 1 0's, for UTF-16 2, for UTF-32 4. // For ASCII we need 1 0's, for UTF-16 2, for UTF-32 4.
size += 4;
char* data8 = new char[size]; char* data8 = new char[size];
...@@ -704,9 +705,9 @@ private: ...@@ -704,9 +705,9 @@ private:
while(*t) while(*t)
{ {
*t = ((*t & 0xff000000) >> 24) | *t = ((*t & 0xff000000) >> 24) |
((*t & 0x00ff0000) >> 8) | ((*t & 0x00ff0000) >> 8) |
((*t & 0x0000ff00) << 8) | ((*t & 0x0000ff00) << 8) |
((*t & 0x000000ff) << 24); ((*t & 0x000000ff) << 24);
++t; ++t;
} }
} }
...@@ -726,9 +727,9 @@ private: ...@@ -726,9 +727,9 @@ private:
inline bool isLittleEndian(ETEXT_FORMAT f) inline bool isLittleEndian(ETEXT_FORMAT f)
{ {
return f == ETF_ASCII || return f == ETF_ASCII ||
f == ETF_UTF8 || f == ETF_UTF8 ||
f == ETF_UTF16_LE || f == ETF_UTF16_LE ||
f == ETF_UTF32_LE; f == ETF_UTF32_LE;
} }
...@@ -793,7 +794,7 @@ private: ...@@ -793,7 +794,7 @@ private:
// instance variables: // instance variables:
bool IgnoreWhitespaceText; // do not return EXN_TEXT nodes for pure whitespace bool IgnoreWhitespaceText; // do not return EXN_TEXT nodes for pure whitespace
char_type* TextData; // data block of the text file char_type* TextData; // data block of the text file
char_type* P; // current point in text to parse char_type* P; // current point in text to parse
char_type* TextBegin; // start of text to parse char_type* TextBegin; // start of text to parse
......
...@@ -88,7 +88,7 @@ struct sCompressedVec4 ...@@ -88,7 +88,7 @@ struct sCompressedVec4
void setColorf ( const video::SColorf & color ) void setColorf ( const video::SColorf & color )
{ {
argb = core::floor32 ( color.a * 255.f ) << 24 | argb = core::floor32 ( color.a * 255.f ) << 24 |
core::floor32 ( color.r * 255.f ) << 16 | core::floor32 ( color.r * 255.f ) << 16 |
core::floor32 ( color.g * 255.f ) << 8 | core::floor32 ( color.g * 255.f ) << 8 |
core::floor32 ( color.b * 255.f ); core::floor32 ( color.b * 255.f );
...@@ -390,7 +390,7 @@ struct sVec3 ...@@ -390,7 +390,7 @@ struct sVec3
inline void sCompressedVec4::setVec4 ( const sVec4 & v ) inline void sCompressedVec4::setVec4 ( const sVec4 & v )
{ {
argb = core::floor32 ( v.x * 255.f ) << 24 | argb = core::floor32 ( v.x * 255.f ) << 24 |
core::floor32 ( v.y * 255.f ) << 16 | core::floor32 ( v.y * 255.f ) << 16 |
core::floor32 ( v.z * 255.f ) << 8 | core::floor32 ( v.z * 255.f ) << 8 |
core::floor32 ( v.w * 255.f ); core::floor32 ( v.w * 255.f );
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "SMaterial.h" #include "SMaterial.h"
namespace irr namespace irr
{ {
...@@ -300,10 +299,10 @@ REALINLINE u32 PixelAdd32 ( const u32 c2, const u32 c1) ...@@ -300,10 +299,10 @@ REALINLINE u32 PixelAdd32 ( const u32 c2, const u32 c1)
// 1 - Bit Alpha Blending // 1 - Bit Alpha Blending
inline u16 PixelBlend16 ( const u16 destination, const u16 source ) inline u16 PixelBlend16 ( const u16 destination, const u16 source )
{ {
if((source & 0x8000) == 0x8000) if((source & 0x8000) == 0x8000)
return source; // The source is visible, so use it. return source; // The source is visible, so use it.
else else
return destination; // The source is transparent, so use the destination. return destination; // The source is transparent, so use the destination.
} }
// 1 - Bit Alpha Blending 16Bit SIMD // 1 - Bit Alpha Blending 16Bit SIMD
...@@ -577,8 +576,8 @@ inline s32 roundFix ( const tFixPoint x ) ...@@ -577,8 +576,8 @@ inline s32 roundFix ( const tFixPoint x )
// x in [0;1[ // x in [0;1[
inline s32 f32_to_23Bits(const f32 x) inline s32 f32_to_23Bits(const f32 x)
{ {
f32 y = x + 1.f; f32 y = x + 1.f;
return IR(y) & 0x7FFFFF; // last 23 bits return IR(y) & 0x7FFFFF; // last 23 bits
} }
/*! /*!
...@@ -624,9 +623,9 @@ REALINLINE tVideoSample fix4_to_color ( const tFixPoint a, const tFixPoint r, co ...@@ -624,9 +623,9 @@ REALINLINE tVideoSample fix4_to_color ( const tFixPoint a, const tFixPoint r, co
*/ */
inline void color_to_fix ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVideoSample t00 ) inline void color_to_fix ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVideoSample t00 )
{ {
(tFixPointu&) r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE ); (tFixPointu&) r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE );
(tFixPointu&) g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G ); (tFixPointu&) g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G );
(tFixPointu&) b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B ); (tFixPointu&) b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B );
} }
/*! /*!
...@@ -634,10 +633,10 @@ inline void color_to_fix ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVide ...@@ -634,10 +633,10 @@ inline void color_to_fix ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVide
*/ */
inline void color_to_fix ( tFixPoint &a, tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVideoSample t00 ) inline void color_to_fix ( tFixPoint &a, tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVideoSample t00 )
{ {
(tFixPointu&) a = (t00 & MASK_A) >> ( SHIFT_A - FIX_POINT_PRE ); (tFixPointu&) a = (t00 & MASK_A) >> ( SHIFT_A - FIX_POINT_PRE );
(tFixPointu&) r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE ); (tFixPointu&) r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE );
(tFixPointu&) g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G ); (tFixPointu&) g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G );
(tFixPointu&) b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B ); (tFixPointu&) b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B );
} }
/*! /*!
...@@ -645,9 +644,9 @@ inline void color_to_fix ( tFixPoint &a, tFixPoint &r, tFixPoint &g, tFixPoint & ...@@ -645,9 +644,9 @@ inline void color_to_fix ( tFixPoint &a, tFixPoint &r, tFixPoint &g, tFixPoint &
*/ */
inline void color_to_fix1 ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVideoSample t00 ) inline void color_to_fix1 ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVideoSample t00 )
{ {
(tFixPointu&) r = (t00 & MASK_R) >> ( SHIFT_R + COLOR_MAX_LOG2 - FIX_POINT_PRE ); (tFixPointu&) r = (t00 & MASK_R) >> ( SHIFT_R + COLOR_MAX_LOG2 - FIX_POINT_PRE );
(tFixPointu&) g = (t00 & MASK_G) >> ( SHIFT_G + COLOR_MAX_LOG2 - FIX_POINT_PRE ); (tFixPointu&) g = (t00 & MASK_G) >> ( SHIFT_G + COLOR_MAX_LOG2 - FIX_POINT_PRE );
(tFixPointu&) b = (t00 & MASK_B) << ( FIX_POINT_PRE - COLOR_MAX_LOG2 ); (tFixPointu&) b = (t00 & MASK_B) << ( FIX_POINT_PRE - COLOR_MAX_LOG2 );
} }
/*! /*!
...@@ -655,10 +654,10 @@ inline void color_to_fix1 ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVid ...@@ -655,10 +654,10 @@ inline void color_to_fix1 ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVid
*/ */
inline void color_to_fix1 ( tFixPoint &a, tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVideoSample t00 ) inline void color_to_fix1 ( tFixPoint &a, tFixPoint &r, tFixPoint &g, tFixPoint &b, const tVideoSample t00 )
{ {
(tFixPointu&) a = (t00 & MASK_A) >> ( SHIFT_A + COLOR_MAX_LOG2 - FIX_POINT_PRE ); (tFixPointu&) a = (t00 & MASK_A) >> ( SHIFT_A + COLOR_MAX_LOG2 - FIX_POINT_PRE );
(tFixPointu&) r = (t00 & MASK_R) >> ( SHIFT_R + COLOR_MAX_LOG2 - FIX_POINT_PRE ); (tFixPointu&) r = (t00 & MASK_R) >> ( SHIFT_R + COLOR_MAX_LOG2 - FIX_POINT_PRE );
(tFixPointu&) g = (t00 & MASK_G) >> ( SHIFT_G + COLOR_MAX_LOG2 - FIX_POINT_PRE ); (tFixPointu&) g = (t00 & MASK_G) >> ( SHIFT_G + COLOR_MAX_LOG2 - FIX_POINT_PRE );
(tFixPointu&) b = (t00 & MASK_B) << ( FIX_POINT_PRE - COLOR_MAX_LOG2 ); (tFixPointu&) b = (t00 & MASK_B) << ( FIX_POINT_PRE - COLOR_MAX_LOG2 );
} }
...@@ -676,15 +675,15 @@ struct fp24 ...@@ -676,15 +675,15 @@ struct fp24
fp24 ( const f32 f ) fp24 ( const f32 f )
{ {
f32 y = f + 1.f; f32 y = f + 1.f;
v = ((u32&)y) & 0x7FFFFF; // last 23 bits v = ((u32&)y) & 0x7FFFFF; // last 23 bits
} }
void operator=(const f32 f ) void operator=(const f32 f )
{ {
f32 y = f + 1.f; f32 y = f + 1.f;
v = ((u32&)y) & 0x7FFFFF; // last 23 bits v = ((u32&)y) & 0x7FFFFF; // last 23 bits
} }
void operator+=(const fp24 &other ) void operator+=(const fp24 &other )
{ {
...@@ -743,16 +742,15 @@ inline void getTexel_fix ( tFixPoint &r, tFixPoint &g, tFixPoint &b, ...@@ -743,16 +742,15 @@ inline void getTexel_fix ( tFixPoint &r, tFixPoint &g, tFixPoint &b,
tVideoSample t00; tVideoSample t00;
t00 = *((tVideoSample*)( (u8*) t->data + ofs )); t00 = *((tVideoSample*)( (u8*) t->data + ofs ));
r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE); r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE);
g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G ); g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G );
b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B ); b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B );
} }
// get video sample to fixpoint // get video sample to fixpoint
REALINLINE void getTexel_fix ( tFixPoint &a, REALINLINE void getTexel_fix ( tFixPoint &a,
const sInternalTexture * t, const tFixPointu tx, const tFixPointu ty const sInternalTexture * t, const tFixPointu tx, const tFixPointu ty)
)
{ {
u32 ofs; u32 ofs;
...@@ -763,7 +761,7 @@ REALINLINE void getTexel_fix ( tFixPoint &a, ...@@ -763,7 +761,7 @@ REALINLINE void getTexel_fix ( tFixPoint &a,
tVideoSample t00; tVideoSample t00;
t00 = *((tVideoSample*)( (u8*) t->data + ofs )); t00 = *((tVideoSample*)( (u8*) t->data + ofs ));
a = (t00 & MASK_A) >> ( SHIFT_A - FIX_POINT_PRE); a = (t00 & MASK_A) >> ( SHIFT_A - FIX_POINT_PRE);
} }
...@@ -792,9 +790,9 @@ inline void getSample_texture_dither ( tFixPoint &r, tFixPoint &g, tFixPoint &b, ...@@ -792,9 +790,9 @@ inline void getSample_texture_dither ( tFixPoint &r, tFixPoint &g, tFixPoint &b,
// texel // texel
const tVideoSample t00 = *((tVideoSample*)( (u8*) t->data + ofs )); const tVideoSample t00 = *((tVideoSample*)( (u8*) t->data + ofs ));
(tFixPointu &) r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE); (tFixPointu &) r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE);
(tFixPointu &) g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G ); (tFixPointu &) g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G );
(tFixPointu &) b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B ); (tFixPointu &) b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B );
} }
...@@ -817,9 +815,9 @@ inline void getSample_texture ( tFixPoint &r, tFixPoint &g, tFixPoint &b, ...@@ -817,9 +815,9 @@ inline void getSample_texture ( tFixPoint &r, tFixPoint &g, tFixPoint &b,
// texel // texel
const tVideoSample t00 = *((tVideoSample*)( (u8*) t->data + ofs )); const tVideoSample t00 = *((tVideoSample*)( (u8*) t->data + ofs ));
(tFixPointu &) r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE); (tFixPointu &) r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE);
(tFixPointu &) g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G ); (tFixPointu &) g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G );
(tFixPointu &) b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B ); (tFixPointu &) b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B );
} }
inline void getSample_texture ( tFixPointu &a, tFixPointu &r, tFixPointu &g, tFixPointu &b, inline void getSample_texture ( tFixPointu &a, tFixPointu &r, tFixPointu &g, tFixPointu &b,
...@@ -834,10 +832,10 @@ inline void getSample_texture ( tFixPointu &a, tFixPointu &r, tFixPointu &g, tFi ...@@ -834,10 +832,10 @@ inline void getSample_texture ( tFixPointu &a, tFixPointu &r, tFixPointu &g, tFi
// texel // texel
const tVideoSample t00 = *((tVideoSample*)( (u8*) t->data + ofs )); const tVideoSample t00 = *((tVideoSample*)( (u8*) t->data + ofs ));
(tFixPointu &)a = (t00 & MASK_A) >> ( SHIFT_A - FIX_POINT_PRE); (tFixPointu &)a = (t00 & MASK_A) >> ( SHIFT_A - FIX_POINT_PRE);
(tFixPointu &)r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE); (tFixPointu &)r = (t00 & MASK_R) >> ( SHIFT_R - FIX_POINT_PRE);
(tFixPointu &)g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G ); (tFixPointu &)g = (t00 & MASK_G) << ( FIX_POINT_PRE - SHIFT_G );
(tFixPointu &)b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B ); (tFixPointu &)b = (t00 & MASK_B) << ( FIX_POINT_PRE - SHIFT_B );
} }
...@@ -858,9 +856,9 @@ REALINLINE void getSample_linear ( tFixPointu &r, tFixPointu &g, tFixPointu &b, ...@@ -858,9 +856,9 @@ REALINLINE void getSample_linear ( tFixPointu &r, tFixPointu &g, tFixPointu &b,
tVideoSample t00; tVideoSample t00;
t00 = *((tVideoSample*)( (u8*) t->data + ofs )); t00 = *((tVideoSample*)( (u8*) t->data + ofs ));
r = (t00 & MASK_R) >> SHIFT_R; r = (t00 & MASK_R) >> SHIFT_R;
g = (t00 & MASK_G) >> SHIFT_G; g = (t00 & MASK_G) >> SHIFT_G;
b = (t00 & MASK_B); b = (t00 & MASK_B);
} }
// get Sample bilinear // get Sample bilinear
...@@ -889,16 +887,24 @@ REALINLINE void getSample_texture ( tFixPoint &r, tFixPoint &g, tFixPoint &b, ...@@ -889,16 +887,24 @@ REALINLINE void getSample_texture ( tFixPoint &r, tFixPoint &g, tFixPoint &b,
o3 = ( (tx+FIX_POINT_ONE) & t->textureXMask ) >> ( FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY ); o3 = ( (tx+FIX_POINT_ONE) & t->textureXMask ) >> ( FIX_POINT_PRE - VIDEO_SAMPLE_GRANULARITY );
t00 = *((tVideoSample*)( (u8*) t->data + (o0 | o2 ) )); t00 = *((tVideoSample*)( (u8*) t->data + (o0 | o2 ) ));
r00 = (t00 & MASK_R) >> SHIFT_R; g00 = (t00 & MASK_G) >> SHIFT_G; b00 = (t00 & MASK_B); r00 = (t00 & MASK_R) >> SHIFT_R;
g00 = (t00 & MASK_G) >> SHIFT_G;
b00 = (t00 & MASK_B);
t00 = *((tVideoSample*)( (u8*) t->data + (o0 | o3 ) )); t00 = *((tVideoSample*)( (u8*) t->data + (o0 | o3 ) ));
r10 = (t00 & MASK_R) >> SHIFT_R; g10 = (t00 & MASK_G) >> SHIFT_G; b10 = (t00 & MASK_B); r10 = (t00 & MASK_R) >> SHIFT_R;
g10 = (t00 & MASK_G) >> SHIFT_G;
b10 = (t00 & MASK_B);
t00 = *((tVideoSample*)( (u8*) t->data + (o1 | o2 ) )); t00 = *((tVideoSample*)( (u8*) t->data + (o1 | o2 ) ));
r01 = (t00 & MASK_R) >> SHIFT_R; g01 = (t00 & MASK_G) >> SHIFT_G; b01 = (t00 & MASK_B); r01 = (t00 & MASK_R) >> SHIFT_R;
g01 = (t00 & MASK_G) >> SHIFT_G;
b01 = (t00 & MASK_B);
t00 = *((tVideoSample*)( (u8*) t->data + (o1 | o3 ) )); t00 = *((tVideoSample*)( (u8*) t->data + (o1 | o3 ) ));
r11 = (t00 & MASK_R) >> SHIFT_R; g11 = (t00 & MASK_G) >> SHIFT_G; b11 = (t00 & MASK_B); r11 = (t00 & MASK_R) >> SHIFT_R;
g11 = (t00 & MASK_G) >> SHIFT_G;
b11 = (t00 & MASK_B);
#endif #endif
...@@ -945,10 +951,10 @@ REALINLINE void getSample_linear ( tFixPointu &a, tFixPointu &r, tFixPointu &g, ...@@ -945,10 +951,10 @@ REALINLINE void getSample_linear ( tFixPointu &a, tFixPointu &r, tFixPointu &g,
tVideoSample t00; tVideoSample t00;
t00 = *((tVideoSample*)( (u8*) t->data + ofs )); t00 = *((tVideoSample*)( (u8*) t->data + ofs ));
a = (t00 & MASK_A) >> SHIFT_A; a = (t00 & MASK_A) >> SHIFT_A;
r = (t00 & MASK_R) >> SHIFT_R; r = (t00 & MASK_R) >> SHIFT_R;
g = (t00 & MASK_G) >> SHIFT_G; g = (t00 & MASK_G) >> SHIFT_G;
b = (t00 & MASK_B); b = (t00 & MASK_B);
} }
// get Sample bilinear // get Sample bilinear
......
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