finalise ENABLE_RETAIL

main
Dominik Madarász 2023-10-13 17:56:26 +02:00
parent 6616dce555
commit 21a058ac23
8 changed files with 28 additions and 13 deletions

@ -1 +1 @@
Subproject commit b82b5ab54dae8de6498e566956b6163b3f4c27cd Subproject commit 20989f73cd14330b84c627cc1742b63732d67bcb

View File

@ -14153,6 +14153,12 @@ extern "C" {
#define ifdef_32 ifdef_true #define ifdef_32 ifdef_true
#endif #endif
#ifdef ENABLE_RETAIL
#define ifdef_retail ifdef_true
#else
#define ifdef_retail ifdef_false
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// new C keywords // new C keywords
@ -335600,6 +335606,7 @@ void cook_cancel() {
int cook_jobs() { int cook_jobs() {
int num_jobs = optioni("--cook-jobs", maxf(1.15,app_cores()) * 1.75), max_jobs = countof(jobs); int num_jobs = optioni("--cook-jobs", maxf(1.15,app_cores()) * 1.75), max_jobs = countof(jobs);
ifdef(ems, num_jobs = 0); ifdef(ems, num_jobs = 0);
ifdef(retail, num_jobs = 0);
return clampi(num_jobs, 0, max_jobs); return clampi(num_jobs, 0, max_jobs);
} }
@ -355261,9 +355268,9 @@ void window_color(unsigned color) {
winbgcolor = vec4(r / 255.0, g / 255.0, b / 255.0, a / 255.0); winbgcolor = vec4(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
} }
void window_icon(const char *file_icon) { void window_icon(const char *file_icon) {
unsigned len = file_size(file_icon); len = len ? len : vfs_size(file_icon); // @fixme: reenable this to allow icons to be put in cooked .zipfiles unsigned len = file_size(file_icon); len = len ? len : vfs_size(file_icon);
if( len ) { if( len ) {
void *data = file_read(file_icon); data = data ? data : vfs_read(file_icon); // @fixme: reenable this to allow icons to be put in cooked .zipfiles void *data = file_read(file_icon); data = data ? data : vfs_read(file_icon);
if( data ) { if( data ) {
image_t img = image_from_mem(data, len, IMAGE_RGBA); image_t img = image_from_mem(data, len, IMAGE_RGBA);
if( img.w && img.h && img.pixels ) { if( img.w && img.h && img.pixels ) {
@ -356982,12 +356989,10 @@ void v4k_init() {
__argc = 0; __argc = 0;
} }
#if !ENABLE_RETAIL
// create or update cook.zip file // create or update cook.zip file
if( /* !COOK_ON_DEMAND && */ file_exist(COOK_INI) && cook_jobs() ) { if( /* !COOK_ON_DEMAND && */ file_exist(COOK_INI) && cook_jobs() ) {
cook_start(COOK_INI, "**", 0|COOK_ASYNC|COOK_CANCELABLE ); cook_start(COOK_INI, "**", 0|COOK_ASYNC|COOK_CANCELABLE );
} }
#endif
atexit(v4k_quit); atexit(v4k_quit);
} }

View File

@ -122,6 +122,12 @@
#define ifdef_32 ifdef_true #define ifdef_32 ifdef_true
#endif #endif
#ifdef ENABLE_RETAIL
#define ifdef_retail ifdef_true
#else
#define ifdef_retail ifdef_false
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// new C keywords // new C keywords

View File

@ -799,6 +799,7 @@ void cook_cancel() {
int cook_jobs() { int cook_jobs() {
int num_jobs = optioni("--cook-jobs", maxf(1.15,app_cores()) * 1.75), max_jobs = countof(jobs); int num_jobs = optioni("--cook-jobs", maxf(1.15,app_cores()) * 1.75), max_jobs = countof(jobs);
ifdef(ems, num_jobs = 0); ifdef(ems, num_jobs = 0);
ifdef(retail, num_jobs = 0);
return clampi(num_jobs, 0, max_jobs); return clampi(num_jobs, 0, max_jobs);
} }

View File

@ -90,12 +90,10 @@ void v4k_init() {
__argc = 0; __argc = 0;
} }
#if !ENABLE_RETAIL
// create or update cook.zip file // create or update cook.zip file
if( /* !COOK_ON_DEMAND && */ file_exist(COOK_INI) && cook_jobs() ) { if( /* !COOK_ON_DEMAND && */ file_exist(COOK_INI) && cook_jobs() ) {
cook_start(COOK_INI, "**", 0|COOK_ASYNC|COOK_CANCELABLE ); cook_start(COOK_INI, "**", 0|COOK_ASYNC|COOK_CANCELABLE );
} }
#endif
atexit(v4k_quit); atexit(v4k_quit);
} }

View File

@ -991,9 +991,9 @@ void window_color(unsigned color) {
winbgcolor = vec4(r / 255.0, g / 255.0, b / 255.0, a / 255.0); winbgcolor = vec4(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
} }
void window_icon(const char *file_icon) { void window_icon(const char *file_icon) {
unsigned len = file_size(file_icon); len = len ? len : vfs_size(file_icon); // @fixme: reenable this to allow icons to be put in cooked .zipfiles unsigned len = file_size(file_icon); len = len ? len : vfs_size(file_icon);
if( len ) { if( len ) {
void *data = file_read(file_icon); data = data ? data : vfs_read(file_icon); // @fixme: reenable this to allow icons to be put in cooked .zipfiles void *data = file_read(file_icon); data = data ? data : vfs_read(file_icon);
if( data ) { if( data ) {
image_t img = image_from_mem(data, len, IMAGE_RGBA); image_t img = image_from_mem(data, len, IMAGE_RGBA);
if( img.w && img.h && img.pixels ) { if( img.w && img.h && img.pixels ) {

View File

@ -4631,6 +4631,7 @@ void cook_cancel() {
int cook_jobs() { int cook_jobs() {
int num_jobs = optioni("--cook-jobs", maxf(1.15,app_cores()) * 1.75), max_jobs = countof(jobs); int num_jobs = optioni("--cook-jobs", maxf(1.15,app_cores()) * 1.75), max_jobs = countof(jobs);
ifdef(ems, num_jobs = 0); ifdef(ems, num_jobs = 0);
ifdef(retail, num_jobs = 0);
return clampi(num_jobs, 0, max_jobs); return clampi(num_jobs, 0, max_jobs);
} }
@ -24292,9 +24293,9 @@ void window_color(unsigned color) {
winbgcolor = vec4(r / 255.0, g / 255.0, b / 255.0, a / 255.0); winbgcolor = vec4(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
} }
void window_icon(const char *file_icon) { void window_icon(const char *file_icon) {
unsigned len = file_size(file_icon); len = len ? len : vfs_size(file_icon); // @fixme: reenable this to allow icons to be put in cooked .zipfiles unsigned len = file_size(file_icon); len = len ? len : vfs_size(file_icon);
if( len ) { if( len ) {
void *data = file_read(file_icon); data = data ? data : vfs_read(file_icon); // @fixme: reenable this to allow icons to be put in cooked .zipfiles void *data = file_read(file_icon); data = data ? data : vfs_read(file_icon);
if( data ) { if( data ) {
image_t img = image_from_mem(data, len, IMAGE_RGBA); image_t img = image_from_mem(data, len, IMAGE_RGBA);
if( img.w && img.h && img.pixels ) { if( img.w && img.h && img.pixels ) {
@ -26013,12 +26014,10 @@ void v4k_init() {
__argc = 0; __argc = 0;
} }
#if !ENABLE_RETAIL
// create or update cook.zip file // create or update cook.zip file
if( /* !COOK_ON_DEMAND && */ file_exist(COOK_INI) && cook_jobs() ) { if( /* !COOK_ON_DEMAND && */ file_exist(COOK_INI) && cook_jobs() ) {
cook_start(COOK_INI, "**", 0|COOK_ASYNC|COOK_CANCELABLE ); cook_start(COOK_INI, "**", 0|COOK_ASYNC|COOK_CANCELABLE );
} }
#endif
atexit(v4k_quit); atexit(v4k_quit);
} }

View File

@ -220,6 +220,12 @@ extern "C" {
#define ifdef_32 ifdef_true #define ifdef_32 ifdef_true
#endif #endif
#ifdef ENABLE_RETAIL
#define ifdef_retail ifdef_true
#else
#define ifdef_retail ifdef_false
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// new C keywords // new C keywords