mirror of
https://github.com/leozide/leocad.git
synced 2026-10-27 06:20:55 +00:00
SetImage previously uploaded automatically on the UI thread while the asset loader needed a separate AdoptDecodedImage path to control context switching and retries. Make SetImage and the renamed SetImages prepare and store pixels only, remove AdoptDecodedImage and LoadImages, and upload generated atlases explicitly. CacheStrings now accepts the caller's current rendering context. Retain cube-map faces and supplied mipmaps through SetImages. Advance the image index after each face so a supplied mip chain does not leave the next face reading the previous face's last mip level. Validation: full application build and diff checks passed. OpenGL readback checks covered explicit setters, all six cube faces with generated and supplied mipmaps, narrow and custom-stride image uploads, alignment restoration, failure cleanup, and all nine grid levels against the previous generator.
28 lines
570 B
C++
28 lines
570 B
C++
#pragma once
|
|
|
|
struct lcStringCacheEntry
|
|
{
|
|
int Left, Right, Top, Bottom;
|
|
};
|
|
|
|
class lcStringCache
|
|
{
|
|
public:
|
|
lcStringCache();
|
|
~lcStringCache();
|
|
|
|
void Initialize(lcContext* Context);
|
|
void Reset();
|
|
|
|
void CacheStrings(lcContext* Context, const QStringList& Strings);
|
|
void GetStringDimensions(int* cx, int* cy, const QString& String) const;
|
|
void DrawStrings(lcContext* Context, const lcMatrix44* Transforms, const QStringList& Strings) const;
|
|
|
|
protected:
|
|
lcTexture* mTexture;
|
|
|
|
std::map<QString, lcStringCacheEntry> mStrings;
|
|
};
|
|
|
|
extern lcStringCache gStringCache;
|