2011-02-18 13:05:18 +00:00
|
|
|
/*
|
2002-10-12 11:37:38 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-01-07 19:13:47 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup bke
|
2011-02-18 13:05:18 +00:00
|
|
|
*/
|
2020-03-02 15:07:49 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-05-12 20:39:39 +00:00
|
|
|
#define RET_OK 0
|
|
|
|
#define RET_ERROR 1
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
|
2020-09-30 11:51:13 +10:00
|
|
|
struct BlendDataReader;
|
|
|
|
struct BlendWriter;
|
2013-01-27 14:28:45 +00:00
|
|
|
struct ID;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct Image;
|
2009-06-30 19:20:45 +00:00
|
|
|
struct Main;
|
|
|
|
struct PackedFile;
|
|
|
|
struct ReportList;
|
|
|
|
struct VFont;
|
2020-03-17 14:41:48 +01:00
|
|
|
struct Volume;
|
2020-03-20 12:19:44 +11:00
|
|
|
struct bSound;
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2019-07-08 00:40:56 +10:00
|
|
|
enum ePF_FileCompare {
|
|
|
|
PF_CMP_EQUAL = 0,
|
|
|
|
PF_CMP_DIFFERS = 1,
|
|
|
|
PF_CMP_NOFILE = 2,
|
|
|
|
};
|
2019-07-08 00:06:52 +10:00
|
|
|
|
2019-07-08 00:40:56 +10:00
|
|
|
enum ePF_FileStatus {
|
2019-07-08 00:06:52 +10:00
|
|
|
PF_WRITE_ORIGINAL = 3,
|
|
|
|
PF_WRITE_LOCAL = 4,
|
|
|
|
PF_USE_LOCAL = 5,
|
|
|
|
PF_USE_ORIGINAL = 6,
|
|
|
|
PF_KEEP = 7,
|
|
|
|
PF_REMOVE = 8,
|
|
|
|
|
|
|
|
PF_ASK = 10,
|
|
|
|
};
|
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/* Pack. */
|
|
|
|
|
2019-07-07 23:57:35 +10:00
|
|
|
struct PackedFile *BKE_packedfile_duplicate(const struct PackedFile *pf_src);
|
|
|
|
struct PackedFile *BKE_packedfile_new(struct ReportList *reports,
|
|
|
|
const char *filename,
|
2020-09-04 20:59:13 +02:00
|
|
|
const char *basepath);
|
2019-07-07 23:57:35 +10:00
|
|
|
struct PackedFile *BKE_packedfile_new_from_memory(void *mem, int memlen);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
* No libraries for now.
|
|
|
|
*/
|
2019-07-07 23:57:35 +10:00
|
|
|
void BKE_packedfile_pack_all(struct Main *bmain, struct ReportList *reports, bool verbose);
|
|
|
|
void BKE_packedfile_pack_all_libraries(struct Main *bmain, struct ReportList *reports);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/* Unpack. */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* #BKE_packedfile_unpack_to_file() looks at the existing files (abs_name, local_name)
|
|
|
|
* and a packed file.
|
|
|
|
*
|
|
|
|
* It returns a char *to the existing file name / new file name or NULL when
|
|
|
|
* there was an error or when the user decides to cancel the operation.
|
|
|
|
*
|
|
|
|
* \warning 'abs_name' may be relative still! (use a "//" prefix)
|
|
|
|
* be sure to run #BLI_path_abs on it first.
|
|
|
|
*/
|
2019-07-07 23:57:35 +10:00
|
|
|
char *BKE_packedfile_unpack_to_file(struct ReportList *reports,
|
|
|
|
const char *ref_file_name,
|
|
|
|
const char *abs_name,
|
|
|
|
const char *local_name,
|
|
|
|
struct PackedFile *pf,
|
2019-07-08 00:06:52 +10:00
|
|
|
enum ePF_FileStatus how);
|
2021-09-13 14:13:58 +02:00
|
|
|
char *BKE_packedfile_unpack(struct Main *bmain,
|
|
|
|
struct ReportList *reports,
|
|
|
|
struct ID *id,
|
2021-09-14 16:41:29 +02:00
|
|
|
const char *orig_file_path,
|
2021-09-13 14:13:58 +02:00
|
|
|
struct PackedFile *pf,
|
|
|
|
enum ePF_FileStatus how);
|
2019-07-07 23:57:35 +10:00
|
|
|
int BKE_packedfile_unpack_vfont(struct Main *bmain,
|
|
|
|
struct ReportList *reports,
|
|
|
|
struct VFont *vfont,
|
2019-07-08 00:06:52 +10:00
|
|
|
enum ePF_FileStatus how);
|
2019-07-07 23:57:35 +10:00
|
|
|
int BKE_packedfile_unpack_sound(struct Main *bmain,
|
|
|
|
struct ReportList *reports,
|
|
|
|
struct bSound *sound,
|
2019-07-08 00:06:52 +10:00
|
|
|
enum ePF_FileStatus how);
|
2019-07-07 23:57:35 +10:00
|
|
|
int BKE_packedfile_unpack_image(struct Main *bmain,
|
|
|
|
struct ReportList *reports,
|
|
|
|
struct Image *ima,
|
2019-07-08 00:06:52 +10:00
|
|
|
enum ePF_FileStatus how);
|
2020-03-17 14:41:48 +01:00
|
|
|
int BKE_packedfile_unpack_volume(struct Main *bmain,
|
|
|
|
struct ReportList *reports,
|
|
|
|
struct Volume *volume,
|
|
|
|
enum ePF_FileStatus how);
|
2019-07-08 00:06:52 +10:00
|
|
|
void BKE_packedfile_unpack_all(struct Main *bmain,
|
|
|
|
struct ReportList *reports,
|
|
|
|
enum ePF_FileStatus how);
|
2019-07-07 23:57:35 +10:00
|
|
|
int BKE_packedfile_unpack_all_libraries(struct Main *bmain, struct ReportList *reports);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2019-07-07 23:57:35 +10:00
|
|
|
int BKE_packedfile_write_to_file(struct ReportList *reports,
|
|
|
|
const char *ref_file_name,
|
|
|
|
const char *filename,
|
|
|
|
struct PackedFile *pf,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool guimode);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/* Free. */
|
|
|
|
|
2019-07-07 23:57:35 +10:00
|
|
|
void BKE_packedfile_free(struct PackedFile *pf);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/* Info. */
|
|
|
|
|
2019-07-07 23:57:35 +10:00
|
|
|
int BKE_packedfile_count_all(struct Main *bmain);
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
* This function compares a packed file to a 'real' file.
|
|
|
|
* It returns an integer indicating if:
|
|
|
|
*
|
|
|
|
* - #PF_EQUAL: the packed file and original file are identical.
|
|
|
|
* - #PF_DIFFERENT: the packed file and original file differ.
|
|
|
|
* - #PF_NOFILE: the original file doesn't exist.
|
|
|
|
*/
|
2019-07-08 00:40:56 +10:00
|
|
|
enum ePF_FileCompare BKE_packedfile_compare_to_file(const char *ref_file_name,
|
|
|
|
const char *filename,
|
|
|
|
struct PackedFile *pf);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/* Read. */
|
|
|
|
|
2019-07-07 23:57:35 +10:00
|
|
|
int BKE_packedfile_seek(struct PackedFile *pf, int offset, int whence);
|
|
|
|
void BKE_packedfile_rewind(struct PackedFile *pf);
|
|
|
|
int BKE_packedfile_read(struct PackedFile *pf, void *data, int size);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
* ID should be not NULL, return true if there's a packed file.
|
|
|
|
*/
|
2021-10-11 09:40:22 +02:00
|
|
|
bool BKE_packedfile_id_check(const struct ID *id);
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
* ID should be not NULL, throws error when ID is Library.
|
|
|
|
*/
|
2019-07-07 23:57:35 +10:00
|
|
|
void BKE_packedfile_id_unpack(struct Main *bmain,
|
|
|
|
struct ID *id,
|
|
|
|
struct ReportList *reports,
|
2019-07-08 00:06:52 +10:00
|
|
|
enum ePF_FileStatus how);
|
2013-01-27 14:28:45 +00:00
|
|
|
|
2020-09-10 14:35:09 +02:00
|
|
|
void BKE_packedfile_blend_write(struct BlendWriter *writer, struct PackedFile *pf);
|
|
|
|
void BKE_packedfile_blend_read(struct BlendDataReader *reader, struct PackedFile **pf_p);
|
|
|
|
|
2020-03-02 15:07:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|