mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 22:56:30 -10:00
Compare commits
30
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb46c94d08 | ||
|
|
3afde9b623 | ||
|
|
65aceccc13 | ||
|
|
e37bc109c8 | ||
|
|
dafca28717 | ||
|
|
2a9e6719a7 | ||
|
|
aed59d2125 | ||
|
|
c599955813 | ||
|
|
3bcab10109 | ||
|
|
78cf382996 | ||
|
|
54b2994204 | ||
|
|
3960161427 | ||
|
|
0b68d9c09c | ||
|
|
66285e2cab | ||
|
|
ff8607d74e | ||
|
|
acf72ef431 | ||
|
|
9f61dd5286 | ||
|
|
6e6b4b1620 | ||
|
|
3b9869a00a | ||
|
|
c761256461 | ||
|
|
5f7b9159b8 | ||
|
|
89291af840 | ||
|
|
6401a8266d | ||
|
|
8706f824fa | ||
|
|
77a0d6a841 | ||
|
|
4e590a6761 | ||
|
|
953f47560e | ||
|
|
f3d747db32 | ||
|
|
117dd15bda | ||
|
|
5431beb81d |
No files matched your search
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file bm_examples.cpp
|
||||
* This file contains example code for using bmpman.
|
||||
*/
|
||||
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
void bm_create_example() {
|
||||
static int test_inited = 0;
|
||||
static int test_bmp;
|
||||
static uint test_bmp_data[128 * 64];
|
||||
|
||||
if (!test_inited) {
|
||||
test_inited = 1;
|
||||
// Create the new bitmap and fill in its data.
|
||||
// When you're done with it completely, call
|
||||
// bm_release to free up the bitmap handle
|
||||
test_bmp = bm_create(32, 128, 64, test_bmp_data);
|
||||
int i, j;
|
||||
for (i = 0; i < 64; i++) {
|
||||
for (j = 0; j < 64; j++) {
|
||||
uint r = i * 4;
|
||||
test_bmp_data[j + i * 128] = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// page out the data, so that the next bm_lock will convert the new data to
|
||||
// the correct bpp
|
||||
bm_unload(test_bmp);
|
||||
|
||||
// put in new data
|
||||
int x, y;
|
||||
gr_reset_clip();
|
||||
for (y = 0; y < 64; y++) {
|
||||
for (x = 0; x < 128; x++) {
|
||||
test_bmp_data[y * 128 + x] = 15;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the bitmap, the upper left corner is the origin (0, 0)
|
||||
gr_set_bitmap(test_bmp);
|
||||
gr_bitmap(0, 0);
|
||||
}
|
||||
+77
-81
@@ -1,121 +1,119 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __BM_INTERNAL_H__
|
||||
#define __BM_INTERNAL_H__
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file bm_internal.h
|
||||
* These are functions and types used by bmpman and a few others.
|
||||
*
|
||||
* @details It is a "protected" header that requires BMPMAN_INTERNAL to be defined before it can be included. This is to
|
||||
* provide a small measure of safety since this functions can cause problems if not used correctly
|
||||
*/
|
||||
|
||||
// extra check to make sure this stuff doesn't end up in normal files
|
||||
// don't use any of this unless BMPMAN_INTERNAL is defined
|
||||
#ifdef BMPMAN_INTERNAL
|
||||
#ifndef BMPMAN_INTERNAL
|
||||
#error The file header "bmpman/bm_internal.h" is protected. Make sure you know what you are doing!
|
||||
#endif
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
// Bitmap types
|
||||
enum BM_TYPE
|
||||
{
|
||||
BM_TYPE_NONE = 0, //!< No type
|
||||
BM_TYPE_USER, //!< in-memory
|
||||
BM_TYPE_PCX, //!< PCX
|
||||
BM_TYPE_TGA, //!< 16 or 32 bit targa
|
||||
BM_TYPE_DDS, //!< generic identifier for DDS
|
||||
BM_TYPE_PNG, //!< PNG
|
||||
BM_TYPE_JPG, //!< 32 bit jpeg
|
||||
BM_TYPE_ANI, //!< in-house ANI format
|
||||
BM_TYPE_EFF, //!< specifies any type of animated image, the EFF itself is just text
|
||||
|
||||
// no-type ( used in: bm_bitmaps[i].type )
|
||||
#define BM_TYPE_NONE 0
|
||||
// in-memory type ( used in: bm_bitmaps[i].type )
|
||||
#define BM_TYPE_USER 1
|
||||
// file-type types ( used in: bm_bitmaps[i].type )
|
||||
#define BM_TYPE_PCX 2
|
||||
#define BM_TYPE_TGA 3 // 16 or 32 bit targa
|
||||
#define BM_TYPE_DDS 4 // generic identifier for DDS
|
||||
#define BM_TYPE_PNG 5 // PNG
|
||||
#define BM_TYPE_JPG 6 // 32 bit jpeg
|
||||
#define BM_TYPE_ANI 7 // in-house ANI format
|
||||
#define BM_TYPE_EFF 8 // specifies any type of animated image, the EFF itself is just text
|
||||
// c-type types ( used in: bm_bitmaps[i].c_type )
|
||||
#define BM_TYPE_DXT1 9 // 24 bit with switchable alpha (compressed)
|
||||
#define BM_TYPE_DXT3 10 // 32 bit with 4 bit alpha (compressed)
|
||||
#define BM_TYPE_DXT5 11 // 32 bit with 8 bit alpha (compressed)
|
||||
#define BM_TYPE_CUBEMAP_DDS 12 // generic DDS cubemap (uncompressed cubemap surface)
|
||||
#define BM_TYPE_CUBEMAP_DXT1 13 // 24-bit cubemap (compressed cubemap surface)
|
||||
#define BM_TYPE_CUBEMAP_DXT3 14 // 32-bit cubemap (compressed cubemap surface)
|
||||
#define BM_TYPE_CUBEMAP_DXT5 15 // 32-bit cubemap (compressed cubemap surface)
|
||||
// special types ( used in: bm_bitmaps[i].type )
|
||||
#define BM_TYPE_RENDER_TARGET_STATIC 16 // 24/32 bit setup internally as a static render target
|
||||
#define BM_TYPE_RENDER_TARGET_DYNAMIC 17 // 24/32 bit setup internally as a dynamic render target
|
||||
// special types
|
||||
BM_TYPE_RENDER_TARGET_STATIC, //!< 24/32 bit setup internally as a static render target
|
||||
BM_TYPE_RENDER_TARGET_DYNAMIC, //!< 24/32 bit setup internally as a dynamic render target
|
||||
|
||||
// Compressed types (bitmap.c_type)
|
||||
BM_TYPE_DXT1, //!< 24 bit with switchable alpha
|
||||
BM_TYPE_DXT3, //!< 32 bit with 4 bit alpha
|
||||
BM_TYPE_DXT5, //!< 32 bit with 8 bit alpha
|
||||
BM_TYPE_CUBEMAP_DDS, //!< generic DDS cubemap (uncompressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT1, //!< 24-bit cubemap (compressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT3, //!< 32-bit cubemap (compressed cubemap surface)
|
||||
BM_TYPE_CUBEMAP_DXT5 //!< 32-bit cubemap (compressed cubemap surface)
|
||||
};
|
||||
|
||||
/// Moved from cpp file ///////////////////
|
||||
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
|
||||
typedef union bm_extra_info {
|
||||
union bm_extra_info {
|
||||
struct {
|
||||
// Stuff needed for animations
|
||||
int first_frame; // used for animations -- points to index of first frame
|
||||
int num_frames; // used for animation -- number of frames in the animation
|
||||
int keyframe; // used for animation -- keyframe info
|
||||
ubyte fps; // used for animation -- frames per second
|
||||
int first_frame; //!< used for animations -- points to index of first frame
|
||||
int num_frames; //!< used for animations -- number of frames in the animation
|
||||
int keyframe; //!< used for animations -- keyframe info
|
||||
ubyte fps; //!< used for animations -- frames per second
|
||||
|
||||
struct {
|
||||
// stuff for static animations
|
||||
ubyte type; // type for individual images
|
||||
char filename[MAX_FILENAME_LEN]; // filename for individual images
|
||||
ubyte type; //!< type for individual images
|
||||
char filename[MAX_FILENAME_LEN]; //!< filename for individual images
|
||||
} eff;
|
||||
} ani;
|
||||
|
||||
struct {
|
||||
// Stuff needed for user bitmaps
|
||||
void *data; // For user bitmaps, this is where the data comes from
|
||||
ubyte bpp; // For user bitmaps, this is what format the data is
|
||||
ubyte flags; // Flags passed to bm_create
|
||||
void* data; //!< For user bitmaps, this is where the data comes from
|
||||
ubyte bpp; //!< For user bitmaps, this is what format the data is
|
||||
ubyte flags; //!< For user bitmaps, Flags passed to bm_create
|
||||
} user;
|
||||
} bm_extra_info;
|
||||
};
|
||||
|
||||
|
||||
typedef struct bitmap_entry {
|
||||
struct bitmap_entry {
|
||||
// identification
|
||||
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
|
||||
char filename[MAX_FILENAME_LEN]; //!< filename for this bitmap
|
||||
|
||||
uint signature; // a unique signature identifying the data
|
||||
uint palette_checksum; // checksum used to be sure bitmap is in current palette
|
||||
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
|
||||
int last_used; // When this bitmap was last used
|
||||
uint signature; //!< a unique signature identifying the data
|
||||
uint palette_checksum; //!< checksum used to be sure bitmap is in current palette
|
||||
int handle; //!< Handle = id*MAX_BITMAPS + bitmapnum
|
||||
int last_used; //!< When this bitmap was last used
|
||||
|
||||
ubyte type; // PCX, USER, ANI, etc
|
||||
ubyte comp_type; // What sort of compressed type, BM_TYPE_NONE if not compressed
|
||||
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
|
||||
ubyte type; //!< PCX, USER, ANI, etc
|
||||
ubyte comp_type; //!< What sort of compressed type, BM_TYPE_NONE if not compressed
|
||||
signed char ref_count; //!< Number of locks on bitmap. Can't unload unless ref_count is 0.
|
||||
|
||||
int dir_type; // which directory this was loaded from (to skip other locations with same name)
|
||||
int dir_type; //!< which directory this was loaded from (to skip other locations with same name)
|
||||
|
||||
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
|
||||
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
|
||||
int num_mipmaps; // number of mipmap levels, we need to read all of them
|
||||
int mem_taken; //!< How much memory does this bitmap use? - UnknownPlayer
|
||||
int num_mipmaps; //!< number of mipmap levels, we need to read all of them
|
||||
|
||||
// Stuff to keep track of usage
|
||||
ubyte preloaded; // If set, then this was loaded from the lst file
|
||||
int preload_count; // how many times this gets used in game, for unlocking
|
||||
ubyte used_flags; // What flags it was accessed thru
|
||||
int load_count;
|
||||
ubyte preloaded; //!< If set, then this was loaded from the lst file
|
||||
int preload_count; //!< how many times this gets used in game, for unlocking
|
||||
ubyte used_flags; //!< What flags it was accessed thru
|
||||
int load_count;
|
||||
|
||||
// Bitmap info
|
||||
bitmap bm;
|
||||
bitmap bm; //!< Bitmap info
|
||||
|
||||
// Data for animations and user bitmaps
|
||||
bm_extra_info info;
|
||||
bm_extra_info info; //!< Data for animations and user bitmaps
|
||||
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
// bookeeping
|
||||
ubyte used_last_frame; // If set, then it was used last frame
|
||||
ubyte used_this_frame; // If set, then it was used this frame
|
||||
int data_size; // How much data this bitmap uses
|
||||
int used_count; // How many times it was accessed
|
||||
ubyte used_last_frame; // If set, then it was used last frame
|
||||
ubyte used_this_frame; // If set, then it was used this frame
|
||||
int data_size; // How much data this bitmap uses
|
||||
int used_count; // How many times it was accessed
|
||||
#endif
|
||||
} bitmap_entry;
|
||||
};
|
||||
|
||||
extern bitmap_entry bm_bitmaps[MAX_BITMAPS];
|
||||
|
||||
|
||||
// image specific lock functions
|
||||
void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
@@ -126,6 +124,4 @@ void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyt
|
||||
void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
|
||||
|
||||
|
||||
#endif // BMPMAN_INTERNAL
|
||||
|
||||
#endif // __BM_INTERNAL_H__
|
||||
+1731
-1936
File diff suppressed because it is too large.
Load diff
+543
-201
@@ -1,288 +1,630 @@
|
||||
#ifndef _BMPMAN_H
|
||||
#define _BMPMAN_H
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file bmpman.h
|
||||
* Header file for the bitmap manager (bmpman)
|
||||
*/
|
||||
|
||||
/**
|
||||
* @example bm_examples.cpp
|
||||
* @brief This containes examples of bmpman usage
|
||||
*/
|
||||
|
||||
#ifndef _BMPMAN_H
|
||||
#define _BMPMAN_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define BMPMAN_NDEBUG
|
||||
#define BMPMAN_NDEBUG //!< Enables BMPMAN debugging code
|
||||
#endif
|
||||
|
||||
#define MAX_BITMAPS 4750 // How many bitmaps the game can handle
|
||||
// NOTE: MAX_BITMAPS shouldn't need to be bumped again. With the fixed bm_release() and it's
|
||||
// proper use even the largest missions should stay under this number. With the largest retail
|
||||
// missions and wasteful content we should still have about 20% of the slots free. If it still
|
||||
// goes over then it's something the artists need to fix. For instance the Terran Mara fighter,
|
||||
// with -spec and -glow and using the Shinepack, needs 117 bitmap slots alone. 111 of those is
|
||||
// just for the glowmaps. This number can be greatly reduced if the number of ani frames for
|
||||
// another LOD than LOD0 has fewer or no ani frames. A 37 frame glow ani for LOD2 is little
|
||||
// more than a waste of resources. Future reports of texture corruption should be initially
|
||||
// approached with content as the cause and not code. If anything we could/should reduce
|
||||
// MAX_BITMAPS in the future. Where it's at now should accomidate even the largest mods.
|
||||
// -- Taylor
|
||||
/**
|
||||
* @defgroup BMPMAN_CONSTANTS Macro constants used in/with bmpman.h
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief How many bitmaps the game can handle
|
||||
*
|
||||
* @attention MAX_BITMAPS shouldn't need to be bumped again. With the fixed bm_release() and it's proper use even the
|
||||
* largest missions should stay under this number. With the largest retail missions and wasteful content we should
|
||||
* still have about 20% of the slots free. If it still goes over then it's something the artists need to fix.
|
||||
* For instance the Terran Mara fighter, with -spec and -glow and using the Shinepack, needs 117 bitmap slots alone.
|
||||
* 111 of those is just for the glowmaps. This number can be greatly reduced if the number of ani frames for another
|
||||
* LOD than LOD0 has fewer or no ani frames. A 37 frame glow ani for LOD2 is little more than a waste of resources.
|
||||
* Future reports of texture corruption should be initially approached with content as the cause and not code.
|
||||
* If anything we could/should reduce MAX_BITMAPS in the future. Where it's at now should accomidate even the
|
||||
* largest mods. -- Taylor
|
||||
*/
|
||||
#define MAX_BITMAPS 4750
|
||||
|
||||
#define BMP_AABITMAP (1<<0) // antialiased bitmap
|
||||
#define BMP_TEX_XPARENT (1<<1) // transparent texture
|
||||
#define BMP_TEX_OTHER (1<<2) // so we can identify all "normal" textures
|
||||
#define BMP_TEX_DXT1 (1<<3) // dxt1 compressed 8r8g8b1a (24bit)
|
||||
#define BMP_TEX_DXT3 (1<<4) // dxt3 compressed 8r8g8b4a (32bit)
|
||||
#define BMP_TEX_DXT5 (1<<5) // dxt5 compressed 8r8g8b8a (32bit)
|
||||
#define BMP_TEX_CUBEMAP (1<<6) // a texture made for cubic environment map
|
||||
// Flag positions for bitmap.flags
|
||||
// ***** NOTE: bitmap.flags is an 8-bit value, no more BMP_TEX_* flags can be added unless the type is changed!! ******
|
||||
#define BMP_AABITMAP (1<<0) //!< antialiased bitmap
|
||||
#define BMP_TEX_XPARENT (1<<1) //!< transparent texture
|
||||
#define BMP_TEX_OTHER (1<<2) //!< so we can identify all "normal" textures
|
||||
#define BMP_TEX_DXT1 (1<<3) //!< dxt1 compressed 8r8g8b1a (24bit)
|
||||
#define BMP_TEX_DXT3 (1<<4) //!< dxt3 compressed 8r8g8b4a (32bit)
|
||||
#define BMP_TEX_DXT5 (1<<5) //!< dxt5 compressed 8r8g8b8a (32bit)
|
||||
#define BMP_TEX_CUBEMAP (1<<6) //!< a texture made for cubic environment map
|
||||
|
||||
//compressed texture types
|
||||
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 )
|
||||
// Combined flags
|
||||
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 ) //!< Compressed textures
|
||||
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_OTHER ) //!< Non-compressed textures
|
||||
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP ) //!< Any texture
|
||||
|
||||
//non compressed textures
|
||||
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_OTHER )
|
||||
// Flag positions for bitmap.type
|
||||
#define BMP_FLAG_RENDER_TARGET_STATIC (1<<0) //!< Texture is a static type
|
||||
#define BMP_FLAG_RENDER_TARGET_DYNAMIC (1<<1) //!< Texture is a dynamic type (animation)
|
||||
#define BMP_FLAG_CUBEMAP (1<<2) //!< Texture is a cubemap
|
||||
|
||||
// any texture type
|
||||
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP )
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#define BMP_FLAG_RENDER_TARGET_STATIC (1<<0)
|
||||
#define BMP_FLAG_RENDER_TARGET_DYNAMIC (1<<1)
|
||||
#define BMP_FLAG_CUBEMAP (1<<2)
|
||||
struct bitmap
|
||||
{
|
||||
short w; //!< Width, in number of pixels
|
||||
short h; //!< Height, in number of pixels
|
||||
short rowsize; //!< What you need to add to go to next row
|
||||
ubyte bpp; //!< Requested bitdepth of each pixel. ( 7, 8, 15, 16, 24, 32)
|
||||
ubyte true_bpp; //!< The image's actual bitdepth
|
||||
ubyte flags; //!< Various texture type flags. @see BMPMAN_CONSTANTS
|
||||
ptr_u data; //!< Pointer to data, or maybe offset into VRAM.
|
||||
ubyte *palette; /**< @brief Pointer to this bitmap's palette (if it has one).
|
||||
* @details If BMP_NO_PALETTE_MAP flag is cleared, this palette just points to the screen palette. (gr_palette)
|
||||
*/
|
||||
};
|
||||
|
||||
typedef struct bitmap {
|
||||
short w, h; // Width and height
|
||||
short rowsize; // What you need to add to go to next row
|
||||
ubyte bpp; // How many bits per pixel it is. (7,8,15,16,24,32) (what is requested)
|
||||
ubyte true_bpp; // How many bits per pixel the image actually is.
|
||||
ubyte flags; // See the BMP_???? defines for values (this isn't for the BMP_FLAG_* stuff)
|
||||
ptr_u data; // Pointer to data, or maybe offset into VRAM.
|
||||
ubyte *palette; // If bpp==8, this is pointer to palette. If the BMP_NO_PALETTE_MAP flag
|
||||
// is not set, this palette just points to the screen palette. (gr_palette)
|
||||
} bitmap;
|
||||
extern int bm_texture_ram; //!< how many bytes of textures are used.
|
||||
|
||||
extern int Bm_paging; //!< Bool type that indicates if BMPMAN is currently paging.
|
||||
|
||||
extern int Bm_paging;
|
||||
extern int GLOWMAP; //!< References a map that is a fully lit version of its index -Bobboau
|
||||
extern int SPECMAP; //!< References a map that is for specular mapping -Bobboau
|
||||
extern int ENVMAP; //!< References a map that is for environment mapping -Bobboau
|
||||
extern int NORMMAP; //!< Normal mapping
|
||||
extern int HEIGHTMAP; //!< Height map for normal mapping
|
||||
extern int MISCMAP; //!< Utility map, to be utilized for various things shader authors can come up with
|
||||
|
||||
/**
|
||||
* @brief Initilizes the bitmap manager
|
||||
*/
|
||||
void bm_init();
|
||||
|
||||
/**
|
||||
* @brief Closes the bitmap manager, freeing any allocated memory used by bitmaps. Is called at program close.
|
||||
*/
|
||||
void bm_close();
|
||||
|
||||
int bm_get_cache_slot( int bitmap_id, int separate_ani_frames );
|
||||
/**
|
||||
* Gets the cache slot of the bitmap indexed by handle.
|
||||
*
|
||||
* @details if the bitmap is an ani, gets the first frame
|
||||
*
|
||||
* @returns The cache slot index of the bitmap if handle is valid
|
||||
*
|
||||
* @note If the handle is invalid, an Assert() fails
|
||||
*/
|
||||
int bm_get_cache_slot(int bitmap_id, int separate_ani_frames);
|
||||
|
||||
/**
|
||||
* @brief Gets the next available bitmap slot.
|
||||
*/
|
||||
int bm_get_next_handle();
|
||||
|
||||
void *bm_malloc(int n, int size);
|
||||
/**
|
||||
* @brief Allocates memory for the given handle.
|
||||
*
|
||||
* @returns A pointer to the allocated vm if successful,
|
||||
* @returns Null, if unsuccessful
|
||||
*
|
||||
* @note z64 - This function looks fishy. Not only is handle not used in release builds, but bm_bitmaps[handle].size
|
||||
* and bm_texture_size aren't modified unless this is a debug build
|
||||
*/
|
||||
void *bm_malloc(int handle, int size);
|
||||
|
||||
/**
|
||||
* @brief (DEBUG) Similar to bm_malloc, but only updates how much memory is used
|
||||
*
|
||||
* @note z64 - Also fishy (see bm_malloc)
|
||||
*/
|
||||
void bm_update_memory_used(int n, int size);
|
||||
|
||||
// how many bytes of textures are used.
|
||||
extern int bm_texture_ram;
|
||||
|
||||
// This loads a bitmap so we can draw with it later.
|
||||
// It returns a negative number if it couldn't load
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number.
|
||||
/**
|
||||
* @brief Loads a bitmap so we can draw with it later.
|
||||
*
|
||||
* @param filename
|
||||
*
|
||||
* @returns The bitmap number if successful, else
|
||||
* @returns a negative value if not
|
||||
*/
|
||||
int bm_load(const char* filename);
|
||||
|
||||
/**
|
||||
* @brief Loads a bitmap so we can draw with it later. (Preferred version)
|
||||
*
|
||||
* @param filename
|
||||
*
|
||||
* @returns The bitmap number if successful, else
|
||||
* @returns a negative value if not
|
||||
*/
|
||||
int bm_load(const SCP_string& filename);
|
||||
|
||||
// special load function. basically allows you to load a bitmap which already exists (by filename).
|
||||
// this is useful because in some cases we need to have a bitmap which is locked in screen format
|
||||
// _and_ texture format, such as pilot pics and squad logos
|
||||
/**
|
||||
* @brief Reloads a bitmap as a duplicate.
|
||||
*
|
||||
* @details This function basically allows you to load a bitmap which already exists (by filename). This is useful
|
||||
* because in some cases we need to have a bitmap which is locked in screen format _and_ texture format, such as
|
||||
* the pilot pics and squad logos
|
||||
*
|
||||
* @param filename
|
||||
*
|
||||
* @returns The bitmap number if successful, else
|
||||
* @returns a negative value if not
|
||||
*/
|
||||
int bm_load_duplicate(const char *filename);
|
||||
|
||||
// Creates a bitmap that exists in RAM somewhere, instead
|
||||
// of coming from a disk file. You pass in a pointer to a
|
||||
// block of data. The data can be in the following formats:
|
||||
// 8 bpp (mapped into game palette)
|
||||
// 32 bpp
|
||||
// On success, it returns the bitmap number. You cannot
|
||||
// free that RAM until bm_release is called on that bitmap.
|
||||
// See example at bottom of this file
|
||||
int bm_create( int bpp, int w, int h, void *data = NULL, int flags = 0);
|
||||
/**
|
||||
* Loads a bitmap which exists somewhere in the RAM.
|
||||
*
|
||||
* @param bpp The bitdepth of the bitmap
|
||||
* @param w The width of the bitmap
|
||||
* @param h The height of the bitmap
|
||||
* @param[in] data The bitmap's data glob
|
||||
* @param flags
|
||||
*
|
||||
* @note The used RAM cannot be freed until bm_release is called on the created bitmap
|
||||
*/
|
||||
int bm_create(int bpp, int w, int h, void *data = NULL, int flags = 0);
|
||||
|
||||
// Frees up a bitmap's data, but bitmap number 'n' can
|
||||
// still be used, it will just have to be paged in next
|
||||
// time it is locked.
|
||||
int bm_unload( int n, int clear_render_targets = 0, bool nodebug = false);
|
||||
/**
|
||||
* @brief Unloads a bitmap's data, but not the bitmap info
|
||||
*
|
||||
* @details The bm number (n) may be reused once this function has been called on it. However, it will have to be paged
|
||||
* in the next time it is locked.
|
||||
|
||||
// like bm_unload() except that it's safe to use to free data without worrying about
|
||||
// load_count so it's safe to use in relation to bm_release() and in gr_*_texture functions
|
||||
int bm_unload_fast( int n, int clear_render_targets = 0 );
|
||||
* @param handle The index number of the bitmap to free
|
||||
* @param clear_render_targets If true, release a render target
|
||||
* @param nodebug If true, exclude certain debug messages
|
||||
*
|
||||
* @returns 0 if not successful,
|
||||
* @returns 1 if successful
|
||||
*/
|
||||
int bm_unload(int handle, int clear_render_targets = 0, bool nodebug = false);
|
||||
|
||||
// Frees up a bitmap's data, and it's slot, so bitmap
|
||||
// number 'n' cannot be used anymore, and bm_load or
|
||||
// bm_create might reuse the slot.
|
||||
int bm_release( int n, int clear_render_targets = 0 );
|
||||
/**
|
||||
* @brief Quickly unloads a bitmap's data, ignoring the load_count
|
||||
*
|
||||
* @details Similar to bm_unload(), except that it can be safely used to free data without worrying about load_count.
|
||||
* It's safe to use in relation to bm_release() and in gr_*_texture functions
|
||||
*
|
||||
* @param handle The bm number of the bitmap to free
|
||||
* @param clear_render_targets If true, release a render target
|
||||
*
|
||||
* @note bm_free_data_fast() is used here and NOT bm_free_data()
|
||||
*/
|
||||
int bm_unload_fast(int handle, int clear_render_targets = 0);
|
||||
|
||||
// This loads a bitmap sequence so we can draw with it later.
|
||||
// It returns a negative number if it couldn't load
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number of the first frame and nframes is set.
|
||||
extern int bm_load_animation( const char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
|
||||
/**
|
||||
* @brief Frees both a bitmap's data and it's associated slot.
|
||||
*
|
||||
* @details Once called, the bm number 'n' cannot be used until bm_load or bm_create is re-inits the slot.
|
||||
*
|
||||
* @param handle The index number of the bitmap to release
|
||||
* @param clear_render_targets If nonzero, also release render targets
|
||||
*
|
||||
* @returns 1 on success,
|
||||
* @returns 0 otherwise
|
||||
*
|
||||
* @note If the passed handle is that of an ANI, it frees EVERY frame. Be sure to only pass the handle of the first frame!
|
||||
*
|
||||
* @todo upgrade return type and clear_render_targets type to bools
|
||||
*/
|
||||
int bm_release(int handle, int clear_render_targets = 0);
|
||||
|
||||
//Loads either animation (bm_load_animation) or still image (bm_load)
|
||||
extern int bm_load_either(const char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
|
||||
/**
|
||||
* @brief Loads a bitmap sequance so we can draw with it.
|
||||
*
|
||||
* @param[in] filename
|
||||
* @param[out] nframes If non-null, set to the number of frames the animation has
|
||||
* @param[out] fps If non-null, set to the fps of this animation
|
||||
* @param[out] keyframe if non null, set to the keyframe index of this animation
|
||||
* @param[in] can_drop_frames If set, allows dropped frames
|
||||
* @param[in] dir_type Directory type
|
||||
*
|
||||
* @returns The bm number of the first bitmap in the sequence if successful, or
|
||||
* @returns A negative value if unsuccessful
|
||||
*/
|
||||
int bm_load_animation(const char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
|
||||
|
||||
// This locks down a bitmap and returns a pointer to a bitmap
|
||||
// that can be accessed until you call bm_unlock. Only lock
|
||||
// a bitmap when you need it! This will convert it into the
|
||||
// appropriate format also.
|
||||
extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags, bool nodebug = false);
|
||||
/**
|
||||
* @brief Loads either animation (bm_load_animation) or still image (bm_load)
|
||||
*
|
||||
* @param[in] filename
|
||||
* @param[out] nframes If non-null and loading was successful, set to the number of frames the animation has
|
||||
* @param[out] fps If non-null and loading was successful, set to the fps of this animation
|
||||
* @param[out] keyframe if non null and loading was successful, set to the keyframe index of this animation
|
||||
* @param[in] can_drop_frames
|
||||
* @param[in] dir_type
|
||||
*
|
||||
* @returns The bm number of the first bitmap in the sequence if successful, or
|
||||
* @returns A negative value if unsuccessful
|
||||
*/
|
||||
int bm_load_either(const char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
|
||||
|
||||
// The signature is a field that gets filled in with
|
||||
// a unique signature for each bitmap. The signature for each bitmap
|
||||
// will also change when the bitmap's data changes.
|
||||
extern uint bm_get_signature( int bitmapnum);
|
||||
/**
|
||||
* @brief Locks down the bitmap indexed by bitmapnum.
|
||||
*
|
||||
* @details Also converts the bitmap to the appropriate format specified by bpp and flags. Only lock a bitmap when you
|
||||
* need it!
|
||||
*
|
||||
* @param bitmapnum The number indexing the desired bitmap
|
||||
* @param bpp The desired bpp of the bitmep
|
||||
* @param flags The desired bitmap format
|
||||
* @param nodebug
|
||||
|
||||
//gets the image type
|
||||
* @returns A pointer to the bitmap that's valid until bm_unlock is called if successful, or
|
||||
* @returns NULL if unsuccessful
|
||||
*/
|
||||
bitmap* bm_lock(int handle, ubyte bpp, ubyte flags, bool nodebug = false);
|
||||
|
||||
/**
|
||||
* @brief Returns a unique signiature for the bitmap indexed by handle
|
||||
*
|
||||
* @details A signature will change when the bitmap's data changes
|
||||
*/
|
||||
uint bm_get_signature(int handle);
|
||||
|
||||
/**
|
||||
* @brief Returns the image type of the given bitmap handle
|
||||
*/
|
||||
ubyte bm_get_type(int handle);
|
||||
|
||||
// Unlocks a bitmap
|
||||
extern void bm_unlock( int bitmapnum );
|
||||
/**
|
||||
* @brief Unlocks a bitmap
|
||||
*
|
||||
* @details Decrements the ref_count member of the bitmap_entry struct, A bitmap can only be unloaded when the
|
||||
* ref_count is 0
|
||||
*/
|
||||
void bm_unlock(int handle);
|
||||
|
||||
//WMC - Returns 0 if invalid, nonzero if valid
|
||||
extern int bm_is_valid(int handle);
|
||||
/**
|
||||
* @brief Checks if the bitmap indexed by handle is valid
|
||||
*
|
||||
* @details Some early known false or out of range handles (such as negative) are checked within
|
||||
* an initial routine pass, followed by a more thorough check routine to ensure the
|
||||
* series of bitmaps within the bm_bitmaps[] structure have not become invalid.
|
||||
*
|
||||
* @returns Nonzero if valid, else
|
||||
* @returns Zero otherwise
|
||||
*
|
||||
* @todo z64 - Returned value is essentially a bool type, need to check all caller functions to see if it can safely
|
||||
* be updated to reflect this
|
||||
*/
|
||||
int bm_is_valid(int handle);
|
||||
|
||||
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
|
||||
//WMC - Returns -1 on failure, handle or first frame handle on success.
|
||||
int bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL );
|
||||
/**
|
||||
* @brief Gets info on the bitmap indexed by handle.
|
||||
*
|
||||
* @param[out] w If non-null, gets the width
|
||||
* @param[out] h If non-null, gets the heigth
|
||||
* @param[out] flags If non-null, gets the flags
|
||||
* @param[out] nframs If non-null, gets the nframes
|
||||
* @param[out] fps If non-null, gets the fps
|
||||
*
|
||||
* @returns The handle on success, or
|
||||
* @returns The handle to the first frame on success, or
|
||||
* @returns -1 on failure
|
||||
*/
|
||||
int bm_get_info(int handle, int *w = NULL, int * h = NULL, ubyte * flags = NULL, int *nframes = NULL, int *fps = NULL);
|
||||
|
||||
// get filename
|
||||
extern void bm_get_filename(int bitmapnum, char *filename);
|
||||
/**
|
||||
* @brief Gets the filename of the bitmap indexed by handle
|
||||
*
|
||||
* @param[out] filename The filename of the bitmap, if successful. Is set to an empty string if unseccessful
|
||||
*
|
||||
* @todo z64 - maybe deprecate this in favor of an SCP_string version
|
||||
*/
|
||||
void bm_get_filename(int bitmapnum, char *filename);
|
||||
|
||||
// call to load all data for all bitmaps that have been requested to be loaded
|
||||
extern void bm_gfx_load_all();
|
||||
extern void bm_unload_all();
|
||||
/**
|
||||
* @brief Gets the filename of the bitmap indexed by handle, which must exist.
|
||||
*
|
||||
* @details If the bitmap does not exist (i.e. the handle is invalid), then an Assertion halts program execution.
|
||||
*
|
||||
* @returns A const char* to the filename of the bitmap
|
||||
*
|
||||
* @todo z64 - maybe deprecate this in favor of an SCP_string version.
|
||||
* @todo z64 - maybe combine this with the other bm_get_filename function like so:
|
||||
* void bm_get_filename(int handle, SCP_string *filename, bool must_exist = false);
|
||||
*/
|
||||
const char *bm_get_filename(int handle);
|
||||
|
||||
// call to get the palette for a bitmap
|
||||
void bm_get_palette(int n, ubyte *pal, char *name);
|
||||
/**
|
||||
* @brief Loads all data for all bitmaps that have been requested to be loaded
|
||||
*
|
||||
* @note This function is not defined.
|
||||
*/
|
||||
void bm_gfx_load_all();
|
||||
|
||||
// Hacked function to get a pixel from a bitmap.
|
||||
// Only works good in 8bpp mode.
|
||||
void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
|
||||
/**
|
||||
* @brief Unloads all used bitmaps, should only ever be called by game_shutdown()
|
||||
*
|
||||
* @todo Maybe move this declaration into bmpman.cpp and then extern this function within game_shutdown() to
|
||||
* ensure it only ever gets called there.
|
||||
*/
|
||||
void bm_unload_all();
|
||||
|
||||
// Returns number of bytes of bitmaps locked this frame
|
||||
// ntotal = number of bytes of bitmaps locked this frame
|
||||
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
|
||||
/**
|
||||
* @brief Gets the palette for a given bitmap indexed by handle, and optionally the filename
|
||||
*
|
||||
* @param[out] pal Is set to reference the bitmap's palette
|
||||
* @param[out] name (optional) Is set to the bitmap's filename
|
||||
*
|
||||
* @todo Maybe get rid of the optional filename and have the callers call bm_get_filename. Less efficient, however.
|
||||
*/
|
||||
void bm_get_palette(int handle, ubyte *pal, char *name);
|
||||
|
||||
/**
|
||||
* @brief Hack to get a pixel from a bitmap
|
||||
*
|
||||
* @details only works good in 8bpp mode
|
||||
*
|
||||
* @note This function is not defined.
|
||||
*/
|
||||
void bm_gfx_get_pixel(int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b);
|
||||
|
||||
/**
|
||||
* @brief (DEBUG) Gets memory size, in bytes, of the locked bitmaps
|
||||
*
|
||||
* @details Both params are non-optional, and must be non-null. There's currently no safety checks on either.
|
||||
*
|
||||
* @param ntotal[out] Memory size, in bytes, of the locked bitmaps
|
||||
* @param nnew[out] Memory size, in bytes, of the bitmaps that were locked since the last frame
|
||||
*
|
||||
* @note This is a debug function, and is undefined within release builds
|
||||
*/
|
||||
void bm_get_frame_usage(int *ntotal, int *nnew);
|
||||
|
||||
// Reload a different image into an existing bmpman slot
|
||||
/**
|
||||
* @brief Reloads an existing bmpman slot with different bitmap
|
||||
*
|
||||
* @param[in] filename The filename of the image to load
|
||||
*
|
||||
* @returns The bitmap handle on success, or
|
||||
* @returns A negative value on failure
|
||||
*
|
||||
* @note This should only be used if you are certain the new picture is the same type, has same dimensions, etc.
|
||||
*/
|
||||
int bm_reload(int bitmap_handle, const char* filename);
|
||||
|
||||
/*
|
||||
* Example on using bm_create
|
||||
*
|
||||
{
|
||||
static int test_inited = 0;
|
||||
static int test_bmp;
|
||||
static uint test_bmp_data[128*64];
|
||||
|
||||
if ( !test_inited ) {
|
||||
test_inited = 1;
|
||||
// Create the new bitmap and fill in its data.
|
||||
// When you're done with it completely, call
|
||||
// bm_release to free up the bitmap handle
|
||||
test_bmp = bm_create( 32, 128, 64, test_bmp_data );
|
||||
int i,j;
|
||||
for (i=0; i<64; i++ ) {
|
||||
for (j=0; j<64; j++ ) {
|
||||
uint r=i*4;
|
||||
test_bmp_data[j+i*128] = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bm_unload(test_bmp); // this pages out the data, so that the
|
||||
// next bm_lock will convert the new data to the
|
||||
// correct bpp
|
||||
|
||||
// put in new data
|
||||
int x,y;
|
||||
gr_reset_clip();
|
||||
for (y=0; y<64; y++)
|
||||
for (x=0; x<128; x++ )
|
||||
test_bmp_data[y*128+x] = 15;
|
||||
|
||||
// Draw the bitmap to upper left corner
|
||||
gr_set_bitmap(test_bmp);
|
||||
gr_bitmap( 0,0 );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Paging stuff
|
||||
//============================================================================
|
||||
|
||||
/**
|
||||
* @brief Tells bmpman to start keeping track of what bitmaps are used where
|
||||
*/
|
||||
void bm_page_in_start();
|
||||
|
||||
/**
|
||||
* @brief Tells bmpman to stop paging (?)
|
||||
*/
|
||||
void bm_page_in_stop();
|
||||
|
||||
// Paging code in a library should call these functions
|
||||
// in its page in function.
|
||||
|
||||
// Marks a texture as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_page_in_texture( int bitmapnum, int num_frames = 0 );
|
||||
/**
|
||||
* @brief Marks a texture as being used for this level
|
||||
*
|
||||
* @param[in] num_frames If specified, assumes this is an animated texture
|
||||
*/
|
||||
void bm_page_in_texture(int bitmapnum, int num_frames = 0);
|
||||
|
||||
// marks a texture as being a transparent textyre used for this level
|
||||
// Marks a texture as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
|
||||
/**
|
||||
* @brief Marks a textures as being used for level and is transparant
|
||||
*
|
||||
* @param[in] num_frames If specified, assumes this is an animated texture
|
||||
*/
|
||||
void bm_page_in_xparent_texture(int bitmapnum, int num_frames = 1);
|
||||
|
||||
// Marks an aabitmap as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_page_in_aabitmap( int bitmapnum, int num_frames=1 );
|
||||
/**
|
||||
* @brief Marks a texture as being used for this level, and is anti-aliased
|
||||
*
|
||||
* @param[in] num_frames If specified, assumes this is an animated texture
|
||||
*/
|
||||
void bm_page_in_aabitmap(int bitmapnum, int num_frames = 1);
|
||||
|
||||
// unload a texture that was paged in
|
||||
int bm_page_out( int handle );
|
||||
/**
|
||||
* @brief Unloads the bitmap indexed by handle that was previously paged-in
|
||||
*
|
||||
* @returns 0 If the bitmap had already been released, or
|
||||
* @returns 0 If the handle is invalid, or
|
||||
* @returns 1 If successful
|
||||
*
|
||||
* @todo The return type should be a bool
|
||||
*/
|
||||
int bm_page_out(int handle);
|
||||
|
||||
//
|
||||
// Mode: 0 = High memory
|
||||
// 1 = Low memory ( every other frame of ani's)
|
||||
// 2 = Debug low memory ( only use first frame of each ani )
|
||||
void bm_set_low_mem( int mode );
|
||||
|
||||
const char *bm_get_filename(int handle);
|
||||
/**
|
||||
* @brief Sets BMPMAN's memory mode
|
||||
*
|
||||
* @details 0 = High memory;
|
||||
* 1 = Low memory (loads every other frame of ani's);
|
||||
* 2 = Debug low memory (only use first frame of each ani)
|
||||
*
|
||||
* @todo This should use an enum, or instead allow an arbitrary number to drop frames (like 1/2, 1/3, etc.)
|
||||
*/
|
||||
void bm_set_low_mem(int mode);
|
||||
|
||||
/**
|
||||
* @brief Sets bm_set_components and bm_get_components to reference screen format functions
|
||||
*/
|
||||
void BM_SELECT_SCREEN_FORMAT();
|
||||
|
||||
/**
|
||||
* @brief Sets bm_set_components and bm_get_components to reference texture format functions
|
||||
*/
|
||||
void BM_SELECT_TEX_FORMAT();
|
||||
|
||||
/**
|
||||
* @brief Sets bm_set_components and bm_get_components to reference texture format functions (with alpha)
|
||||
*/
|
||||
void BM_SELECT_ALPHA_TEX_FORMAT();
|
||||
|
||||
// set the rgba components of a pixel, any of the parameters can be NULL
|
||||
extern void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
extern void (*bm_set_components_32)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_32_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
/**
|
||||
* @brief Functional pointer that references any of the bm_set_components functions.
|
||||
*
|
||||
* @details The bm_set_components functions packs the RGBA values into the ubyte array referenced by pixel, whose
|
||||
* format differs according to its bpp value and presence of an alpha channel. The RGBA values are scaled accordingly.
|
||||
*
|
||||
* @param[out] pixel The pixel to set
|
||||
* @param[in] r Red value (may not be NULL)
|
||||
* @param[in] g Green value (may not be NULL)
|
||||
* @param[in] b Blue value (may not be NULL)
|
||||
* @param[in] a Alpha value (currently ignored)
|
||||
*
|
||||
* @note z64 - These functions were made predating the introduction of C++ classes, and are basically the equivalent
|
||||
* of Pixel::set(ubyte *r, ubyte *b, ubyte *g). The original comment mentions that any of the rgba params may be
|
||||
* NULL, but this is by far _NOT_ the case, as a NULL value will cause undefined behavior (really really bad chroma
|
||||
* corruption)
|
||||
*
|
||||
* @note These functions assume the incoming bitdepth will always be >= to the outgoing bitdepth of the pixel. Should
|
||||
* the incoming bitdepth be lower, the outgoing values will appear darker than they should be
|
||||
*/
|
||||
extern void(*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
// get the rgba components of a pixel, any of the parameters can be NULL
|
||||
/**
|
||||
* @brief Functional pointer that references any of the bm_set_components_32 functions.
|
||||
*
|
||||
* @details The bm_set_components functions packs the RGBA values into the ubyte array referenced by pixel, whose
|
||||
* format differs according to its bpp value and presence of an alpha channel. The RGBA values are scaled accordingly.
|
||||
*
|
||||
* @see bm_set_components
|
||||
*/
|
||||
extern void(*bm_set_components_32)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
/**
|
||||
* @brief Sets the 16bpp screen pixel to the specified RGBA value
|
||||
*
|
||||
* @see bm_set_components
|
||||
*/
|
||||
void bm_set_components_argb_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
/**
|
||||
* @brief Sets the 32bpp screen pixel to the specified RGBA value
|
||||
*
|
||||
* @see bm_set_components
|
||||
*/
|
||||
void bm_set_components_argb_32_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
/**
|
||||
* @brief Sets the 16bpp texture pixel to the specified RGBA value
|
||||
*
|
||||
* @see bm_set_components
|
||||
*/
|
||||
void bm_set_components_argb_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
/**
|
||||
* @brief Sets the 32bpp texture pixel to the specified RGBA value
|
||||
*
|
||||
* @see bm_set_components
|
||||
*/
|
||||
void bm_set_components_argb_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
/**
|
||||
* @brief Gets the RGBA components of a pixel according to the selected mode
|
||||
*
|
||||
* @see BM_SELECT_SCREEN_FORMAT() BM_SELECT_TEX_FORMAT() BM_SELECT_ALPHA_TEX_FORMAT()
|
||||
*/
|
||||
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of its index -Bobboau
|
||||
extern int SPECMAP; //this holds a reference to a map that is for specular mapping -Bobboau
|
||||
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
|
||||
extern int NORMMAP; // normal mapping
|
||||
extern int HEIGHTMAP; // height map for normal mapping
|
||||
extern int MISCMAP; // Utility map, to be utilized for various things shader authors can come up with
|
||||
/**
|
||||
* @brief Returns the compression type of the bitmap indexed by handle
|
||||
*/
|
||||
int bm_is_compressed(int handle);
|
||||
|
||||
int bm_is_compressed(int num);
|
||||
int bm_get_tcache_type(int num);
|
||||
int bm_get_size(int num);
|
||||
int bm_get_num_mipmaps(int num);
|
||||
/**
|
||||
* @brief Gets the correct TCACHE_TYPE for compressed graphics (uncompressed are assumed TCACHE_TYPE_NORMAL)
|
||||
*/
|
||||
int bm_get_tcache_type(int handle);
|
||||
|
||||
/**
|
||||
* @brief Gets the size, in bytes, taken up by the bitmap indexed by handle
|
||||
*
|
||||
* @todo retval should be a size_t
|
||||
*/
|
||||
int bm_get_size(int handle);
|
||||
|
||||
/**
|
||||
* @brief Gets the number of mipmaps of the indexed texture
|
||||
*/
|
||||
int bm_get_num_mipmaps(int handle);
|
||||
|
||||
/**
|
||||
* @brief Checks to see if the indexed bitmap has an alpha channel
|
||||
*
|
||||
* @note Currently just checks if the bitmap is 32bpp and is not a .PCX
|
||||
*
|
||||
* @todo retval should be a bool
|
||||
*/
|
||||
int bm_has_alpha_channel(int handle);
|
||||
|
||||
/**
|
||||
* @brief (DEBUG) Prints all loaded bitmaps to an outwindow
|
||||
*/
|
||||
void bm_print_bitmaps();
|
||||
|
||||
int bm_make_render_target( int width, int height, int flags );
|
||||
int bm_is_render_target(int bitmap_id);
|
||||
/**
|
||||
* @brief Creates a render target as close to the desired resolution as possible.
|
||||
*
|
||||
* @returns the handle of an avilable render target if successful, or
|
||||
* @returns -1 if not successful
|
||||
*
|
||||
* @note BM_FLAG_RENDER_TARGET_STATIC are drawn once/infrequently, while BM_FLAG_RENDER_TARGET_DYNAMIC are drawn roughly once every frame
|
||||
*/
|
||||
int bm_make_render_target(int width, int height, int flags);
|
||||
|
||||
/**
|
||||
* @brief Checks to see if the given bitmap indexed by handle is a render target
|
||||
*
|
||||
* @returns The render type (BM_TYPE) if it is a render target, or
|
||||
* @returns 0 if it is not
|
||||
*/
|
||||
int bm_is_render_target(int handle);
|
||||
|
||||
/**
|
||||
* @brief (GR function) Calls gr_bm_set_render target for the given bitmap indexed by handle
|
||||
*
|
||||
* @returns 1 if successful, or
|
||||
* @returns 0 if unsuccessful
|
||||
*
|
||||
* @todo retval should be a bool
|
||||
*/
|
||||
int bm_set_render_target(int handle, int face = -1);
|
||||
|
||||
/**
|
||||
* @brief Loads and parses an .EFF
|
||||
*
|
||||
* @param[in] filename The filename of the .EFF
|
||||
* @param[in] dir_type
|
||||
* @param[out] nframes (optional) If given, is set to the number of frames this .EFF has
|
||||
* @param[out] nfps (optional) If given, is set to the fps of this .EFF
|
||||
* @param[out] key (optional) If given, is set to the keyframe index of this .EFF
|
||||
* @param[out] type (optional) If given, is set to the BM_TYPE of the .EFF
|
||||
*
|
||||
* @returns 0 If successful,
|
||||
* @returns -1 if not successful
|
||||
*
|
||||
* @todo retval should be a bool
|
||||
*/
|
||||
int bm_load_and_parse_eff(const char *filename, int dir_type, int *nframes, int *nfps, int *key, ubyte *type);
|
||||
|
||||
#endif
|
||||
@@ -217,7 +217,6 @@ Flag exe_params[] =
|
||||
{ "-dis_weapons", "Disable weapon rendering", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dis_weapons", },
|
||||
{ "-output_sexps", "Output SEXPs to sexps.html", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_sexps", },
|
||||
{ "-output_scripting", "Output scripting to scripting.html", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_scripting", },
|
||||
{ "-output_json_data", "Output table objects to [table].json", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_json_data", },
|
||||
{ "-save_render_target", "Save render targets to file", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-save_render_target", },
|
||||
{ "-debug_window", "Display debug window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-debug_window", },
|
||||
{ "-verify_vps", "Spew VP CRCs to vp_crcs.txt", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-verify_vps", },
|
||||
@@ -495,9 +494,6 @@ bool Cmdline_no_unfocus_pause = false;
|
||||
cmdline_parm get_flags_arg("-get_flags", "Output the launcher flags file", AT_NONE);
|
||||
cmdline_parm output_sexp_arg("-output_sexps", NULL, AT_NONE); //WMC - outputs all SEXPs to sexps.html
|
||||
cmdline_parm output_scripting_arg("-output_scripting", NULL, AT_NONE); //WMC
|
||||
cmdline_parm output_json_data_arg("-output_json_data", "Output table objects to [table].json", AT_NONE); //chief1983, Cmdline_output_json_data
|
||||
|
||||
bool Cmdline_output_json_data = false;
|
||||
|
||||
// Deprecated flags - CommanderDJ
|
||||
cmdline_parm deprecated_spec_arg("-spec", "Deprecated", AT_NONE);
|
||||
@@ -1513,11 +1509,6 @@ bool SetCmdlineParams()
|
||||
output_sexps("sexps.html");
|
||||
}
|
||||
|
||||
if ( output_json_data_arg.found() )
|
||||
{
|
||||
Cmdline_output_json_data = true;
|
||||
}
|
||||
|
||||
if ( no_vbo_arg.found() )
|
||||
{
|
||||
Cmdline_novbo = 1;
|
||||
|
||||
@@ -155,6 +155,5 @@ extern int Cmdline_reparse_mainhall;
|
||||
extern bool Cmdline_frame_profile;
|
||||
extern bool Cmdline_profile_write_file;
|
||||
extern bool Cmdline_no_unfocus_pause;
|
||||
extern bool Cmdline_output_json_data;
|
||||
|
||||
#endif
|
||||
@@ -9,10 +9,8 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////
|
||||
// Testing Goals
|
||||
// Breakpoints are set at places that need testing:
|
||||
// * the value of endptr strtol and strtoul needs to investigated, according to cplusplus.com, *endptr = end of the string that was successfully converted
|
||||
// TODO: Make a fast version of the parse_long, parse_ulong, etc. That just checks the first 1-3 characters. The fast version will be used in retail builds while the slow/safe version will be in debug's
|
||||
// @todo Make a fast version of the parse_long, parse_ulong, etc. That just checks the first 1-3 characters. The fast version will be used in retail builds while the slow/safe version will be in debug's
|
||||
// @todo Maybe make parser functions case-insensitive
|
||||
////////////////
|
||||
#include "debugconsole/consoleparse.h"
|
||||
|
||||
@@ -466,7 +464,7 @@ void dc_required_string(char *pstr)
|
||||
|
||||
dc_ignore_gray_space();
|
||||
|
||||
if (strnicmp(pstr, Cp, strlen(pstr))) {
|
||||
if (strncmp(pstr, Cp, strlen(pstr)) == 0) {
|
||||
str_found = pstr;
|
||||
}
|
||||
|
||||
@@ -492,10 +490,10 @@ int dc_required_string_either(char *str1, char *str2)
|
||||
|
||||
dc_ignore_gray_space();
|
||||
|
||||
if (strncmp(str1, Cp, strlen(str1) == 0)) {
|
||||
if (strncmp(str1, Cp, strlen(str1)) == 0) {
|
||||
str_found = str1;
|
||||
i = 0;
|
||||
} else if (strncmp(str2, Cp, strlen(str2) == 0)) {
|
||||
} else if (strncmp(str2, Cp, strlen(str2)) == 0) {
|
||||
str_found = str2;
|
||||
i = 1;
|
||||
}
|
||||
@@ -563,7 +561,7 @@ bool dc_optional_string(const char *pstr)
|
||||
{
|
||||
dc_ignore_gray_space();
|
||||
|
||||
if (strncmp(pstr, Cp, strlen(pstr) != 0)) {
|
||||
if (strncmp(pstr, Cp, strlen(pstr)) != 0) {
|
||||
return false;
|
||||
} // Else, optional string was found
|
||||
|
||||
|
||||
+226
-226
File diff suppressed because it is too large.
Load diff
@@ -7127,13 +7127,6 @@ int game_main(char *cmdline)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// maybe output parsed table objects, and exit
|
||||
if (Cmdline_output_json_data) {
|
||||
ship_output_json("ships.json");
|
||||
weapons_output_json("weapons.json");
|
||||
game_shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// maybe spew VP CRCs, and exit
|
||||
if (Cmdline_verify_vps) {
|
||||
|
||||
@@ -336,8 +336,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 3,7,1,000000
|
||||
PRODUCTVERSION 3,7,1,000000
|
||||
FILEVERSION 3,7,2,11329
|
||||
PRODUCTVERSION 3,7,2,11329
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -354,12 +354,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Volition Inc."
|
||||
VALUE "FileDescription", "FreeSpace 2 Open"
|
||||
VALUE "FileVersion", "3.7.1.000000"
|
||||
VALUE "FileVersion", "3.7.2.11329"
|
||||
VALUE "InternalName", "FreeSpace 2 Open"
|
||||
VALUE "LegalCopyright", "Copyright © 1998"
|
||||
VALUE "OriginalFilename", "fs2.exe"
|
||||
VALUE "ProductName", "FreeSpace 2 Open"
|
||||
VALUE "ProductVersion", "3.7.1"
|
||||
VALUE "ProductVersion", "3.7.2"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
#define FS_VERSION_MAJOR 3 // major version
|
||||
#define FS_VERSION_MINOR 7 // increase by 1 for minor revs
|
||||
#define FS_VERSION_BUILD 1 // bugfix release
|
||||
#define FS_VERSION_REVIS 000000 // SVN revision
|
||||
#define FS_VERSION_BUILD 2 // bugfix release
|
||||
#define FS_VERSION_REVIS 11329 // SVN revision
|
||||
//#define FS_VERSION_IDENT NOX("custom") // special build release identifier, must be a string (don't define unless it's supposed to be used!!)
|
||||
|
||||
#define VERSION_LOC_FNAME "version.nfo"
|
||||
|
||||
@@ -192,6 +192,10 @@ int gr_opengl_create_stream_buffer()
|
||||
{
|
||||
opengl_vertex_buffer buffer;
|
||||
|
||||
if ( !Use_VBOs ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
vglGenBuffersARB(1, &buffer.vbo);
|
||||
|
||||
GL_vertex_buffers.push_back(buffer);
|
||||
|
||||
@@ -858,7 +858,7 @@ int hud_squadmsg_is_target_order_valid(int order, int find_order, ai_info *aip )
|
||||
}
|
||||
|
||||
// if we are messaging a ship, and that ship is our target, no target type orders are ever active
|
||||
if ( (Squad_msg_mode == SM_MODE_SHIP_COMMAND) && (target_objnum == Msg_instance) ){
|
||||
if ( (Squad_msg_mode == SM_MODE_SHIP_COMMAND) && (Objects[target_objnum].instance == Msg_instance) ){
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+10
-15
@@ -35,9 +35,9 @@
|
||||
char *fs2_open_credit_text =
|
||||
"SOURCE CODE PROJECT STAFF:\n"
|
||||
"\n"
|
||||
"Project Leaders:\n"
|
||||
"Project Leader:\n"
|
||||
"\n"
|
||||
"Cliff \"chief1983\" Gordon\n"
|
||||
"Fabian \"The E\" Woltermann\n"
|
||||
"\n"
|
||||
"Senior Advisors:\n"
|
||||
"\n"
|
||||
@@ -45,6 +45,7 @@ char *fs2_open_credit_text =
|
||||
"Michael \"Zacam\" LaFleur\n"
|
||||
"Taylor Richards\n"
|
||||
"Edward \"Inquisitor\" Gardner\n"
|
||||
"Cliff \"chief1983\" Gordon\n"
|
||||
"\n"
|
||||
"Programmers:\n"
|
||||
"\n"
|
||||
@@ -52,19 +53,13 @@ char *fs2_open_credit_text =
|
||||
"Derek \"Kazan\" Meek\n"
|
||||
"Nick \"phreak\" Iannetta\n"
|
||||
"Mike \"Bobboau\" Abegg\n"
|
||||
"Backslash\n"
|
||||
"Echelon9\n"
|
||||
"Flaming_Sword\n"
|
||||
"FUBAR\n"
|
||||
"Iss Mneur\n"
|
||||
"kkmic\n"
|
||||
"Shade\n"
|
||||
"Soulstorm\n"
|
||||
"Sushi\n"
|
||||
"Swifty\n"
|
||||
"Wanderer\n"
|
||||
"Fabian \"The E\" Woltermann\n"
|
||||
"CommanderDJ\n"
|
||||
"Backslash, Echelon9, Flaming_Sword\n"
|
||||
"FUBAR, Iss Mneur, kkmic\n"
|
||||
"Shade, Soulstorm, Sushi\n"
|
||||
"Swifty, Wanderer, CommanderDJ\n"
|
||||
"Valathil, MageKing17, Yarn\n"
|
||||
"m!m, z64555, zookeeper\n"
|
||||
"jg18, niffiwan\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"Readme Staff:\n"
|
||||
|
||||
+10
-10
@@ -10491,7 +10491,7 @@ void sexp_adjust_audio_volume(int node)
|
||||
|
||||
if (n > 0) {
|
||||
int option = audio_volume_option_lookup(CTEXT(n));
|
||||
if (option > 0) {
|
||||
if (option >= 0) {
|
||||
n = CDR(n);
|
||||
|
||||
float target_volume = 1.0f;
|
||||
@@ -32111,7 +32111,7 @@ sexp_help_struct Sexp_help[] = {
|
||||
"\tReturns a percentage from 0 to 100\r\n"
|
||||
"\t1: Ship name\r\n" },
|
||||
|
||||
{ OP_GET_ETS_VALUE, "get-ets-values\r\n"
|
||||
{ OP_GET_ETS_VALUE, "get-ets-value\r\n"
|
||||
"\tGets one ETS index for a ship\r\n"
|
||||
"\t1: ETS index to get, Engine|Shield|Weapon\r\n"
|
||||
"\t2: Ship name\r\n"},
|
||||
@@ -32432,8 +32432,8 @@ sexp_help_struct Sexp_help[] = {
|
||||
"\tSets the amount of ammo for the specified ballistic bank\r\n"
|
||||
"\t1: Ship name\r\n"
|
||||
"\t2: Bank to check (0, 1, and 2 are legal banks)\r\n"
|
||||
"\t3: Number to set this bank to (If this is larger than the maximimum, bank will be set to maximum).\r\n"
|
||||
"\t4: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximimum, bank will be set to maximum)"
|
||||
"\t3: Number to set this bank to (If this is larger than the maximum, bank will be set to maximum).\r\n"
|
||||
"\t4: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximum, bank will be set to maximum)"
|
||||
},
|
||||
|
||||
// Karajorma
|
||||
@@ -32441,8 +32441,8 @@ sexp_help_struct Sexp_help[] = {
|
||||
"\tSets the amount of ammo for the specified bank\r\n"
|
||||
"\t1: Ship name\r\n"
|
||||
"\t2: Bank to check (0, 1, 2 and 3 are legal banks)\r\n"
|
||||
"\t3: Number to set this bank to (If this is larger than the maximimum, bank will be set to maximum).\r\n"
|
||||
"\t4: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximimum, bank will be set to maximum)"
|
||||
"\t3: Number to set this bank to (If this is larger than the maximum, bank will be set to maximum).\r\n"
|
||||
"\t4: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximum, bank will be set to maximum)"
|
||||
},
|
||||
|
||||
// Karajorma
|
||||
@@ -32451,8 +32451,8 @@ sexp_help_struct Sexp_help[] = {
|
||||
"\t1: Ship name\r\n"
|
||||
"\t2: Bank to check (0, 1 and 2 are legal banks)\r\n"
|
||||
"\t3: Name of the primary weapon \r\n"
|
||||
"\t4: Number to set this bank to (If this is larger than the maximimum, bank will be set to maximum)\r\n"
|
||||
"\t5: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximimum, bank will be set to maximum)"
|
||||
"\t4: Number to set ammo of this bank to (If this is larger than the maximum, bank will be set to maximum)\r\n"
|
||||
"\t5: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximum, bank will be set to maximum)"
|
||||
},
|
||||
|
||||
// Karajorma
|
||||
@@ -32461,8 +32461,8 @@ sexp_help_struct Sexp_help[] = {
|
||||
"\t1: Ship name\r\n"
|
||||
"\t2: Bank to check (0, 1, 2 and 3 are legal banks)\r\n"
|
||||
"\t3: Name of the secondary weapon \r\n"
|
||||
"\t4: Number to set this bank to (If this is larger than the maximimum, bank will be set to maximum)\r\n"
|
||||
"\t5: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximimum, bank will be set to maximum)"
|
||||
"\t4: Number to set ammo of this bank to (If this is larger than the maximum, bank will be set to maximum)\r\n"
|
||||
"\t5: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximum, bank will be set to maximum)"
|
||||
},
|
||||
|
||||
|
||||
|
||||
+158
-488
@@ -83,17 +83,7 @@
|
||||
#include "debugconsole/console.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
|
||||
#include "jansson.h"
|
||||
|
||||
#ifndef JSON_REAL_PRECISION
|
||||
#define JSON_REAL_PRECISION(n) 0
|
||||
#endif
|
||||
|
||||
#ifndef JSON_ESCAPE_SLASH
|
||||
#define JSON_ESCAPE_SLASH 0
|
||||
#endif
|
||||
|
||||
#define NUM_SHIP_SUBSYSTEM_SETS 20 // number of subobject sets to use (because of the fact that it's a linked list,
|
||||
// we can't easily go fully dynamic)
|
||||
@@ -1266,60 +1256,6 @@ void parse_ship_particle_effect(ship_info* sip, particle_effect* pe, char *id_st
|
||||
}
|
||||
}
|
||||
|
||||
void parse_allowed_weapons(ship_info *sip, bool is_primary, bool is_dogfight)
|
||||
{
|
||||
int i, num_allowed;
|
||||
int allowed_weapons[MAX_WEAPON_TYPES];
|
||||
const int max_banks = (is_primary ? MAX_SHIP_PRIMARY_BANKS : MAX_SHIP_SECONDARY_BANKS);
|
||||
const int weapon_type = (is_dogfight ? DOGFIGHT_WEAPON : REGULAR_WEAPON);
|
||||
const int offset = (is_primary ? 0 : MAX_SHIP_PRIMARY_BANKS);
|
||||
const char *allowed_banks_str = is_primary ? (is_dogfight ? "$Allowed Dogfight PBanks:" : "$Allowed PBanks:")
|
||||
: (is_dogfight ? "$Allowed Dogfight SBanks:" : "$Allowed SBanks:");
|
||||
const char *bank_type_str = is_primary ? "primary" : "secondary";
|
||||
|
||||
// Goober5000 - fixed Bobboau's implementation of restricted banks
|
||||
int bank;
|
||||
|
||||
// Set the weapons filter used in weapons loadout (for primary weapons)
|
||||
if (optional_string(allowed_banks_str))
|
||||
{
|
||||
bank = -1;
|
||||
|
||||
while (check_for_string("("))
|
||||
{
|
||||
bank++;
|
||||
|
||||
// make sure we don't specify more than we have banks for
|
||||
if (bank >= max_banks)
|
||||
{
|
||||
Warning(LOCATION, "%s bank-specific loadout for %s exceeds permissible number of %s banks. Ignoring the rest...", allowed_banks_str, sip->name, bank_type_str);
|
||||
bank--;
|
||||
break;
|
||||
}
|
||||
|
||||
num_allowed = stuff_int_list(allowed_weapons, MAX_WEAPON_TYPES, WEAPON_LIST_TYPE);
|
||||
|
||||
// actually say which weapons are allowed
|
||||
for ( i = 0; i < num_allowed; i++ )
|
||||
{
|
||||
if ( allowed_weapons[i] >= 0 ) // MK, Bug fix, 9/6/99. Used to be "allowed_weapons" not "allowed_weapons[i]".
|
||||
{
|
||||
sip->allowed_bank_restricted_weapons[offset+bank][allowed_weapons[i]] |= weapon_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set flags if need be
|
||||
if (bank > 0) // meaning there was a restricted bank table entry
|
||||
{
|
||||
for (i=0; i<=bank; i++)
|
||||
{
|
||||
sip->restricted_loadout_flag[offset+i] |= weapon_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Common method for parsing ship/subsystem primary/secondary weapons so that the parser doesn't flip out in the event of a problem.
|
||||
*
|
||||
@@ -1419,7 +1355,8 @@ int parse_and_add_briefing_icon_info()
|
||||
int parse_ship_values(ship_info* sip, bool first_time, bool replace)
|
||||
{
|
||||
char buf[SHIP_MULTITEXT_LENGTH];
|
||||
int i, j;
|
||||
int i, j, num_allowed;
|
||||
int allowed_weapons[MAX_WEAPON_TYPES];
|
||||
int rtn = 0;
|
||||
char name_tmp[NAME_LENGTH];
|
||||
|
||||
@@ -1691,7 +1628,7 @@ int parse_ship_values(ship_info* sip, bool first_time, bool replace)
|
||||
if (optional_string("$Enable Team Colors:")) {
|
||||
stuff_boolean(&sip->uses_team_colors);
|
||||
sip->default_team_name = "None";
|
||||
}
|
||||
}
|
||||
|
||||
if (optional_string("$Default Team:")) {
|
||||
char temp[NAME_LENGTH];
|
||||
@@ -2284,9 +2221,86 @@ int parse_ship_values(ship_info* sip, bool first_time, bool replace)
|
||||
stuff_float( &sip->weapon_model_draw_distance );
|
||||
}
|
||||
|
||||
// Goober5000 - fixed Bobboau's implementation of restricted banks
|
||||
int bank;
|
||||
|
||||
// Set the weapons filter used in weapons loadout (for primary weapons)
|
||||
parse_allowed_weapons(sip, true, false);
|
||||
parse_allowed_weapons(sip, true, true);
|
||||
if (optional_string("$Allowed PBanks:"))
|
||||
{
|
||||
bank = -1;
|
||||
|
||||
while (check_for_string("("))
|
||||
{
|
||||
bank++;
|
||||
|
||||
// make sure we don't specify more than we have banks for
|
||||
if (bank >= MAX_SHIP_PRIMARY_BANKS)
|
||||
{
|
||||
Warning(LOCATION, "$Allowed PBanks bank-specific loadout for %s exceeds permissible number of primary banks. Ignoring the rest...", sip->name);
|
||||
bank--;
|
||||
break;
|
||||
}
|
||||
|
||||
num_allowed = stuff_int_list(allowed_weapons, MAX_WEAPON_TYPES, WEAPON_LIST_TYPE);
|
||||
|
||||
// actually say which weapons are allowed
|
||||
for ( i = 0; i < num_allowed; i++ )
|
||||
{
|
||||
if ( allowed_weapons[i] >= 0 ) // MK, Bug fix, 9/6/99. Used to be "allowed_weapons" not "allowed_weapons[i]".
|
||||
{
|
||||
sip->allowed_bank_restricted_weapons[bank][allowed_weapons[i]] |= REGULAR_WEAPON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set flags if need be
|
||||
if (bank > 0) // meaning there was a restricted bank table entry
|
||||
{
|
||||
for (i=0; i<=bank; i++)
|
||||
{
|
||||
sip->restricted_loadout_flag[i] |= REGULAR_WEAPON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the weapons filter used in weapons loadout (for primary weapons)
|
||||
if (optional_string("$Allowed Dogfight PBanks:"))
|
||||
{
|
||||
bank = -1;
|
||||
|
||||
while (check_for_string("("))
|
||||
{
|
||||
bank++;
|
||||
|
||||
// make sure we don't specify more than we have banks for
|
||||
if (bank >= MAX_SHIP_PRIMARY_BANKS)
|
||||
{
|
||||
Warning(LOCATION, "$Allowed Dogfight PBanks bank-specific loadout for %s exceeds permissible number of primary banks. Ignoring the rest...", sip->name);
|
||||
bank--;
|
||||
break;
|
||||
}
|
||||
|
||||
num_allowed = stuff_int_list(allowed_weapons, MAX_WEAPON_TYPES, WEAPON_LIST_TYPE);
|
||||
|
||||
// actually say which weapons are allowed
|
||||
for ( i = 0; i < num_allowed; i++ )
|
||||
{
|
||||
if ( allowed_weapons[i] >= 0 ) // MK, Bug fix, 9/6/99. Used to be "allowed_weapons" not "allowed_weapons[i]".
|
||||
{
|
||||
sip->allowed_bank_restricted_weapons[bank][allowed_weapons[i]] |= DOGFIGHT_WEAPON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set flags if need be
|
||||
if (bank > 0) // meaning there was a restricted bank table entry
|
||||
{
|
||||
for (i=0; i<=bank; i++)
|
||||
{
|
||||
sip->restricted_loadout_flag[i] |= DOGFIGHT_WEAPON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get primary bank weapons
|
||||
parse_weapon_bank(sip, true, &sip->num_primary_banks, sip->primary_bank_weapons, sip->primary_bank_ammo_capacity);
|
||||
@@ -2298,8 +2312,82 @@ int parse_ship_values(ship_info* sip, bool first_time, bool replace)
|
||||
}
|
||||
|
||||
// Set the weapons filter used in weapons loadout (for secondary weapons)
|
||||
parse_allowed_weapons(sip, false, false);
|
||||
parse_allowed_weapons(sip, false, true);
|
||||
if (optional_string("$Allowed SBanks:"))
|
||||
{
|
||||
bank = -1;
|
||||
|
||||
while (check_for_string("("))
|
||||
{
|
||||
bank++;
|
||||
|
||||
// make sure we don't specify more than we have banks for
|
||||
if (bank >= MAX_SHIP_SECONDARY_BANKS)
|
||||
{
|
||||
Warning(LOCATION, "$Allowed SBanks bank-specific loadout for %s exceeds permissible number of secondary banks. Ignoring the rest...", sip->name);
|
||||
bank--;
|
||||
break;
|
||||
}
|
||||
|
||||
num_allowed = stuff_int_list(allowed_weapons, MAX_WEAPON_TYPES, WEAPON_LIST_TYPE);
|
||||
|
||||
// actually say which weapons are allowed
|
||||
for ( i = 0; i < num_allowed; i++ )
|
||||
{
|
||||
if ( allowed_weapons[i] >= 0 ) // MK, Bug fix, 9/6/99. Used to be "allowed_weapons" not "allowed_weapons[i]".
|
||||
{
|
||||
sip->allowed_bank_restricted_weapons[MAX_SHIP_PRIMARY_BANKS+bank][allowed_weapons[i]] |= REGULAR_WEAPON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set flags if need be
|
||||
if (bank > 0) // meaning there was a restricted bank table entry
|
||||
{
|
||||
for (i=0; i<=bank; i++)
|
||||
{
|
||||
sip->restricted_loadout_flag[MAX_SHIP_PRIMARY_BANKS+i] |= REGULAR_WEAPON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the weapons filter used in weapons loadout (for secondary weapons)
|
||||
if (optional_string("$Allowed Dogfight SBanks:"))
|
||||
{
|
||||
bank = -1;
|
||||
|
||||
while (check_for_string("("))
|
||||
{
|
||||
bank++;
|
||||
|
||||
// make sure we don't specify more than we have banks for
|
||||
if (bank >= MAX_SHIP_SECONDARY_BANKS)
|
||||
{
|
||||
Warning(LOCATION, "$Allowed Dogfight SBanks bank-specific loadout for %s exceeds permissible number of secondary banks. Ignoring the rest...", sip->name);
|
||||
bank--;
|
||||
break;
|
||||
}
|
||||
|
||||
num_allowed = stuff_int_list(allowed_weapons, MAX_WEAPON_TYPES, WEAPON_LIST_TYPE);
|
||||
|
||||
// actually say which weapons are allowed
|
||||
for ( i = 0; i < num_allowed; i++ )
|
||||
{
|
||||
if ( allowed_weapons[i] >= 0 ) // MK, Bug fix, 9/6/99. Used to be "allowed_weapons" not "allowed_weapons[i]".
|
||||
{
|
||||
sip->allowed_bank_restricted_weapons[MAX_SHIP_PRIMARY_BANKS+bank][allowed_weapons[i]] |= DOGFIGHT_WEAPON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set flags if need be
|
||||
if (bank > 0) // meaning there was a restricted bank table entry
|
||||
{
|
||||
for (i=0; i<=bank; i++)
|
||||
{
|
||||
sip->restricted_loadout_flag[MAX_SHIP_PRIMARY_BANKS+i] |= DOGFIGHT_WEAPON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get secondary bank weapons
|
||||
parse_weapon_bank(sip, false, &sip->num_secondary_banks, sip->secondary_bank_weapons, sip->secondary_bank_ammo_capacity);
|
||||
@@ -17800,421 +17888,3 @@ int get_nearest_bbox_point(object *ship_obj, vec3d *start, vec3d *box_pt)
|
||||
|
||||
return inside;
|
||||
}
|
||||
|
||||
bool check_restricted(const ship_info* sip, json_t* bank_json, bool restricted, int bank, int weapon_idx, int weapon_type)
|
||||
{
|
||||
// bank is a bank index, weapon_idx is a weapon type. sip->allowed_bank_restricted_weapons[bank][weapon_idx] is a 2-bit bitfield.
|
||||
if(sip->allowed_bank_restricted_weapons[bank][weapon_idx] & weapon_type)
|
||||
{
|
||||
json_array_append(bank_json, json_string(Weapon_info[weapon_idx].name));
|
||||
if(!restricted && bank > 0)
|
||||
{
|
||||
restricted = true;
|
||||
}
|
||||
}
|
||||
|
||||
return restricted;
|
||||
}
|
||||
|
||||
void append_weapons(const ship_info* sip, json_t* ship_data, bool is_primary, int bank_offset)
|
||||
{
|
||||
int bank, weapon_idx, num_banks;
|
||||
bool restricted = false, dogfight_restricted = false;
|
||||
json_t *Allowed_banks = json_array();
|
||||
json_t *Allowed_dogfight_banks = json_array();
|
||||
json_t *Default_banks = json_array();
|
||||
json_t *Bank_capacity = json_array();
|
||||
json_t *Show_models = json_array();
|
||||
char Allowed_Banks_name[16], Allowed_Dogfight_Banks_name[25], Default_Banks_name[16], Bank_Capacity_name[16], Show_Models_name[23], type_name[10];
|
||||
|
||||
if(is_primary)
|
||||
{
|
||||
num_banks = sip->num_primary_banks;
|
||||
strcpy_s(type_name, "Primary");
|
||||
}
|
||||
else
|
||||
{
|
||||
num_banks = sip->num_secondary_banks;
|
||||
strcpy_s(type_name, "Secondary");
|
||||
}
|
||||
sprintf(Allowed_Banks_name, "$Allowed %cBanks", type_name[0]);
|
||||
sprintf(Allowed_Dogfight_Banks_name, "$Allowed Dogfight %cBanks", type_name[0]);
|
||||
sprintf(Default_Banks_name, "$Default %cBanks", type_name[0]);
|
||||
sprintf(Bank_Capacity_name, "$%cBank Capacity", type_name[0]);
|
||||
sprintf(Show_Models_name, "$Show %s Models", type_name);
|
||||
|
||||
for(bank = bank_offset; bank < bank_offset + num_banks; bank++)
|
||||
{
|
||||
json_t *regular_bank = json_array();
|
||||
json_t *dogfight_bank = json_array();
|
||||
for(weapon_idx = 0; weapon_idx < Num_weapon_types; weapon_idx++)
|
||||
{
|
||||
restricted = check_restricted(sip, regular_bank, restricted, bank, weapon_idx, REGULAR_WEAPON);
|
||||
dogfight_restricted = check_restricted(sip, dogfight_bank, dogfight_restricted, bank, weapon_idx, DOGFIGHT_WEAPON);
|
||||
}
|
||||
json_array_append(Allowed_banks, regular_bank);
|
||||
json_array_append(Allowed_dogfight_banks, dogfight_bank);
|
||||
|
||||
if(is_primary)
|
||||
{
|
||||
json_array_append(Default_banks, json_string(Weapon_info[sip->primary_bank_weapons[bank - bank_offset]].name));
|
||||
json_array_append(Bank_capacity, json_integer(sip->primary_bank_ammo_capacity[bank - bank_offset]));
|
||||
json_array_append(Show_models, json_boolean(sip->draw_primary_models[bank - bank_offset]));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_array_append(Default_banks, json_string(Weapon_info[sip->secondary_bank_weapons[bank - bank_offset]].name));
|
||||
json_array_append(Bank_capacity, json_integer(sip->secondary_bank_ammo_capacity[bank - bank_offset]));
|
||||
json_array_append(Show_models, json_boolean(sip->draw_secondary_models[bank - bank_offset]));
|
||||
}
|
||||
}
|
||||
json_object_set_new(ship_data, Allowed_Banks_name, (restricted ? Allowed_banks : json_array_get(Allowed_banks, 0)));
|
||||
json_object_set_new(ship_data, Allowed_Dogfight_Banks_name, (dogfight_restricted ? Allowed_dogfight_banks : json_array_get(Allowed_dogfight_banks, 0)));
|
||||
json_object_set_new(ship_data, Default_Banks_name, Default_banks);
|
||||
json_object_set_new(ship_data, Bank_Capacity_name, Bank_capacity);
|
||||
json_object_set_new(ship_data, Show_Models_name, Show_models);
|
||||
}
|
||||
|
||||
void ship_output_json(const char *outfile)
|
||||
{
|
||||
mprintf(("Exporting ship data to json.\n"));
|
||||
|
||||
int i;
|
||||
json_t *ships_obj = json_object();
|
||||
json_t *Ships = json_array();
|
||||
ship_info *sip;
|
||||
species_info *species;
|
||||
char full_name[MAX_PATH_LEN];
|
||||
|
||||
json_object_set_new(ships_obj, "default_player_ship", json_string(default_player_ship));
|
||||
|
||||
// Loop over the Ship_info array and add a new entry to ship_info_arr each time
|
||||
for (i = 0; i < Num_ship_classes; i++)
|
||||
{
|
||||
int j;
|
||||
sip = &Ship_info[i];
|
||||
species = &Species_info[sip->species];
|
||||
json_t *ship_data = json_object();
|
||||
json_t *Displays = json_array();
|
||||
json_t *Replacements = json_array();
|
||||
json_t *Cockpit_offset = json_object();
|
||||
json_t *Detail_distance = json_array();
|
||||
json_t *ND = json_array();
|
||||
json_t *Impact = json_object();
|
||||
json_t *Collision_Physics = json_object();
|
||||
json_t *Debris = json_object();
|
||||
json_t *Max_Velocity = json_object();
|
||||
json_t *Rotation_Time = json_object();
|
||||
json_t *Anims = json_array();
|
||||
json_t *Model_point_shield_controls = json_array();
|
||||
size_t insert_index, shield_point;
|
||||
json_t *quadrant;
|
||||
json_t *Shield_color = json_object();
|
||||
|
||||
json_object_set_new(ship_data, "$Name", json_string(sip->name));
|
||||
json_object_set_new(ship_data, "$Alt Name", json_string(sip->alt_name));
|
||||
json_object_set_new(ship_data, "$Short Name", json_string(sip->short_name));
|
||||
json_object_set_new(ship_data, "$Species", json_string(species->species_name));
|
||||
json_object_set_new(ship_data, "+Type", json_string(sip->type_str));
|
||||
json_object_set_new(ship_data, "+Maneuverability", json_string(sip->maneuverability_str));
|
||||
json_object_set_new(ship_data, "+Armor", json_string(sip->armor_str));
|
||||
json_object_set_new(ship_data, "+Manufacturer", json_string(sip->manufacturer_str));
|
||||
json_object_set_new(ship_data, "+Description", json_string(sip->desc));
|
||||
json_object_set_new(ship_data, "+Tech Title", json_string(sip->tech_title));
|
||||
json_object_set_new(ship_data, "+Tech Description", json_string(sip->tech_desc));
|
||||
json_object_set_new(ship_data, "+Length", json_string(sip->ship_length));
|
||||
json_object_set_new(ship_data, "+Gun Mounts", json_string(sip->gun_mounts));
|
||||
json_object_set_new(ship_data, "+Missile Banks", json_string(sip->missile_banks));
|
||||
switch(sip->selection_effect)
|
||||
{
|
||||
case 0:
|
||||
json_object_set_new(ship_data, "$Selection Effect", json_string("off"));
|
||||
break;
|
||||
case 1:
|
||||
json_object_set_new(ship_data, "$Selection Effect", json_string("FS1"));
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
json_object_set_new(ship_data, "$Selection Effect", json_string("FS2"));
|
||||
}
|
||||
json_object_set_new(ship_data, "$Cockpit POF file", json_string(sip->cockpit_pof_file));
|
||||
json_object_set_new(Cockpit_offset, "x", json_real(sip->cockpit_offset.xyz.x));
|
||||
json_object_set_new(Cockpit_offset, "y", json_real(sip->cockpit_offset.xyz.y));
|
||||
json_object_set_new(Cockpit_offset, "z", json_real(sip->cockpit_offset.xyz.z));
|
||||
json_object_set_new(ship_data, "+Cockpit offset", Cockpit_offset);
|
||||
for(SCP_vector<cockpit_display_info>::iterator display = sip->displays.begin(); display != sip->displays.end(); ++display)
|
||||
{
|
||||
json_t *display_data = json_object();
|
||||
json_t *offsets = json_array();
|
||||
json_t *size = json_array();
|
||||
|
||||
json_object_set_new(display_data, "+Texture", json_string(display->filename));
|
||||
json_array_append_new(offsets, json_integer(display->offset[0]));
|
||||
json_array_append_new(offsets, json_integer(display->offset[1]));
|
||||
json_object_set_new(display_data, "+Offsets", offsets);
|
||||
json_array_append_new(size, json_integer(display->size[0]));
|
||||
json_array_append_new(size, json_integer(display->size[1]));
|
||||
json_object_set_new(display_data, "+Size", size);
|
||||
json_object_set_new(display_data, "+Background", json_string(display->bg_filename));
|
||||
json_object_set_new(display_data, "+Foreground", json_string(display->fg_filename));
|
||||
json_object_set_new(display_data, "+Display Name", json_string(display->name));
|
||||
|
||||
json_array_append_new(Displays, display_data);
|
||||
}
|
||||
json_object_set_new(ship_data, "$Cockpit Display", Displays);
|
||||
json_object_set_new(ship_data, "$POF file", json_string(sip->pof_file));
|
||||
for(SCP_vector<texture_replace>::iterator replace = sip->replacement_textures.begin(); replace != sip->replacement_textures.end(); ++replace)
|
||||
{
|
||||
json_t *replace_data = json_object();
|
||||
|
||||
json_object_set_new(replace_data, "+old", json_string(replace->old_texture));
|
||||
json_object_set_new(replace_data, "+new", json_string(replace->new_texture));
|
||||
|
||||
json_array_append_new(Replacements, replace_data);
|
||||
}
|
||||
json_object_set_new(ship_data, "$Texture Replace", Replacements);
|
||||
json_object_set_new(ship_data, "$POF target file", json_string(sip->pof_file_hud));
|
||||
json_object_set_new(ship_data, "$POF target LOD", json_integer(sip->hud_target_lod));
|
||||
for (j = 0; j < sip->num_detail_levels; j++)
|
||||
{
|
||||
json_array_append_new(Detail_distance, json_integer(sip->detail_distance[j]));
|
||||
}
|
||||
json_object_set_new(ship_data, "$Detail distance", Detail_distance);
|
||||
for (j = 0; j < sip->num_nondark_colors; j++)
|
||||
{
|
||||
json_t *nd_values = json_object();
|
||||
|
||||
json_object_set_new(nd_values, "red", json_integer(sip->nondark_colors[j][0]));
|
||||
json_object_set_new(nd_values, "green", json_integer(sip->nondark_colors[j][1]));
|
||||
json_object_set_new(nd_values, "blue", json_integer(sip->nondark_colors[j][2]));
|
||||
|
||||
json_array_append_new(ND, nd_values);
|
||||
}
|
||||
json_object_set_new(ship_data, "$ND", ND);
|
||||
json_object_set_new(ship_data, "$Enable Team Colors", json_boolean(sip->uses_team_colors));
|
||||
json_object_set_new(ship_data, "$Default Team", json_string(sip->default_team_name.c_str()));
|
||||
json_object_set_new(ship_data, "$Damage Lightning Type", json_string(Lightning_types[sip->damage_lightning_type]));
|
||||
if(sip->collision_damage_type_idx > -1 && sip->collision_damage_type_idx < Damage_types.size())
|
||||
{
|
||||
json_object_set_new(Impact, "+Damage Type", json_string(Damage_types.at(sip->collision_damage_type_idx).name));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_object_set_new(Impact, "+Damage Type", json_null());
|
||||
}
|
||||
json_object_set_new(ship_data, "$Impact", Impact);
|
||||
// Skipping spews
|
||||
json_object_set_new(Collision_Physics, "+Bounce", json_real(sip->collision_physics.bounce));
|
||||
json_object_set_new(Collision_Physics, "+Both Small Bounce", json_real(sip->collision_physics.both_small_bounce));
|
||||
json_object_set_new(Collision_Physics, "+Friction", json_real(sip->collision_physics.friction));
|
||||
json_object_set_new(Collision_Physics, "+Rotation Factor", json_real(sip->collision_physics.rotation_factor));
|
||||
json_object_set_new(Collision_Physics, "+Landing Max Forward Vel", json_real(sip->collision_physics.landing_max_z));
|
||||
json_object_set_new(Collision_Physics, "+Landing Min Forward Vel", json_real(sip->collision_physics.landing_min_z));
|
||||
json_object_set_new(Collision_Physics, "+Landing Max Descent Vel", json_real(sip->collision_physics.landing_min_y));
|
||||
json_object_set_new(Collision_Physics, "+Landing Max Horizontal Vel", json_real(sip->collision_physics.landing_max_x));
|
||||
json_object_set_new(Collision_Physics, "+Landing Max Angle", json_real(sip->collision_physics.landing_max_angle));
|
||||
json_object_set_new(Collision_Physics, "+Landing Min Angle", json_real(sip->collision_physics.landing_min_angle));
|
||||
json_object_set_new(Collision_Physics, "+Landing Max Rotate Angle", json_real(sip->collision_physics.landing_max_rot_angle));
|
||||
json_object_set_new(Collision_Physics, "+Reorient Max Forward Vel", json_real(sip->collision_physics.reorient_max_z));
|
||||
json_object_set_new(Collision_Physics, "+Reorient Min Forward Vel", json_real(sip->collision_physics.reorient_min_z));
|
||||
json_object_set_new(Collision_Physics, "+Reorient Max Descent Vel", json_real(sip->collision_physics.reorient_min_y));
|
||||
json_object_set_new(Collision_Physics, "+Reorient Max Horizontal Vel", json_real(sip->collision_physics.reorient_max_x));
|
||||
json_object_set_new(Collision_Physics, "+Reorient Max Angle", json_real(sip->collision_physics.reorient_max_angle));
|
||||
json_object_set_new(Collision_Physics, "+Reorient Min Angle", json_real(sip->collision_physics.reorient_min_angle));
|
||||
json_object_set_new(Collision_Physics, "+Reorient Max Rotate Angle", json_real(sip->collision_physics.reorient_max_rot_angle));
|
||||
json_object_set_new(Collision_Physics, "+Reorient Speed Mult", json_real(sip->collision_physics.reorient_mult));
|
||||
json_object_set_new(Collision_Physics, "+Landing Rest Angle", json_real(sip->collision_physics.landing_rest_angle));
|
||||
if(sip->collision_damage_type_idx > -1 && sip->collision_damage_type_idx < Snds.size())
|
||||
{
|
||||
json_object_set_new(Collision_Physics, "+Landing Sound", json_string(Snds.at(sip->collision_physics.landing_sound_idx).name.c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_object_set_new(Collision_Physics, "+Landing Sound", json_null());
|
||||
}
|
||||
json_object_set_new(ship_data, "$Collision Physics", Collision_Physics);
|
||||
json_object_set_new(Debris, "+Min Lifetime", json_real(sip->debris_min_lifetime));
|
||||
json_object_set_new(Debris, "+Max Lifetime", json_real(sip->debris_max_lifetime));
|
||||
json_object_set_new(Debris, "+Min Speed", json_real(sip->debris_min_speed));
|
||||
json_object_set_new(Debris, "+Max Speed", json_real(sip->debris_max_speed));
|
||||
json_object_set_new(Debris, "+Min Rotation speed", json_real(sip->debris_min_rotspeed));
|
||||
json_object_set_new(Debris, "+Max Rotation speed", json_real(sip->debris_max_rotspeed));
|
||||
if(sip->collision_damage_type_idx > -1 && sip->collision_damage_type_idx < Damage_types.size())
|
||||
{
|
||||
json_object_set_new(Debris, "+Damage Type", json_string(Damage_types.at(sip->debris_damage_type_idx).name));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_object_set_new(Debris, "+Damage Type", json_null());
|
||||
}
|
||||
json_object_set_new(Debris, "+Min Hitpoints", json_real(sip->debris_min_hitpoints));
|
||||
json_object_set_new(Debris, "+Max Hitpoints", json_real(sip->debris_max_hitpoints));
|
||||
json_object_set_new(Debris, "+Damage Multiplier", json_real(sip->debris_damage_mult));
|
||||
json_object_set_new(Debris, "+Lightning Arc Percent", json_real(sip->debris_arc_percent * 100.0f));
|
||||
json_object_set_new(ship_data, "$Debris", Debris);
|
||||
json_object_set_new(ship_data, "$Density", json_real(sip->density));
|
||||
json_object_set_new(ship_data, "$Damp", json_real(sip->damp));
|
||||
json_object_set_new(ship_data, "$Rotdamp", json_real(sip->rotdamp));
|
||||
json_object_set_new(ship_data, "$Banking Constant", json_real(sip->delta_bank_const));
|
||||
json_object_set_new(Max_Velocity, "x", json_real(sip->max_vel.xyz.x));
|
||||
json_object_set_new(Max_Velocity, "y", json_real(sip->max_vel.xyz.y));
|
||||
json_object_set_new(Max_Velocity, "z", json_real(sip->max_vel.xyz.z));
|
||||
json_object_set_new(ship_data, "$Max Velocity", Max_Velocity);
|
||||
json_object_set_new(Rotation_Time, "x", json_real(sip->rotation_time.xyz.x));
|
||||
json_object_set_new(Rotation_Time, "y", json_real(sip->rotation_time.xyz.y));
|
||||
json_object_set_new(Rotation_Time, "z", json_real(sip->rotation_time.xyz.z));
|
||||
json_object_set_new(ship_data, "$Rotation Time", Rotation_Time);
|
||||
json_object_set_new(ship_data, "$Rear Velocity", json_real(sip->max_rear_vel));
|
||||
json_object_set_new(ship_data, "$Forward accel", json_real(sip->forward_accel));
|
||||
json_object_set_new(ship_data, "$Forward decel", json_real(sip->forward_decel));
|
||||
json_object_set_new(ship_data, "$Slide accel", json_real(sip->slide_accel));
|
||||
json_object_set_new(ship_data, "$Slide decel", json_real(sip->slide_decel));
|
||||
json_object_set_new(ship_data, "$Glide", json_boolean(sip->can_glide));
|
||||
json_object_set_new(ship_data, "+Dynamic Glide Cap", json_boolean(sip->glide_dynamic_cap));
|
||||
json_object_set_new(ship_data, "+Max Glide Speed", json_real(sip->glide_cap));
|
||||
json_object_set_new(ship_data, "+Glide Accel Mult", json_real(sip->glide_accel_mult));
|
||||
json_object_set_new(ship_data, "$Use Newtonian Dampening", json_boolean(sip->use_newtonian_damp));
|
||||
json_object_set_new(ship_data, "$Autoaim FOV", json_integer(sip->autoaim_fov));
|
||||
// Skipping convergence, ugh...
|
||||
json_object_set_new(ship_data, "$Warpin type", json_string(Warp_types[sip->warpin_type]));
|
||||
if(sip->warpin_snd_start > -1 && sip->warpin_snd_start < Snds.size())
|
||||
{
|
||||
json_object_set_new(ship_data, "$Warpin Start Sound", json_string(Snds.at(sip->warpin_snd_start).name.c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_object_set_new(ship_data, "$Warpin Start Sound", json_null());
|
||||
}
|
||||
if(sip->warpin_snd_end > -1 && sip->warpin_snd_end < Snds.size())
|
||||
{
|
||||
json_object_set_new(ship_data, "$Warpin End Sound", json_string(Snds.at(sip->warpin_snd_end).name.c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_object_set_new(ship_data, "$Warpin End Sound", json_null());
|
||||
}
|
||||
json_object_set_new(ship_data, "$Warpin speed", json_real(sip->warpin_speed));
|
||||
json_object_set_new(ship_data, "$Warpin time", json_real(sip->warpin_time));
|
||||
json_object_set_new(ship_data, "$Warpin decel exp", json_real(sip->warpin_decel_exp));
|
||||
json_object_set_new(ship_data, "$Warpin radius", json_real(sip->warpin_radius));
|
||||
json_object_set_new(ship_data, "$Warpin animation", json_string(sip->warpin_anim));
|
||||
json_object_set_new(ship_data, "$Warpout type", json_string(Warp_types[sip->warpout_type]));
|
||||
if(sip->warpout_snd_start > -1 && sip->warpout_snd_start < Snds.size())
|
||||
{
|
||||
json_object_set_new(ship_data, "$Warpout Start Sound", json_string(Snds.at(sip->warpout_snd_start).name.c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_object_set_new(ship_data, "$Warpout Start Sound", json_null());
|
||||
}
|
||||
if(sip->warpout_snd_end > -1 && sip->warpout_snd_end < Snds.size())
|
||||
{
|
||||
json_object_set_new(ship_data, "$Warpout End Sound", json_string(Snds.at(sip->warpout_snd_end).name.c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_object_set_new(ship_data, "$Warpout End Sound", json_null());
|
||||
}
|
||||
json_object_set_new(ship_data, "$Warpout engage time", json_real(sip->warpout_engage_time));
|
||||
json_object_set_new(ship_data, "$Warpout speed", json_real(sip->warpout_speed));
|
||||
json_object_set_new(ship_data, "$Warpout time", json_real(sip->warpout_time));
|
||||
json_object_set_new(ship_data, "$Warpout accel exp", json_real(sip->warpout_accel_exp));
|
||||
json_object_set_new(ship_data, "$Warpout radius", json_real(sip->warpout_radius));
|
||||
json_object_set_new(ship_data, "$Warpout animation", json_string(sip->warpout_anim));
|
||||
json_object_set_new(ship_data, "$Player warpout speed", json_real(sip->warpout_player_speed));
|
||||
json_object_set_new(ship_data, "$Expl inner rad", json_real(sip->shockwave.inner_rad));
|
||||
json_object_set_new(ship_data, "$Expl outer rad", json_real(sip->shockwave.outer_rad));
|
||||
json_object_set_new(ship_data, "$Expl damage", json_real(sip->shockwave.damage));
|
||||
json_object_set_new(ship_data, "$Expl blast", json_real(sip->shockwave.blast));
|
||||
json_object_set_new(ship_data, "$Expl Propogates", json_boolean(sip->explosion_propagates));
|
||||
json_object_set_new(ship_data, "$Propagating Expl Radius Multiplier", json_real(sip->prop_exp_rad_mult));
|
||||
json_object_set_new(ship_data, "$Expl Visual Rad", json_real(sip->big_exp_visual_rad));
|
||||
json_object_set_new(ship_data, "$Base Death-Roll Time", json_integer(sip->death_roll_base_time));
|
||||
json_object_set_new(ship_data, "$Death-Roll Explosion Radius Mult", json_real(sip->death_roll_r_mult));
|
||||
json_object_set_new(ship_data, "$Death-Roll Explosion Intensity Mult", json_real(sip->death_roll_time_mult));
|
||||
json_object_set_new(ship_data, "$Death FX Explosion Radius Mult", json_real(sip->death_fx_r_mult));
|
||||
json_object_set_new(ship_data, "$Death FX Explosion Count", json_integer(sip->death_fx_count));
|
||||
// Skipping more particle stuff for now
|
||||
json_object_set_new(ship_data, "$Vaporize Percent Chance", json_real(sip->vaporize_chance));
|
||||
if(sip->shockwave.damage_type_idx > -1 && sip->shockwave.damage_type_idx < Damage_types.size())
|
||||
{
|
||||
json_object_set_new(ship_data, "$Shockwave Damage Type", json_string(Damage_types.at(sip->shockwave.damage_type_idx).name));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_object_set_new(ship_data, "$Shockwave Damage Type", json_null());
|
||||
}
|
||||
json_object_set_new(ship_data, "$Shockwave Speed", json_real(sip->shockwave.speed));
|
||||
json_object_set_new(ship_data, "$Shockwave Count", json_real(sip->shockwave_count));
|
||||
json_object_set_new(ship_data, "$Shockwave model", json_string(sip->shockwave.pof_name));
|
||||
json_object_set_new(ship_data, "$Shockwave name", json_string(sip->shockwave.name));
|
||||
for(SCP_vector<int>::iterator anim = sip->explosion_bitmap_anims.begin(); anim != sip->explosion_bitmap_anims.end(); ++anim)
|
||||
{
|
||||
json_array_append_new(Anims, json_integer(*anim));
|
||||
}
|
||||
json_object_set_new(ship_data, "$Explosion Animations", Anims);
|
||||
json_object_set_new(ship_data, "$Weapon Model Draw Distance", json_real(sip->weapon_model_draw_distance));
|
||||
append_weapons(sip, ship_data, true, 0);
|
||||
append_weapons(sip, ship_data, false, MAX_SHIP_PRIMARY_BANKS);
|
||||
json_object_set_new(ship_data, "$Shields", json_real(sip->max_shield_strength));
|
||||
json_object_set_new(ship_data, "+Auto Spread", json_real(sip->auto_shield_spread));
|
||||
json_object_set_new(ship_data, "+Allow Bypass", json_boolean(sip->auto_shield_spread_bypass));
|
||||
json_object_set_new(ship_data, "+Spread From LOD", json_integer(sip->auto_shield_spread_from_lod));
|
||||
for(j = 0; j < sizeof(sip->shield_point_augment_ctrls) / sizeof(int); j++)
|
||||
{
|
||||
if(sip->shield_point_augment_ctrls[j] != -1)
|
||||
{
|
||||
insert_index = 0;
|
||||
json_array_foreach(Model_point_shield_controls, shield_point, quadrant)
|
||||
{
|
||||
insert_index = shield_point;
|
||||
if(sip->shield_point_augment_ctrls[j] < shield_point)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch(j)
|
||||
{
|
||||
case 0:
|
||||
json_array_insert_new(Model_point_shield_controls, insert_index, json_string("right"));
|
||||
break;
|
||||
case 1:
|
||||
json_array_insert_new(Model_point_shield_controls, insert_index, json_string("front"));
|
||||
break;
|
||||
case 2:
|
||||
json_array_insert_new(Model_point_shield_controls, insert_index, json_string("rear"));
|
||||
break;
|
||||
case 3:
|
||||
json_array_insert_new(Model_point_shield_controls, insert_index, json_string("left"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
json_object_set_new(ship_data, "$Model Point Shield Controls", Model_point_shield_controls);
|
||||
json_object_set_new(Shield_color, "red", json_integer(sip->shield_color[0]));
|
||||
json_object_set_new(Shield_color, "green", json_integer(sip->shield_color[1]));
|
||||
json_object_set_new(Shield_color, "blue", json_integer(sip->shield_color[2]));
|
||||
json_object_set_new(ship_data, "$Shield Color", Shield_color);
|
||||
json_object_set_new(ship_data, "$Power Output", json_real(sip->power_output));
|
||||
json_object_set_new(ship_data, "$Shield Regeneration Rate", json_real(sip->max_shield_regen_per_second));
|
||||
json_object_set_new(ship_data, "$Support Shield Repair Rate", json_real(sip->sup_shield_repair_rate * 100));
|
||||
json_object_set_new(ship_data, "$Weapon Regeneration Rate", json_real(sip->max_weapon_regen_per_second));
|
||||
json_object_set_new(ship_data, "$Max Oclk Speed", json_real(sip->max_overclocked_speed));
|
||||
json_object_set_new(ship_data, "$Max Weapon Eng", json_real(sip->max_weapon_reserve));
|
||||
json_object_set_new(ship_data, "$Hitpoints", json_real(sip->max_hull_strength));
|
||||
json_object_set_new(ship_data, "$Hull Repair Rate", json_real(sip->hull_repair_rate * 100));
|
||||
json_object_set_new(ship_data, "$Support Hull Repair Rate", json_real(sip->sup_hull_repair_rate * 100));
|
||||
json_object_set_new(ship_data, "$Subsystem Repair Rate", json_real(sip->subsys_repair_rate * 100));
|
||||
json_object_set_new(ship_data, "$Support Subsystem Repair Rate", json_real(sip->sup_subsys_repair_rate * 100));
|
||||
json_object_set_new(ship_data, "$Armor Type", ( (sip->armor_type_idx > -1) ? json_string(Armor_types[sip->armor_type_idx].GetNamePtr()) : json_null() ));
|
||||
json_object_set_new(ship_data, "$Shield Armor Type", ( (sip->shield_armor_type_idx > -1) ? json_string(Armor_types[sip->shield_armor_type_idx].GetNamePtr()) : json_null() ));
|
||||
// Skipping flags
|
||||
|
||||
json_array_append_new(Ships, ship_data);
|
||||
}
|
||||
|
||||
json_object_set_new(ships_obj, "Ships", Ships);
|
||||
|
||||
cf_create_default_path_string(full_name, sizeof(full_name) - 1, CF_TYPE_ROOT, outfile);
|
||||
json_dump_file(ships_obj, full_name, JSON_ESCAPE_SLASH | JSON_INDENT(4) | JSON_PRESERVE_ORDER | JSON_REAL_PRECISION(4));
|
||||
}
|
||||
@@ -2006,6 +2006,4 @@ int get_default_player_ship_index();
|
||||
*/
|
||||
int get_nearest_bbox_point(object *ship_obj, vec3d *start, vec3d *box_pt);
|
||||
|
||||
extern void ship_output_json(const char *outfile);
|
||||
|
||||
#endif
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "render/3d.h"
|
||||
#include "sound/sound.h"
|
||||
#include "sound/audiostr.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "globalincs/vmallocator.h"
|
||||
@@ -1518,6 +1519,12 @@ void adjust_volume_on_frame(float* volume_now, aav* data)
|
||||
//apply change
|
||||
*volume_now = data->start_volume + (data->delta * done);
|
||||
CLAMP(*volume_now, 0.0f, 1.0f);
|
||||
|
||||
// if setting music volume, trigger volume change in playing tracks
|
||||
// done here in order to avoid setting music volume in every frame regardless if it changed or not
|
||||
if (&aav_music_volume == volume_now) {
|
||||
audiostream_set_volume_all(Master_event_music_volume * aav_music_volume, ASF_EVENTMUSIC);
|
||||
}
|
||||
}
|
||||
|
||||
void snd_aav_init()
|
||||
|
||||
@@ -2338,6 +2338,30 @@ int beam_collide_ship(obj_pair *pair)
|
||||
int hull_enter_collision = model_collide(&mc_hull_enter);
|
||||
int hull_exit_collision = (beam_will_tool_target(b, ship_objp)) ? model_collide(&mc_hull_exit) : 0;
|
||||
|
||||
// If we have a range less than the "far" range, check if the ray actually hit within the range
|
||||
if (b->range < BEAM_FAR_LENGTH
|
||||
&& (shield_collision || hull_enter_collision || hull_exit_collision))
|
||||
{
|
||||
// We can't use hit_dist as "1" is the distance between p0 and p1
|
||||
float rangeSq = b->range * b->range;
|
||||
|
||||
// actually make sure that the collision points are within range of our beam
|
||||
if (shield_collision && vm_vec_dist_squared(&b->last_start, &mc_shield.hit_point_world) > rangeSq)
|
||||
{
|
||||
shield_collision = 0;
|
||||
}
|
||||
|
||||
if (hull_enter_collision && vm_vec_dist_squared(&b->last_start, &mc_hull_enter.hit_point_world) > rangeSq)
|
||||
{
|
||||
hull_enter_collision = 0;
|
||||
}
|
||||
|
||||
if (hull_exit_collision && vm_vec_dist_squared(&mc_hull_exit.hit_point_world, &b->last_start) > rangeSq)
|
||||
{
|
||||
hull_exit_collision = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// check shields for impact
|
||||
// (tooled ships are probably not going to be maintaining a shield over their exit hole,
|
||||
// therefore we need only check the entrance, just as with conventional weapons)
|
||||
|
||||
@@ -670,7 +670,4 @@ void weapon_pause_sounds();
|
||||
// Unpauses all running weapon sounds
|
||||
void weapon_unpause_sounds();
|
||||
|
||||
// Dumps parsed weapon data to a json file
|
||||
extern void weapons_output_json(const char *outfile);
|
||||
|
||||
#endif
|
||||
@@ -7022,8 +7022,3 @@ void weapon_unpause_sounds()
|
||||
// Pause all beam sounds
|
||||
beam_unpause_sounds();
|
||||
}
|
||||
|
||||
void weapons_output_json(const char *outfile)
|
||||
{
|
||||
mprintf(("Exporting weapon data to json.\n"));
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ dnl configure.ac for fs2_open
|
||||
dnl
|
||||
dnl $Id: configure.ac,v 1.31.2.4 2007-05-28 19:36:12 taylor Exp $
|
||||
|
||||
AC_INIT(fs2_open, 3.7.1)
|
||||
AC_INIT(fs2_open, 3.7.2)
|
||||
AC_CONFIG_SRCDIR(code/freespace2/freespace.cpp)
|
||||
|
||||
dnl we need at least version 2.54 of autoconf
|
||||
|
||||
+1553
-2651
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009-2014 Petri Lehtinen <[email protected]>
|
||||
Copyright (c) 2009-2013 Petri Lehtinen <[email protected]>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+13
-19
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -22,9 +22,6 @@
|
||||
#define MAX_INTEGER_STR_LENGTH 100
|
||||
#define MAX_REAL_STR_LENGTH 100
|
||||
|
||||
#define FLAGS_TO_INDENT(f) ((f) & 0x1F)
|
||||
#define FLAGS_TO_PRECISION(f) (((f) >> 11) & 0x1F)
|
||||
|
||||
struct object_key {
|
||||
size_t serial;
|
||||
const char *key;
|
||||
@@ -48,9 +45,9 @@ static const char whitespace[] = " ";
|
||||
|
||||
static int dump_indent(size_t flags, int depth, int space, json_dump_callback_t dump, void *data)
|
||||
{
|
||||
if(FLAGS_TO_INDENT(flags) > 0)
|
||||
if(JSON_INDENT(flags) > 0)
|
||||
{
|
||||
int i, ws_count = FLAGS_TO_INDENT(flags);
|
||||
int i, ws_count = JSON_INDENT(flags);
|
||||
|
||||
if(dump("\n", 1, data))
|
||||
return -1;
|
||||
@@ -68,25 +65,24 @@ static int dump_indent(size_t flags, int depth, int space, json_dump_callback_t
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dump_string(const char *str, size_t len, json_dump_callback_t dump, void *data, size_t flags)
|
||||
static int dump_string(const char *str, json_dump_callback_t dump, void *data, size_t flags)
|
||||
{
|
||||
const char *pos, *end, *lim;
|
||||
const char *pos, *end;
|
||||
int32_t codepoint;
|
||||
|
||||
if(dump("\"", 1, data))
|
||||
return -1;
|
||||
|
||||
end = pos = str;
|
||||
lim = str + len;
|
||||
while(1)
|
||||
{
|
||||
const char *text;
|
||||
char seq[13];
|
||||
int length;
|
||||
|
||||
while(end < lim)
|
||||
while(*end)
|
||||
{
|
||||
end = utf8_iterate(pos, lim - pos, &codepoint);
|
||||
end = utf8_iterate(pos, &codepoint);
|
||||
if(!end)
|
||||
return -1;
|
||||
|
||||
@@ -130,7 +126,7 @@ static int dump_string(const char *str, size_t len, json_dump_callback_t dump, v
|
||||
/* codepoint is in BMP */
|
||||
if(codepoint < 0x10000)
|
||||
{
|
||||
sprintf(seq, "\\u%04X", codepoint);
|
||||
sprintf(seq, "\\u%04x", codepoint);
|
||||
length = 6;
|
||||
}
|
||||
|
||||
@@ -143,7 +139,7 @@ static int dump_string(const char *str, size_t len, json_dump_callback_t dump, v
|
||||
first = 0xD800 | ((codepoint & 0xffc00) >> 10);
|
||||
last = 0xDC00 | (codepoint & 0x003ff);
|
||||
|
||||
sprintf(seq, "\\u%04X\\u%04X", first, last);
|
||||
sprintf(seq, "\\u%04x\\u%04x", first, last);
|
||||
length = 12;
|
||||
}
|
||||
|
||||
@@ -211,8 +207,7 @@ static int do_dump(const json_t *json, size_t flags, int depth,
|
||||
int size;
|
||||
double value = json_real_value(json);
|
||||
|
||||
size = jsonp_dtostr(buffer, MAX_REAL_STR_LENGTH, value,
|
||||
FLAGS_TO_PRECISION(flags));
|
||||
size = jsonp_dtostr(buffer, MAX_REAL_STR_LENGTH, value);
|
||||
if(size < 0)
|
||||
return -1;
|
||||
|
||||
@@ -220,7 +215,7 @@ static int do_dump(const json_t *json, size_t flags, int depth,
|
||||
}
|
||||
|
||||
case JSON_STRING:
|
||||
return dump_string(json_string_value(json), json_string_length(json), dump, data, flags);
|
||||
return dump_string(json_string_value(json), dump, data, flags);
|
||||
|
||||
case JSON_ARRAY:
|
||||
{
|
||||
@@ -341,7 +336,7 @@ static int do_dump(const json_t *json, size_t flags, int depth,
|
||||
value = json_object_get(json, key);
|
||||
assert(value);
|
||||
|
||||
dump_string(key, strlen(key), dump, data, flags);
|
||||
dump_string(key, dump, data, flags);
|
||||
if(dump(separator, separator_length, data) ||
|
||||
do_dump(value, flags, depth + 1, dump, data))
|
||||
{
|
||||
@@ -377,9 +372,8 @@ static int do_dump(const json_t *json, size_t flags, int depth,
|
||||
while(iter)
|
||||
{
|
||||
void *next = json_object_iter_next((json_t *)json, iter);
|
||||
const char *key = json_object_iter_key(iter);
|
||||
|
||||
dump_string(key, strlen(key), dump, data, flags);
|
||||
dump_string(json_object_iter_key(iter), dump, data, flags);
|
||||
if(dump(separator, separator_length, data) ||
|
||||
do_dump(json_object_iter_value(iter), flags, depth + 1,
|
||||
dump, data))
|
||||
|
||||
+44
-36
@@ -1,21 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <jansson_private_config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <jansson_config.h> /* for JSON_INLINE */
|
||||
#include "jansson_private.h" /* for container_of() */
|
||||
#include "hashtable.h"
|
||||
@@ -24,13 +15,24 @@ typedef struct hashtable_list list_t;
|
||||
typedef struct hashtable_pair pair_t;
|
||||
typedef struct hashtable_bucket bucket_t;
|
||||
|
||||
extern volatile uint32_t hashtable_seed;
|
||||
|
||||
/* Implementation of the hash function */
|
||||
#include "lookup3.h"
|
||||
|
||||
#define list_to_pair(list_) container_of(list_, pair_t, list)
|
||||
#define hash_str(key) ((size_t)hashlittle((key), strlen(key), hashtable_seed))
|
||||
|
||||
/* From http://www.cse.yorku.ca/~oz/hash.html */
|
||||
static size_t hash_str(const void *ptr)
|
||||
{
|
||||
const char *str = (const char *)ptr;
|
||||
|
||||
size_t hash = 5381;
|
||||
size_t c;
|
||||
|
||||
while((c = (size_t)*str))
|
||||
{
|
||||
hash = ((hash << 5) + hash) + c;
|
||||
str++;
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
static JSON_INLINE void list_init(list_t *list)
|
||||
{
|
||||
@@ -72,6 +74,19 @@ static void insert_to_bucket(hashtable_t *hashtable, bucket_t *bucket,
|
||||
}
|
||||
}
|
||||
|
||||
static const size_t primes[] = {
|
||||
5, 13, 23, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593,
|
||||
49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469,
|
||||
12582917, 25165843, 50331653, 100663319, 201326611, 402653189,
|
||||
805306457, 1610612741
|
||||
};
|
||||
|
||||
static JSON_INLINE size_t num_buckets(hashtable_t *hashtable)
|
||||
{
|
||||
return primes[hashtable->num_buckets];
|
||||
}
|
||||
|
||||
|
||||
static pair_t *hashtable_find_pair(hashtable_t *hashtable, bucket_t *bucket,
|
||||
const char *key, size_t hash)
|
||||
{
|
||||
@@ -105,7 +120,7 @@ static int hashtable_do_del(hashtable_t *hashtable,
|
||||
bucket_t *bucket;
|
||||
size_t index;
|
||||
|
||||
index = hash & hashmask(hashtable->order);
|
||||
index = hash % num_buckets(hashtable);
|
||||
bucket = &hashtable->buckets[index];
|
||||
|
||||
pair = hashtable_find_pair(hashtable, bucket, key, hash);
|
||||
@@ -152,14 +167,14 @@ static int hashtable_do_rehash(hashtable_t *hashtable)
|
||||
|
||||
jsonp_free(hashtable->buckets);
|
||||
|
||||
hashtable->order++;
|
||||
new_size = hashsize(hashtable->order);
|
||||
hashtable->num_buckets++;
|
||||
new_size = num_buckets(hashtable);
|
||||
|
||||
hashtable->buckets = jsonp_malloc(new_size * sizeof(bucket_t));
|
||||
if(!hashtable->buckets)
|
||||
return -1;
|
||||
|
||||
for(i = 0; i < hashsize(hashtable->order); i++)
|
||||
for(i = 0; i < num_buckets(hashtable); i++)
|
||||
{
|
||||
hashtable->buckets[i].first = hashtable->buckets[i].last =
|
||||
&hashtable->list;
|
||||
@@ -184,14 +199,14 @@ int hashtable_init(hashtable_t *hashtable)
|
||||
size_t i;
|
||||
|
||||
hashtable->size = 0;
|
||||
hashtable->order = 3;
|
||||
hashtable->buckets = jsonp_malloc(hashsize(hashtable->order) * sizeof(bucket_t));
|
||||
hashtable->num_buckets = 0; /* index to primes[] */
|
||||
hashtable->buckets = jsonp_malloc(num_buckets(hashtable) * sizeof(bucket_t));
|
||||
if(!hashtable->buckets)
|
||||
return -1;
|
||||
|
||||
list_init(&hashtable->list);
|
||||
|
||||
for(i = 0; i < hashsize(hashtable->order); i++)
|
||||
for(i = 0; i < num_buckets(hashtable); i++)
|
||||
{
|
||||
hashtable->buckets[i].first = hashtable->buckets[i].last =
|
||||
&hashtable->list;
|
||||
@@ -215,12 +230,12 @@ int hashtable_set(hashtable_t *hashtable,
|
||||
size_t hash, index;
|
||||
|
||||
/* rehash if the load ratio exceeds 1 */
|
||||
if(hashtable->size >= hashsize(hashtable->order))
|
||||
if(hashtable->size >= num_buckets(hashtable))
|
||||
if(hashtable_do_rehash(hashtable))
|
||||
return -1;
|
||||
|
||||
hash = hash_str(key);
|
||||
index = hash & hashmask(hashtable->order);
|
||||
index = hash % num_buckets(hashtable);
|
||||
bucket = &hashtable->buckets[index];
|
||||
pair = hashtable_find_pair(hashtable, bucket, key, hash);
|
||||
|
||||
@@ -234,14 +249,7 @@ int hashtable_set(hashtable_t *hashtable,
|
||||
/* offsetof(...) returns the size of pair_t without the last,
|
||||
flexible member. This way, the correct amount is
|
||||
allocated. */
|
||||
|
||||
size_t len = strlen(key);
|
||||
if(len >= (size_t)-1 - offsetof(pair_t, key)) {
|
||||
/* Avoid an overflow if the key is very long */
|
||||
return -1;
|
||||
}
|
||||
|
||||
pair = jsonp_malloc(offsetof(pair_t, key) + len + 1);
|
||||
pair = jsonp_malloc(offsetof(pair_t, key) + strlen(key) + 1);
|
||||
if(!pair)
|
||||
return -1;
|
||||
|
||||
@@ -265,7 +273,7 @@ void *hashtable_get(hashtable_t *hashtable, const char *key)
|
||||
bucket_t *bucket;
|
||||
|
||||
hash = hash_str(key);
|
||||
bucket = &hashtable->buckets[hash & hashmask(hashtable->order)];
|
||||
bucket = &hashtable->buckets[hash % num_buckets(hashtable)];
|
||||
|
||||
pair = hashtable_find_pair(hashtable, bucket, key, hash);
|
||||
if(!pair)
|
||||
@@ -286,7 +294,7 @@ void hashtable_clear(hashtable_t *hashtable)
|
||||
|
||||
hashtable_do_clear(hashtable);
|
||||
|
||||
for(i = 0; i < hashsize(hashtable->order); i++)
|
||||
for(i = 0; i < num_buckets(hashtable); i++)
|
||||
{
|
||||
hashtable->buckets[i].first = hashtable->buckets[i].last =
|
||||
&hashtable->list;
|
||||
@@ -308,7 +316,7 @@ void *hashtable_iter_at(hashtable_t *hashtable, const char *key)
|
||||
bucket_t *bucket;
|
||||
|
||||
hash = hash_str(key);
|
||||
bucket = &hashtable->buckets[hash & hashmask(hashtable->order)];
|
||||
bucket = &hashtable->buckets[hash % num_buckets(hashtable)];
|
||||
|
||||
pair = hashtable_find_pair(hashtable, bucket, key, hash);
|
||||
if(!pair)
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -32,7 +32,7 @@ struct hashtable_bucket {
|
||||
typedef struct hashtable {
|
||||
size_t size;
|
||||
struct hashtable_bucket *buckets;
|
||||
size_t order; /* hashtable has pow(2, order) buckets */
|
||||
size_t num_buckets; /* index to primes[] */
|
||||
struct hashtable_list list;
|
||||
} hashtable_t;
|
||||
|
||||
@@ -40,7 +40,6 @@ typedef struct hashtable {
|
||||
#define hashtable_key_to_iter(key_) \
|
||||
(&(container_of(key_, struct hashtable_pair, key)->list))
|
||||
|
||||
|
||||
/**
|
||||
* hashtable_init - Initialize a hashtable object
|
||||
*
|
||||
|
||||
@@ -1,277 +0,0 @@
|
||||
/* Generate sizeof(uint32_t) bytes of as random data as possible to seed
|
||||
the hash function.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <jansson_private_config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SCHED_H
|
||||
#include <sched.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
/* For GetModuleHandle(), GetProcAddress() and GetCurrentProcessId() */
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "jansson.h"
|
||||
|
||||
|
||||
static uint32_t buf_to_uint32(char *data) {
|
||||
size_t i;
|
||||
uint32_t result = 0;
|
||||
|
||||
for (i = 0; i < sizeof(uint32_t); i++)
|
||||
result = (result << 8) | (unsigned char)data[i];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* /dev/urandom */
|
||||
#if !defined(_WIN32) && defined(USE_URANDOM)
|
||||
static int seed_from_urandom(uint32_t *seed) {
|
||||
/* Use unbuffered I/O if we have open(), close() and read(). Otherwise
|
||||
fall back to fopen() */
|
||||
|
||||
char data[sizeof(uint32_t)];
|
||||
int ok;
|
||||
|
||||
#if defined(HAVE_OPEN) && defined(HAVE_CLOSE) && defined(HAVE_READ)
|
||||
int urandom;
|
||||
urandom = open("/dev/urandom", O_RDONLY);
|
||||
if (urandom == -1)
|
||||
return 1;
|
||||
|
||||
ok = read(urandom, data, sizeof(uint32_t)) == sizeof(uint32_t);
|
||||
close(urandom);
|
||||
#else
|
||||
FILE *urandom;
|
||||
|
||||
urandom = fopen("/dev/urandom", "rb");
|
||||
if (!urandom)
|
||||
return 1;
|
||||
|
||||
ok = fread(data, 1, sizeof(uint32_t), urandom) == sizeof(uint32_t);
|
||||
fclose(urandom);
|
||||
#endif
|
||||
|
||||
if (!ok)
|
||||
return 1;
|
||||
|
||||
*seed = buf_to_uint32(data);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Windows Crypto API */
|
||||
#if defined(_WIN32) && defined(USE_WINDOWS_CRYPTOAPI)
|
||||
#include <wincrypt.h>
|
||||
|
||||
typedef BOOL (WINAPI *CRYPTACQUIRECONTEXTA)(HCRYPTPROV *phProv, LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags);
|
||||
typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer);
|
||||
typedef BOOL (WINAPI *CRYPTRELEASECONTEXT)(HCRYPTPROV hProv, DWORD dwFlags);
|
||||
|
||||
static int seed_from_windows_cryptoapi(uint32_t *seed)
|
||||
{
|
||||
HINSTANCE hAdvAPI32 = NULL;
|
||||
CRYPTACQUIRECONTEXTA pCryptAcquireContext = NULL;
|
||||
CRYPTGENRANDOM pCryptGenRandom = NULL;
|
||||
CRYPTRELEASECONTEXT pCryptReleaseContext = NULL;
|
||||
HCRYPTPROV hCryptProv = 0;
|
||||
BYTE data[sizeof(uint32_t)];
|
||||
int ok;
|
||||
|
||||
hAdvAPI32 = GetModuleHandle(TEXT("advapi32.dll"));
|
||||
if(hAdvAPI32 == NULL)
|
||||
return 1;
|
||||
|
||||
pCryptAcquireContext = (CRYPTACQUIRECONTEXTA)GetProcAddress(hAdvAPI32, "CryptAcquireContextA");
|
||||
if (!pCryptAcquireContext)
|
||||
return 1;
|
||||
|
||||
pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(hAdvAPI32, "CryptGenRandom");
|
||||
if (!pCryptGenRandom)
|
||||
return 1;
|
||||
|
||||
pCryptReleaseContext = (CRYPTRELEASECONTEXT)GetProcAddress(hAdvAPI32, "CryptReleaseContext");
|
||||
if (!pCryptReleaseContext)
|
||||
return 1;
|
||||
|
||||
if (!pCryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
|
||||
return 1;
|
||||
|
||||
ok = pCryptGenRandom(hCryptProv, sizeof(uint32_t), data);
|
||||
pCryptReleaseContext(hCryptProv, 0);
|
||||
|
||||
if (!ok)
|
||||
return 1;
|
||||
|
||||
*seed = buf_to_uint32((char *)data);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* gettimeofday() and getpid() */
|
||||
static int seed_from_timestamp_and_pid(uint32_t *seed) {
|
||||
#ifdef HAVE_GETTIMEOFDAY
|
||||
/* XOR of seconds and microseconds */
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
*seed = (uint32_t)tv.tv_sec ^ (uint32_t)tv.tv_usec;
|
||||
#else
|
||||
/* Seconds only */
|
||||
*seed = (uint32_t)time(NULL);
|
||||
#endif
|
||||
|
||||
/* XOR with PID for more randomness */
|
||||
#if defined(_WIN32)
|
||||
*seed ^= (uint32_t)GetCurrentProcessId();
|
||||
#elif defined(HAVE_GETPID)
|
||||
*seed ^= (uint32_t)getpid();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint32_t generate_seed() {
|
||||
uint32_t seed;
|
||||
int done = 0;
|
||||
|
||||
#if !defined(_WIN32) && defined(USE_URANDOM)
|
||||
if (!done && seed_from_urandom(&seed) == 0)
|
||||
done = 1;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(USE_WINDOWS_CRYPTOAPI)
|
||||
if (!done && seed_from_windows_cryptoapi(&seed) == 0)
|
||||
done = 1;
|
||||
#endif
|
||||
|
||||
if (!done) {
|
||||
/* Fall back to timestamp and PID if no better randomness is
|
||||
available */
|
||||
seed_from_timestamp_and_pid(&seed);
|
||||
}
|
||||
|
||||
/* Make sure the seed is never zero */
|
||||
if (seed == 0)
|
||||
seed = 1;
|
||||
|
||||
return seed;
|
||||
}
|
||||
|
||||
|
||||
volatile uint32_t hashtable_seed = 0;
|
||||
|
||||
#if defined(HAVE_ATOMIC_BUILTINS) && (defined(HAVE_SCHED_YIELD) || !defined(_WIN32))
|
||||
static volatile char seed_initialized = 0;
|
||||
|
||||
void json_object_seed(size_t seed) {
|
||||
uint32_t new_seed = (uint32_t)seed;
|
||||
|
||||
if (hashtable_seed == 0) {
|
||||
if (__atomic_test_and_set(&seed_initialized, __ATOMIC_RELAXED) == 0) {
|
||||
/* Do the seeding ourselves */
|
||||
if (new_seed == 0)
|
||||
new_seed = generate_seed();
|
||||
|
||||
__atomic_store_n(&hashtable_seed, new_seed, __ATOMIC_RELEASE);
|
||||
} else {
|
||||
/* Wait for another thread to do the seeding */
|
||||
do {
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
sched_yield();
|
||||
#endif
|
||||
} while(__atomic_load_n(&hashtable_seed, __ATOMIC_ACQUIRE) == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif defined(HAVE_SYNC_BUILTINS) && (defined(HAVE_SCHED_YIELD) || !defined(_WIN32))
|
||||
void json_object_seed(size_t seed) {
|
||||
uint32_t new_seed = (uint32_t)seed;
|
||||
|
||||
if (hashtable_seed == 0) {
|
||||
if (new_seed == 0) {
|
||||
/* Explicit synchronization fences are not supported by the
|
||||
__sync builtins, so every thread getting here has to
|
||||
generate the seed value.
|
||||
*/
|
||||
new_seed = generate_seed();
|
||||
}
|
||||
|
||||
do {
|
||||
if (__sync_bool_compare_and_swap(&hashtable_seed, 0, new_seed)) {
|
||||
/* We were the first to seed */
|
||||
break;
|
||||
} else {
|
||||
/* Wait for another thread to do the seeding */
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
sched_yield();
|
||||
#endif
|
||||
}
|
||||
} while(hashtable_seed == 0);
|
||||
}
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
static long seed_initialized = 0;
|
||||
void json_object_seed(size_t seed) {
|
||||
uint32_t new_seed = (uint32_t)seed;
|
||||
|
||||
if (hashtable_seed == 0) {
|
||||
if (InterlockedIncrement(&seed_initialized) == 1) {
|
||||
/* Do the seeding ourselves */
|
||||
if (new_seed == 0)
|
||||
new_seed = generate_seed();
|
||||
|
||||
hashtable_seed = new_seed;
|
||||
} else {
|
||||
/* Wait for another thread to do the seeding */
|
||||
do {
|
||||
SwitchToThread();
|
||||
} while (hashtable_seed == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Fall back to a thread-unsafe version */
|
||||
void json_object_seed(size_t seed) {
|
||||
uint32_t new_seed = (uint32_t)seed;
|
||||
|
||||
if (hashtable_seed == 0) {
|
||||
if (new_seed == 0)
|
||||
new_seed = generate_seed();
|
||||
|
||||
hashtable_seed = new_seed;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+19
-28
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -21,11 +21,11 @@ extern "C" {
|
||||
/* version */
|
||||
|
||||
#define JANSSON_MAJOR_VERSION 2
|
||||
#define JANSSON_MINOR_VERSION 7
|
||||
#define JANSSON_MINOR_VERSION 5
|
||||
#define JANSSON_MICRO_VERSION 0
|
||||
|
||||
/* Micro version is omitted if it's 0 */
|
||||
#define JANSSON_VERSION "2.7"
|
||||
#define JANSSON_VERSION "2.5"
|
||||
|
||||
/* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this
|
||||
for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */
|
||||
@@ -67,26 +67,23 @@ typedef long json_int_t;
|
||||
#endif
|
||||
|
||||
#define json_typeof(json) ((json)->type)
|
||||
#define json_is_object(json) ((json) && json_typeof(json) == JSON_OBJECT)
|
||||
#define json_is_array(json) ((json) && json_typeof(json) == JSON_ARRAY)
|
||||
#define json_is_string(json) ((json) && json_typeof(json) == JSON_STRING)
|
||||
#define json_is_integer(json) ((json) && json_typeof(json) == JSON_INTEGER)
|
||||
#define json_is_real(json) ((json) && json_typeof(json) == JSON_REAL)
|
||||
#define json_is_object(json) (json && json_typeof(json) == JSON_OBJECT)
|
||||
#define json_is_array(json) (json && json_typeof(json) == JSON_ARRAY)
|
||||
#define json_is_string(json) (json && json_typeof(json) == JSON_STRING)
|
||||
#define json_is_integer(json) (json && json_typeof(json) == JSON_INTEGER)
|
||||
#define json_is_real(json) (json && json_typeof(json) == JSON_REAL)
|
||||
#define json_is_number(json) (json_is_integer(json) || json_is_real(json))
|
||||
#define json_is_true(json) ((json) && json_typeof(json) == JSON_TRUE)
|
||||
#define json_is_false(json) ((json) && json_typeof(json) == JSON_FALSE)
|
||||
#define json_boolean_value json_is_true
|
||||
#define json_is_true(json) (json && json_typeof(json) == JSON_TRUE)
|
||||
#define json_is_false(json) (json && json_typeof(json) == JSON_FALSE)
|
||||
#define json_is_boolean(json) (json_is_true(json) || json_is_false(json))
|
||||
#define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL)
|
||||
#define json_is_null(json) (json && json_typeof(json) == JSON_NULL)
|
||||
|
||||
/* construction, destruction, reference counting */
|
||||
|
||||
json_t *json_object(void);
|
||||
json_t *json_array(void);
|
||||
json_t *json_string(const char *value);
|
||||
json_t *json_stringn(const char *value, size_t len);
|
||||
json_t *json_string_nocheck(const char *value);
|
||||
json_t *json_stringn_nocheck(const char *value, size_t len);
|
||||
json_t *json_integer(json_int_t value);
|
||||
json_t *json_real(double value);
|
||||
json_t *json_true(void);
|
||||
@@ -129,7 +126,6 @@ typedef struct {
|
||||
|
||||
/* getters, setters, manipulation */
|
||||
|
||||
void json_object_seed(size_t seed);
|
||||
size_t json_object_size(const json_t *object);
|
||||
json_t *json_object_get(const json_t *object, const char *key);
|
||||
int json_object_set_new(json_t *object, const char *key, json_t *value);
|
||||
@@ -203,18 +199,16 @@ int json_array_insert(json_t *array, size_t ind, json_t *value)
|
||||
}
|
||||
|
||||
const char *json_string_value(const json_t *string);
|
||||
size_t json_string_length(const json_t *string);
|
||||
json_int_t json_integer_value(const json_t *integer);
|
||||
double json_real_value(const json_t *real);
|
||||
double json_number_value(const json_t *json);
|
||||
|
||||
int json_string_set(json_t *string, const char *value);
|
||||
int json_string_setn(json_t *string, const char *value, size_t len);
|
||||
int json_string_set_nocheck(json_t *string, const char *value);
|
||||
int json_string_setn_nocheck(json_t *string, const char *value, size_t len);
|
||||
int json_integer_set(json_t *integer, json_int_t value);
|
||||
int json_real_set(json_t *real, double value);
|
||||
|
||||
|
||||
/* pack, unpack */
|
||||
|
||||
json_t *json_pack(const char *fmt, ...);
|
||||
@@ -246,7 +240,6 @@ json_t *json_deep_copy(const json_t *value);
|
||||
#define JSON_DISABLE_EOF_CHECK 0x2
|
||||
#define JSON_DECODE_ANY 0x4
|
||||
#define JSON_DECODE_INT_AS_REAL 0x8
|
||||
#define JSON_ALLOW_NUL 0x10
|
||||
|
||||
typedef size_t (*json_load_callback_t)(void *buffer, size_t buflen, void *data);
|
||||
|
||||
@@ -259,15 +252,13 @@ json_t *json_load_callback(json_load_callback_t callback, void *data, size_t fla
|
||||
|
||||
/* encoding */
|
||||
|
||||
#define JSON_MAX_INDENT 0x1F
|
||||
#define JSON_INDENT(n) ((n) & JSON_MAX_INDENT)
|
||||
#define JSON_COMPACT 0x20
|
||||
#define JSON_ENSURE_ASCII 0x40
|
||||
#define JSON_SORT_KEYS 0x80
|
||||
#define JSON_PRESERVE_ORDER 0x100
|
||||
#define JSON_ENCODE_ANY 0x200
|
||||
#define JSON_ESCAPE_SLASH 0x400
|
||||
#define JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11)
|
||||
#define JSON_INDENT(n) (n & 0x1F)
|
||||
#define JSON_COMPACT 0x20
|
||||
#define JSON_ENSURE_ASCII 0x40
|
||||
#define JSON_SORT_KEYS 0x80
|
||||
#define JSON_PRESERVE_ORDER 0x100
|
||||
#define JSON_ENCODE_ANY 0x200
|
||||
#define JSON_ESCAPE_SLASH 0x400
|
||||
|
||||
typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2010-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -49,7 +49,6 @@ typedef struct {
|
||||
typedef struct {
|
||||
json_t json;
|
||||
char *value;
|
||||
size_t length;
|
||||
} json_string_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -65,13 +64,9 @@ typedef struct {
|
||||
#define json_to_object(json_) container_of(json_, json_object_t, json)
|
||||
#define json_to_array(json_) container_of(json_, json_array_t, json)
|
||||
#define json_to_string(json_) container_of(json_, json_string_t, json)
|
||||
#define json_to_real(json_) container_of(json_, json_real_t, json)
|
||||
#define json_to_real(json_) container_of(json_, json_real_t, json)
|
||||
#define json_to_integer(json_) container_of(json_, json_integer_t, json)
|
||||
|
||||
/* Create a string by taking ownership of an existing buffer */
|
||||
json_t *jsonp_stringn_nocheck_own(const char *value, size_t len);
|
||||
|
||||
/* Error message formatting */
|
||||
void jsonp_error_init(json_error_t *error, const char *source);
|
||||
void jsonp_error_set_source(json_error_t *error, const char *source);
|
||||
void jsonp_error_set(json_error_t *error, int line, int column,
|
||||
@@ -81,14 +76,13 @@ void jsonp_error_vset(json_error_t *error, int line, int column,
|
||||
|
||||
/* Locale independent string<->double conversions */
|
||||
int jsonp_strtod(strbuffer_t *strbuffer, double *out);
|
||||
int jsonp_dtostr(char *buffer, size_t size, double value, int prec);
|
||||
int jsonp_dtostr(char *buffer, size_t size, double value);
|
||||
|
||||
/* Wrappers for custom memory functions */
|
||||
void* jsonp_malloc(size_t size);
|
||||
void jsonp_free(void *ptr);
|
||||
char *jsonp_strndup(const char *str, size_t length);
|
||||
char *jsonp_strdup(const char *str);
|
||||
char *jsonp_strndup(const char *str, size_t len);
|
||||
|
||||
/* Windows compatibility */
|
||||
#ifdef _WIN32
|
||||
|
||||
+39
-67
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -63,10 +63,7 @@ typedef struct {
|
||||
strbuffer_t saved_text;
|
||||
int token;
|
||||
union {
|
||||
struct {
|
||||
char *val;
|
||||
size_t len;
|
||||
} string;
|
||||
char *string;
|
||||
json_int_t integer;
|
||||
double real;
|
||||
} value;
|
||||
@@ -282,13 +279,6 @@ static void lex_save_cached(lex_t *lex)
|
||||
}
|
||||
}
|
||||
|
||||
static void lex_free_string(lex_t *lex)
|
||||
{
|
||||
jsonp_free(lex->value.string.val);
|
||||
lex->value.string.val = NULL;
|
||||
lex->value.string.len = 0;
|
||||
}
|
||||
|
||||
/* assumes that str points to 'u' plus at least 4 valid hex digits */
|
||||
static int32_t decode_unicode_escape(const char *str)
|
||||
{
|
||||
@@ -307,7 +297,7 @@ static int32_t decode_unicode_escape(const char *str)
|
||||
else if(l_isupper(c))
|
||||
value += c - 'A' + 10;
|
||||
else
|
||||
return -1;
|
||||
assert(0);
|
||||
}
|
||||
|
||||
return value;
|
||||
@@ -320,7 +310,7 @@ static void lex_scan_string(lex_t *lex, json_error_t *error)
|
||||
char *t;
|
||||
int i;
|
||||
|
||||
lex->value.string.val = NULL;
|
||||
lex->value.string = NULL;
|
||||
lex->token = TOKEN_INVALID;
|
||||
|
||||
c = lex_get_save(lex, error);
|
||||
@@ -375,12 +365,14 @@ static void lex_scan_string(lex_t *lex, json_error_t *error)
|
||||
- two \uXXXX escapes (length 12) forming an UTF-16 surrogate pair
|
||||
are converted to 4 bytes
|
||||
*/
|
||||
t = jsonp_malloc(lex->saved_text.length + 1);
|
||||
if(!t) {
|
||||
lex->value.string = jsonp_malloc(lex->saved_text.length + 1);
|
||||
if(!lex->value.string) {
|
||||
/* this is not very nice, since TOKEN_INVALID is returned */
|
||||
goto out;
|
||||
}
|
||||
lex->value.string.val = t;
|
||||
|
||||
/* the target */
|
||||
t = lex->value.string;
|
||||
|
||||
/* + 1 to skip the " */
|
||||
p = strbuffer_value(&lex->saved_text) + 1;
|
||||
@@ -389,24 +381,17 @@ static void lex_scan_string(lex_t *lex, json_error_t *error)
|
||||
if(*p == '\\') {
|
||||
p++;
|
||||
if(*p == 'u') {
|
||||
size_t length;
|
||||
char buffer[4];
|
||||
int length;
|
||||
int32_t value;
|
||||
|
||||
value = decode_unicode_escape(p);
|
||||
if(value < 0) {
|
||||
error_set(error, lex, "invalid Unicode escape '%.6s'", p - 1);
|
||||
goto out;
|
||||
}
|
||||
p += 5;
|
||||
|
||||
if(0xD800 <= value && value <= 0xDBFF) {
|
||||
/* surrogate pair */
|
||||
if(*p == '\\' && *(p + 1) == 'u') {
|
||||
int32_t value2 = decode_unicode_escape(++p);
|
||||
if(value2 < 0) {
|
||||
error_set(error, lex, "invalid Unicode escape '%.6s'", p - 1);
|
||||
goto out;
|
||||
}
|
||||
p += 5;
|
||||
|
||||
if(0xDC00 <= value2 && value2 <= 0xDFFF) {
|
||||
@@ -435,9 +420,16 @@ static void lex_scan_string(lex_t *lex, json_error_t *error)
|
||||
error_set(error, lex, "invalid Unicode '\\u%04X'", value);
|
||||
goto out;
|
||||
}
|
||||
else if(value == 0)
|
||||
{
|
||||
error_set(error, lex, "\\u0000 is not allowed");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if(utf8_encode(value, t, &length))
|
||||
if(utf8_encode(value, buffer, &length))
|
||||
assert(0);
|
||||
|
||||
memcpy(t, buffer, length);
|
||||
t += length;
|
||||
}
|
||||
else {
|
||||
@@ -459,12 +451,11 @@ static void lex_scan_string(lex_t *lex, json_error_t *error)
|
||||
*(t++) = *(p++);
|
||||
}
|
||||
*t = '\0';
|
||||
lex->value.string.len = t - lex->value.string.val;
|
||||
lex->token = TOKEN_STRING;
|
||||
return;
|
||||
|
||||
out:
|
||||
lex_free_string(lex);
|
||||
jsonp_free(lex->value.string);
|
||||
}
|
||||
|
||||
#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */
|
||||
@@ -483,7 +474,7 @@ static int lex_scan_number(lex_t *lex, int c, json_error_t *error)
|
||||
{
|
||||
const char *saved_text;
|
||||
char *end;
|
||||
double doubleval;
|
||||
double value;
|
||||
|
||||
lex->token = TOKEN_INVALID;
|
||||
|
||||
@@ -508,16 +499,16 @@ static int lex_scan_number(lex_t *lex, int c, json_error_t *error)
|
||||
}
|
||||
|
||||
if(c != '.' && c != 'E' && c != 'e') {
|
||||
json_int_t intval;
|
||||
json_int_t value;
|
||||
|
||||
lex_unget_unsave(lex, c);
|
||||
|
||||
saved_text = strbuffer_value(&lex->saved_text);
|
||||
|
||||
errno = 0;
|
||||
intval = json_strtoint(saved_text, &end, 10);
|
||||
value = json_strtoint(saved_text, &end, 10);
|
||||
if(errno == ERANGE) {
|
||||
if(intval < 0)
|
||||
if(value < 0)
|
||||
error_set(error, lex, "too big negative integer");
|
||||
else
|
||||
error_set(error, lex, "too big integer");
|
||||
@@ -527,7 +518,7 @@ static int lex_scan_number(lex_t *lex, int c, json_error_t *error)
|
||||
assert(end == saved_text + lex->saved_text.length);
|
||||
|
||||
lex->token = TOKEN_INTEGER;
|
||||
lex->value.integer = intval;
|
||||
lex->value.integer = value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -561,13 +552,13 @@ static int lex_scan_number(lex_t *lex, int c, json_error_t *error)
|
||||
|
||||
lex_unget_unsave(lex, c);
|
||||
|
||||
if(jsonp_strtod(&lex->saved_text, &doubleval)) {
|
||||
if(jsonp_strtod(&lex->saved_text, &value)) {
|
||||
error_set(error, lex, "real number overflow");
|
||||
goto out;
|
||||
}
|
||||
|
||||
lex->token = TOKEN_REAL;
|
||||
lex->value.real = doubleval;
|
||||
lex->value.real = value;
|
||||
return 0;
|
||||
|
||||
out:
|
||||
@@ -580,8 +571,10 @@ static int lex_scan(lex_t *lex, json_error_t *error)
|
||||
|
||||
strbuffer_clear(&lex->saved_text);
|
||||
|
||||
if(lex->token == TOKEN_STRING)
|
||||
lex_free_string(lex);
|
||||
if(lex->token == TOKEN_STRING) {
|
||||
jsonp_free(lex->value.string);
|
||||
lex->value.string = NULL;
|
||||
}
|
||||
|
||||
c = lex_get(lex, error);
|
||||
while(c == ' ' || c == '\t' || c == '\n' || c == '\r')
|
||||
@@ -642,14 +635,13 @@ out:
|
||||
return lex->token;
|
||||
}
|
||||
|
||||
static char *lex_steal_string(lex_t *lex, size_t *out_len)
|
||||
static char *lex_steal_string(lex_t *lex)
|
||||
{
|
||||
char *result = NULL;
|
||||
if(lex->token == TOKEN_STRING) {
|
||||
result = lex->value.string.val;
|
||||
*out_len = lex->value.string.len;
|
||||
lex->value.string.val = NULL;
|
||||
lex->value.string.len = 0;
|
||||
if(lex->token == TOKEN_STRING)
|
||||
{
|
||||
result = lex->value.string;
|
||||
lex->value.string = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -667,7 +659,7 @@ static int lex_init(lex_t *lex, get_func get, void *data)
|
||||
static void lex_close(lex_t *lex)
|
||||
{
|
||||
if(lex->token == TOKEN_STRING)
|
||||
lex_free_string(lex);
|
||||
jsonp_free(lex->value.string);
|
||||
strbuffer_close(&lex->saved_text);
|
||||
}
|
||||
|
||||
@@ -688,7 +680,6 @@ static json_t *parse_object(lex_t *lex, size_t flags, json_error_t *error)
|
||||
|
||||
while(1) {
|
||||
char *key;
|
||||
size_t len;
|
||||
json_t *value;
|
||||
|
||||
if(lex->token != TOKEN_STRING) {
|
||||
@@ -696,14 +687,9 @@ static json_t *parse_object(lex_t *lex, size_t flags, json_error_t *error)
|
||||
goto error;
|
||||
}
|
||||
|
||||
key = lex_steal_string(lex, &len);
|
||||
key = lex_steal_string(lex);
|
||||
if(!key)
|
||||
return NULL;
|
||||
if (memchr(key, '\0', len)) {
|
||||
jsonp_free(key);
|
||||
error_set(error, lex, "NUL byte in object key not supported");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if(flags & JSON_REJECT_DUPLICATES) {
|
||||
if(json_object_get(object, key)) {
|
||||
@@ -802,21 +788,7 @@ static json_t *parse_value(lex_t *lex, size_t flags, json_error_t *error)
|
||||
|
||||
switch(lex->token) {
|
||||
case TOKEN_STRING: {
|
||||
const char *value = lex->value.string.val;
|
||||
size_t len = lex->value.string.len;
|
||||
|
||||
if(!(flags & JSON_ALLOW_NUL)) {
|
||||
if(memchr(value, '\0', len)) {
|
||||
error_set(error, lex, "\\u0000 is not allowed without JSON_ALLOW_NUL");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
json = jsonp_stringn_nocheck_own(value, len);
|
||||
if(json) {
|
||||
lex->value.string.val = NULL;
|
||||
lex->value.string.len = 0;
|
||||
}
|
||||
json = json_string_nocheck(lex->value.string);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,381 +0,0 @@
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
lookup3.c, by Bob Jenkins, May 2006, Public Domain.
|
||||
|
||||
These are functions for producing 32-bit hashes for hash table lookup.
|
||||
hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
|
||||
are externally useful functions. Routines to test the hash are included
|
||||
if SELF_TEST is defined. You can use this free for any purpose. It's in
|
||||
the public domain. It has no warranty.
|
||||
|
||||
You probably want to use hashlittle(). hashlittle() and hashbig()
|
||||
hash byte arrays. hashlittle() is is faster than hashbig() on
|
||||
little-endian machines. Intel and AMD are little-endian machines.
|
||||
On second thought, you probably want hashlittle2(), which is identical to
|
||||
hashlittle() except it returns two 32-bit hashes for the price of one.
|
||||
You could implement hashbig2() if you wanted but I haven't bothered here.
|
||||
|
||||
If you want to find a hash of, say, exactly 7 integers, do
|
||||
a = i1; b = i2; c = i3;
|
||||
mix(a,b,c);
|
||||
a += i4; b += i5; c += i6;
|
||||
mix(a,b,c);
|
||||
a += i7;
|
||||
final(a,b,c);
|
||||
then use c as the hash value. If you have a variable length array of
|
||||
4-byte integers to hash, use hashword(). If you have a byte array (like
|
||||
a character string), use hashlittle(). If you have several byte arrays, or
|
||||
a mix of things, see the comments above hashlittle().
|
||||
|
||||
Why is this so big? I read 12 bytes at a time into 3 4-byte integers,
|
||||
then mix those integers. This is fast (you can do a lot more thorough
|
||||
mixing with 12*3 instructions on 3 integers than you can with 3 instructions
|
||||
on 1 byte), but shoehorning those bytes into integers efficiently is messy.
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <jansson_private_config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h> /* defines uint32_t etc */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h> /* attempt to define endianness */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# include <endian.h> /* attempt to define endianness */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* My best guess at if you are big-endian or little-endian. This may
|
||||
* need adjustment.
|
||||
*/
|
||||
#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \
|
||||
__BYTE_ORDER == __LITTLE_ENDIAN) || \
|
||||
(defined(i386) || defined(__i386__) || defined(__i486__) || \
|
||||
defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL))
|
||||
# define HASH_LITTLE_ENDIAN 1
|
||||
# define HASH_BIG_ENDIAN 0
|
||||
#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \
|
||||
__BYTE_ORDER == __BIG_ENDIAN) || \
|
||||
(defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel))
|
||||
# define HASH_LITTLE_ENDIAN 0
|
||||
# define HASH_BIG_ENDIAN 1
|
||||
#else
|
||||
# define HASH_LITTLE_ENDIAN 0
|
||||
# define HASH_BIG_ENDIAN 0
|
||||
#endif
|
||||
|
||||
#define hashsize(n) ((uint32_t)1<<(n))
|
||||
#define hashmask(n) (hashsize(n)-1)
|
||||
#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
mix -- mix 3 32-bit values reversibly.
|
||||
|
||||
This is reversible, so any information in (a,b,c) before mix() is
|
||||
still in (a,b,c) after mix().
|
||||
|
||||
If four pairs of (a,b,c) inputs are run through mix(), or through
|
||||
mix() in reverse, there are at least 32 bits of the output that
|
||||
are sometimes the same for one pair and different for another pair.
|
||||
This was tested for:
|
||||
* pairs that differed by one bit, by two bits, in any combination
|
||||
of top bits of (a,b,c), or in any combination of bottom bits of
|
||||
(a,b,c).
|
||||
* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
|
||||
the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
|
||||
is commonly produced by subtraction) look like a single 1-bit
|
||||
difference.
|
||||
* the base values were pseudorandom, all zero but one bit set, or
|
||||
all zero plus a counter that starts at zero.
|
||||
|
||||
Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
|
||||
satisfy this are
|
||||
4 6 8 16 19 4
|
||||
9 15 3 18 27 15
|
||||
14 9 3 7 17 3
|
||||
Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
|
||||
for "differ" defined as + with a one-bit base and a two-bit delta. I
|
||||
used http://burtleburtle.net/bob/hash/avalanche.html to choose
|
||||
the operations, constants, and arrangements of the variables.
|
||||
|
||||
This does not achieve avalanche. There are input bits of (a,b,c)
|
||||
that fail to affect some output bits of (a,b,c), especially of a. The
|
||||
most thoroughly mixed value is c, but it doesn't really even achieve
|
||||
avalanche in c.
|
||||
|
||||
This allows some parallelism. Read-after-writes are good at doubling
|
||||
the number of bits affected, so the goal of mixing pulls in the opposite
|
||||
direction as the goal of parallelism. I did what I could. Rotates
|
||||
seem to cost as much as shifts on every machine I could lay my hands
|
||||
on, and rotates are much kinder to the top and bottom bits, so I used
|
||||
rotates.
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
#define mix(a,b,c) \
|
||||
{ \
|
||||
a -= c; a ^= rot(c, 4); c += b; \
|
||||
b -= a; b ^= rot(a, 6); a += c; \
|
||||
c -= b; c ^= rot(b, 8); b += a; \
|
||||
a -= c; a ^= rot(c,16); c += b; \
|
||||
b -= a; b ^= rot(a,19); a += c; \
|
||||
c -= b; c ^= rot(b, 4); b += a; \
|
||||
}
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
final -- final mixing of 3 32-bit values (a,b,c) into c
|
||||
|
||||
Pairs of (a,b,c) values differing in only a few bits will usually
|
||||
produce values of c that look totally different. This was tested for
|
||||
* pairs that differed by one bit, by two bits, in any combination
|
||||
of top bits of (a,b,c), or in any combination of bottom bits of
|
||||
(a,b,c).
|
||||
* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
|
||||
the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
|
||||
is commonly produced by subtraction) look like a single 1-bit
|
||||
difference.
|
||||
* the base values were pseudorandom, all zero but one bit set, or
|
||||
all zero plus a counter that starts at zero.
|
||||
|
||||
These constants passed:
|
||||
14 11 25 16 4 14 24
|
||||
12 14 25 16 4 14 24
|
||||
and these came close:
|
||||
4 8 15 26 3 22 24
|
||||
10 8 15 26 3 22 24
|
||||
11 8 15 26 3 22 24
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
#define final(a,b,c) \
|
||||
{ \
|
||||
c ^= b; c -= rot(b,14); \
|
||||
a ^= c; a -= rot(c,11); \
|
||||
b ^= a; b -= rot(a,25); \
|
||||
c ^= b; c -= rot(b,16); \
|
||||
a ^= c; a -= rot(c,4); \
|
||||
b ^= a; b -= rot(a,14); \
|
||||
c ^= b; c -= rot(b,24); \
|
||||
}
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
hashlittle() -- hash a variable-length key into a 32-bit value
|
||||
k : the key (the unaligned variable-length array of bytes)
|
||||
length : the length of the key, counting by bytes
|
||||
initval : can be any 4-byte value
|
||||
Returns a 32-bit value. Every bit of the key affects every bit of
|
||||
the return value. Two keys differing by one or two bits will have
|
||||
totally different hash values.
|
||||
|
||||
The best hash table sizes are powers of 2. There is no need to do
|
||||
mod a prime (mod is sooo slow!). If you need less than 32 bits,
|
||||
use a bitmask. For example, if you need only 10 bits, do
|
||||
h = (h & hashmask(10));
|
||||
In which case, the hash table should have hashsize(10) elements.
|
||||
|
||||
If you are hashing n strings (uint8_t **)k, do it like this:
|
||||
for (i=0, h=0; i<n; ++i) h = hashlittle( k[i], len[i], h);
|
||||
|
||||
By Bob Jenkins, 2006. bob_jenkins@burtleburtle.net. You may use this
|
||||
code any way you wish, private, educational, or commercial. It's free.
|
||||
|
||||
Use for hash table lookup, or anything where one collision in 2^^32 is
|
||||
acceptable. Do NOT use for cryptographic purposes.
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
|
||||
{
|
||||
uint32_t a,b,c; /* internal state */
|
||||
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
|
||||
|
||||
/* Set up the internal state */
|
||||
a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
|
||||
|
||||
u.ptr = key;
|
||||
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
|
||||
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
|
||||
|
||||
/* Detect Valgrind or AddressSanitizer */
|
||||
#ifdef VALGRIND
|
||||
# define NO_MASKING_TRICK 1
|
||||
#else
|
||||
# if defined(__has_feature) /* Clang */
|
||||
# if __has_feature(address_sanitizer) /* is ASAN enabled? */
|
||||
# define NO_MASKING_TRICK 1
|
||||
# endif
|
||||
# else
|
||||
# if defined(__SANITIZE_ADDRESS__) /* GCC 4.8.x, is ASAN enabled? */
|
||||
# define NO_MASKING_TRICK 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef NO_MASKING_TRICK
|
||||
const uint8_t *k8;
|
||||
#endif
|
||||
|
||||
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
|
||||
while (length > 12)
|
||||
{
|
||||
a += k[0];
|
||||
b += k[1];
|
||||
c += k[2];
|
||||
mix(a,b,c);
|
||||
length -= 12;
|
||||
k += 3;
|
||||
}
|
||||
|
||||
/*----------------------------- handle the last (probably partial) block */
|
||||
/*
|
||||
* "k[2]&0xffffff" actually reads beyond the end of the string, but
|
||||
* then masks off the part it's not allowed to read. Because the
|
||||
* string is aligned, the masked-off tail is in the same word as the
|
||||
* rest of the string. Every machine with memory protection I've seen
|
||||
* does it on word boundaries, so is OK with this. But VALGRIND will
|
||||
* still catch it and complain. The masking trick does make the hash
|
||||
* noticably faster for short strings (like English words).
|
||||
*/
|
||||
#ifndef NO_MASKING_TRICK
|
||||
|
||||
switch(length)
|
||||
{
|
||||
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
|
||||
case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
|
||||
case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
|
||||
case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
|
||||
case 8 : b+=k[1]; a+=k[0]; break;
|
||||
case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
|
||||
case 6 : b+=k[1]&0xffff; a+=k[0]; break;
|
||||
case 5 : b+=k[1]&0xff; a+=k[0]; break;
|
||||
case 4 : a+=k[0]; break;
|
||||
case 3 : a+=k[0]&0xffffff; break;
|
||||
case 2 : a+=k[0]&0xffff; break;
|
||||
case 1 : a+=k[0]&0xff; break;
|
||||
case 0 : return c; /* zero length strings require no mixing */
|
||||
}
|
||||
|
||||
#else /* make valgrind happy */
|
||||
|
||||
k8 = (const uint8_t *)k;
|
||||
switch(length)
|
||||
{
|
||||
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
|
||||
case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
|
||||
case 10: c+=((uint32_t)k8[9])<<8; /* fall through */
|
||||
case 9 : c+=k8[8]; /* fall through */
|
||||
case 8 : b+=k[1]; a+=k[0]; break;
|
||||
case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
|
||||
case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */
|
||||
case 5 : b+=k8[4]; /* fall through */
|
||||
case 4 : a+=k[0]; break;
|
||||
case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
|
||||
case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */
|
||||
case 1 : a+=k8[0]; break;
|
||||
case 0 : return c;
|
||||
}
|
||||
|
||||
#endif /* !valgrind */
|
||||
|
||||
} else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
|
||||
const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */
|
||||
const uint8_t *k8;
|
||||
|
||||
/*--------------- all but last block: aligned reads and different mixing */
|
||||
while (length > 12)
|
||||
{
|
||||
a += k[0] + (((uint32_t)k[1])<<16);
|
||||
b += k[2] + (((uint32_t)k[3])<<16);
|
||||
c += k[4] + (((uint32_t)k[5])<<16);
|
||||
mix(a,b,c);
|
||||
length -= 12;
|
||||
k += 6;
|
||||
}
|
||||
|
||||
/*----------------------------- handle the last (probably partial) block */
|
||||
k8 = (const uint8_t *)k;
|
||||
switch(length)
|
||||
{
|
||||
case 12: c+=k[4]+(((uint32_t)k[5])<<16);
|
||||
b+=k[2]+(((uint32_t)k[3])<<16);
|
||||
a+=k[0]+(((uint32_t)k[1])<<16);
|
||||
break;
|
||||
case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
|
||||
case 10: c+=k[4];
|
||||
b+=k[2]+(((uint32_t)k[3])<<16);
|
||||
a+=k[0]+(((uint32_t)k[1])<<16);
|
||||
break;
|
||||
case 9 : c+=k8[8]; /* fall through */
|
||||
case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
|
||||
a+=k[0]+(((uint32_t)k[1])<<16);
|
||||
break;
|
||||
case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
|
||||
case 6 : b+=k[2];
|
||||
a+=k[0]+(((uint32_t)k[1])<<16);
|
||||
break;
|
||||
case 5 : b+=k8[4]; /* fall through */
|
||||
case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
|
||||
break;
|
||||
case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
|
||||
case 2 : a+=k[0];
|
||||
break;
|
||||
case 1 : a+=k8[0];
|
||||
break;
|
||||
case 0 : return c; /* zero length requires no mixing */
|
||||
}
|
||||
|
||||
} else { /* need to read the key one byte at a time */
|
||||
const uint8_t *k = (const uint8_t *)key;
|
||||
|
||||
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
|
||||
while (length > 12)
|
||||
{
|
||||
a += k[0];
|
||||
a += ((uint32_t)k[1])<<8;
|
||||
a += ((uint32_t)k[2])<<16;
|
||||
a += ((uint32_t)k[3])<<24;
|
||||
b += k[4];
|
||||
b += ((uint32_t)k[5])<<8;
|
||||
b += ((uint32_t)k[6])<<16;
|
||||
b += ((uint32_t)k[7])<<24;
|
||||
c += k[8];
|
||||
c += ((uint32_t)k[9])<<8;
|
||||
c += ((uint32_t)k[10])<<16;
|
||||
c += ((uint32_t)k[11])<<24;
|
||||
mix(a,b,c);
|
||||
length -= 12;
|
||||
k += 12;
|
||||
}
|
||||
|
||||
/*-------------------------------- last block: affect all 32 bits of (c) */
|
||||
switch(length) /* all the case statements fall through */
|
||||
{
|
||||
case 12: c+=((uint32_t)k[11])<<24;
|
||||
case 11: c+=((uint32_t)k[10])<<16;
|
||||
case 10: c+=((uint32_t)k[9])<<8;
|
||||
case 9 : c+=k[8];
|
||||
case 8 : b+=((uint32_t)k[7])<<24;
|
||||
case 7 : b+=((uint32_t)k[6])<<16;
|
||||
case 6 : b+=((uint32_t)k[5])<<8;
|
||||
case 5 : b+=k[4];
|
||||
case 4 : a+=((uint32_t)k[3])<<24;
|
||||
case 3 : a+=((uint32_t)k[2])<<16;
|
||||
case 2 : a+=((uint32_t)k[1])<<8;
|
||||
case 1 : a+=k[0];
|
||||
break;
|
||||
case 0 : return c;
|
||||
}
|
||||
}
|
||||
|
||||
final(a,b,c);
|
||||
return c;
|
||||
}
|
||||
+7
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2011-2012 Basile Starynkevitch <basile@starynkevitch.net>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify it
|
||||
@@ -12,10 +12,6 @@
|
||||
#include "jansson.h"
|
||||
#include "jansson_private.h"
|
||||
|
||||
/* C89 allows these to be macros */
|
||||
#undef malloc
|
||||
#undef free
|
||||
|
||||
/* memory function pointers */
|
||||
static json_malloc_t do_malloc = malloc;
|
||||
static json_free_t do_free = free;
|
||||
@@ -37,20 +33,19 @@ void jsonp_free(void *ptr)
|
||||
}
|
||||
|
||||
char *jsonp_strdup(const char *str)
|
||||
{
|
||||
return jsonp_strndup(str, strlen(str));
|
||||
}
|
||||
|
||||
char *jsonp_strndup(const char *str, size_t len)
|
||||
{
|
||||
char *new_str;
|
||||
size_t len;
|
||||
|
||||
len = strlen(str);
|
||||
if(len == (size_t)-1)
|
||||
return NULL;
|
||||
|
||||
new_str = jsonp_malloc(len + 1);
|
||||
if(!new_str)
|
||||
return NULL;
|
||||
|
||||
memcpy(new_str, str, len);
|
||||
new_str[len] = '\0';
|
||||
memcpy(new_str, str, len + 1);
|
||||
return new_str;
|
||||
}
|
||||
|
||||
|
||||
+29
-72
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2011-2012 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
@@ -125,18 +125,19 @@ static json_t *pack(scanner_t *s, va_list *ap);
|
||||
/* ours will be set to 1 if jsonp_free() must be called for the result
|
||||
afterwards */
|
||||
static char *read_string(scanner_t *s, va_list *ap,
|
||||
const char *purpose, size_t *out_len, int *ours)
|
||||
const char *purpose, int *ours)
|
||||
{
|
||||
char t;
|
||||
strbuffer_t strbuff;
|
||||
const char *str;
|
||||
size_t length;
|
||||
char *result;
|
||||
|
||||
next_token(s);
|
||||
t = token(s);
|
||||
prev_token(s);
|
||||
|
||||
if(t != '#' && t != '%' && t != '+') {
|
||||
if(t != '#' && t != '+') {
|
||||
/* Optimize the simple case */
|
||||
str = va_arg(*ap, const char *);
|
||||
|
||||
@@ -145,14 +146,11 @@ static char *read_string(scanner_t *s, va_list *ap,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
length = strlen(str);
|
||||
|
||||
if(!utf8_check_string(str, length)) {
|
||||
if(!utf8_check_string(str, -1)) {
|
||||
set_error(s, "<args>", "Invalid UTF-8 %s", purpose);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*out_len = length;
|
||||
*ours = 0;
|
||||
return (char *)str;
|
||||
}
|
||||
@@ -172,9 +170,6 @@ static char *read_string(scanner_t *s, va_list *ap,
|
||||
if(token(s) == '#') {
|
||||
length = va_arg(*ap, int);
|
||||
}
|
||||
else if(token(s) == '%') {
|
||||
length = va_arg(*ap, size_t);
|
||||
}
|
||||
else {
|
||||
prev_token(s);
|
||||
length = strlen(str);
|
||||
@@ -193,15 +188,15 @@ static char *read_string(scanner_t *s, va_list *ap,
|
||||
}
|
||||
}
|
||||
|
||||
if(!utf8_check_string(strbuff.value, strbuff.length)) {
|
||||
result = strbuffer_steal_value(&strbuff);
|
||||
|
||||
if(!utf8_check_string(result, -1)) {
|
||||
set_error(s, "<args>", "Invalid UTF-8 %s", purpose);
|
||||
strbuffer_close(&strbuff);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*out_len = strbuff.length;
|
||||
*ours = 1;
|
||||
return strbuffer_steal_value(&strbuff);
|
||||
return result;
|
||||
}
|
||||
|
||||
static json_t *pack_object(scanner_t *s, va_list *ap)
|
||||
@@ -211,7 +206,6 @@ static json_t *pack_object(scanner_t *s, va_list *ap)
|
||||
|
||||
while(token(s) != '}') {
|
||||
char *key;
|
||||
size_t len;
|
||||
int ours;
|
||||
json_t *value;
|
||||
|
||||
@@ -225,19 +219,15 @@ static json_t *pack_object(scanner_t *s, va_list *ap)
|
||||
goto error;
|
||||
}
|
||||
|
||||
key = read_string(s, ap, "object key", &len, &ours);
|
||||
key = read_string(s, ap, "object key", &ours);
|
||||
if(!key)
|
||||
goto error;
|
||||
|
||||
next_token(s);
|
||||
|
||||
value = pack(s, ap);
|
||||
if(!value) {
|
||||
if(ours)
|
||||
jsonp_free(key);
|
||||
|
||||
if(!value)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if(json_object_set_new_nocheck(object, key, value)) {
|
||||
if(ours)
|
||||
@@ -300,20 +290,20 @@ static json_t *pack(scanner_t *s, va_list *ap)
|
||||
case '[':
|
||||
return pack_array(s, ap);
|
||||
|
||||
case 's': /* string */
|
||||
{
|
||||
case 's': { /* string */
|
||||
char *str;
|
||||
size_t len;
|
||||
int ours;
|
||||
json_t *result;
|
||||
|
||||
str = read_string(s, ap, "string", &len, &ours);
|
||||
str = read_string(s, ap, "string", &ours);
|
||||
if(!str)
|
||||
return NULL;
|
||||
|
||||
if (ours)
|
||||
return jsonp_stringn_nocheck_own(str, len);
|
||||
else
|
||||
return json_stringn_nocheck(str, len);
|
||||
result = json_string_nocheck(str);
|
||||
if(ours)
|
||||
jsonp_free(str);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
case 'n': /* null */
|
||||
@@ -350,7 +340,6 @@ static int unpack_object(scanner_t *s, json_t *root, va_list *ap)
|
||||
{
|
||||
int ret = -1;
|
||||
int strict = 0;
|
||||
int gotopt = 0;
|
||||
|
||||
/* Use a set (emulated by a hashtable) to check that all object
|
||||
keys are accessed. Checking that the correct number of keys
|
||||
@@ -407,7 +396,7 @@ static int unpack_object(scanner_t *s, json_t *root, va_list *ap)
|
||||
next_token(s);
|
||||
|
||||
if(token(s) == '?') {
|
||||
opt = gotopt = 1;
|
||||
opt = 1;
|
||||
next_token(s);
|
||||
}
|
||||
|
||||
@@ -433,26 +422,10 @@ static int unpack_object(scanner_t *s, json_t *root, va_list *ap)
|
||||
if(strict == 0 && (s->flags & JSON_STRICT))
|
||||
strict = 1;
|
||||
|
||||
if(root && strict == 1) {
|
||||
/* We need to check that all non optional items have been parsed */
|
||||
const char *key;
|
||||
json_t *value;
|
||||
long unpacked = 0;
|
||||
if (gotopt) {
|
||||
/* We have optional keys, we need to iter on each key */
|
||||
json_object_foreach(root, key, value) {
|
||||
if(!hashtable_get(&key_set, key)) {
|
||||
unpacked++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* No optional keys, we can just compare the number of items */
|
||||
unpacked = (long)json_object_size(root) - (long)key_set.size;
|
||||
}
|
||||
if (unpacked) {
|
||||
set_error(s, "<validation>", "%li object item(s) left unpacked", unpacked);
|
||||
goto out;
|
||||
}
|
||||
if(root && strict == 1 && key_set.size != json_object_size(root)) {
|
||||
long diff = (long)json_object_size(root) - (long)key_set.size;
|
||||
set_error(s, "<validation>", "%li object item(s) left unpacked", diff);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
@@ -550,32 +523,16 @@ static int unpack(scanner_t *s, json_t *root, va_list *ap)
|
||||
}
|
||||
|
||||
if(!(s->flags & JSON_VALIDATE_ONLY)) {
|
||||
const char **str_target;
|
||||
size_t *len_target = NULL;
|
||||
const char **target;
|
||||
|
||||
str_target = va_arg(*ap, const char **);
|
||||
if(!str_target) {
|
||||
target = va_arg(*ap, const char **);
|
||||
if(!target) {
|
||||
set_error(s, "<args>", "NULL string argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
next_token(s);
|
||||
|
||||
if(token(s) == '%') {
|
||||
len_target = va_arg(*ap, size_t *);
|
||||
if(!len_target) {
|
||||
set_error(s, "<args>", "NULL string length argument");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
prev_token(s);
|
||||
|
||||
if(root) {
|
||||
*str_target = json_string_value(root);
|
||||
if(len_target)
|
||||
*len_target = json_string_length(root);
|
||||
}
|
||||
if(root)
|
||||
*target = json_string_value(root);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
|
||||
+5
-9
@@ -2,13 +2,12 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "jansson_private.h"
|
||||
#include "strbuffer.h"
|
||||
|
||||
/* need jansson_private_config.h to get the correct snprintf */
|
||||
/* need config.h to get the correct snprintf */
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <jansson_private_config.h>
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#if JSON_HAVE_LOCALECONV
|
||||
@@ -70,7 +69,7 @@ int jsonp_strtod(strbuffer_t *strbuffer, double *out)
|
||||
value = strtod(strbuffer->value, &end);
|
||||
assert(end == strbuffer->value + strbuffer->length);
|
||||
|
||||
if((value == HUGE_VAL || value == -HUGE_VAL) && errno == ERANGE) {
|
||||
if(errno == ERANGE && value != 0) {
|
||||
/* Overflow */
|
||||
return -1;
|
||||
}
|
||||
@@ -79,16 +78,13 @@ int jsonp_strtod(strbuffer_t *strbuffer, double *out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int jsonp_dtostr(char *buffer, size_t size, double value, int precision)
|
||||
int jsonp_dtostr(char *buffer, size_t size, double value)
|
||||
{
|
||||
int ret;
|
||||
char *start, *end;
|
||||
size_t length;
|
||||
|
||||
if (precision == 0)
|
||||
precision = 17;
|
||||
|
||||
ret = snprintf(buffer, size, "%.*g", precision, value);
|
||||
ret = snprintf(buffer, size, "%.17g", value);
|
||||
if(ret < 0)
|
||||
return -1;
|
||||
|
||||
|
||||
+16
-13
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <string.h>
|
||||
#include "utf.h"
|
||||
|
||||
int utf8_encode(int32_t codepoint, char *buffer, size_t *size)
|
||||
int utf8_encode(int32_t codepoint, char *buffer, int *size)
|
||||
{
|
||||
if(codepoint < 0)
|
||||
return -1;
|
||||
@@ -44,7 +44,7 @@ int utf8_encode(int32_t codepoint, char *buffer, size_t *size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t utf8_check_first(char byte)
|
||||
int utf8_check_first(char byte)
|
||||
{
|
||||
unsigned char u = (unsigned char)byte;
|
||||
|
||||
@@ -80,9 +80,9 @@ size_t utf8_check_first(char byte)
|
||||
}
|
||||
}
|
||||
|
||||
size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint)
|
||||
int utf8_check_full(const char *buffer, int size, int32_t *codepoint)
|
||||
{
|
||||
size_t i;
|
||||
int i;
|
||||
int32_t value = 0;
|
||||
unsigned char u = (unsigned char)buffer[0];
|
||||
|
||||
@@ -136,12 +136,12 @@ size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint)
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *utf8_iterate(const char *buffer, size_t bufsize, int32_t *codepoint)
|
||||
const char *utf8_iterate(const char *buffer, int32_t *codepoint)
|
||||
{
|
||||
size_t count;
|
||||
int count;
|
||||
int32_t value;
|
||||
|
||||
if(!bufsize)
|
||||
if(!*buffer)
|
||||
return buffer;
|
||||
|
||||
count = utf8_check_first(buffer[0]);
|
||||
@@ -152,7 +152,7 @@ const char *utf8_iterate(const char *buffer, size_t bufsize, int32_t *codepoint)
|
||||
value = (unsigned char)buffer[0];
|
||||
else
|
||||
{
|
||||
if(count > bufsize || !utf8_check_full(buffer, count, &value))
|
||||
if(!utf8_check_full(buffer, count, &value))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -162,18 +162,21 @@ const char *utf8_iterate(const char *buffer, size_t bufsize, int32_t *codepoint)
|
||||
return buffer + count;
|
||||
}
|
||||
|
||||
int utf8_check_string(const char *string, size_t length)
|
||||
int utf8_check_string(const char *string, int length)
|
||||
{
|
||||
size_t i;
|
||||
int i;
|
||||
|
||||
if(length == -1)
|
||||
length = strlen(string);
|
||||
|
||||
for(i = 0; i < length; i++)
|
||||
{
|
||||
size_t count = utf8_check_first(string[i]);
|
||||
int count = utf8_check_first(string[i]);
|
||||
if(count == 0)
|
||||
return 0;
|
||||
else if(count > 1)
|
||||
{
|
||||
if(count > length - i)
|
||||
if(i + count > length)
|
||||
return 0;
|
||||
|
||||
if(!utf8_check_full(&string[i], count, NULL))
|
||||
|
||||
+23
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -9,19 +9,31 @@
|
||||
#define UTF_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <jansson_private_config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
/* inttypes.h includes stdint.h in a standard environment, so there's
|
||||
no need to include stdint.h separately. If inttypes.h doesn't define
|
||||
int32_t, it's defined in config.h. */
|
||||
#include <inttypes.h>
|
||||
#endif /* HAVE_INTTYPES_H */
|
||||
|
||||
int utf8_encode(int32_t codepoint, char *buffer, size_t *size);
|
||||
#else /* !HAVE_CONFIG_H */
|
||||
#ifdef _WIN32
|
||||
typedef int int32_t;
|
||||
#else /* !_WIN32 */
|
||||
/* Assume a standard environment */
|
||||
#include <inttypes.h>
|
||||
#endif /* _WIN32 */
|
||||
|
||||
size_t utf8_check_first(char byte);
|
||||
size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint);
|
||||
const char *utf8_iterate(const char *buffer, size_t size, int32_t *codepoint);
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
int utf8_check_string(const char *string, size_t length);
|
||||
int utf8_encode(int codepoint, char *buffer, int *size);
|
||||
|
||||
int utf8_check_first(char byte);
|
||||
int utf8_check_full(const char *buffer, int size, int32_t *codepoint);
|
||||
const char *utf8_iterate(const char *buffer, int32_t *codepoint);
|
||||
|
||||
int utf8_check_string(const char *string, int length);
|
||||
|
||||
#endif
|
||||
+19
-110
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
||||
* Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
||||
*
|
||||
* Jansson is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
@@ -9,19 +9,11 @@
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <jansson_private_config.h>
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include "jansson.h"
|
||||
#include "hashtable.h"
|
||||
#include "jansson_private.h"
|
||||
@@ -29,10 +21,8 @@
|
||||
|
||||
/* Work around nonstandard isnan() and isinf() implementations */
|
||||
#ifndef isnan
|
||||
#ifndef __sun
|
||||
static JSON_INLINE int isnan(double x) { return x != x; }
|
||||
#endif
|
||||
#endif
|
||||
#ifndef isinf
|
||||
static JSON_INLINE int isinf(double x) { return !isnan(x) && isnan(x - x); }
|
||||
#endif
|
||||
@@ -46,19 +36,11 @@ static JSON_INLINE void json_init(json_t *json, json_type type)
|
||||
|
||||
/*** object ***/
|
||||
|
||||
extern volatile uint32_t hashtable_seed;
|
||||
|
||||
json_t *json_object(void)
|
||||
{
|
||||
json_object_t *object = jsonp_malloc(sizeof(json_object_t));
|
||||
if(!object)
|
||||
return NULL;
|
||||
|
||||
if (!hashtable_seed) {
|
||||
/* Autoseed */
|
||||
json_object_seed(0);
|
||||
}
|
||||
|
||||
json_init(&object->json, JSON_OBJECT);
|
||||
|
||||
if(hashtable_init(&object->hashtable))
|
||||
@@ -94,7 +76,7 @@ json_t *json_object_get(const json_t *json, const char *key)
|
||||
{
|
||||
json_object_t *object;
|
||||
|
||||
if(!key || !json_is_object(json))
|
||||
if(!json_is_object(json))
|
||||
return NULL;
|
||||
|
||||
object = json_to_object(json);
|
||||
@@ -126,7 +108,7 @@ int json_object_set_new_nocheck(json_t *json, const char *key, json_t *value)
|
||||
|
||||
int json_object_set_new(json_t *json, const char *key, json_t *value)
|
||||
{
|
||||
if(!key || !utf8_check_string(key, strlen(key)))
|
||||
if(!key || !utf8_check_string(key, -1))
|
||||
{
|
||||
json_decref(value);
|
||||
return -1;
|
||||
@@ -139,7 +121,7 @@ int json_object_del(json_t *json, const char *key)
|
||||
{
|
||||
json_object_t *object;
|
||||
|
||||
if(!key || !json_is_object(json))
|
||||
if(!json_is_object(json))
|
||||
return -1;
|
||||
|
||||
object = json_to_object(json);
|
||||
@@ -638,68 +620,33 @@ static json_t *json_array_deep_copy(const json_t *array)
|
||||
|
||||
/*** string ***/
|
||||
|
||||
static json_t *string_create(const char *value, size_t len, int own)
|
||||
json_t *json_string_nocheck(const char *value)
|
||||
{
|
||||
char *v;
|
||||
json_string_t *string;
|
||||
|
||||
if(!value)
|
||||
return NULL;
|
||||
|
||||
if(own)
|
||||
v = (char *)value;
|
||||
else {
|
||||
v = jsonp_strndup(value, len);
|
||||
if(!v)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
string = jsonp_malloc(sizeof(json_string_t));
|
||||
if(!string) {
|
||||
if(!own)
|
||||
jsonp_free(v);
|
||||
if(!string)
|
||||
return NULL;
|
||||
json_init(&string->json, JSON_STRING);
|
||||
|
||||
string->value = jsonp_strdup(value);
|
||||
if(!string->value) {
|
||||
jsonp_free(string);
|
||||
return NULL;
|
||||
}
|
||||
json_init(&string->json, JSON_STRING);
|
||||
string->value = v;
|
||||
string->length = len;
|
||||
|
||||
return &string->json;
|
||||
}
|
||||
|
||||
json_t *json_string_nocheck(const char *value)
|
||||
{
|
||||
if(!value)
|
||||
return NULL;
|
||||
|
||||
return string_create(value, strlen(value), 0);
|
||||
}
|
||||
|
||||
json_t *json_stringn_nocheck(const char *value, size_t len)
|
||||
{
|
||||
return string_create(value, len, 0);
|
||||
}
|
||||
|
||||
/* this is private; "steal" is not a public API concept */
|
||||
json_t *jsonp_stringn_nocheck_own(const char *value, size_t len)
|
||||
{
|
||||
return string_create(value, len, 1);
|
||||
}
|
||||
|
||||
json_t *json_string(const char *value)
|
||||
{
|
||||
if(!value)
|
||||
if(!value || !utf8_check_string(value, -1))
|
||||
return NULL;
|
||||
|
||||
return json_stringn(value, strlen(value));
|
||||
}
|
||||
|
||||
json_t *json_stringn(const char *value, size_t len)
|
||||
{
|
||||
if(!value || !utf8_check_string(value, len))
|
||||
return NULL;
|
||||
|
||||
return json_stringn_nocheck(value, len);
|
||||
return json_string_nocheck(value);
|
||||
}
|
||||
|
||||
const char *json_string_value(const json_t *json)
|
||||
@@ -710,23 +657,7 @@ const char *json_string_value(const json_t *json)
|
||||
return json_to_string(json)->value;
|
||||
}
|
||||
|
||||
size_t json_string_length(const json_t *json)
|
||||
{
|
||||
if(!json_is_string(json))
|
||||
return 0;
|
||||
|
||||
return json_to_string(json)->length;
|
||||
}
|
||||
|
||||
int json_string_set_nocheck(json_t *json, const char *value)
|
||||
{
|
||||
if(!value)
|
||||
return -1;
|
||||
|
||||
return json_string_setn_nocheck(json, value, strlen(value));
|
||||
}
|
||||
|
||||
int json_string_setn_nocheck(json_t *json, const char *value, size_t len)
|
||||
{
|
||||
char *dup;
|
||||
json_string_t *string;
|
||||
@@ -734,32 +665,23 @@ int json_string_setn_nocheck(json_t *json, const char *value, size_t len)
|
||||
if(!json_is_string(json) || !value)
|
||||
return -1;
|
||||
|
||||
dup = jsonp_strndup(value, len);
|
||||
dup = jsonp_strdup(value);
|
||||
if(!dup)
|
||||
return -1;
|
||||
|
||||
string = json_to_string(json);
|
||||
jsonp_free(string->value);
|
||||
string->value = dup;
|
||||
string->length = len;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int json_string_set(json_t *json, const char *value)
|
||||
{
|
||||
if(!value)
|
||||
if(!value || !utf8_check_string(value, -1))
|
||||
return -1;
|
||||
|
||||
return json_string_setn(json, value, strlen(value));
|
||||
}
|
||||
|
||||
int json_string_setn(json_t *json, const char *value, size_t len)
|
||||
{
|
||||
if(!value || !utf8_check_string(value, len))
|
||||
return -1;
|
||||
|
||||
return json_string_setn_nocheck(json, value, len);
|
||||
return json_string_set_nocheck(json, value);
|
||||
}
|
||||
|
||||
static void json_delete_string(json_string_t *string)
|
||||
@@ -770,25 +692,12 @@ static void json_delete_string(json_string_t *string)
|
||||
|
||||
static int json_string_equal(json_t *string1, json_t *string2)
|
||||
{
|
||||
json_string_t *s1, *s2;
|
||||
|
||||
if(!json_is_string(string1) || !json_is_string(string2))
|
||||
return 0;
|
||||
|
||||
s1 = json_to_string(string1);
|
||||
s2 = json_to_string(string2);
|
||||
return s1->length == s2->length && !memcmp(s1->value, s2->value, s1->length);
|
||||
return strcmp(json_string_value(string1), json_string_value(string2)) == 0;
|
||||
}
|
||||
|
||||
static json_t *json_string_copy(const json_t *string)
|
||||
{
|
||||
json_string_t *s;
|
||||
|
||||
if(!json_is_string(string))
|
||||
return NULL;
|
||||
|
||||
s = json_to_string(string);
|
||||
return json_stringn_nocheck(s->value, s->length);
|
||||
return json_string_nocheck(json_string_value(string));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FORCE:MULTIPLE"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_1-DEBUG.exe"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_2-DEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -197,7 +197,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FORCE:MULTIPLE"
|
||||
AdditionalDependencies="wsock32.lib winmm.lib msacm32.lib vfw32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_1.exe"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_2.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
LinkLibraryDependencies="true"
|
||||
UseLibraryDependencyInputs="false"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_1-DEBUG.exe"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_2-DEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -199,7 +199,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_1.exe"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_2.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Copying build..."
|
||||
CommandLine="copy "$(TargetPath)" "$(FS2PATH)/wxfred2_open_3_7_1-debug.exe"
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"
"
|
||||
Outputs="$(FS2PATH)/wxfred2_open_3_7_1-debug.exe;$(FS2PATH)\wxfred.xrc"
|
||||
CommandLine="copy "$(TargetPath)" "$(FS2PATH)/wxfred2_open_3_7_2-debug.exe"
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"
"
|
||||
Outputs="$(FS2PATH)/wxfred2_open_3_7_2-debug.exe;$(FS2PATH)\wxfred.xrc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
@@ -80,15 +80,15 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw28d_xrc.lib wxmsw28d_html.lib wxmsw28d_adv.lib wxmsw28d_core.lib wxbase28d_xml.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib"
|
||||
OutputFile="Debug/wxfred2_open_3_7_1-debug.exe"
|
||||
OutputFile="Debug/wxfred2_open_3_7_2-debug.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(WXWIN)/lib,$(WXWIN)/lib/vc_lib"
|
||||
IgnoreDefaultLibraryNames="libcd.lib,libcid.lib"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/wxfred2_open_3_7_1-debug.pdb"
|
||||
ProgramDatabaseFile=".\Debug/wxfred2_open_3_7_2-debug.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName=".\Debug\Profile\wxfred2/wxfred2_open_3_7_1-debug.map"
|
||||
MapFileName=".\Debug\Profile\wxfred2/wxfred2_open_3_7_2-debug.map"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
@@ -134,8 +134,8 @@
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Copying build..."
|
||||
CommandLine="copy "$(TargetPath)" "$(FS2PATH)\wxfred2_open_3_7_1.exe"
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"
"
|
||||
Outputs="$(FS2PATH)\wxfred2_open_3_7_1.exe;$(FS2PATH)\wxfred.xrc"
|
||||
CommandLine="copy "$(TargetPath)" "$(FS2PATH)\wxfred2_open_3_7_2.exe"
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"
"
|
||||
Outputs="$(FS2PATH)\wxfred2_open_3_7_2.exe;$(FS2PATH)\wxfred.xrc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
@@ -185,15 +185,15 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw28_xrc.lib wxmsw28_html.lib wxmsw28_adv.lib wxmsw28_core.lib wxbase28_xml.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib"
|
||||
OutputFile="Release/wxfred2_open_3_7_1.exe"
|
||||
OutputFile="Release/wxfred2_open_3_7_2.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(WXWIN)/lib,$(WXWIN)/lib/vc_lib"
|
||||
IgnoreDefaultLibraryNames="libc.lib,libci.lib"
|
||||
GenerateDebugInformation="false"
|
||||
ProgramDatabaseFile=".\Release/wxfred2_open_3_7_1.pdb"
|
||||
ProgramDatabaseFile=".\Release/wxfred2_open_3_7_2.pdb"
|
||||
GenerateMapFile="false"
|
||||
MapFileName=".\Release\Profile\wxfred2/wxfred2_open_3_7_1.map"
|
||||
MapFileName=".\Release\Profile\wxfred2/wxfred2_open_3_7_2.map"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -84,7 +84,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FORCE:MULTIPLE"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_1_NO-SSE-DEBUG.exe"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_2_NO-SSE-DEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -160,7 +160,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -193,7 +193,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FORCE:MULTIPLE"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_1_SSE-DEBUG.exe"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_2_SSE-DEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -269,7 +269,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -302,7 +302,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FORCE:MULTIPLE"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_1-DEBUG.exe"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_2-DEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -385,7 +385,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
@@ -416,7 +416,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FORCE:MULTIPLE"
|
||||
AdditionalDependencies="wsock32.lib winmm.lib msacm32.lib vfw32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_1_NO-SSE.exe"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_2_NO-SSE.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -499,7 +499,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
@@ -531,7 +531,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FORCE:MULTIPLE"
|
||||
AdditionalDependencies="wsock32.lib winmm.lib msacm32.lib vfw32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_1_SSE.exe"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_2_SSE.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -614,7 +614,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;FRED;WINVER=0x410;_WIN32_WINNT=0x500;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
@@ -646,7 +646,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FORCE:MULTIPLE"
|
||||
AdditionalDependencies="wsock32.lib winmm.lib msacm32.lib vfw32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_1.exe"
|
||||
OutputFile="$(OutDir)\fred2_open_3_7_2.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -75,7 +75,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_VC08;"
|
||||
PreprocessorDefinitions="_DEBUG;_VC08;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
@@ -87,7 +87,7 @@
|
||||
UseLibraryDependencyInputs="false"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib ole32.lib advapi32.lib gdi32.lib user32.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_1_NO-SSE-DEBUG.exe"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_2_NO-SSE-DEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -164,7 +164,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -188,7 +188,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_VC08;"
|
||||
PreprocessorDefinitions="_DEBUG;_VC08;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
@@ -200,7 +200,7 @@
|
||||
UseLibraryDependencyInputs="false"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib ole32.lib advapi32.lib gdi32.lib user32.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_1_SSE-DEBUG.exe"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_2_SSE-DEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -277,7 +277,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -301,7 +301,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_VC08;_SSE2;"
|
||||
PreprocessorDefinitions="_DEBUG;_VC08;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;_SSE2;"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
@@ -313,7 +313,7 @@
|
||||
UseLibraryDependencyInputs="false"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib ole32.lib advapi32.lib gdi32.lib user32.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_1-DEBUG.exe"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_2-DEBUG.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -397,7 +397,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
@@ -419,7 +419,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_VC08;"
|
||||
PreprocessorDefinitions="NDEBUG;_VC08;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
@@ -428,7 +428,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_1_NO-SSE.exe"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_2_NO-SSE.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -514,7 +514,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
@@ -537,7 +537,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_VC08;"
|
||||
PreprocessorDefinitions="NDEBUG;_VC08;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
@@ -546,7 +546,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_1_SSE.exe"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_2_SSE.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
@@ -632,7 +632,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
@@ -655,7 +655,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_VC08;_SSE2;"
|
||||
PreprocessorDefinitions="NDEBUG;_VC08;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;FS2_VOICER;_SSE2;"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
@@ -664,7 +664,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_1.exe"
|
||||
OutputFile="$(OutDir)\fs2_open_3_7_2.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(ConfigurationName)";../../oggvorbis/lib;../../openal/libs/win32;../../openal/libs/win64;"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -123,7 +123,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -206,7 +206,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@@ -296,7 +296,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -382,7 +382,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -469,7 +469,7 @@
|
||||
OmitFramePointers="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories="../../code;../../libjpeg;../../libpng;../../lua;../../oggvorbis/include;../../openal/include;../../zlib;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PDB_DEBUGGING;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;FS2_SPEECH;FS2_VOICER;"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
|
||||
@@ -125,12 +125,12 @@
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fred2_open_3_7_1-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fred2_open_3_7_1_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fred2_open_3_7_1_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fred2_open_3_7_1</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fred2_open_3_7_1_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fred2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fred2_open_3_7_2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fred2_open_3_7_2_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fred2_open_3_7_2_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fred2_open_3_7_2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fred2_open_3_7_2_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fred2_open_3_7_2_SSE2</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildStep>
|
||||
|
||||
@@ -124,12 +124,12 @@
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fs2_open_3_7_1-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fs2_open_3_7_1_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fs2_open_3_7_1_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fs2_open_3_7_1</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fs2_open_3_7_1_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fs2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fs2_open_3_7_2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fs2_open_3_7_2_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fs2_open_3_7_2_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fs2_open_3_7_2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fs2_open_3_7_2_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fs2_open_3_7_2_SSE2</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildStep>
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<AdditionalDependencies>comctl32.lib;rpcrt4.lib;winmm.lib;advapi32.lib;wsock32.lib;wxmsw29ud_core.lib;wxbase29ud.lib</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy /y "$(TargetPath)" "$(FS2PATH)\wxfred2_open_3_7_1-debug.exe" </Command>
|
||||
<Command>copy /y "$(TargetPath)" "$(FS2PATH)\wxfred2_open_3_7_2-debug.exe" </Command>
|
||||
<Message>Copying build...</Message>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open$(FS_VERSION_FULL)-debug.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
@@ -159,9 +159,9 @@
|
||||
<AdditionalDependencies>comctl32.lib;rpcrt4.lib;winmm.lib;advapi32.lib;wsock32.lib;wxmsw29u_core.lib;wxbase29u.lib</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy /y "$(TargetPath)" "$(FS2PATH)/wxfred2_open_3_7_1.exe"</Command>
|
||||
<Command>copy /y "$(TargetPath)" "$(FS2PATH)/wxfred2_open_3_7_2.exe"</Command>
|
||||
<Message>Copying build...</Message>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open_3_7_1.exe;%(Outputs)</Outputs>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open_3_7_2.exe;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -171,14 +171,14 @@
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fred2_open_3_7_1-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fred2_open_3_7_1_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fred2_open_3_7_1_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fred2_open_3_7_1_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fred2_open_3_7_1</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fred2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fred2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fred2_open_3_7_1_AVX</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fred2_open_3_7_2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fred2_open_3_7_2_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fred2_open_3_7_2_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fred2_open_3_7_2_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fred2_open_3_7_2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fred2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fred2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fred2_open_3_7_2_AVX</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildStep>
|
||||
|
||||
@@ -170,14 +170,14 @@
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fs2_open_3_7_1-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fs2_open_3_7_1_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fs2_open_3_7_1_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fs2_open_3_7_1_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fs2_open_3_7_1</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fs2_open_3_7_1_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fs2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fs2_open_3_7_1_AVX</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fs2_open_3_7_2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fs2_open_3_7_2_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fs2_open_3_7_2_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fs2_open_3_7_2_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fs2_open_3_7_2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fs2_open_3_7_2_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fs2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fs2_open_3_7_2_AVX</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildStep>
|
||||
|
||||
@@ -95,10 +95,10 @@
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;winmm.lib;wxmsw28d_xrc.lib;wxmsw28d_html.lib;wxmsw28d_adv.lib;wxmsw28d_core.lib;wxbase28d_xml.lib;wxbase28d.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy %(FullPath) "$(FS2PATH)/wxfred2_open_3_7_1-debug.exe"
|
||||
<Command>copy %(FullPath) "$(FS2PATH)/wxfred2_open_3_7_2-debug.exe"
|
||||
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Command>
|
||||
<Message>Copying build...</Message>
|
||||
<Outputs>$(FS2PATH)/wxfred2_open_3_7_1-debug.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
<Outputs>$(FS2PATH)/wxfred2_open_3_7_2-debug.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@@ -146,10 +146,10 @@ copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Comma
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;winmm.lib;wxmsw28_xrc.lib;wxmsw28_html.lib;wxmsw28_adv.lib;wxmsw28_core.lib;wxbase28_xml.lib;wxbase28.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy %(FullPath) "$(FS2PATH)\wxfred2_open_3_7_1.exe"
|
||||
<Command>copy %(FullPath) "$(FS2PATH)\wxfred2_open_3_7_2.exe"
|
||||
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Command>
|
||||
<Message>Copying build...</Message>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open_3_7_1.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open_3_7_2.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -170,14 +170,14 @@
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fred2_open_3_7_1-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fred2_open_3_7_1_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fred2_open_3_7_1_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fred2_open_3_7_1_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fred2_open_3_7_1</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fred2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fred2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fred2_open_3_7_1_AVX</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fred2_open_3_7_2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fred2_open_3_7_2_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fred2_open_3_7_2_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fred2_open_3_7_2_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fred2_open_3_7_2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fred2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fred2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fred2_open_3_7_2_AVX</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildStep>
|
||||
|
||||
@@ -169,14 +169,14 @@
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fs2_open_3_7_1-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fs2_open_3_7_1_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fs2_open_3_7_1_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fs2_open_3_7_1_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fs2_open_3_7_1</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fs2_open_3_7_1_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fs2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fs2_open_3_7_1_AVX</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fs2_open_3_7_2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fs2_open_3_7_2_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fs2_open_3_7_2_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fs2_open_3_7_2_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fs2_open_3_7_2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fs2_open_3_7_2_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fs2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fs2_open_3_7_2_AVX</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildStep>
|
||||
|
||||
@@ -95,10 +95,10 @@
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;winmm.lib;wxmsw28d_xrc.lib;wxmsw28d_html.lib;wxmsw28d_adv.lib;wxmsw28d_core.lib;wxbase28d_xml.lib;wxbase28d.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy %(FullPath) "$(FS2PATH)/wxfred2_open_3_7_1-debug.exe"
|
||||
<Command>copy %(FullPath) "$(FS2PATH)/wxfred2_open_3_7_2-debug.exe"
|
||||
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Command>
|
||||
<Message>Copying build...</Message>
|
||||
<Outputs>$(FS2PATH)/wxfred2_open_3_7_1-debug.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
<Outputs>$(FS2PATH)/wxfred2_open_3_7_2-debug.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@@ -146,10 +146,10 @@ copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Comma
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;winmm.lib;wxmsw28_xrc.lib;wxmsw28_html.lib;wxmsw28_adv.lib;wxmsw28_core.lib;wxbase28_xml.lib;wxbase28.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy %(FullPath) "$(FS2PATH)\wxfred2_open_3_7_1.exe"
|
||||
<Command>copy %(FullPath) "$(FS2PATH)\wxfred2_open_3_7_2.exe"
|
||||
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Command>
|
||||
<Message>Copying build...</Message>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open_3_7_1.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open_3_7_2.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -170,14 +170,14 @@
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fred2_open_3_7_1-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fred2_open_3_7_1_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fred2_open_3_7_1_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fred2_open_3_7_1_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fred2_open_3_7_1</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fred2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fred2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fred2_open_3_7_1_AVX</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fred2_open_3_7_2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fred2_open_3_7_2_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fred2_open_3_7_2_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fred2_open_3_7_2_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fred2_open_3_7_2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fred2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fred2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fred2_open_3_7_2_AVX</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildStep>
|
||||
|
||||
@@ -169,14 +169,14 @@
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fs2_open_3_7_1-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fs2_open_3_7_1_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fs2_open_3_7_1_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fs2_open_3_7_1_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fs2_open_3_7_1</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fs2_open_3_7_1_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fs2_open_3_7_1_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fs2_open_3_7_1_AVX</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fs2_open_3_7_2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE|Win32'">fs2_open_3_7_2_SSE-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug SSE2|Win32'">fs2_open_3_7_2_SSE2-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug AVX|Win32'">fs2_open_3_7_2_AVX-DEBUG</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fs2_open_3_7_2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE|Win32'">fs2_open_3_7_2_SSE</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release SSE2|Win32'">fs2_open_3_7_2_SSE2</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release AVX|Win32'">fs2_open_3_7_2_AVX</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildStep>
|
||||
|
||||
@@ -95,10 +95,10 @@
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;winmm.lib;wxmsw28d_xrc.lib;wxmsw28d_html.lib;wxmsw28d_adv.lib;wxmsw28d_core.lib;wxbase28d_xml.lib;wxbase28d.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy %(FullPath) "$(FS2PATH)/wxfred2_open_3_7_1-debug.exe"
|
||||
<Command>copy %(FullPath) "$(FS2PATH)/wxfred2_open_3_7_2-debug.exe"
|
||||
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Command>
|
||||
<Message>Copying build...</Message>
|
||||
<Outputs>$(FS2PATH)/wxfred2_open_3_7_1-debug.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
<Outputs>$(FS2PATH)/wxfred2_open_3_7_2-debug.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@@ -146,10 +146,10 @@ copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Comma
|
||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;winmm.lib;wxmsw28_xrc.lib;wxmsw28_html.lib;wxmsw28_adv.lib;wxmsw28_core.lib;wxbase28_xml.lib;wxbase28.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>copy %(FullPath) "$(FS2PATH)\wxfred2_open_3_7_1.exe"
|
||||
<Command>copy %(FullPath) "$(FS2PATH)\wxfred2_open_3_7_2.exe"
|
||||
copy "$(ProjectDir)..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc"</Command>
|
||||
<Message>Copying build...</Message>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open_3_7_1.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
<Outputs>$(FS2PATH)\wxfred2_open_3_7_2.exe;$(FS2PATH)\wxfred.xrc;%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -54,14 +54,14 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 wsock32.lib winmm.lib msacm32.lib vfw32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"Release/fred2_open_3_7_1.exe" /libpath:"Release" /libpath:"../../STLport-5.2.1/lib" /libpath:"../../oggvorbis/lib" /libpath:"../../openal/libs/win32" /libpath:"../../openal/libs/win64" /MAPINFO:EXPORTS /MAPINFO:LINES /FORCE:MULTIPLE
|
||||
# ADD LINK32 wsock32.lib winmm.lib msacm32.lib vfw32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"Release/fred2_open_3_7_2.exe" /libpath:"Release" /libpath:"../../STLport-5.2.1/lib" /libpath:"../../oggvorbis/lib" /libpath:"../../openal/libs/win32" /libpath:"../../openal/libs/win64" /MAPINFO:EXPORTS /MAPINFO:LINES /FORCE:MULTIPLE
|
||||
# SUBTRACT LINK32 /map
|
||||
# Begin Custom Build - Copying build...
|
||||
InputPath=.\Release\fred2_open_3_7_1.exe
|
||||
InputPath=.\Release\fred2_open_3_7_2.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(FS2PATH)/fred2_open_3_7_1.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy /y $(InputPath) "$(FS2PATH)/fred2_open_3_7_1.exe"
|
||||
"$(FS2PATH)/fred2_open_3_7_2.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy /y $(InputPath) "$(FS2PATH)/fred2_open_3_7_2.exe"
|
||||
|
||||
# End Custom Build
|
||||
|
||||
@@ -89,14 +89,14 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 Quartz.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /nodefaultlib:"libcmt.lib" /out:"Debug/fred2_open_3_7_1-debug.exe" /pdbtype:sept /libpath:"Debug" /libpath:"../../STLport-5.2.1/lib" /libpath:"../../oggvorbis/lib" /libpath:"../../openal/libs/win32" /libpath:"../../openal/libs/win64" /MAPINFO:EXPORTS /MAPINFO:LINES /FORCE:MULTIPLE
|
||||
# ADD LINK32 Quartz.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /nodefaultlib:"libcmt.lib" /out:"Debug/fred2_open_3_7_2-debug.exe" /pdbtype:sept /libpath:"Debug" /libpath:"../../STLport-5.2.1/lib" /libpath:"../../oggvorbis/lib" /libpath:"../../openal/libs/win32" /libpath:"../../openal/libs/win64" /MAPINFO:EXPORTS /MAPINFO:LINES /FORCE:MULTIPLE
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Custom Build - Copying build...
|
||||
InputPath=.\Debug\fred2_open_3_7_1-debug.exe
|
||||
InputPath=.\Debug\fred2_open_3_7_2-debug.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(FS2PATH)/fred2_open_3_7_1-debug.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy /y $(InputPath) "$(FS2PATH)/fred2_open_3_7_1-debug.exe"
|
||||
"$(FS2PATH)/fred2_open_3_7_2-debug.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy /y $(InputPath) "$(FS2PATH)/fred2_open_3_7_2-debug.exe"
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
||||
@@ -54,14 +54,14 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo /o"Release\Profile\Freespace2.bsc" "Release\Profile\*.sbr"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 Quartz.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"Release/fs2_open_3_7_1.exe" /libpath:"Release" /libpath:"../../STLport-5.2.1/lib" /libpath:"../../oggvorbis/lib" /libpath:"../../openal/libs/win32" /libpath:"../../openal/libs/win64" /MAPINFO:EXPORTS /MAPINFO:LINES
|
||||
# ADD LINK32 Quartz.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"Release/fs2_open_3_7_2.exe" /libpath:"Release" /libpath:"../../STLport-5.2.1/lib" /libpath:"../../oggvorbis/lib" /libpath:"../../openal/libs/win32" /libpath:"../../openal/libs/win64" /MAPINFO:EXPORTS /MAPINFO:LINES
|
||||
# SUBTRACT LINK32 /map /debug
|
||||
# Begin Custom Build - Copying build...
|
||||
InputPath=.\Release\fs2_open_3_7_1.exe
|
||||
InputPath=.\Release\fs2_open_3_7_2.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(FS2PATH)/fs2_open_3_7_1.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy /y $(InputPath) "$(FS2PATH)/fs2_open_3_7_1.exe"
|
||||
"$(FS2PATH)/fs2_open_3_7_2.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy /y $(InputPath) "$(FS2PATH)/fs2_open_3_7_2.exe"
|
||||
|
||||
# End Custom Build
|
||||
|
||||
@@ -89,14 +89,14 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo /o"Debug\Profile\Freespace2.bsc" "Debug\Profile\*.sbr"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 Quartz.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib /nologo /subsystem:windows /map /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /nodefaultlib:"libcmt.lib" /out:"Debug\fs2_open_3_7_1-debug.exe" /libpath:"Debug" /libpath:"../../STLport-5.2.1/lib" /libpath:"../../oggvorbis/lib" /libpath:"../../openal/libs/win32" /libpath:"../../openal/libs/win64" /MAPINFO:EXPORTS /MAPINFO:LINES
|
||||
# ADD LINK32 Quartz.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib openal32.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib theora_static.lib /nologo /subsystem:windows /map /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /nodefaultlib:"libcmt.lib" /out:"Debug\fs2_open_3_7_2-debug.exe" /libpath:"Debug" /libpath:"../../STLport-5.2.1/lib" /libpath:"../../oggvorbis/lib" /libpath:"../../openal/libs/win32" /libpath:"../../openal/libs/win64" /MAPINFO:EXPORTS /MAPINFO:LINES
|
||||
# SUBTRACT LINK32 /pdb:none /incremental:no
|
||||
# Begin Custom Build - Copying build...
|
||||
InputPath=.\Debug\fs2_open_3_7_1-debug.exe
|
||||
InputPath=.\Debug\fs2_open_3_7_2-debug.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"$(FS2PATH)/fs2_open_3_7_1-debug.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy /y $(InputPath) "$(FS2PATH)/fs2_open_3_7_1-debug.exe"
|
||||
"$(FS2PATH)/fs2_open_3_7_2-debug.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy /y $(InputPath) "$(FS2PATH)/fs2_open_3_7_2-debug.exe"
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
||||
@@ -54,18 +54,18 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo /o"Release/Profile/wxFRED2.bsc" "Release\Profile\*.sbr"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw28_xrc.lib wxmsw28_html.lib wxmsw28_adv.lib wxmsw28_core.lib wxbase28_xml.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /out:"Release/wxfred2_open_3_7_1.exe" /libpath:"../../STLport-5.2.1/lib" /libpath:"$(WXWIN)/lib" /libpath:"$(WXWIN)/lib/vc_lib"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw28_xrc.lib wxmsw28_html.lib wxmsw28_adv.lib wxmsw28_core.lib wxbase28_xml.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /out:"Release/wxfred2_open_3_7_2.exe" /libpath:"../../STLport-5.2.1/lib" /libpath:"$(WXWIN)/lib" /libpath:"$(WXWIN)/lib/vc_lib"
|
||||
# SUBTRACT LINK32 /map /debug /nodefaultlib
|
||||
# Begin Custom Build - Copying build...
|
||||
ProjDir=.
|
||||
InputPath=.\Release\wxfred2_open_3_7_1.exe
|
||||
InputPath=.\Release\wxfred2_open_3_7_2.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
BuildCmds= \
|
||||
copy $(InputPath) "$(FS2PATH)\wxfred2_open_3_7_1.exe" \
|
||||
copy $(InputPath) "$(FS2PATH)\wxfred2_open_3_7_2.exe" \
|
||||
copy "$(ProjDir)\..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc" \
|
||||
|
||||
"$(FS2PATH)\wxfred2_open_3_7_1.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(FS2PATH)\wxfred2_open_3_7_2.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(FS2PATH)\wxfred.xrc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
@@ -96,18 +96,18 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo /o"Debug/Profile/wxFRED2.bsc" "Debug\Profile\*.sbr"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw28d_xrc.lib wxmsw28d_html.lib wxmsw28d_adv.lib wxmsw28d_core.lib wxbase28d_xml.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /out:"Debug/wxfred2_open_3_7_1-debug.exe" /pdbtype:sept /libpath:"../../STLport-5.2.1/lib" /libpath:"$(WXWIN)/lib" /libpath:"$(WXWIN)/lib/vc_lib"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw28d_xrc.lib wxmsw28d_html.lib wxmsw28d_adv.lib wxmsw28d_core.lib wxbase28d_xml.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /out:"Debug/wxfred2_open_3_7_2-debug.exe" /pdbtype:sept /libpath:"../../STLport-5.2.1/lib" /libpath:"$(WXWIN)/lib" /libpath:"$(WXWIN)/lib/vc_lib"
|
||||
# SUBTRACT LINK32 /nodefaultlib
|
||||
# Begin Custom Build - Copying build...
|
||||
ProjDir=.
|
||||
InputPath=.\Debug\wxfred2_open_3_7_1-debug.exe
|
||||
InputPath=.\Debug\wxfred2_open_3_7_2-debug.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
BuildCmds= \
|
||||
copy $(InputPath) "$(FS2PATH)/wxfred2_open_3_7_1-debug.exe" \
|
||||
copy $(InputPath) "$(FS2PATH)/wxfred2_open_3_7_2-debug.exe" \
|
||||
copy "$(ProjDir)\..\..\code\wxfred2\wxfred.xrc" "$(FS2PATH)\wxfred.xrc" \
|
||||
|
||||
"$(FS2PATH)/wxfred2_open_3_7_1-debug.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(FS2PATH)/wxfred2_open_3_7_2-debug.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(FS2PATH)\wxfred.xrc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
|
||||
Binary file not shown.
@@ -4534,7 +4534,7 @@
|
||||
i386,
|
||||
);
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 3.7.1;
|
||||
CURRENT_PROJECT_VERSION = 3.7.2;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
@@ -4567,7 +4567,7 @@
|
||||
i386,
|
||||
);
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 3.7.1;
|
||||
CURRENT_PROJECT_VERSION = 3.7.2;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
|
||||
Binary file not shown.
@@ -614,8 +614,6 @@
|
||||
918A074C1804B4A600983AE1 /* libjansson.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 918A07221804AFAA00983AE1 /* libjansson.a */; };
|
||||
918A074D1804B4A600983AE1 /* libmongoose.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 918A07141804AF0F00983AE1 /* libmongoose.a */; };
|
||||
9193B29817EDFEB7003CC0BA /* profiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9193B29717EDFEB7003CC0BA /* profiling.cpp */; };
|
||||
91F4EE3A1AB32675006EF158 /* hashtable_seed.c in Sources */ = {isa = PBXBuildFile; fileRef = 91F4EE381AB32675006EF158 /* hashtable_seed.c */; };
|
||||
91F4EE3B1AB32675006EF158 /* lookup3.h in Headers */ = {isa = PBXBuildFile; fileRef = 91F4EE391AB32675006EF158 /* lookup3.h */; };
|
||||
F007DDF612F4F44600D2F6C1 /* jconfig.h in Headers */ = {isa = PBXBuildFile; fileRef = F007DDB512F4F44600D2F6C1 /* jconfig.h */; };
|
||||
F007DDF712F4F44600D2F6C1 /* jdct.h in Headers */ = {isa = PBXBuildFile; fileRef = F007DDB612F4F44600D2F6C1 /* jdct.h */; };
|
||||
F007DDF912F4F44600D2F6C1 /* jerror.h in Headers */ = {isa = PBXBuildFile; fileRef = F007DDB812F4F44600D2F6C1 /* jerror.h */; };
|
||||
@@ -1558,8 +1556,6 @@
|
||||
918A07361804B01800983AE1 /* utf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf.h; sourceTree = "<group>"; };
|
||||
918A07371804B01800983AE1 /* value.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = value.c; sourceTree = "<group>"; };
|
||||
9193B29717EDFEB7003CC0BA /* profiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = profiling.cpp; sourceTree = "<group>"; };
|
||||
91F4EE381AB32675006EF158 /* hashtable_seed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hashtable_seed.c; sourceTree = "<group>"; };
|
||||
91F4EE391AB32675006EF158 /* lookup3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lookup3.h; sourceTree = "<group>"; };
|
||||
B2F67ED704C74A3F00A80002 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
|
||||
B2F67F1E04C773E400A80002 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = /System/Library/Frameworks/GLUT.framework; sourceTree = "<absolute>"; };
|
||||
F007DDB512F4F44600D2F6C1 /* jconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jconfig.h; sourceTree = "<group>"; };
|
||||
@@ -3120,8 +3116,6 @@
|
||||
918A07261804B01800983AE1 /* jansson */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
91F4EE381AB32675006EF158 /* hashtable_seed.c */,
|
||||
91F4EE391AB32675006EF158 /* lookup3.h */,
|
||||
918A07271804B01800983AE1 /* dump.c */,
|
||||
918A07281804B01800983AE1 /* error.c */,
|
||||
918A07291804B01800983AE1 /* hashtable.c */,
|
||||
@@ -3550,7 +3544,6 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
918A07461804B01800983AE1 /* utf.h in Headers */,
|
||||
91F4EE3B1AB32675006EF158 /* lookup3.h in Headers */,
|
||||
918A073B1804B01800983AE1 /* hashtable.h in Headers */,
|
||||
918A073E1804B01800983AE1 /* jansson_private.h in Headers */,
|
||||
918A07431804B01800983AE1 /* strbuffer.h in Headers */,
|
||||
@@ -4226,7 +4219,6 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
91F4EE3A1AB32675006EF158 /* hashtable_seed.c in Sources */,
|
||||
918A07451804B01800983AE1 /* utf.c in Sources */,
|
||||
918A07391804B01800983AE1 /* error.c in Sources */,
|
||||
918A07441804B01800983AE1 /* strconv.c in Sources */,
|
||||
@@ -4436,7 +4428,7 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = "3.7.1";
|
||||
CURRENT_PROJECT_VERSION = "3.7.2";
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
@@ -4482,7 +4474,7 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = "3.7.1";
|
||||
CURRENT_PROJECT_VERSION = "3.7.2";
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
@@ -4595,13 +4587,6 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
_DEBUG,
|
||||
SCP_UNIX,
|
||||
USE_OPENAL,
|
||||
APPLE_APP,
|
||||
HAVE_STDINT_H,
|
||||
);
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
@@ -4614,13 +4599,6 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
NDEBUG,
|
||||
SCP_UNIX,
|
||||
USE_OPENAL,
|
||||
APPLE_APP,
|
||||
HAVE_STDINT_H,
|
||||
);
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<Option virtualFolders="Freespace2/;" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="../Debug/Freespace2/lib/fs2_open_3_7_1_debug" prefix_auto="1" extension_auto="1" />
|
||||
<Option output="../Debug/Freespace2/lib/fs2_open_3_7_2_debug" prefix_auto="1" extension_auto="1" />
|
||||
<Option working_dir="../freespaceDirectoryLink" />
|
||||
<Option object_output="../Debug/Freespace2/obj/" />
|
||||
<Option type="1" />
|
||||
@@ -24,7 +24,7 @@
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="../Release/Freespace2/lib/fs2_open_3_7_1" prefix_auto="1" extension_auto="1" />
|
||||
<Option output="../Release/Freespace2/lib/fs2_open_3_7_2" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="../Release/Freespace2/obj/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
|
||||
Reference in new issue
Block a user