- Created Layout for Textures

- Separated Build and Output directories
This commit is contained in:
2025-06-14 22:17:46 -04:00
parent 885cca6ca7
commit 096e82f47a
11 changed files with 365 additions and 176 deletions

View File

@@ -21,7 +21,7 @@
#define FENNEC_LANG_BITS_H
#include <fennec/lang/intrinsics.h>
#include <fennec/memory/memory.h>
#include <fennec/lang/detail/__bits.h>
namespace fennec
{
@@ -46,6 +46,20 @@ constexpr ToT bit_cast(const FromT& from)
}
}
constexpr void* bitmask(void* arr, const void* mask, size_t n)
{
if (arr == mask) return arr;
uint8_t* d = static_cast<uint8_t*>(arr);
const uint8_t* s = static_cast<const uint8_t*>(mask);
while (n >= 8) { detail::__bitmask_64(d, s); d += 8; s += 8; n -= 8; }
while (n >= 4) { detail::__bitmask_32(d, s); d += 4; s += 4; n -= 4; }
while (n >= 2) { detail::__bitmask_16(d, s); d += 2; s += 2; n -= 2; }
while (n >= 1) { *d++ = *s++; --n; }
return arr;
}
}
#endif // FENNEC_LANG_BITS_H

View File

@@ -0,0 +1,46 @@
// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 Medusa Slockbower
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================
#ifndef FENNEC_LANG_DETAIL_BITS_H
#define FENNEC_LANG_DETAIL_BITS_H
#include <fennec/lang/types.h>
namespace fennec
{
namespace detail
{
// helper for copying 2 bytes at once
constexpr size_t __bitmask_16(void* dst, const void* src)
{ *static_cast<uint16_t*>(dst) = *static_cast<const uint16_t*>(src); return 2; }
// helper for copying 4 bytes at once
constexpr size_t __bitmask_32(void* dst, const void* src)
{ *static_cast<uint32_t*>(dst) = *static_cast<const uint32_t*>(src); return 4; }
// helper for copying 8 bytes at once
constexpr size_t __bitmask_64(void* dst, const void* src)
{ *static_cast<uint64_t*>(dst) = *static_cast<const uint64_t*>(src); return 8; }
}
}
#endif // FENNEC_LANG_DETAIL_BITS_H

View File

@@ -30,7 +30,7 @@
#ifndef FENNEC_LANG_FLOAT_H
#define FENNEC_LANG_FLOAT_H
#include <fennec/memory/bits.h>
#include <fennec/lang/bits.h>
#define FLT_HAS_INFINITY 1
#define FLT_HAS_QUIET_NAN 1