JubeatPlus 3.9.11
Loading...
Searching...
No Matches
ImageCache Class Reference

Holds decoded images so a screen change does not re-read them from disk. More...

#include <ImageCache.h>

Inheritance diagram for ImageCache:
Collaboration diagram for ImageCache:

Instance Methods

(instancetype) - init
 Creates the backing cache and caps it at a hundred and twenty-eight entries.
(nullable UIImage *) - getResPNG:
 Returns the named image, loading and caching it on a miss.
(void) - clear
 Drops everything held.

Properties

ImageCache * sharedCache
 The shared instance.

Detailed Description

Holds decoded images so a screen change does not re-read them from disk.

Backed by an NSCache capped at a hundred and twenty-eight entries, so entries may be evicted under memory pressure as well as by that limit. A caller must never assume a name it fetched once is still held.

Method Documentation

◆ clear

- (void) clear

Drops everything held.

Sent on every screen transition except a game restart or replay, which is what keeps those two fast.

Ghidra address:
0xcee84
Ghidra address:
0xcee84

◆ getResPNG:

- (nullable UIImage *) getResPNG: (nullable NSString *) name

Returns the named image, loading and caching it on a miss.

A nil name yields nil without touching the cache. A load that fails is not cached, so a missing resource is retried on every call rather than remembered as absent.

Parameters
nameThe resource's base name, with no scale suffix and no extension.
Returns
The image, or nil when the name is nil or the resource is missing.
Ghidra address:
0xcede0

◆ init

- (instancetype) init

Creates the backing cache and caps it at a hundred and twenty-eight entries.

Returns
The initialised cache.
Ghidra address:
0xced48
Ghidra address:
0xced48

Property Documentation

◆ sharedCache

- (ImageCache *) sharedCache
readnonatomicassign
Initial value:
{
NSCache *cache

The shared instance.

A dispatch_once singleton; nothing vends any other instance.

Ghidra address:
0xcecc8
Ghidra address:
0xcecc8
Ghidra address:
0xced08

The documentation for this class was generated from the following files: