mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-04 15:40:10 +00:00
16da2512b4
* Created base::write24bits() function (and detect endianness with a special base/config.h.cmakein) * Use _WIN32 instead of ALLEGRO_WINDOWS * Use _DEBUG instead of DEBUGMODE * Replaced AL_CONST with "const" in bmp_format.cpp * Replace stricmp() with base::utf8_icmp()
38 lines
804 B
C++
38 lines
804 B
C++
// Aseprite Base Library
|
|
// Copyright (c) 2001-2015 David Capello
|
|
//
|
|
// This file is released under the terms of the MIT license.
|
|
// Read LICENSE.txt for more information.
|
|
|
|
#ifndef BASE_24BITS_H_INCLUDED
|
|
#define BASE_24BITS_H_INCLUDED
|
|
#pragma once
|
|
|
|
#include "base/config.h"
|
|
|
|
namespace base {
|
|
|
|
#ifdef ASEPRITE_LITTLE_ENDIAN
|
|
|
|
template<typename PTR, typename VALUE>
|
|
inline void write24bits(PTR* ptr, VALUE value) {
|
|
((uint8_t*)ptr)[0] = value;
|
|
((uint8_t*)ptr)[1] = value >> 8;
|
|
((uint8_t*)ptr)[2] = value >> 16;
|
|
}
|
|
|
|
#elif defined(ASEPRITE_BIG_ENDIAN)
|
|
|
|
template<typename PTR, typename VALUE>
|
|
inline void write24bits(PTR* ptr, VALUE value) {
|
|
((uint8_t*)ptr)[0] = value >> 16;
|
|
((uint8_t*)ptr)[1] = value >> 8;
|
|
((uint8_t*)ptr)[2] = value;
|
|
}
|
|
|
|
#endif
|
|
|
|
} // namespace base
|
|
|
|
#endif
|