Held block is visible on NDS by default

This commit is contained in:
UnknownShadow200 2024-07-21 17:16:21 +10:00
parent 4f184e46f5
commit 06353a8fe5
3 changed files with 15 additions and 8 deletions

View File

@ -12,7 +12,7 @@
#include "Options.h"
#include "Logger.h"
#ifndef CC_BUILD_NOFPUHARDWARE
#ifdef CC_BUILD_ANIMATIONS
static void Animations_Update(int loc, struct Bitmap* bmp, int stride);
#ifdef CC_BUILD_LOWMEM

View File

@ -143,6 +143,7 @@ typedef cc_uint8 cc_bool;
#define CC_BUILD_RESOURCES
#define CC_BUILD_PLUGINS
#define CC_BUILD_ANIMATIONS
#define CC_BUILD_HELDBLOCK
#define CC_BUILD_FILESYSTEM
#define CC_BUILD_ADVLIGHTING
/*#define CC_BUILD_GL11*/
@ -382,7 +383,7 @@ typedef cc_uint8 cc_bool;
#define CC_BUILD_HTTPCLIENT
#define CC_BUILD_TOUCH
#define CC_BUILD_SMALLSTACK
#define CC_BUILD_NOFPUHARDWARE
#undef CC_BUILD_ANIMATIONS /* Very costly in FPU less system */
#undef CC_BUILD_ADVLIGHTING
#elif defined __WIIU__
#define CC_BUILD_WIIU
@ -410,9 +411,10 @@ typedef cc_uint8 cc_bool;
#define CC_BUILD_COOPTHREADED
#define CC_BUILD_NOMUSIC
#define CC_BUILD_NOSOUNDS
#define CC_BUILD_NOFPUHARDWARE
#undef CC_BUILD_RESOURCES
#undef CC_BUILD_NETWORKING
#undef CC_BUILD_ANIMATIONS /* Very costly in FPU less system */
#undef CC_BUILD_HELDBLOCK /* Very costly in FPU less system */
#undef CC_BUILD_ADVLIGHTING
#undef CC_BUILD_FILESYSTEM
#elif defined OS2
@ -432,9 +434,10 @@ typedef cc_uint8 cc_bool;
#define CC_BUILD_NOSOUNDS
#define CC_BUILD_SMALLSTACK
#define CC_BUILD_TINYSTACK
#define CC_BUILD_NOFPUHARDWARE
#undef CC_BUILD_RESOURCES
#undef CC_BUILD_NETWORKING
#undef CC_BUILD_ANIMATIONS /* Very costly in FPU less system */
#undef CC_BUILD_HELDBLOCK /* Very costly in FPU less system */
#undef CC_BUILD_ADVLIGHTING
#undef CC_BUILD_FILESYSTEM
#endif
@ -501,3 +504,4 @@ struct Texture {
TextureRec uv;
};
#endif

View File

@ -11,6 +11,7 @@
#include "Options.h"
cc_bool HeldBlockRenderer_Show;
#ifdef CC_BUILD_HELDBLOCK
static BlockID held_block;
static struct Entity held_entity;
static struct Matrix held_blockProj;
@ -253,11 +254,7 @@ static void OnInit(void) {
held_entity.VTABLE = &heldEntity_VTABLE;
held_entity.NoShade = true;
#ifdef CC_BUILD_NOFPUHARDWARE
HeldBlockRenderer_Show = false;
#else
HeldBlockRenderer_Show = Options_GetBool(OPT_SHOW_BLOCK_IN_HAND, true);
#endif
held_lastBlock = Inventory_SelectedBlock;
Event_Register_(&GfxEvents.ProjectionChanged, NULL, OnProjectionChanged);
@ -265,6 +262,12 @@ static void OnInit(void) {
Event_Register_(&UserEvents.BlockChanged, NULL, OnBlockChanged);
Event_Register_(&GfxEvents.ContextLost, NULL, OnContextLost);
}
#else
void HeldBlockRenderer_ClickAnim(cc_bool digging) { }
void HeldBlockRenderer_Render(float delta) { }
static void OnInit(void) { }
#endif
struct IGameComponent HeldBlockRenderer_Component = {
OnInit /* Init */