-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove old comment * Add BULL, b69dcab9ea1ae226e6c9d31343ae96947c0ac131 from RFCDOC * Format * Add missing files BULL, 022026b395b7d7c24c9795aaac851e4a801e3d41 from RFCDOC * Fix * Add dll
- Loading branch information
1 parent
c0981a4
commit 51532aa
Showing
76 changed files
with
9,649 additions
and
1,352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/********************************************************************** | ||
File: Buffy.h | ||
Author: EmperorFool | ||
Created: 2010-01-23 | ||
Defines common constants and functions for use throughout BUFFY. | ||
Copyright (c) 2010 The BUG Mod. All rights reserved. | ||
**********************************************************************/ | ||
|
||
#pragma once | ||
|
||
#ifndef BUFFY_H | ||
#define BUFFY_H | ||
|
||
// name of the Python module where all the BUFFY functions that the DLL calls must live | ||
// MUST BE A BUILT-IN MODULE IN THE ENTRYPOINTS FOLDER | ||
// currently CvAppInterface | ||
#define PYBuffyModule PYCivModule | ||
|
||
// Increment this by 1 each time you commit new/changed functions in the Python API. | ||
#define BUFFY_DLL_API_VERSION 1 | ||
|
||
// Used to signal the BULL saved game format is used | ||
#define BUFFY_DLL_SAVE_FORMAT 64 | ||
|
||
// These are display-only values; the version and build should be changed for each release. | ||
#define BUFFY_DLL_NAME L"BUFFY" | ||
#define BUFFY_DLL_VERSION L"3.19.003" | ||
#define BUFFY_DLL_BUILD L"100" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/********************************************************************** | ||
File: BugMod.h | ||
Author: EmperorFool | ||
Created: 2009-01-22 | ||
Defines common constants and functions for use throughout the BUG Mod. | ||
Copyright (c) 2009 The BUG Mod. All rights reserved. | ||
**********************************************************************/ | ||
|
||
#pragma once | ||
|
||
#ifndef BUG_MOD_H | ||
#define BUG_MOD_H | ||
|
||
// name of the Python module where all the BUG functions that the DLL calls must live | ||
// MUST BE A BUILT-IN MODULE IN THE ENTRYPOINTS FOLDER | ||
// currently CvAppInterface | ||
#define PYBugModule PYCivModule | ||
|
||
// Increment this by 1 each time you commit new/changed functions/constants in the Python API. | ||
#define BUG_DLL_API_VERSION 4 | ||
|
||
// Used to signal the BULL saved game format is used | ||
#define BUG_DLL_SAVE_FORMAT 64 | ||
|
||
// These are display-only values, and the version should be changed for each release. | ||
#define BUG_DLL_NAME L"BULL" | ||
#define BUG_DLL_VERSION L"1.2" | ||
#define BUG_DLL_BUILD L"182" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/********************************************************************** | ||
File: CvBugOptions.cpp | ||
Author: EmperorFool | ||
Created: 2009-01-21 | ||
Copyright (c) 2009 The BUG Mod. All rights reserved. | ||
**********************************************************************/ | ||
|
||
// This file has been edited for K-Mod | ||
|
||
#include "CvGameCoreDLL.h" | ||
#include "CyArgsList.h" | ||
#include "CvDLLPythonIFaceBase.h" | ||
#include "FVariableSystem.h" | ||
|
||
#include "CvBugOptions.h" | ||
|
||
bool g_bIsBug = false; | ||
|
||
void logMsg(const char *format, ...) | ||
{ | ||
static char buf[2048]; | ||
_vsnprintf(buf, 2048 - 4, format, (char *)(&format + 1)); | ||
gDLL->logMsg("bull.log", buf); | ||
} | ||
|
||
bool isBug() | ||
{ | ||
return g_bIsBug; | ||
} | ||
|
||
void setIsBug(bool bIsBug) | ||
{ | ||
logMsg("isBug: %s", bIsBug ? "true" : "false"); | ||
g_bIsBug = bIsBug; | ||
} | ||
|
||
bool getDefineBOOL(const char *xmlKey, bool bDefault) | ||
{ | ||
int iResult = 0; | ||
if (GC.getDefinesVarSystem()->GetValue(xmlKey, iResult)) | ||
{ | ||
return iResult != 0; | ||
} | ||
else | ||
{ | ||
return bDefault; | ||
} | ||
} | ||
|
||
int getDefineINT(const char *xmlKey, int iDefault) | ||
{ | ||
int iResult = 0; | ||
if (GC.getDefinesVarSystem()->GetValue(xmlKey, iResult)) | ||
{ | ||
return iResult; | ||
} | ||
else | ||
{ | ||
return iDefault; | ||
} | ||
} | ||
|
||
bool getBugOptionBOOL(const char *id, bool bDefault, const char *xmlKey) | ||
{ | ||
if (isBug()) | ||
{ | ||
CyArgsList argsList; | ||
long lResult = 0; | ||
|
||
argsList.add(id); | ||
argsList.add(bDefault); | ||
|
||
//logMsg("debug - getOptionBOOL(%s)", id); | ||
gDLL->getPythonIFace()->callFunction(PYBugOptionsModule, "getOptionBOOL", argsList.makeFunctionArgs(), &lResult); | ||
//logMsg("debug - got value %ld", lResult); | ||
|
||
return lResult != 0; | ||
} | ||
else | ||
{ | ||
CvString tmp; | ||
if (!xmlKey) | ||
{ | ||
tmp.append(OPTION_XML_PREFIX); | ||
tmp.append(id); | ||
xmlKey = tmp.c_str(); | ||
} | ||
//logMsg("debug - getBugOptionBOOL %s", xmlKey); | ||
return getDefineBOOL(xmlKey, bDefault); | ||
} | ||
} | ||
|
||
int getBugOptionINT(const char *id, int iDefault, const char *xmlKey) | ||
{ | ||
if (isBug()) | ||
{ | ||
CyArgsList argsList; | ||
long lResult = 0; | ||
|
||
argsList.add(id); | ||
argsList.add(iDefault); | ||
|
||
//logMsg("debug - getOptionBOOL(%s)", id); | ||
gDLL->getPythonIFace()->callFunction(PYBugOptionsModule, "getOptionINT", argsList.makeFunctionArgs(), &lResult); | ||
//logMsg("debug - got value %ld", lResult); | ||
|
||
return lResult; | ||
} | ||
else | ||
{ | ||
CvString tmp; | ||
if (!xmlKey) | ||
{ | ||
tmp.append(OPTION_XML_PREFIX); | ||
tmp.append(id); | ||
xmlKey = tmp.c_str(); | ||
} | ||
//logMsg("debug - getBugOptionINT %s", xmlKey); | ||
return getDefineINT(xmlKey, iDefault); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
/********************************************************************** | ||
File: CvBugOptions.h | ||
Author: EmperorFool | ||
Created: 2009-01-21 | ||
Calls out to the CvAppInterface Python module to check user options. | ||
Copyright (c) 2009 The BUG Mod. All rights reserved. | ||
**********************************************************************/ | ||
|
||
#ifndef BUG_OPTIONS_H | ||
#define BUG_OPTIONS_H | ||
|
||
// Must use existing module because the DLL cannot see new modules in CustomAssets | ||
#define PYBugOptionsModule PYCivModule | ||
|
||
// Text prepended to option name if no XML key given | ||
#define OPTION_XML_PREFIX "BULL__" | ||
|
||
void logMsg(const char *format, ...); | ||
|
||
bool isBug(); | ||
void setIsBug(bool bIsBug); | ||
|
||
bool getDefineBOOL(const char *xmlKey, bool bDefault = false); | ||
int getDefineINT(const char *xmlKey, int iDefault = 0); | ||
|
||
bool getBugOptionBOOL(const char *id, bool bDefault = true, const char *xmlKey = NULL); | ||
int getBugOptionINT(const char *id, int iDefault = 0, const char *xmlKey = NULL); | ||
|
||
#endif |
Oops, something went wrong.