mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-14 00:50:38 +00:00
fa7aa93450
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@52 af15c1b1-3010-417e-b628-4374ebc0bcbd
31 lines
786 B
C
31 lines
786 B
C
// Embed a custom conback.lmp into the binary
|
|
//
|
|
// S.A. 6 Feb 2010, Ozkan 18 Feb 2010
|
|
|
|
#include "quakedef.h"
|
|
|
|
static const byte conback_byte[] =
|
|
{
|
|
# include "conback.h"
|
|
};
|
|
|
|
static char *custom_conback = NULL;
|
|
static char size_data[2 * sizeof(int)];
|
|
|
|
char *get_conback (void)
|
|
{
|
|
if (custom_conback) {
|
|
memcpy(custom_conback, size_data, 2 * sizeof(int));
|
|
return custom_conback;
|
|
}
|
|
/* sanity check */
|
|
if (sizeof(conback_byte) < sizeof(qpic_t))
|
|
Sys_Error ("Bad conback image.");
|
|
/* make a copy of the conback_byte[] array */
|
|
custom_conback = (char *)malloc (sizeof(conback_byte));
|
|
memcpy (custom_conback, conback_byte, sizeof(conback_byte));
|
|
/* backup the original size fields */
|
|
memcpy (size_data, custom_conback, 2 * sizeof(int));
|
|
return custom_conback;
|
|
}
|
|
|