mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-24 15:00:55 -04:00
5f1a002cf4
* d_a_shop_item OK * d_a_b_go OK * d_a_b_gos OK * remove asm * some work on d_a_b_oh / d_a_b_zant_sima * d_a_startAndGoal done
20 lines
517 B
C++
20 lines
517 B
C++
#ifndef SEARCH_H
|
|
#define SEARCH_H
|
|
|
|
#include "dolphin/os.h"
|
|
|
|
namespace JGadget {
|
|
|
|
//! @todo: mangled name isn't correct, fix this
|
|
//! Current: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d
|
|
//! Target: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d_RCPFdd_d
|
|
template <typename T>
|
|
inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& fallback) {
|
|
ASSERT(pValue != NULL);
|
|
return (idx >= count) ? fallback : pValue[idx];
|
|
}
|
|
|
|
} // namespace JGadget
|
|
|
|
#endif /* SEARCH_H */
|