Skip to content

Commit

Permalink
Disable script console output in release build
Browse files Browse the repository at this point in the history
Improve Ini
  • Loading branch information
segrax committed Dec 31, 2019
1 parent 88eeaab commit eea76b9
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 16 deletions.
8 changes: 5 additions & 3 deletions Projects/WinInstaller/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SetCompressor lzma
; Welcome page
!insertmacro MUI_PAGE_WELCOME

!insertmacro MUI_PAGE_LICENSE "..\..\gpl-3.0.txt"
!insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
;!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY

Expand Down Expand Up @@ -75,7 +75,7 @@ Section "Copy Files" drcreepInst

File ".\openfodder.ini"
File ".\packages\VC_redist.x86.exe"
File "..\..\gpl-3.0.txt"
File "..\..\COPYING*"
File "..\..\Readme.md"
File "..\VS2017\Release\OpenFodder.exe"
File "..\VS2017\Release\SDL2.dll"
Expand All @@ -90,10 +90,12 @@ Section "Copy Files" drcreepInst
CopyFilesLocal:

SetOutPath "$DataDest"
File /r "..\..\Run\about.bmp"
File /r "..\..\Run\Campaigns"
File /r "..\..\Run\Data"
File /r "..\..\Run\Saves"

File /r "..\..\Run\Scripts"

SetOutPath "$INSTDIR"

;Store installation folder
Expand Down
45 changes: 43 additions & 2 deletions Projects/WinInstaller/openfodder.ini
Original file line number Diff line number Diff line change
@@ -1,23 +1,64 @@
; OpenFodder
;
; Example ini settings are the engine defaults
;

[openfodder]
window=false

; Start the game in a window
window=true

; Enable cheat keys
cheats=false

; Window size multipler by original game resolution (Amiga 320x225, Dos 320x200)
; auto finds a size approximately half your screen resolution
; values such as 1, 2 or 3+ are multiples of the original resolution
scale=auto

; Number of map tiles to draw horizontally (0 for platform default)
columns=0

; Number of map tiles to draw vertically (0 for platform default)
rows=0

; Don't use mouse grab (this alters the behaviour of the in-game camera window) -- Useful for VMs
alternate-mouse=false

[paths]
; Paths to data base folder
; There is no limit to the number paths in this section (eg, path1, path2... path10)
;path1=c:/games/openfodder
;path2=d:/games/openfodder
;path3=d:/games/openfodder

;
;
[engine]

; Default platform (amiga/pc)
platform=amiga

; Game engine to use in single/random maps (cf1/cf2)
game=cf1

; Maximum number of sprites in game (original engine is 45)
maxsprite=45

; Maximum number of enemies which can spawn (original engine is 10)
maxspawn=10


[skip]

; Skip the game introduction screens
intro=false

; Skip the briefing screen
briefing=false

; Skip the killed in action / promotion screens
service=false
hill=false

; Skip the hill recruit screen
hill=false
4 changes: 1 addition & 3 deletions Source/Fodder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10031,9 +10031,7 @@ void cFodder::Sprite_Handle_Player(sSprite *pSprite) {
if (mSquad_CurrentWeapon[pSprite->field_32] == eWeapon_Rocket) {
mTroop_Weapon_Grenade_Disabled = true;
mTroop_Weapon_Bullet_Disabled = true;

}
else {
} else {
if (mSquad_CurrentWeapon[pSprite->field_32] == eWeapon_Grenade) {
mTroop_Weapon_Rocket_Disabled = true;
mTroop_Weapon_Bullet_Disabled = true;
Expand Down
7 changes: 6 additions & 1 deletion Source/ScriptingEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,22 @@ namespace dukglue {
}

void print(const std::string pString) {

#ifdef DEBUG
g_Debugger->Notice(pString);
#endif
}

void consoleLog(DukValue pValue) {
#ifdef DEBUG
std::string json = duk_json_encode(pValue.context(), -1);
g_Debugger->Notice(json);
#endif
}

void consoleClear() {
#ifdef DEBUG
g_Debugger->ClearConsole();
#endif
}

cScriptFileIO::cScriptFileIO(std::string pFilename, bool pRead) {
Expand Down
15 changes: 8 additions & 7 deletions openfodder.ini.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; OpenFodder
;
;

; Example ini settings are the engine defaults
;

[openfodder]

Expand All @@ -13,23 +13,24 @@ cheats=false

; Window size multipler by original game resolution (Amiga 320x225, Dos 320x200)
; auto finds a size approximately half your screen resolution
; so values such as 1, 2 or 3
; values such as 1, 2 or 3+ are multiples of the original resolution
scale=auto

; Number of map tiles to draw horizontally (0 for platform default)
columns=22
columns=0

; Number of map tiles to draw vertically (0 for platform default)
rows=16
rows=0

; Don't use mouse grab (this alters the behaviour of the in-game camera window) -- Useful of VMs
; Don't use mouse grab (this alters the behaviour of the in-game camera window) -- Useful for VMs
alternate-mouse=false

[paths]
; Paths to data base folder
; There is no limit to the number paths in this section (eg, path1, path2... path10)
;path1=c:/games/openfodder
;path2=d:/games/openfodder
;path3=d:/games/openfodder

;
;
Expand All @@ -38,7 +39,7 @@ alternate-mouse=false
; Default platform (amiga/pc)
platform=amiga

; Game engine to use in single/random maps
; Game engine to use in single/random maps (cf1/cf2)
game=cf1

; Maximum number of sprites in game (original engine is 45)
Expand Down

0 comments on commit eea76b9

Please sign in to comment.