mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: Pass std::string_view from blitters instead of char *.
This commit is contained in:
parent
332cbca36e
commit
6bc4a62c27
|
@ -47,7 +47,7 @@ public:
|
|||
void PaletteAnimate(const Palette &palette) override;
|
||||
Blitter::PaletteAnimation UsePaletteAnimation() override;
|
||||
|
||||
const char *GetName() override { return "32bpp-anim"; }
|
||||
std::string_view GetName() override { return "32bpp-anim"; }
|
||||
void PostResize() override;
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
class Blitter_32bppSSE2_Anim : public Blitter_32bppAnim {
|
||||
public:
|
||||
void PaletteAnimate(const Palette &palette) override;
|
||||
const char *GetName() override { return "32bpp-sse2-anim"; }
|
||||
std::string_view GetName() override { return "32bpp-sse2-anim"; }
|
||||
};
|
||||
|
||||
/** Factory for the partially 32bpp blitter with animation. */
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
Sprite *Encode(const SpriteLoader::SpriteCollection &sprite, AllocatorProc *allocator) override {
|
||||
return Blitter_32bppSSE_Base::Encode(sprite, allocator);
|
||||
}
|
||||
const char *GetName() override { return "32bpp-sse4-anim"; }
|
||||
std::string_view GetName() override { return "32bpp-sse4-anim"; }
|
||||
using Blitter_32bppSSE2_Anim::LookupColourInPalette;
|
||||
};
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
|
||||
Sprite *Encode(const SpriteLoader::SpriteCollection &sprite, AllocatorProc *allocator) override;
|
||||
|
||||
const char *GetName() override { return "32bpp-optimized"; }
|
||||
std::string_view GetName() override { return "32bpp-optimized"; }
|
||||
|
||||
template <BlitterMode mode, bool Tpal_to_rgb = false> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
|
||||
Sprite *Encode(const SpriteLoader::SpriteCollection &sprite, AllocatorProc *allocator) override;
|
||||
|
||||
const char *GetName() override { return "32bpp-simple"; }
|
||||
std::string_view GetName() override { return "32bpp-simple"; }
|
||||
};
|
||||
|
||||
/** Factory for the simple 32 bpp blitter. */
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
return Blitter_32bppSSE_Base::Encode(sprite, allocator);
|
||||
}
|
||||
|
||||
const char *GetName() override { return "32bpp-sse2"; }
|
||||
std::string_view GetName() override { return "32bpp-sse2"; }
|
||||
};
|
||||
|
||||
/** Factory for the SSE2 32 bpp blitter (without palette animation). */
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
|
||||
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
|
||||
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
|
||||
const char *GetName() override { return "32bpp-sse4"; }
|
||||
std::string_view GetName() override { return "32bpp-sse4"; }
|
||||
};
|
||||
|
||||
/** Factory for the SSE4 32 bpp blitter (without palette animation). */
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
|
||||
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
|
||||
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
|
||||
const char *GetName() override { return "32bpp-ssse3"; }
|
||||
std::string_view GetName() override { return "32bpp-ssse3"; }
|
||||
};
|
||||
|
||||
/** Factory for the SSSE3 32 bpp blitter (without palette animation). */
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
Blitter::PaletteAnimation UsePaletteAnimation() override;
|
||||
bool NeedsAnimationBuffer() override;
|
||||
|
||||
const char *GetName() override { return "40bpp-anim"; }
|
||||
std::string_view GetName() override { return "40bpp-anim"; }
|
||||
|
||||
template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
|
||||
Sprite *Encode(const SpriteLoader::SpriteCollection &sprite, AllocatorProc *allocator) override;
|
||||
|
||||
const char *GetName() override { return "8bpp-optimized"; }
|
||||
std::string_view GetName() override { return "8bpp-optimized"; }
|
||||
};
|
||||
|
||||
/** Factory for the 8bpp blitter optimised for speed. */
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
|
||||
Sprite *Encode(const SpriteLoader::SpriteCollection &sprite, AllocatorProc *allocator) override;
|
||||
|
||||
const char *GetName() override { return "8bpp-simple"; }
|
||||
std::string_view GetName() override { return "8bpp-simple"; }
|
||||
};
|
||||
|
||||
/** Factory for the most trivial 8bpp blitter. */
|
||||
|
|
|
@ -197,7 +197,7 @@ public:
|
|||
/**
|
||||
* Get the name of the blitter, the same as the Factory-instance returns.
|
||||
*/
|
||||
virtual const char *GetName() = 0;
|
||||
virtual std::string_view GetName() = 0;
|
||||
|
||||
/**
|
||||
* Post resize event
|
||||
|
|
|
@ -159,7 +159,7 @@ public:
|
|||
/**
|
||||
* Get the long, human readable, name for the Blitter-class.
|
||||
*/
|
||||
const std::string &GetName() const
|
||||
std::string_view GetName() const
|
||||
{
|
||||
return this->name;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ public:
|
|||
/**
|
||||
* Get a nice description of the blitter-class.
|
||||
*/
|
||||
const std::string &GetDescription() const
|
||||
std::string_view GetDescription() const
|
||||
{
|
||||
return this->description;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
void PaletteAnimate(const Palette &) override { };
|
||||
Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; };
|
||||
|
||||
const char *GetName() override { return "null"; }
|
||||
std::string_view GetName() override { return "null"; }
|
||||
};
|
||||
|
||||
/** Factory for the blitter that does nothing. */
|
||||
|
|
Loading…
Reference in New Issue