Updated GemRB project (courtesy of Beholder)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# The application settings for Android libSDL port
|
||||
AppSettingVersion=15
|
||||
AppSettingVersion=16
|
||||
LibSdlVersion=1.2
|
||||
AppName="GemRB"
|
||||
AppFullName=net.sourceforge.gemrb
|
||||
ScreenOrientation=h
|
||||
InhibitSuspend=n
|
||||
AppDataDownloadUrl="GemRB data(local)|data.zip"
|
||||
AppDataDownloadUrl="GemRB data(local)|data1.zip"
|
||||
SdlVideoResize=y
|
||||
SdlVideoResizeKeepAspect=y
|
||||
NeedDepthBuffer=n
|
||||
@@ -20,12 +20,13 @@ NonBlockingSwapBuffers=n
|
||||
RedefinedKeys="LCTRL c p o e"
|
||||
AppTouchscreenKeyboardKeysAmount=0
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||
RedefinedKeysScreenKb="LCTRL c p o e"
|
||||
MultiABI=y
|
||||
AppVersionCode=063
|
||||
AppVersionName="0.6.3"
|
||||
AppVersionCode=0631
|
||||
AppVersionName="0.6.3.1"
|
||||
CompiledLibraries="sdl_mixer ogg vorbis openal png python"
|
||||
CustomBuildScript=n
|
||||
AppCflags='-fexceptions -finline-functions -O2 -DSTATIC_LINK=Yes'
|
||||
AppCflags='-fexceptions -finline-functions -O3 -DSTATIC_LINK=Yes -DHAVE_SNPRINTF -DTOUCHSCREEN'
|
||||
AppLdflags=''
|
||||
AppSubdirsBuild=''
|
||||
AppUseCrystaXToolchain=y
|
||||
|
||||
Binary file not shown.
35
project/jni/application/gemrb/gemrb/CMakeLists.txt
Normal file
35
project/jni/application/gemrb/gemrb/CMakeLists.txt
Normal file
@@ -0,0 +1,35 @@
|
||||
ADD_SUBDIRECTORY( core )
|
||||
ADD_SUBDIRECTORY( plugins )
|
||||
ADD_SUBDIRECTORY( override )
|
||||
ADD_SUBDIRECTORY( GUIScripts )
|
||||
ADD_SUBDIRECTORY( docs )
|
||||
ADD_SUBDIRECTORY( tests )
|
||||
|
||||
ADD_EXECUTABLE(gemrb GemRB.cpp )
|
||||
SET_TARGET_PROPERTIES(gemrb PROPERTIES INSTALL_RPATH ${LIB_DIR})
|
||||
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(gemrb gemrb_core)
|
||||
ELSE(WIN32)
|
||||
IF(APPLE)
|
||||
TARGET_LINK_LIBRARIES(gemrb gemrb_core ${SDL_LIBRARY}
|
||||
${SDL_MAIN_LIBRARY_PATH} ${COCOA_LIBRARY_PATH} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
ELSE(APPLE)
|
||||
if (STATIC_LINK)
|
||||
TARGET_LINK_LIBRARIES(gemrb ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}
|
||||
-Wl,--whole-archive gemrb_core ${plugins} -Wl,--no-whole-archive)
|
||||
else (STATIC_LINK)
|
||||
TARGET_LINK_LIBRARIES(gemrb gemrb_core ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif (STATIC_LINK)
|
||||
ENDIF(APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# preconfigure the sample config with the selected paths
|
||||
CONFIGURE_FILE(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/GemRB.cfg.sample.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/GemRB.cfg.sample"
|
||||
IMMEDIATE @ONLY
|
||||
)
|
||||
|
||||
INSTALL( TARGETS gemrb DESTINATION ${BIN_DIR} )
|
||||
INSTALL( FILES "${CMAKE_CURRENT_BINARY_DIR}/GemRB.cfg.sample" GemRB.cfg.noinstall.sample DESTINATION ${SYSCONF_DIR} )
|
||||
254
project/jni/application/gemrb/gemrb/GemRB.cfg.noinstall.sample
Normal file
254
project/jni/application/gemrb/gemrb/GemRB.cfg.noinstall.sample
Normal file
@@ -0,0 +1,254 @@
|
||||
#####################################################
|
||||
# #
|
||||
# This is the GemRB Configuration file. #
|
||||
# Here are defined some default parameters for #
|
||||
# basic configuration and paths definition. #
|
||||
# #
|
||||
# Parameters are defined as a Name=Value pair #
|
||||
# The Value can be of three types: #
|
||||
# - String #
|
||||
# - Integer #
|
||||
# - Boolean #
|
||||
# #
|
||||
# The String value is represented as follows #
|
||||
# i.e. H:\GemRB\plugins #
|
||||
# Integers are defined as follows #
|
||||
# i.e. 12723 #
|
||||
# Booleans are represented as 1 or 0 in this file #
|
||||
# #
|
||||
# Lines starting with # are ignored #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
#####################################################
|
||||
# #
|
||||
# Game Type [String] Use one of the following #
|
||||
# values: #
|
||||
# #
|
||||
# bg1 Baldur's Gate #
|
||||
# bg2 Baldur's Gate 2 : SoA or ToB #
|
||||
# tob Baldur's Gate 2 : ToB (obsolete) #
|
||||
# iwd IceWind Dale #
|
||||
# how IceWind Dale : HoW or ToTL #
|
||||
# iwd2 IceWind Dale 2 #
|
||||
# pst Planescape Torment #
|
||||
# (More will come) #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
GameType=test
|
||||
|
||||
#####################################################
|
||||
# Game Name [String] Title for GemRB window, use #
|
||||
# anything you wish, e.g. Baldur's Gate 3: RotFL #
|
||||
#####################################################
|
||||
|
||||
GameName=Baldur's Gate 2
|
||||
|
||||
#####################################################
|
||||
# Video Parameters #
|
||||
#####################################################
|
||||
|
||||
#Screen width
|
||||
Width=640
|
||||
|
||||
#Screen height
|
||||
Height=480
|
||||
|
||||
#Bits per pixel [Integer:16,32]
|
||||
Bpp=32
|
||||
|
||||
#Fullscreen [Boolean]
|
||||
Fullscreen=0
|
||||
|
||||
# Delay before tooltips appear [milliseconds]
|
||||
TooltipDelay=500
|
||||
|
||||
#####################################################
|
||||
# Audio Parameters #
|
||||
#####################################################
|
||||
# #
|
||||
# All volume options are in percents, with 100 #
|
||||
# being the normal and default volume #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
# Choices: openal (default), sdlaudio (faster, but limited featureset), none
|
||||
#AudioDriver = openal
|
||||
|
||||
# Volume of ambient sounds
|
||||
#VolumeAmbients = 100
|
||||
|
||||
# Volume during movie playback
|
||||
#VolumeMovie = 100
|
||||
|
||||
# Volume of background music
|
||||
#VolumeMusic = 100
|
||||
|
||||
# Volume of sound effects
|
||||
#VolumeSFX = 100
|
||||
|
||||
# Volume of PC or NPC voices
|
||||
#VolumeVoices = 100
|
||||
|
||||
#####################################################
|
||||
# Case Sensitive Filesystem [Boolean] #
|
||||
# #
|
||||
# If your installed game files are residing on a #
|
||||
# case sensitive filesystem (ext2 on Linux) then #
|
||||
# you need to set this value to 1, it has no #
|
||||
# effect on Windows #
|
||||
#####################################################
|
||||
|
||||
#CaseSensitive=1
|
||||
|
||||
#GameOnCD=0
|
||||
|
||||
#####################################################
|
||||
# GUI Parameters #
|
||||
#####################################################
|
||||
# #
|
||||
# GemRB may enhance the GUI of the Infinity Engine #
|
||||
# games (so far only in bg2) creating functionally #
|
||||
# new buttons or scrollbars where they weren't #
|
||||
# present in original games. It may improve its #
|
||||
# usability, but is not quite compatible with #
|
||||
# mods changing graphics and alignment in the *.chu #
|
||||
# files (e.g. the buttons will appear in old #
|
||||
# coordinates and may stop being clickable). #
|
||||
#####################################################
|
||||
|
||||
# Enable all gui enhancements ? [Boolean]
|
||||
GUIEnhancements = 1
|
||||
|
||||
|
||||
#####################################################
|
||||
# Debug #
|
||||
#####################################################
|
||||
|
||||
# Do not play intro videos [Boolean], useful for development
|
||||
#SkipIntroVideos=1
|
||||
|
||||
# Draw Frames per Second info [Boolean]
|
||||
#DrawFPS=1
|
||||
|
||||
# Hide unexplored parts of a map
|
||||
#FogOfWar=1
|
||||
|
||||
# Enable debug and cheat keystrokes, see docs/en/CheatKeys.txt
|
||||
# full listing
|
||||
#EnableCheatKeys=1
|
||||
|
||||
#####################################################
|
||||
# Paths #
|
||||
#####################################################
|
||||
|
||||
#####################################################
|
||||
# Game Paths [String] #
|
||||
# #
|
||||
# These are the paths where the Game you want to #
|
||||
# play is installed. #
|
||||
# Enter the full path to the directory. #
|
||||
#####################################################
|
||||
|
||||
GamePath=../gemrb/tests/minimal
|
||||
CD1=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
CD2=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD2/
|
||||
CD3=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD3/
|
||||
CD4=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD4/
|
||||
CD5=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD5/
|
||||
|
||||
#####################################################
|
||||
# GemRB Cache Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB will store the #
|
||||
# cached files, enter the full path to the GemRB #
|
||||
# Cache directory. #
|
||||
#####################################################
|
||||
|
||||
CachePath=./gemrb/Cache/
|
||||
|
||||
#####################################################
|
||||
# GemRB Save Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB looks for saved #
|
||||
# games. #
|
||||
# Enter the full path to the directory containing #
|
||||
# e.g. the 'save' subdirectory. #
|
||||
# #
|
||||
# You do not have to specify this if you use save #
|
||||
# subdir in the GamePath directory. #
|
||||
#####################################################
|
||||
|
||||
#SavePath=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
|
||||
#####################################################
|
||||
# GemRB Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB is stored, just #
|
||||
# enter the full path to the GemRB executable #
|
||||
#####################################################
|
||||
|
||||
GemRBPath=../gemrb
|
||||
|
||||
#####################################################
|
||||
# GemRB GUI Scripts Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB GUI scripts are #
|
||||
# stored, usually these are in the GemRB directory #
|
||||
# Enter the full path to the directory containing #
|
||||
# the 'GUIScript' subdirectory. #
|
||||
#####################################################
|
||||
|
||||
#GUIScriptsPath=./
|
||||
|
||||
#####################################################
|
||||
# GemRB Plugins Path [String] #
|
||||
# #
|
||||
# This is the path containing GemRB plugins #
|
||||
# - shared libraries (.so) on Unixes, or #
|
||||
# DLLs (.dll) on windows. #
|
||||
# Enter the full path to the directory. #
|
||||
# #
|
||||
# You may need to specify this path if running #
|
||||
# GemRB from source directory on Linux. #
|
||||
#####################################################
|
||||
|
||||
PluginsPath=./gemrb/plugins/
|
||||
|
||||
#####################################################
|
||||
# Game Data Path [String] #
|
||||
# #
|
||||
# This is the subdirectory under GamePath where #
|
||||
# game data files are stored. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GameDataPath=data
|
||||
|
||||
#####################################################
|
||||
# Game Data Override Path [String] #
|
||||
# #
|
||||
# This is the subdirectory under GamePath where #
|
||||
# game data override files are stored. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GameOverridePath=override
|
||||
|
||||
#####################################################
|
||||
# GemRB Data Override Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB looks for the GemRB #
|
||||
# data override directory. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GemRBOverridePath=/usr/share/games/gemrb
|
||||
|
||||
#####################################################
|
||||
# END #
|
||||
#####################################################
|
||||
259
project/jni/application/gemrb/gemrb/GemRB.cfg.sample.in
Normal file
259
project/jni/application/gemrb/gemrb/GemRB.cfg.sample.in
Normal file
@@ -0,0 +1,259 @@
|
||||
#####################################################
|
||||
# #
|
||||
# This is the GemRB Configuration file. #
|
||||
# Here are defined some default parameters for #
|
||||
# basic configuration and paths definition. #
|
||||
# #
|
||||
# Parameters are defined as a Name=Value pair #
|
||||
# The Value can be of three types: #
|
||||
# - String #
|
||||
# - Integer #
|
||||
# - Boolean #
|
||||
# #
|
||||
# The String value is represented as follows #
|
||||
# i.e. H:\GemRB\plugins #
|
||||
# Integers are defined as follows #
|
||||
# i.e. 12723 #
|
||||
# Booleans are represented as 1 or 0 in this file #
|
||||
# #
|
||||
# Lines starting with # are ignored #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
#####################################################
|
||||
# #
|
||||
# Game Type [String] Use one of the following #
|
||||
# values: #
|
||||
# #
|
||||
# bg1 Baldur's Gate #
|
||||
# bg2 Baldur's Gate 2 : SoA or ToB #
|
||||
# tob Baldur's Gate 2 : ToB (obsolete) #
|
||||
# iwd IceWind Dale #
|
||||
# how IceWind Dale : HoW or ToTL #
|
||||
# iwd2 IceWind Dale 2 #
|
||||
# pst Planescape Torment #
|
||||
# (More will come) #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
GameType=bg2
|
||||
|
||||
#####################################################
|
||||
# Game Name [String] Title for GemRB window, use #
|
||||
# anything you wish, e.g. Baldur's Gate 3: RotFL #
|
||||
#####################################################
|
||||
|
||||
GameName=Baldur's Gate 2
|
||||
|
||||
#####################################################
|
||||
# Video Parameters #
|
||||
#####################################################
|
||||
|
||||
#Screen width
|
||||
Width=640
|
||||
|
||||
#Screen height
|
||||
Height=480
|
||||
|
||||
#Bits per pixel [Integer:16,32]
|
||||
Bpp=32
|
||||
|
||||
#Fullscreen [Boolean]
|
||||
Fullscreen=0
|
||||
|
||||
# Delay before tooltips appear [milliseconds]
|
||||
TooltipDelay=500
|
||||
|
||||
#####################################################
|
||||
# Audio Parameters #
|
||||
#####################################################
|
||||
# #
|
||||
# All volume options are in percents, with 100 #
|
||||
# being the normal and default volume #
|
||||
# #
|
||||
#####################################################
|
||||
|
||||
# Choices: openal (default), sdlaudio (faster, but limited featureset), none
|
||||
#AudioDriver = openal
|
||||
|
||||
# Volume of ambient sounds
|
||||
#VolumeAmbients = 100
|
||||
|
||||
# Volume during movie playback
|
||||
#VolumeMovie = 100
|
||||
|
||||
# Volume of background music
|
||||
#VolumeMusic = 100
|
||||
|
||||
# Volume of sound effects
|
||||
#VolumeSFX = 100
|
||||
|
||||
# Volume of PC or NPC voices
|
||||
#VolumeVoices = 100
|
||||
|
||||
#####################################################
|
||||
# Case Sensitive Filesystem [Boolean] #
|
||||
# #
|
||||
# If your installed game files are residing on a #
|
||||
# case sensitive filesystem (ext2 on Linux) then #
|
||||
# you need to set this value to 1, it has no #
|
||||
# effect on Windows #
|
||||
#####################################################
|
||||
|
||||
#CaseSensitive=1
|
||||
|
||||
#GameOnCD=0
|
||||
|
||||
#####################################################
|
||||
# GUI Parameters #
|
||||
#####################################################
|
||||
# #
|
||||
# GemRB may enhance the GUI of the Infinity Engine #
|
||||
# games (so far only in bg2) creating functionally #
|
||||
# new buttons or scrollbars where they weren't #
|
||||
# present in original games. It may improve its #
|
||||
# usability, but is not quite compatible with #
|
||||
# mods changing graphics and alignment in the *.chu #
|
||||
# files (e.g. the buttons will appear in old #
|
||||
# coordinates and may stop being clickable). #
|
||||
#####################################################
|
||||
|
||||
# Enable all gui enhancements ? [Boolean]
|
||||
GUIEnhancements = 1
|
||||
|
||||
|
||||
#####################################################
|
||||
# Debug #
|
||||
#####################################################
|
||||
|
||||
# Do not play intro videos [Boolean], useful for development
|
||||
#SkipIntroVideos=1
|
||||
|
||||
# Draw Frames per Second info [Boolean]
|
||||
#DrawFPS=1
|
||||
|
||||
# Hide unexplored parts of a map
|
||||
#FogOfWar=1
|
||||
|
||||
# Enable debug and cheat keystrokes, see docs/en/CheatKeys.txt
|
||||
# full listing
|
||||
#EnableCheatKeys=1
|
||||
|
||||
#####################################################
|
||||
# Paths #
|
||||
#####################################################
|
||||
|
||||
#####################################################
|
||||
# Game Paths [String] #
|
||||
# #
|
||||
# These are the paths where the Game you want to #
|
||||
# play is installed. #
|
||||
# Enter the full path to the directory. #
|
||||
#####################################################
|
||||
|
||||
GamePath=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
CD1=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
CD2=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD2/
|
||||
CD3=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD3/
|
||||
CD4=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD4/
|
||||
CD5=/mnt/windows/Programmi/Black Isle/BGII - SoA/CD5/
|
||||
|
||||
#####################################################
|
||||
# GemRB Cache Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB will store the #
|
||||
# cached files, enter the full path to the GemRB #
|
||||
# Cache directory. #
|
||||
#####################################################
|
||||
|
||||
CachePath=./Cache/
|
||||
|
||||
#####################################################
|
||||
# GemRB Save Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB looks for saved #
|
||||
# games. #
|
||||
# Enter the full path to the directory containing #
|
||||
# e.g. the 'save' subdirectory. #
|
||||
# #
|
||||
# You do not have to specify this if you use save #
|
||||
# subdir in the GamePath directory. #
|
||||
#####################################################
|
||||
|
||||
#SavePath=/mnt/windows/Programmi/Black Isle/BGII - SoA/
|
||||
|
||||
###### HERE BE DRAGONS #############################
|
||||
###### HERE BE DRAGONS #############################
|
||||
###### HERE BE DRAGONS #############################
|
||||
# You shouldn't need to change anything below this point.
|
||||
|
||||
#####################################################
|
||||
# GemRB Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB is stored, just #
|
||||
# enter the full path to the GemRB executable #
|
||||
#####################################################
|
||||
|
||||
#GemRBPath=@DATA_DIR@
|
||||
|
||||
#####################################################
|
||||
# GemRB GUI Scripts Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB GUI scripts are #
|
||||
# stored, usually these are in the GemRB directory #
|
||||
# Enter the full path to the directory containing #
|
||||
# the 'GUIScript' subdirectory. #
|
||||
#####################################################
|
||||
|
||||
#GUIScriptsPath=@DATA_DIR@
|
||||
|
||||
#####################################################
|
||||
# GemRB Plugins Path [String] #
|
||||
# #
|
||||
# This is the path containing GemRB plugins #
|
||||
# - shared libraries (.so) on Unixes, or #
|
||||
# DLLs (.dll) on windows. #
|
||||
# Enter the full path to the directory. #
|
||||
# #
|
||||
# You may need to specify this path if running #
|
||||
# GemRB from source directory on Linux. #
|
||||
#####################################################
|
||||
|
||||
#PluginsPath=@PLUGIN_DIR@
|
||||
|
||||
#####################################################
|
||||
# Game Data Path [String] #
|
||||
# #
|
||||
# This is the subdirectory under GamePath where #
|
||||
# game data files are stored. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GameDataPath=data
|
||||
|
||||
#####################################################
|
||||
# Game Data Override Path [String] #
|
||||
# #
|
||||
# This is the subdirectory under GamePath where #
|
||||
# game data override files are stored. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GameOverridePath=override
|
||||
|
||||
#####################################################
|
||||
# GemRB Data Override Path [String] #
|
||||
# #
|
||||
# This is the path where GemRB looks for the GemRB #
|
||||
# data override directory. #
|
||||
# #
|
||||
# You probably do NOT want to specify this! #
|
||||
#####################################################
|
||||
|
||||
#GemRBOverridePath=@DATA_DIR@
|
||||
|
||||
#####################################################
|
||||
# END #
|
||||
#####################################################
|
||||
@@ -34,7 +34,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <SDL.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include "audio.h"
|
||||
|
||||
// pause audio playing if app goes in background
|
||||
@@ -52,9 +52,6 @@ static void appPutToForeground()
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
#ifdef ANDROID
|
||||
SDL_ANDROID_SetApplicationPutToBackgroundCallback(&appPutToBackground, &appPutToForeground);
|
||||
#endif
|
||||
Interface::SanityCheck(VERSION_GEMRB);
|
||||
core = new Interface( argc, argv );
|
||||
if (core->Init() == GEM_ERROR) {
|
||||
@@ -64,6 +61,9 @@ int main(int argc, char* argv[])
|
||||
getc(stdin);
|
||||
return -1;
|
||||
}
|
||||
#ifdef ANDROID
|
||||
SDL_ANDROID_SetApplicationPutToBackgroundCallback(&appPutToBackground, &appPutToForeground);
|
||||
#endif
|
||||
core->Main();
|
||||
delete( core );
|
||||
textcolor(DEFAULT);
|
||||
13
project/jni/application/gemrb/gemrb/Makefile.am
Normal file
13
project/jni/application/gemrb/gemrb/Makefile.am
Normal file
@@ -0,0 +1,13 @@
|
||||
bin_PROGRAMS = gemrb
|
||||
sysconf_DATA = GemRB.cfg.sample.in
|
||||
gemrb_SOURCES = GemRB.cpp
|
||||
|
||||
gemrb_LDADD = ./core/libgemrb_core.la
|
||||
|
||||
SUBDIRS = core plugins includes GUIScripts override docs
|
||||
EXTRA_DIST = GemRB.cfg* plugins-prepare.sh CMakeLists.txt
|
||||
|
||||
gemrb_LDFLAGS = $(all_libraries) @LIBPTHREAD@
|
||||
|
||||
#install-data-local:
|
||||
# $(INSTALL_DATA) GemRB.cfg* $(sysconfdir)
|
||||
@@ -61,8 +61,8 @@ public:
|
||||
virtual void ResetMusics() = 0;
|
||||
virtual bool Play() = 0;
|
||||
virtual bool Stop() = 0;
|
||||
virtual bool Pause() = 0;
|
||||
virtual bool Resume() = 0;
|
||||
virtual bool Pause() = 0;
|
||||
virtual bool Resume() = 0;
|
||||
virtual int CreateStream(Holder<SoundMgr>) = 0;
|
||||
virtual void UpdateListenerPos(int XPos, int YPos ) = 0;
|
||||
virtual void GetListenerPos(int &XPos, int &YPos ) = 0;
|
||||
@@ -558,10 +558,12 @@ CharAnimations::CharAnimations(unsigned int AnimID, ieDword ArmourLevel)
|
||||
// make initial phase depend on location to make the pulse appear
|
||||
// less even
|
||||
ColorMods[i].phase = 5*i;
|
||||
ColorMods[i].locked = false;
|
||||
}
|
||||
GlobalColorMod.type = RGBModifier::NONE;
|
||||
GlobalColorMod.speed = 0;
|
||||
GlobalColorMod.phase = 0;
|
||||
GlobalColorMod.locked = false;
|
||||
lastModUpdate = 0;
|
||||
|
||||
AvatarsRowNum=AvatarsCount;
|
||||
@@ -2338,6 +2340,7 @@ void CharAnimations::PulseRGBModifiers()
|
||||
GlobalColorMod.type = RGBModifier::NONE;
|
||||
GlobalColorMod.phase = 0;
|
||||
GlobalColorMod.speed = 0;
|
||||
GlobalColorMod.locked = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2347,6 +2350,12 @@ void CharAnimations::PulseRGBModifiers()
|
||||
{
|
||||
ColorMods[i].phase += inc;
|
||||
change[i>>3] = true;
|
||||
if (ColorMods[i].phase > 2*ColorMods[i].speed) {
|
||||
ColorMods[i].type = RGBModifier::NONE;
|
||||
ColorMods[i].phase = 0;
|
||||
ColorMods[i].speed = 0;
|
||||
ColorMods[i].locked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,15 +113,17 @@ unsigned int DisplayMessage::GetSpeakerColor(const char *&name, const Scriptable
|
||||
void DisplayMessage::DisplayConstantString(int stridx, unsigned int color, Scriptable *target) const
|
||||
{
|
||||
if (stridx<0) return;
|
||||
const char* text = core->GetString( strref_table[stridx], IE_STR_SOUND );
|
||||
char* text = core->GetString( strref_table[stridx], IE_STR_SOUND );
|
||||
DisplayString(text, color, target);
|
||||
core->FreeString(text);
|
||||
}
|
||||
|
||||
void DisplayMessage::DisplayString(int stridx, unsigned int color, ieDword flags) const
|
||||
{
|
||||
if (stridx<0) return;
|
||||
const char* text = core->GetString( stridx, flags);
|
||||
char* text = core->GetString( stridx, flags);
|
||||
DisplayString(text, color, NULL);
|
||||
core->FreeString(text);
|
||||
}
|
||||
|
||||
void DisplayMessage::DisplayString(const char *text, unsigned int color, Scriptable *target) const
|
||||
@@ -179,10 +181,13 @@ void DisplayMessage::DisplayConstantStringName(int stridx, unsigned int color, c
|
||||
if (stridx<0) return;
|
||||
if(!speaker) return;
|
||||
|
||||
const char* text = core->GetString( strref_table[stridx], IE_STR_SOUND|IE_STR_SPEECH );
|
||||
char* text = core->GetString( strref_table[stridx], IE_STR_SOUND|IE_STR_SPEECH );
|
||||
DisplayStringName(text, color, speaker);
|
||||
core->FreeString(text);
|
||||
}
|
||||
|
||||
// String format is
|
||||
// <charname> - blah blah <someoneelse>
|
||||
void DisplayMessage::DisplayConstantStringAction(int stridx, unsigned int color, const Scriptable *attacker, const Scriptable *target) const
|
||||
{
|
||||
unsigned int attacker_color;
|
||||
@@ -209,8 +214,9 @@ void DisplayMessage::DisplayStringName(int stridx, unsigned int color, const Scr
|
||||
{
|
||||
if (stridx<0) return;
|
||||
|
||||
const char* text = core->GetString( stridx, flags);
|
||||
char* text = core->GetString( stridx, flags);
|
||||
DisplayStringName(text, color, speaker);
|
||||
core->FreeString( text );
|
||||
}
|
||||
|
||||
void DisplayMessage::DisplayStringName(const char *text, unsigned int color, const Scriptable *speaker) const
|
||||
@@ -221,10 +227,13 @@ void DisplayMessage::DisplayStringName(const char *text, unsigned int color, con
|
||||
if (!text) return;
|
||||
speaker_color = GetSpeakerColor(name, speaker);
|
||||
|
||||
int newlen = (int)(strlen( DisplayFormatName ) + strlen( name ) +
|
||||
+ strlen( text ) + 18);
|
||||
char* newstr = ( char* ) malloc( newlen );
|
||||
snprintf( newstr, newlen, DisplayFormatName, speaker_color, name, color, text );
|
||||
DisplayString( newstr );
|
||||
free( newstr );
|
||||
//FIXME: what happens if there is no name?
|
||||
if (name) {
|
||||
int newlen = (int)(strlen( DisplayFormatName ) + strlen( name ) +
|
||||
+ strlen( text ) + 18);
|
||||
char* newstr = ( char* ) malloc( newlen );
|
||||
snprintf( newstr, newlen, DisplayFormatName, speaker_color, name, color, text );
|
||||
DisplayString( newstr );
|
||||
free( newstr );
|
||||
}
|
||||
}
|
||||
@@ -857,8 +857,7 @@ static int check_type(Actor* actor, Effect* fx)
|
||||
return 0;
|
||||
}
|
||||
if (actor->fxqueue.HasEffectWithResource(fx_store_spell_sequencer_ref, fx->Source) ) {
|
||||
//TODO: display strref 0x806C
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,8 +125,7 @@ void Control::OnKeyPress(unsigned char Key, unsigned short /*Mod*/)
|
||||
{
|
||||
//printf("OnKeyPress: CtrlID = 0x%08X, Key = %c (0x%02hX)\n", (unsigned int) ControlID, Key, Key);
|
||||
#ifdef ANDROID // mapping volume control to volume control keys on device, these keys must be set up in AndroidAppSettings.cfg
|
||||
switch(Key)
|
||||
{
|
||||
switch(Key) {
|
||||
case 'o': // volume down
|
||||
case 'p': // volume up
|
||||
int Ambients, Movie, Music, SFX, Voices;
|
||||
@@ -135,23 +134,20 @@ void Control::OnKeyPress(unsigned char Key, unsigned short /*Mod*/)
|
||||
core->GetDictionary()->Lookup( "Volume Music", (ieDword&)Music );
|
||||
core->GetDictionary()->Lookup( "Volume SFX", (ieDword&)SFX );
|
||||
core->GetDictionary()->Lookup( "Volume Voices", (ieDword&)Voices );
|
||||
if(Key=='o')
|
||||
{
|
||||
if (Key=='o') {
|
||||
if(Ambients>0) Ambients-=10; if(Ambients<0) Ambients=0;
|
||||
if(Movie>0) Movie-=10; if(Movie<0) Movie=0;
|
||||
if(Music>0) Music-=10; if(Music<0) Music=0;
|
||||
if(SFX>0) SFX-=10; if(SFX<0) SFX=0;
|
||||
if(Voices>0) Voices-=10; if(Voices<0) Voices=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if(Ambients<100) Ambients+=10; if(Ambients>100) Ambients=100;
|
||||
if(Movie<100) Movie+=10; if(Movie>100) Movie=100;
|
||||
if(Music<100) Music+=10; if(Music>100) Music=100;
|
||||
if(SFX<100) SFX+=10; if(SFX>100) SFX=100;
|
||||
if(Voices<100) Voices+=10; if(Voices>100) Voices=100;
|
||||
}
|
||||
core->GetDictionary()->SetAt( "Volume Ambients", (ieDword)Ambients );
|
||||
core->GetDictionary()->SetAt( "Volume Ambients", Ambients );
|
||||
core->GetDictionary()->SetAt( "Volume Movie", Movie );
|
||||
core->GetDictionary()->SetAt( "Volume Music", Music );
|
||||
core->GetDictionary()->SetAt( "Volume SFX", SFX );
|
||||
@@ -44,6 +44,12 @@
|
||||
#define DEBUG_SHOW_DOORS DEBUG_SHOW_CONTAINERS
|
||||
#define DEBUG_SHOW_LIGHTMAP 0x08
|
||||
|
||||
#ifndef TOUCHSCREEN
|
||||
#define SCROLL_BORDER 5
|
||||
#else
|
||||
#define SCROLL_BORDER 32
|
||||
#endif
|
||||
|
||||
static const Color cyan = {
|
||||
0x00, 0xff, 0xff, 0xff
|
||||
};
|
||||
@@ -68,6 +74,12 @@ static const Color blue = {
|
||||
0x00, 0x00, 0xff, 0x80
|
||||
};
|
||||
|
||||
#ifdef TOUCHSCREEN
|
||||
static const Color gray = {
|
||||
0x80, 0x80, 0x80, 0xff
|
||||
};
|
||||
#endif
|
||||
|
||||
//Animation* effect;
|
||||
|
||||
#define FORMATIONSIZE 10
|
||||
@@ -120,6 +132,9 @@ GameControl::GameControl(void)
|
||||
lastCursor = IE_CURSOR_NORMAL;
|
||||
moveX = moveY = 0;
|
||||
scrolling = false;
|
||||
#ifdef TOUCHSCREEN
|
||||
touched=false;
|
||||
#endif
|
||||
numScrollCursor = 0;
|
||||
DebugFlags = 0;
|
||||
AIUpdateCounter = 1;
|
||||
@@ -131,8 +146,7 @@ GameControl::GameControl(void)
|
||||
core->GetDictionary()->Lookup("Center",tmp);
|
||||
if (tmp) {
|
||||
ScreenFlags=SF_ALWAYSCENTER|SF_CENTERONACTOR;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ScreenFlags = SF_CENTERONACTOR;
|
||||
}
|
||||
LeftCount = 0;
|
||||
@@ -572,6 +586,25 @@ void GameControl::Draw(unsigned short x, unsigned short y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TOUCHSCREEN
|
||||
if(moveY < 0 && scrolling)
|
||||
video->DrawLine(screen.x+4, screen.y+SCROLL_BORDER, screen.w+screen.x-4, screen.y+SCROLL_BORDER, red);
|
||||
else
|
||||
video->DrawLine(screen.x+4, screen.y+SCROLL_BORDER, screen.w+screen.x-4, screen.y+SCROLL_BORDER, gray);
|
||||
if(moveY > 0 && scrolling)
|
||||
video->DrawLine(screen.x+4, screen.h-SCROLL_BORDER, screen.w+screen.x-4, screen.h-SCROLL_BORDER, red);
|
||||
else
|
||||
video->DrawLine(screen.x+4, screen.h-SCROLL_BORDER, screen.w+screen.x-4, screen.h-SCROLL_BORDER, gray);
|
||||
if(moveX < 0 && scrolling)
|
||||
video->DrawLine(screen.x+SCROLL_BORDER, screen.y+4, screen.x+SCROLL_BORDER, screen.h+screen.y-4, red);
|
||||
else
|
||||
video->DrawLine(screen.x+SCROLL_BORDER, screen.y+4, screen.x+SCROLL_BORDER, screen.h+screen.y-4, gray);
|
||||
if(moveX > 0 && scrolling)
|
||||
video->DrawLine(screen.w+screen.x-SCROLL_BORDER, screen.y+4, screen.w+screen.x-SCROLL_BORDER, screen.h-4, red);
|
||||
else
|
||||
video->DrawLine(screen.w+screen.x-SCROLL_BORDER, screen.y+4, screen.w+screen.x-SCROLL_BORDER, screen.h-4, gray);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** inherited from Control, GameControl doesn't need it */
|
||||
@@ -760,9 +793,9 @@ void GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
|
||||
if (target) {
|
||||
src->CastSpell( TestSpell, target, false );
|
||||
if (src->LastTarget) {
|
||||
src->CastSpellEnd( TestSpell );
|
||||
src->CastSpellEnd();
|
||||
} else {
|
||||
src->CastSpellPointEnd( TestSpell );
|
||||
src->CastSpellPointEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -971,12 +1004,12 @@ void GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
|
||||
printf("Show lightmap %s\n", DebugFlags & DEBUG_SHOW_LIGHTMAP ? "ON" : "OFF");
|
||||
break;
|
||||
case '7': //toggles fog of war
|
||||
core->FogOfWar ^= 1;
|
||||
printf("Show Fog-Of-War: %s\n", core->FogOfWar & 1 ? "ON" : "OFF");
|
||||
core->FogOfWar ^= FOG_DRAWFOG;
|
||||
printf("Show Fog-Of-War: %s\n", core->FogOfWar & FOG_DRAWFOG ? "ON" : "OFF");
|
||||
break;
|
||||
case '8': //show searchmap over area
|
||||
core->FogOfWar ^= 2;
|
||||
printf("Show searchmap %s\n", core->FogOfWar & 2 ? "ON" : "OFF");
|
||||
core->FogOfWar ^= FOG_DRAWSEARCHMAP;
|
||||
printf("Show searchmap %s\n", core->FogOfWar & FOG_DRAWSEARCHMAP ? "ON" : "OFF");
|
||||
break;
|
||||
default:
|
||||
printf( "KeyRelease:%d - %d\n", Key, Mod );
|
||||
@@ -1196,7 +1229,72 @@ void GameControl::OnMouseOver(unsigned short x, unsigned short y)
|
||||
if (ScreenFlags & SF_DISABLEMOUSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TOUCHSCREEN
|
||||
int mousescrollspd = core->GetMouseScrollSpeed();
|
||||
Region region;
|
||||
Map* map;
|
||||
Point mapsize;
|
||||
Region viewport = core->GetVideoDriver()->GetViewport();
|
||||
moveX = 0;
|
||||
moveY = 0;
|
||||
// Top scroll area
|
||||
region=Region(XPos, YPos, Width, YPos+SCROLL_BORDER);
|
||||
if(region.PointInside(x, y))
|
||||
{
|
||||
// Check for end of map area
|
||||
if(viewport.y > 0)
|
||||
moveY = -mousescrollspd;
|
||||
}
|
||||
// Bottom scroll area
|
||||
region=Region(XPos, Height-SCROLL_BORDER, Width, Height);
|
||||
if(region.PointInside(x, y))
|
||||
{
|
||||
// Check for end of map area
|
||||
map = core->GetGame()->GetCurrentArea();
|
||||
if(map != NULL)
|
||||
{
|
||||
mapsize = map->TMap->GetMapSize();
|
||||
if((viewport.y + viewport.h) < mapsize.y)
|
||||
moveY = mousescrollspd;
|
||||
}
|
||||
}
|
||||
// Left scroll area
|
||||
region=Region(XPos, YPos, XPos+SCROLL_BORDER, Height);
|
||||
if(region.PointInside(x, y))
|
||||
{
|
||||
// Check for end of map area
|
||||
if(viewport.x > 0)
|
||||
moveX = -mousescrollspd;
|
||||
}
|
||||
// Right scroll area
|
||||
region=Region(Width-SCROLL_BORDER, YPos, Width, Height);
|
||||
if(region.PointInside(x, y))
|
||||
{
|
||||
// Check for end of map area
|
||||
map = core->GetGame()->GetCurrentArea();
|
||||
if(map != NULL)
|
||||
{
|
||||
mapsize = map->TMap->GetMapSize();
|
||||
if((viewport.x + viewport.w) < mapsize.x)
|
||||
moveX = mousescrollspd;
|
||||
}
|
||||
}
|
||||
if ((moveX != 0 || moveY != 0) && touched)
|
||||
{
|
||||
scrolling = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
moveX = 0;
|
||||
moveY = 0;
|
||||
scrolling = false;
|
||||
Video* video = core->GetVideoDriver();
|
||||
video->SetDragCursor(NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
lastMouseX = x;
|
||||
lastMouseY = y;
|
||||
Point p( x,y );
|
||||
@@ -1361,7 +1459,7 @@ end_function:
|
||||
}
|
||||
}
|
||||
|
||||
#define SCROLL_BORDER 5
|
||||
//#define SCROLL_BORDER 5
|
||||
|
||||
/** Global Mouse Move Event */
|
||||
void GameControl::OnGlobalMouseMove(unsigned short x, unsigned short y)
|
||||
@@ -1373,7 +1471,7 @@ void GameControl::OnGlobalMouseMove(unsigned short x, unsigned short y)
|
||||
if (Owner->Visible!=WINDOW_VISIBLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef TOUCHSCREEN
|
||||
int mousescrollspd = core->GetMouseScrollSpeed();
|
||||
|
||||
if (x <= SCROLL_BORDER)
|
||||
@@ -1401,6 +1499,7 @@ void GameControl::OnGlobalMouseMove(unsigned short x, unsigned short y)
|
||||
Video* video = core->GetVideoDriver();
|
||||
video->SetDragCursor(NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void GameControl::UpdateScrolling() {
|
||||
@@ -1475,11 +1574,11 @@ void GameControl::TryToPick(Actor *source, Door *tgt)
|
||||
source->ClearActions();
|
||||
source->SetModal(MS_NONE);
|
||||
if (tgt->Trapped && tgt->TrapDetected) {
|
||||
snprintf(Tmp, sizeof(Tmp), "RemoveTraps(\"%s\")", tgt->GetScriptName() );
|
||||
strncpy(Tmp, "RemoveTraps([-1])", sizeof(Tmp) );
|
||||
} else {
|
||||
snprintf(Tmp, sizeof(Tmp), "PickLock(\"%s\")", tgt->GetScriptName() );
|
||||
strncpy(Tmp, "PickLock([-1])", sizeof(Tmp) );
|
||||
}
|
||||
source->AddAction( GenerateAction( Tmp ) );
|
||||
source->AddAction( GenerateActionDirect( Tmp, tgt ) );
|
||||
}
|
||||
|
||||
//generate action code for source actor to try to pick a lock/disable trap on a container
|
||||
@@ -1491,11 +1590,11 @@ void GameControl::TryToPick(Actor *source, Container *tgt)
|
||||
source->ClearActions();
|
||||
source->SetModal(MS_NONE);
|
||||
if (tgt->Trapped && tgt->TrapDetected) {
|
||||
snprintf(Tmp, sizeof(Tmp), "RemoveTraps(\"%s\")", tgt->GetScriptName() );
|
||||
strncpy(Tmp, "RemoveTraps([-1])", sizeof(Tmp) );
|
||||
} else {
|
||||
snprintf(Tmp, sizeof(Tmp), "PickLock(\"%s\")", tgt->GetScriptName() );
|
||||
strncpy(Tmp, "PickLock([-1])", sizeof(Tmp) );
|
||||
}
|
||||
source->AddAction( GenerateAction( Tmp ) );
|
||||
source->AddAction( GenerateActionDirect( Tmp, tgt ) );
|
||||
}
|
||||
|
||||
//generate action code for source actor to try to disable trap (only trap type active regions)
|
||||
@@ -1508,20 +1607,8 @@ void GameControl::TryToDisarm(Actor *source, InfoPoint *tgt)
|
||||
source->ClearPath();
|
||||
source->ClearActions();
|
||||
source->SetModal(MS_NONE);
|
||||
snprintf(Tmp, sizeof(Tmp), "RemoveTraps(\"%s\")", tgt->GetScriptName() );
|
||||
source->AddAction( GenerateAction( Tmp ) );
|
||||
}
|
||||
|
||||
//generate action code for source actor to try to force open lock on a door/container
|
||||
void GameControl::TryToBash(Actor *source, Scriptable *tgt)
|
||||
{
|
||||
char Tmp[40];
|
||||
|
||||
source->ClearPath();
|
||||
source->ClearActions();
|
||||
source->SetModal(MS_NONE);
|
||||
snprintf(Tmp, sizeof(Tmp), "Attack(\"%s\")", tgt->GetScriptName() );
|
||||
source->AddAction( GenerateAction( Tmp ) );
|
||||
strncpy(Tmp, "RemoveTraps([-1])", sizeof(Tmp) );
|
||||
source->AddAction( GenerateActionDirect( Tmp, tgt ) );
|
||||
}
|
||||
|
||||
//generate action code for source actor to use item/cast spell on a point
|
||||
@@ -1538,29 +1625,33 @@ void GameControl::TryToCast(Actor *source, const Point &tgt)
|
||||
|
||||
spellCount--;
|
||||
if (spellOrItem>=0) {
|
||||
sprintf(Tmp, "NIDSpecial8()");
|
||||
if (spellIndex<0) {
|
||||
strncpy(Tmp, "SpellPointNoDec(\"\",[0.0])", sizeof(Tmp) );
|
||||
} else {
|
||||
strncpy(Tmp, "SpellPoint(\"\",[0.0])", sizeof(Tmp) );
|
||||
}
|
||||
} else {
|
||||
//using item on target
|
||||
sprintf(Tmp, "NIDSpecial7()");
|
||||
strncpy(Tmp, "UseItemPoint(\"\",[0,0],0)", sizeof(Tmp) );
|
||||
}
|
||||
Action* action = GenerateAction( Tmp );
|
||||
action->pointParameter=tgt;
|
||||
if (spellOrItem>=0)
|
||||
{
|
||||
CREMemorizedSpell *si;
|
||||
//spell casting at target
|
||||
si = source->spellbook.GetMemorizedSpell(spellOrItem, spellSlot, spellIndex);
|
||||
if (!si)
|
||||
{
|
||||
ResetTargetMode();
|
||||
return;
|
||||
if (spellOrItem>=0) {
|
||||
if (spellIndex<0) {
|
||||
sprintf(action->string0Parameter,"%.8s",spellName);
|
||||
} else {
|
||||
CREMemorizedSpell *si;
|
||||
//spell casting at target
|
||||
si = source->spellbook.GetMemorizedSpell(spellOrItem, spellSlot, spellIndex);
|
||||
if (!si) {
|
||||
ResetTargetMode();
|
||||
return;
|
||||
}
|
||||
sprintf(action->string0Parameter,"%.8s",si->SpellResRef);
|
||||
}
|
||||
sprintf(action->string0Parameter,"%.8s",si->SpellResRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
action->int0Parameter=spellSlot;
|
||||
action->int1Parameter=spellIndex;
|
||||
} else {
|
||||
action->int0Parameter = spellSlot;
|
||||
action->int1Parameter = spellIndex;
|
||||
}
|
||||
source->AddAction( action );
|
||||
if (!spellCount) {
|
||||
@@ -1582,28 +1673,32 @@ void GameControl::TryToCast(Actor *source, Actor *tgt)
|
||||
|
||||
spellCount--;
|
||||
if (spellOrItem>=0) {
|
||||
sprintf(Tmp, "NIDSpecial6()");
|
||||
if (spellIndex<0) {
|
||||
sprintf(Tmp, "NIDSpecial7()");
|
||||
} else {
|
||||
sprintf(Tmp, "NIDSpecial6()");
|
||||
}
|
||||
} else {
|
||||
//using item on target
|
||||
sprintf(Tmp, "NIDSpecial5()");
|
||||
}
|
||||
Action* action = GenerateActionDirect( Tmp, tgt);
|
||||
if (spellOrItem>=0)
|
||||
{
|
||||
CREMemorizedSpell *si;
|
||||
//spell casting at target
|
||||
si = source->spellbook.GetMemorizedSpell(spellOrItem, spellSlot, spellIndex);
|
||||
if (!si)
|
||||
{
|
||||
ResetTargetMode();
|
||||
return;
|
||||
if (spellOrItem>=0) {
|
||||
if (spellIndex<0) {
|
||||
sprintf(action->string0Parameter,"%.8s",spellName);
|
||||
} else {
|
||||
CREMemorizedSpell *si;
|
||||
//spell casting at target
|
||||
si = source->spellbook.GetMemorizedSpell(spellOrItem, spellSlot, spellIndex);
|
||||
if (!si) {
|
||||
ResetTargetMode();
|
||||
return;
|
||||
}
|
||||
sprintf(action->string0Parameter,"%.8s",si->SpellResRef);
|
||||
}
|
||||
sprintf(action->string0Parameter,"%.8s",si->SpellResRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
action->int0Parameter=spellSlot;
|
||||
action->int1Parameter=spellIndex;
|
||||
} else {
|
||||
action->int0Parameter = spellSlot;
|
||||
action->int1Parameter = spellIndex;
|
||||
}
|
||||
source->AddAction( action );
|
||||
if (!spellCount) {
|
||||
@@ -1718,7 +1813,7 @@ bool GameControl::HandleActiveRegion(InfoPoint *trap, Actor * actor, Point &p)
|
||||
|
||||
switch(trap->Type) {
|
||||
case ST_TRAVEL:
|
||||
actor->UseExit(true);
|
||||
actor->UseExit(trap->GetGlobalID());
|
||||
return false;
|
||||
case ST_TRIGGER:
|
||||
//the importer shouldn't load the script
|
||||
@@ -1788,6 +1883,9 @@ void GameControl::OnMouseDown(unsigned short x, unsigned short y, unsigned short
|
||||
StartY = py;
|
||||
SelectionRect.w = 0;
|
||||
SelectionRect.h = 0;
|
||||
#ifdef TOUCHSCREEN
|
||||
touched=true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1812,6 +1910,37 @@ void GameControl::OnMouseUp(unsigned short x, unsigned short y, unsigned short B
|
||||
Map* area = game->GetCurrentArea( );
|
||||
if (!area) return;
|
||||
|
||||
#ifdef TOUCHSCREEN
|
||||
touched=false;
|
||||
if(scrolling)
|
||||
{
|
||||
moveX = 0;
|
||||
moveY = 0;
|
||||
scrolling=false;
|
||||
Video* video = core->GetVideoDriver();
|
||||
video->SetDragCursor(NULL);
|
||||
if (DrawSelectionRect)
|
||||
{
|
||||
Actor** ab;
|
||||
unsigned int count = area->GetActorInRect( ab, SelectionRect,true );
|
||||
if (count != 0)
|
||||
{
|
||||
for (i = 0; i < highlighted.size(); i++)
|
||||
highlighted[i]->SetOver( false );
|
||||
highlighted.clear();
|
||||
game->SelectActor( NULL, false, SELECT_NORMAL );
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
// FIXME: should call handler only once
|
||||
game->SelectActor( ab[i], true, SELECT_NORMAL );
|
||||
}
|
||||
}
|
||||
free( ab );
|
||||
DrawSelectionRect = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (DrawSelectionRect) {
|
||||
Actor** ab;
|
||||
unsigned int count = area->GetActorInRect( ab, SelectionRect,true );
|
||||
@@ -1876,8 +2005,16 @@ void GameControl::OnMouseUp(unsigned short x, unsigned short y, unsigned short B
|
||||
return;
|
||||
}
|
||||
if (overInfoPoint) {
|
||||
if (HandleActiveRegion(overInfoPoint, pc, p)) {
|
||||
return;
|
||||
if (overInfoPoint->Type==ST_TRAVEL) {
|
||||
int i = game->selected.size();
|
||||
ieDword exitID = overInfoPoint->GetGlobalID();
|
||||
while(i--) {
|
||||
game->selected[i]->UseExit(exitID);
|
||||
}
|
||||
} else {
|
||||
if (HandleActiveRegion(overInfoPoint, pc, p)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2160,8 +2297,7 @@ void GameControl::OnSpecialKeyPress(unsigned char Key)
|
||||
if (ScreenFlags & SF_LOCKSCROLL) {
|
||||
moveX = 0;
|
||||
moveY = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// override any existing viewport moves which may be in progress
|
||||
core->timer->SetMoveViewPort( Viewport.x, Viewport.y, 0, false );
|
||||
// move it directly ourselves, since we might be paused
|
||||
@@ -2668,6 +2804,7 @@ Actor *GameControl::GetLastActor()
|
||||
//cnt is the number of different targets (usually 1)
|
||||
void GameControl::SetupItemUse(int slot, int header, Actor *u, int targettype, int cnt)
|
||||
{
|
||||
memset(spellName, 0, sizeof(ieResRef));
|
||||
spellOrItem = -1;
|
||||
spellUser = u;
|
||||
spellSlot = slot;
|
||||
@@ -2685,8 +2822,9 @@ void GameControl::SetupItemUse(int slot, int header, Actor *u, int targettype, i
|
||||
//u is the caster
|
||||
//target type is a bunch of GetActor flags that alter valid targets
|
||||
//cnt is the number of different targets (usually 1)
|
||||
void GameControl::SetupCasting(int type, int level, int idx, Actor *u, int targettype, int cnt)
|
||||
void GameControl::SetupCasting(ieResRef spellname, int type, int level, int idx, Actor *u, int targettype, int cnt)
|
||||
{
|
||||
memcpy(spellName, spellname, sizeof(ieResRef));
|
||||
spellOrItem = type;
|
||||
spellUser = u;
|
||||
spellSlot = level;
|
||||
@@ -112,6 +112,9 @@ private:
|
||||
Region SelectionRect;
|
||||
short StartX, StartY;
|
||||
//int action;
|
||||
#ifdef TOUCHSCREEN
|
||||
bool touched; // true, if player touched screen (left button down and hold)
|
||||
#endif
|
||||
public:
|
||||
Door* overDoor;
|
||||
Container* overContainer;
|
||||
@@ -187,6 +190,8 @@ private:
|
||||
Actor *user; //the user of item or spell
|
||||
public:
|
||||
DialogHandler *dialoghandler;
|
||||
//the name of the spell to cast
|
||||
ieResRef spellName;
|
||||
//using spell or item
|
||||
int spellOrItem; // -1 = item, otherwise the spell type
|
||||
//the user of spell or item
|
||||
@@ -201,7 +206,6 @@ public:
|
||||
int HideGUI();
|
||||
int UnhideGUI();
|
||||
void TryToAttack(Actor *source, Actor *target);
|
||||
void TryToBash(Actor *source, Scriptable *tgt);
|
||||
void TryToCast(Actor *source, const Point &p);
|
||||
void TryToCast(Actor *source, Actor *target);
|
||||
void TryToDefend(Actor *source, Actor *target);
|
||||
@@ -245,7 +249,7 @@ public:
|
||||
/** Sets up targeting with spells or items */
|
||||
void SetupItemUse(int slot, int header, Actor *actor, int targettype, int cnt);
|
||||
/** Page is the spell type + spell level info */
|
||||
void SetupCasting(int type, int level, int slot, Actor *actor, int targettype, int cnt);
|
||||
void SetupCasting(ieResRef spellname, int type, int level, int slot, Actor *actor, int targettype, int cnt);
|
||||
bool SetEvent(int eventType, EventHandler handler);
|
||||
};
|
||||
|
||||
@@ -840,6 +840,27 @@ void TextArea::RedrawTextArea(const char* VariableName, unsigned int Sum)
|
||||
Changed = true;
|
||||
}
|
||||
|
||||
void TextArea::SelectText(const char *select)
|
||||
{
|
||||
int i = lines.size();
|
||||
while(i--) {
|
||||
if (!stricmp(lines[i], select) ) {
|
||||
CurLine = i;
|
||||
if (sb) {
|
||||
ScrollBar* bar = ( ScrollBar* ) sb;
|
||||
bar->SetPos( i );
|
||||
} else {
|
||||
SetRow( i );
|
||||
}
|
||||
RedrawTextArea( VarName, i);
|
||||
CalcRowCount();
|
||||
Owner->Invalidate();
|
||||
core->RedrawAll();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char* TextArea::QueryText()
|
||||
{
|
||||
if ( Value<lines.size() ) {
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
static void SetNoteString(const char *s);
|
||||
/** Draws the Control on the Output Display */
|
||||
void Draw(unsigned short x, unsigned short y);
|
||||
/** Set the TextArea value to the line number containing the string parameter */
|
||||
void SelectText(const char *select);
|
||||
/** Sets the Actual Text */
|
||||
int SetText(const char* text, int pos = 0);
|
||||
/** Clears the textarea */
|
||||
@@ -41,6 +41,8 @@ TextEdit::TextEdit(unsigned short maxLength, unsigned short px, unsigned short p
|
||||
ResetEventHandler( EditOnDone );
|
||||
ResetEventHandler( EditOnCancel );
|
||||
Color white = {0xff, 0xff, 0xff, 0x00}, black = {0x00, 0x00, 0x00, 0x00};
|
||||
//Original engine values
|
||||
//Color white = {0xc8, 0xc8, 0xc8, 0x00}, black = {0x3c, 0x3c, 0x3c, 0x00};
|
||||
palette = core->CreatePalette( white, black );
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ Game::Game(void) : Scriptable( ST_GLOBAL )
|
||||
}
|
||||
|
||||
interval = 1000/AI_UPDATE_TIME;
|
||||
hasInfra = false;
|
||||
familiarBlock = false;
|
||||
//FIXME:i'm not sure in this...
|
||||
NoInterrupt();
|
||||
}
|
||||
@@ -365,6 +367,11 @@ void Game::InitActorPos(Actor *actor)
|
||||
unsigned int ip = (unsigned int) (actor->InParty-1);
|
||||
AutoTable start("start");
|
||||
AutoTable strta("startpos");
|
||||
|
||||
if (!start || !strta) {
|
||||
printMessage("Game","Game is missing character start data.\n",RED);
|
||||
abort();
|
||||
}
|
||||
// 0 - single player, 1 - tutorial, 2 - expansion
|
||||
ieDword playmode = 0;
|
||||
core->GetDictionary()->Lookup( "PlayMode", playmode );
|
||||
@@ -384,8 +391,11 @@ void Game::InitActorPos(Actor *actor)
|
||||
actor->Pos.y = actor->Destination.y = (short) atoi( strta->QueryField( strta->GetRowIndex(ypos), ip ) );
|
||||
actor->SetOrientation( atoi( strta->QueryField( strta->GetRowIndex(rot), ip) ), false );
|
||||
|
||||
strta.load("startare");
|
||||
strnlwrcpy(actor->Area, strta->QueryField( strta->GetRowIndex(area), 0 ), 8 );
|
||||
if (strta.load("startare")) {
|
||||
strnlwrcpy(actor->Area, strta->QueryField( strta->GetRowIndex(area), 0 ), 8 );
|
||||
} else {
|
||||
strnlwrcpy(actor->Area, CurrentArea, 8 );
|
||||
}
|
||||
}
|
||||
|
||||
int Game::JoinParty(Actor* actor, int join)
|
||||
@@ -1076,6 +1086,7 @@ bool Game::EveryoneNearPoint(Map *area, const Point &p, int flags) const
|
||||
return false;
|
||||
}
|
||||
if (Distance(p,PCs[i])>MAX_TRAVELING_DISTANCE) {
|
||||
printf("Actor %s is not near!\n", PCs[i]->LongName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1814,3 +1825,12 @@ Actor *Game::GetActorByGlobalID(ieDword globalID)
|
||||
return GetGlobalActorByGlobalID(globalID);
|
||||
}
|
||||
|
||||
ieByte *Game::AllocateMazeData()
|
||||
{
|
||||
if (mazedata) {
|
||||
free(mazedata);
|
||||
}
|
||||
mazedata = (ieByte*)malloc(MAZE_DATA_SIZE);
|
||||
return mazedata;
|
||||
}
|
||||
|
||||
@@ -157,6 +157,64 @@ struct GAMLocationEntry {
|
||||
Point Pos;
|
||||
};
|
||||
|
||||
//pst maze data structures (TODO: create a separate class?)
|
||||
struct maze_entry {
|
||||
ieDword unknown00;
|
||||
ieDword accessible;
|
||||
ieDword valid;
|
||||
ieDword trapped;
|
||||
ieDword traptype;
|
||||
ieWord walls;
|
||||
ieDword unknown16;
|
||||
};
|
||||
|
||||
struct maze_header {
|
||||
ieDword maze_sizex, maze_sizey;
|
||||
ieDword pos1x, pos1y; //nordom's position
|
||||
ieDword pos2x, pos2y; //main hall position
|
||||
ieDword pos3x, pos3y; //unknown
|
||||
ieDword pos4x, pos4y; //unknown
|
||||
ieDword trapcount; //based on map size
|
||||
ieDword initialized; //set to 1
|
||||
ieDword unknown2c; //unknown
|
||||
ieDword unknown30; //unknown
|
||||
};
|
||||
|
||||
#define MAZE_ENTRY_SIZE sizeof(maze_entry)
|
||||
#define MAZE_HEADER_SIZE sizeof(maze_header)
|
||||
#define MAZE_MAX_DIM 8
|
||||
#define MAZE_ENTRY_COUNT (MAZE_MAX_DIM*MAZE_MAX_DIM)
|
||||
#define MAZE_DATA_SIZE (MAZE_ENTRY_COUNT*MAZE_ENTRY_SIZE+MAZE_HEADER_SIZE)
|
||||
#define MAZE_DATA_SIZE_HARDCODED 1720
|
||||
|
||||
//maze header indices
|
||||
#define MH_POS1X 0
|
||||
#define MH_POS1Y 1
|
||||
#define MH_POS2X 2
|
||||
#define MH_POS2Y 3
|
||||
#define MH_POS3X 4
|
||||
#define MH_POS3Y 5
|
||||
#define MH_POS4X 6
|
||||
#define MH_POS4Y 7
|
||||
#define MH_TRAPCOUNT 8
|
||||
#define MH_INITED 9
|
||||
#define MH_UNKNOWN2C 10
|
||||
#define MH_UNKNOWN30 11
|
||||
|
||||
//maze entry indices
|
||||
#define ME_0 0
|
||||
#define ME_VALID 1
|
||||
#define ME_ACCESSIBLE 2
|
||||
#define ME_TRAP 3
|
||||
#define ME_WALLS 4
|
||||
#define ME_16 5
|
||||
|
||||
//ME_WALL bitfields
|
||||
#define WALL_EAST 1
|
||||
#define WALL_WEST 2
|
||||
#define WALL_NORTH 4
|
||||
#define WALL_SOUTH 8
|
||||
|
||||
#define MAX_CRLEVEL 32
|
||||
|
||||
typedef int CRRow[MAX_CRLEVEL];
|
||||
@@ -227,6 +285,7 @@ public:
|
||||
int event_timer;
|
||||
EventHandler event_handler; //like in Control
|
||||
bool hasInfra;
|
||||
bool familiarBlock;
|
||||
private:
|
||||
/** reads the challenge rating table */
|
||||
void LoadCRTable();
|
||||
@@ -398,6 +457,8 @@ public:
|
||||
void RestParty(int checks, int dream, int hp);
|
||||
/** timestop effect initiated by actor */
|
||||
void TimeStop(Actor *actor, ieDword end);
|
||||
/** updates the infravision info */
|
||||
void Infravision();
|
||||
/** gets the colour which should be applied over the game area,
|
||||
may return NULL */
|
||||
const Color *GetGlobalTint() const;
|
||||
@@ -413,8 +474,8 @@ public:
|
||||
void DebugDump();
|
||||
/** Finds an actor by global ID */
|
||||
Actor *GetActorByGlobalID(ieDword objectID);
|
||||
/** updates the infravision info */
|
||||
void Infravision();
|
||||
/** Allocates maze data */
|
||||
ieByte *AllocateMazeData();
|
||||
private:
|
||||
bool DetermineStartPosType(const TableMgr *strta);
|
||||
ieResRef *GetDream(Map *area);
|
||||
@@ -189,7 +189,7 @@ void GameScript::RealSetGlobalTimer(Scriptable* Sender, Action* parameters)
|
||||
ieDword mytime=core->GetGame()->RealTime;
|
||||
|
||||
SetVariable( Sender, parameters->string0Parameter,
|
||||
parameters->int0Parameter + mytime);
|
||||
parameters->int0Parameter*AI_UPDATE_TIME + mytime);
|
||||
}
|
||||
|
||||
void GameScript::ChangeAllegiance(Scriptable* Sender, Action* parameters)
|
||||
@@ -2038,6 +2038,40 @@ void GameScript::PlaySequence(Scriptable* Sender, Action* parameters)
|
||||
actor->SetStance( parameters->int0Parameter );
|
||||
}
|
||||
|
||||
//same as PlaySequence, but the value comes from a variable
|
||||
//ToDo: create a PlaySequenceCore in GSUtils
|
||||
void GameScript::PlaySequenceGlobal(Scriptable* Sender, Action* parameters)
|
||||
{
|
||||
Scriptable* tar;
|
||||
ieDword value;
|
||||
|
||||
value = (ieDword) CheckVariable( Sender, parameters->string0Parameter );
|
||||
|
||||
if (parameters->objects[1]) {
|
||||
tar = GetActorFromObject( Sender, parameters->objects[1] );
|
||||
if (!tar) {
|
||||
//could be an animation
|
||||
AreaAnimation* anim = Sender->GetCurrentArea( )->GetAnimation( parameters->objects[1]->objectName);
|
||||
if (anim) {
|
||||
//set animation's cycle to value;
|
||||
anim->sequence=value;
|
||||
anim->frame=0;
|
||||
//what else to be done???
|
||||
anim->InitAnimation();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
tar = Sender;
|
||||
}
|
||||
if (tar->Type != ST_ACTOR) {
|
||||
return;
|
||||
}
|
||||
Actor* actor = ( Actor* ) tar;
|
||||
actor->SetStance( value );
|
||||
}
|
||||
|
||||
void GameScript::SetDialogue(Scriptable* Sender, Action* parameters)
|
||||
{
|
||||
if (Sender->Type != ST_ACTOR) {
|
||||
@@ -2544,14 +2578,14 @@ void GameScript::Spell(Scriptable* Sender, Action* parameters)
|
||||
|
||||
//if target was set, fire spell
|
||||
if (Sender->LastTarget) {
|
||||
Sender->CastSpellEnd( spellres );
|
||||
Sender->CastSpellEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
|
||||
//the target was converted to a point
|
||||
if(!Sender->LastTargetPos.isempty()) {
|
||||
Sender->CastSpellPointEnd( spellres );
|
||||
Sender->CastSpellPointEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
@@ -2613,7 +2647,7 @@ void GameScript::SpellPoint(Scriptable* Sender, Action* parameters)
|
||||
|
||||
//if target was set, fire spell
|
||||
if (!Sender->LastTargetPos.isempty()) {
|
||||
Sender->CastSpellPointEnd( spellres );
|
||||
Sender->CastSpellPointEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
@@ -2654,18 +2688,22 @@ void GameScript::SpellNoDec(Scriptable* Sender, Action* parameters)
|
||||
if (!ResolveSpellName( spellres, parameters) ) {
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
} else {
|
||||
if (!Sender->SpellResRef[0]) {
|
||||
Sender->SetSpellResRef(spellres);
|
||||
}
|
||||
}
|
||||
|
||||
//if target was set, fire spell
|
||||
if (Sender->LastTarget) {
|
||||
Sender->CastSpellEnd( spellres );
|
||||
Sender->CastSpellEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
|
||||
//the target was converted to a point
|
||||
if(!Sender->LastTargetPos.isempty()) {
|
||||
Sender->CastSpellPointEnd( spellres );
|
||||
Sender->CastSpellPointEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
@@ -2707,11 +2745,15 @@ void GameScript::SpellPointNoDec(Scriptable* Sender, Action* parameters)
|
||||
if (!ResolveSpellName( spellres, parameters) ) {
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
} else {
|
||||
if (!Sender->SpellResRef[0]) {
|
||||
Sender->SetSpellResRef(spellres);
|
||||
}
|
||||
}
|
||||
|
||||
//if target was set, fire spell
|
||||
if (!Sender->LastTargetPos.isempty()) {
|
||||
Sender->CastSpellPointEnd( spellres );
|
||||
Sender->CastSpellPointEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
@@ -2745,18 +2787,22 @@ void GameScript::ForceSpell(Scriptable* Sender, Action* parameters)
|
||||
if (!ResolveSpellName( spellres, parameters) ) {
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
} else {
|
||||
if (!Sender->SpellResRef[0]) {
|
||||
Sender->SetSpellResRef(spellres);
|
||||
}
|
||||
}
|
||||
|
||||
//if target was set, fire spell
|
||||
if (Sender->LastTarget) {
|
||||
Sender->CastSpellEnd( spellres );
|
||||
Sender->CastSpellEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
|
||||
//the target was converted to a point
|
||||
if(!Sender->LastTargetPos.isempty()) {
|
||||
Sender->CastSpellPointEnd( spellres );
|
||||
Sender->CastSpellPointEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
@@ -2797,11 +2843,15 @@ void GameScript::ForceSpellPoint(Scriptable* Sender, Action* parameters)
|
||||
if (!ResolveSpellName( spellres, parameters) ) {
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
} else {
|
||||
if (!Sender->SpellResRef[0]) {
|
||||
Sender->SetSpellResRef(spellres);
|
||||
}
|
||||
}
|
||||
|
||||
//if target was set, fire spell
|
||||
if (!Sender->LastTargetPos.isempty()) {
|
||||
Sender->CastSpellPointEnd( spellres );
|
||||
Sender->CastSpellPointEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
@@ -2835,6 +2885,10 @@ void GameScript::ReallyForceSpell(Scriptable* Sender, Action* parameters)
|
||||
if (!ResolveSpellName( spellres, parameters) ) {
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
} else {
|
||||
if (!Sender->SpellResRef[0]) {
|
||||
Sender->SetSpellResRef(spellres);
|
||||
}
|
||||
}
|
||||
|
||||
Scriptable* tar = GetActorFromObject( Sender, parameters->objects[1] );
|
||||
@@ -2851,9 +2905,9 @@ void GameScript::ReallyForceSpell(Scriptable* Sender, Action* parameters)
|
||||
}
|
||||
Sender->CastSpell (spellres, tar, false, true);
|
||||
if (tar->Type==ST_ACTOR) {
|
||||
Sender->CastSpellEnd(spellres);
|
||||
Sender->CastSpellEnd();
|
||||
} else {
|
||||
Sender->CastSpellPointEnd(spellres);
|
||||
Sender->CastSpellPointEnd();
|
||||
}
|
||||
Sender->ReleaseCurrentAction();
|
||||
}
|
||||
@@ -2869,6 +2923,10 @@ void GameScript::ReallyForceSpellPoint(Scriptable* Sender, Action* parameters)
|
||||
if (!ResolveSpellName( spellres, parameters) ) {
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
} else {
|
||||
if (!Sender->SpellResRef[0]) {
|
||||
Sender->SetSpellResRef(spellres);
|
||||
}
|
||||
}
|
||||
|
||||
//Sender->LastTargetPos=parameters->pointParameter;
|
||||
@@ -2882,7 +2940,7 @@ void GameScript::ReallyForceSpellPoint(Scriptable* Sender, Action* parameters)
|
||||
actor->SetStance (IE_ANI_CONJURE);
|
||||
}
|
||||
Sender->CastSpellPoint (spellres, parameters->pointParameter, false, true);
|
||||
Sender->CastSpellPointEnd(spellres);
|
||||
Sender->CastSpellPointEnd();
|
||||
Sender->ReleaseCurrentAction();
|
||||
}
|
||||
|
||||
@@ -2895,6 +2953,10 @@ void GameScript::ReallyForceSpellDead(Scriptable* Sender, Action* parameters)
|
||||
if (!ResolveSpellName( spellres, parameters) ) {
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
} else {
|
||||
if (!Sender->SpellResRef[0]) {
|
||||
Sender->SetSpellResRef(spellres);
|
||||
}
|
||||
}
|
||||
|
||||
Scriptable* tar = GetActorFromObject( Sender, parameters->objects[1] );
|
||||
@@ -2912,9 +2974,9 @@ void GameScript::ReallyForceSpellDead(Scriptable* Sender, Action* parameters)
|
||||
*/
|
||||
Sender->CastSpell (spellres, tar, false, true);
|
||||
if (tar->Type==ST_ACTOR) {
|
||||
Sender->CastSpellEnd(spellres);
|
||||
Sender->CastSpellEnd();
|
||||
} else {
|
||||
Sender->CastSpellPointEnd(spellres);
|
||||
Sender->CastSpellPointEnd();
|
||||
}
|
||||
Sender->ReleaseCurrentAction();
|
||||
}
|
||||
@@ -3161,7 +3223,6 @@ void GameScript::JoinParty(Scriptable* Sender, Action* parameters)
|
||||
}
|
||||
}
|
||||
core->GetGame()->JoinParty( act, JP_JOIN );
|
||||
//core->GetGUIScriptEngine()->RunFunction( "GUICommonWindows", "UpdatePortraitWindow" );
|
||||
}
|
||||
|
||||
void GameScript::LeaveParty(Scriptable* Sender, Action* /*parameters*/)
|
||||
@@ -3171,7 +3232,6 @@ void GameScript::LeaveParty(Scriptable* Sender, Action* /*parameters*/)
|
||||
}
|
||||
Actor* act = ( Actor* ) Sender;
|
||||
core->GetGame()->LeaveParty( act );
|
||||
//core->GetGUIScriptEngine()->RunFunction( "GUICommonWindows", "UpdatePortraitWindow" );
|
||||
}
|
||||
|
||||
//HideCreature hides only the visuals of a creature
|
||||
@@ -4752,7 +4812,7 @@ void GameScript::Damage(Scriptable* Sender, Action* parameters)
|
||||
} else {
|
||||
damager=damagee;
|
||||
}
|
||||
int damage = damagee->LuckyRoll( (parameters->int1Parameter>>12)&15, (parameters->int1Parameter>>4)&255, parameters->int1Parameter&15, 0, 1, damager);
|
||||
int damage = damagee->LuckyRoll( (parameters->int1Parameter>>12)&15, (parameters->int1Parameter>>4)&255, parameters->int1Parameter&15, LR_DAMAGELUCK, damager);
|
||||
int type=MOD_ADDITIVE;
|
||||
switch(parameters->int0Parameter) {
|
||||
case 2: //raise
|
||||
@@ -5553,6 +5613,20 @@ void GameScript::SetMazeHarder(Scriptable* Sender, Action* /*parameters*/)
|
||||
}
|
||||
}
|
||||
|
||||
void GameScript::GenerateMaze(Scriptable* /*Sender*/, Action* /*parameters*/)
|
||||
{
|
||||
core->SetEventFlag(EF_CREATEMAZE);
|
||||
}
|
||||
|
||||
void GameScript::FixEngineRoom(Scriptable* Sender, Action* /*parameters*/)
|
||||
{
|
||||
int value = CheckVariable( Sender, "EnginInMaze","GLOBAL");
|
||||
if (value) {
|
||||
SetVariable(Sender, "EnginInMaze", "GLOBAL", 0);
|
||||
core->SetEventFlag(EF_CREATEMAZE);
|
||||
}
|
||||
}
|
||||
|
||||
void GameScript::StartRainNow(Scriptable* /*Sender*/, Action* /*parameters*/)
|
||||
{
|
||||
core->GetGame()->StartRainOrSnow( false, WB_RAIN|WB_LIGHTNING);
|
||||
@@ -64,8 +64,6 @@ int ExtraParametersCount = 0;
|
||||
int InDebug = 0;
|
||||
int happiness[3][20];
|
||||
int RandomNumValue;
|
||||
int *SkillStats=NULL;
|
||||
int SkillCount=-1;
|
||||
// reaction modifiers (by reputation and charisma)
|
||||
int rmodrep[20];
|
||||
int rmodchr[25];
|
||||
@@ -73,20 +71,6 @@ Gem_Polygon **polygons;
|
||||
|
||||
void InitScriptTables()
|
||||
{
|
||||
//initializing the skill->stats conversion table
|
||||
{
|
||||
AutoTable tab("skillsta");
|
||||
if (tab) {
|
||||
int rowcount = tab->GetRowCount();
|
||||
SkillCount = rowcount;
|
||||
if (rowcount) {
|
||||
SkillStats = (int *) malloc(rowcount * sizeof(int) );
|
||||
while(rowcount--) {
|
||||
SkillStats[rowcount]=strtol(tab->QueryField(rowcount,0), NULL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//initializing the happiness table
|
||||
{
|
||||
AutoTable tab("happy");
|
||||
@@ -1182,19 +1166,6 @@ void AttackCore(Scriptable *Sender, Scriptable *target, int flags)
|
||||
|
||||
//bool leftorright = (bool) ((attacksperround-attackcount)&1);
|
||||
bool leftorright = false;
|
||||
|
||||
//will return false on any errors (eg, unusable weapon)
|
||||
if (!actor->GetCombatDetails(tohit, leftorright, wi, header, hittingheader, Flags, DamageBonus, speed, CriticalBonus, style)) {
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
|
||||
if (header) wi.range *= 10;
|
||||
else wi.range = 0;
|
||||
|
||||
if ( target->Type == ST_DOOR || target->Type == ST_CONTAINER) {
|
||||
wi.range += 10;
|
||||
}
|
||||
Actor *tar = NULL;
|
||||
ieDword targetID = 0;
|
||||
if (target->Type==ST_ACTOR) {
|
||||
@@ -1205,6 +1176,20 @@ void AttackCore(Scriptable *Sender, Scriptable *target, int flags)
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
|
||||
//will return false on any errors (eg, unusable weapon)
|
||||
if (!actor->GetCombatDetails(tohit, leftorright, wi, header, hittingheader, Flags, DamageBonus, speed, CriticalBonus, style, tar)) {
|
||||
actor->SetStance(IE_ANI_READY);
|
||||
Sender->ReleaseCurrentAction();
|
||||
return;
|
||||
}
|
||||
|
||||
if (header) wi.range *= 10;
|
||||
else wi.range = 0;
|
||||
|
||||
if ( target->Type == ST_DOOR || target->Type == ST_CONTAINER) {
|
||||
wi.range += 10;
|
||||
}
|
||||
if (!(flags&AC_NO_SOUND) ) {
|
||||
if (actor->LastTarget != targetID) {
|
||||
//play attack sound for party members
|
||||
@@ -55,8 +55,6 @@ extern ieResRef *ObjectIDSTableNames;
|
||||
extern int ObjectFieldsCount;
|
||||
extern int ExtraParametersCount;
|
||||
extern int InDebug;
|
||||
extern int *SkillStats;
|
||||
extern int SkillCount;
|
||||
extern Gem_Polygon **polygons;
|
||||
|
||||
#define MIC_INVALID -2
|
||||
@@ -572,6 +572,7 @@ static const ActionLink actionnames[] = {
|
||||
{"fillslot", GameScript::FillSlot, 0},
|
||||
{"finalsave", GameScript::SaveGame, 0}, //synonym
|
||||
{"findtraps", GameScript::FindTraps, 0},
|
||||
{"fixengineroom", GameScript::FixEngineRoom, 0},
|
||||
{"floatmessage", GameScript::DisplayStringHead, 0},
|
||||
{"floatmessagefixed", GameScript::FloatMessageFixed, 0},
|
||||
{"floatmessagefixedrnd", GameScript::FloatMessageFixedRnd, 0},
|
||||
@@ -592,6 +593,7 @@ static const ActionLink actionnames[] = {
|
||||
{"formation", GameScript::Formation, AF_BLOCKING},
|
||||
{"fullheal", GameScript::FullHeal, 0},
|
||||
{"fullhealex", GameScript::FullHeal, 0}, //pst, not sure what's different
|
||||
{"generatemodronmaze", GameScript::GenerateMaze, 0},
|
||||
{"generatepartymember", GameScript::GeneratePartyMember, 0},
|
||||
{"getitem", GameScript::GetItem, 0},
|
||||
{"getstat", GameScript::GetStat, 0}, //gemrb specific
|
||||
@@ -698,8 +700,8 @@ static const ActionLink actionnames[] = {
|
||||
{"nidspecial4", GameScript::ProtectObject,AF_BLOCKING|AF_DIRECT|AF_ALIVE},
|
||||
{"nidspecial5", GameScript::UseItem, AF_BLOCKING|AF_DIRECT|AF_ALIVE},
|
||||
{"nidspecial6", GameScript::Spell, AF_BLOCKING|AF_DIRECT|AF_ALIVE},
|
||||
{"nidspecial7", GameScript::UseItemPoint, AF_BLOCKING|AF_ALIVE},
|
||||
{"nidspecial8", GameScript::SpellPoint, AF_BLOCKING|AF_ALIVE},
|
||||
{"nidspecial7", GameScript::SpellNoDec, AF_BLOCKING|AF_DIRECT|AF_ALIVE},
|
||||
//{"nidspecial8", GameScript::SpellPoint, AF_BLOCKING|AF_ALIVE}, //not needed
|
||||
{"nidspecial9", GameScript::ToggleDoor, AF_BLOCKING},//another internal hack, maybe we should use UseDoor instead
|
||||
{"noaction", GameScript::NoAction, 0},
|
||||
{"opendoor", GameScript::OpenDoor,0},
|
||||
@@ -715,6 +717,7 @@ static const ActionLink actionnames[] = {
|
||||
{"playerdialog", GameScript::PlayerDialogue,AF_BLOCKING},
|
||||
{"playerdialogue", GameScript::PlayerDialogue,AF_BLOCKING},
|
||||
{"playsequence", GameScript::PlaySequence, 0},
|
||||
{"playsequenceglobal", GameScript::PlaySequenceGlobal, 0}, //pst
|
||||
{"playsequencetimed", GameScript::PlaySequenceTimed, 0},//pst
|
||||
{"playsong", GameScript::StartSong, 0},
|
||||
{"playsound", GameScript::PlaySound, 0},
|
||||
@@ -1251,10 +1254,6 @@ void Targets::Clear()
|
||||
/** releasing global memory */
|
||||
static void CleanupIEScript()
|
||||
{
|
||||
if (SkillStats)
|
||||
free(SkillStats);
|
||||
SkillStats = NULL;
|
||||
SkillCount = -1;
|
||||
if (ObjectIDSTableNames)
|
||||
free(ObjectIDSTableNames);
|
||||
ObjectIDSTableNames = NULL;
|
||||
@@ -1095,6 +1095,7 @@ public:
|
||||
static void FakeEffectExpiryCheck(Scriptable* Sender, Action* parameters);
|
||||
static void FillSlot(Scriptable *Sender, Action* parameters);
|
||||
static void FindTraps(Scriptable* Sender, Action* parameters);
|
||||
static void FixEngineRoom(Scriptable *Sender, Action* parameters);
|
||||
static void FloatMessageFixed(Scriptable* Sender, Action* parameters);
|
||||
static void FloatMessageFixedRnd(Scriptable* Sender, Action* parameters);
|
||||
static void FloatMessageRnd(Scriptable* Sender, Action* parameters);
|
||||
@@ -1113,6 +1114,7 @@ public:
|
||||
static void ForceUseContainer(Scriptable* Sender, Action* parameters);
|
||||
static void Formation(Scriptable* Sender, Action* parameters);
|
||||
static void FullHeal(Scriptable* Sender, Action* parameters);
|
||||
static void GenerateMaze(Scriptable* Sender, Action* parameters);
|
||||
static void GeneratePartyMember(Scriptable* Sender, Action* parameters);
|
||||
static void GetItem(Scriptable* Sender, Action* parameters);
|
||||
static void GetStat(Scriptable* Sender, Action* parameters);
|
||||
@@ -1217,6 +1219,7 @@ public:
|
||||
static void PlayDeadInterruptable(Scriptable* Sender, Action* parameters);
|
||||
static void PlayerDialogue(Scriptable* Sender, Action* parameters);
|
||||
static void PlaySequence(Scriptable* Sender, Action* parameters);
|
||||
static void PlaySequenceGlobal(Scriptable* Sender, Action* parameters);
|
||||
static void PlaySequenceTimed(Scriptable* Sender, Action* parameters);
|
||||
static void PlaySound(Scriptable* Sender, Action* parameters);
|
||||
static void PlaySoundNotRanged(Scriptable* Sender, Action* parameters);
|
||||
@@ -26,30 +26,15 @@
|
||||
#include "Game.h"
|
||||
#include "TileMap.h"
|
||||
|
||||
/* return a Targets object with a single actor inside */
|
||||
inline static Targets* ReturnActorAsTarget(Actor *aC)
|
||||
/* return a Targets object with a single scriptable inside */
|
||||
inline static Targets* ReturnScriptableAsTarget(Scriptable *sc)
|
||||
{
|
||||
if (!aC) return NULL;
|
||||
if (!sc) return NULL;
|
||||
Targets *tgts = new Targets();
|
||||
tgts->AddTarget(aC, 0, 0);
|
||||
tgts->AddTarget(sc, 0, 0);
|
||||
return tgts;
|
||||
}
|
||||
|
||||
/*Actor *FindActorNearby(const char *name, Map *except, int ga_flags)
|
||||
{
|
||||
Game *game = core->GetGame();
|
||||
size_t mc = game->GetLoadedMapCount();
|
||||
while(mc--) {
|
||||
Map *map = game->GetMap(mc);
|
||||
if (map==except) continue;
|
||||
Actor * aC = map->GetActor(name, ga_flags);
|
||||
if (aC) {
|
||||
return aC;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}*/
|
||||
|
||||
/* do IDS filtering: [PC], [ENEMY], etc */
|
||||
inline static bool DoObjectIDSCheck(Object *oC, Actor *ac, bool *filtered) {
|
||||
for (int j = 0; j < ObjectIDSCount; j++) {
|
||||
@@ -162,18 +147,34 @@ static Targets* EvaluateObject(Map *map, Scriptable* Sender, Object* oC, int ga_
|
||||
}*/
|
||||
|
||||
//return here because object name/IDS targeting are mutually exclusive
|
||||
return ReturnActorAsTarget(aC);
|
||||
return ReturnScriptableAsTarget(aC);
|
||||
}
|
||||
|
||||
if (oC->objectFields[0]==-1) {
|
||||
// this is an internal hack, allowing us to pass actor ids around as objects
|
||||
Actor* aC = map->GetActorByGlobalID( (ieDword) oC->objectFields[1] );
|
||||
/* TODO: this hack will throw away an invalid target */
|
||||
/* Consider putting this in GetActorByGlobalID */
|
||||
if (aC && !aC->ValidTarget(ga_flags)) {
|
||||
aC = NULL;
|
||||
if (aC) {
|
||||
if (!aC->ValidTarget(ga_flags)) {
|
||||
return NULL;
|
||||
}
|
||||
return ReturnScriptableAsTarget(aC);
|
||||
}
|
||||
return ReturnActorAsTarget(aC);
|
||||
Door *door = map->GetDoorByGlobalID( (ieDword) oC->objectFields[1]);
|
||||
if (door) {
|
||||
return ReturnScriptableAsTarget(door);
|
||||
}
|
||||
|
||||
Container* cont = map->GetContainerByGlobalID((ieDword) oC->objectFields[1]);
|
||||
if (cont) {
|
||||
return ReturnScriptableAsTarget(cont);
|
||||
}
|
||||
|
||||
InfoPoint* trap = map->GetInfoPointByGlobalID((ieDword) oC->objectFields[1]);
|
||||
if (trap) {
|
||||
return ReturnScriptableAsTarget(trap);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Targets *tgts = NULL;
|
||||
@@ -225,21 +226,6 @@ Targets* GetAllObjects(Map *map, Scriptable* Sender, Object* oC, int ga_flags)
|
||||
return tgts;
|
||||
}
|
||||
|
||||
/*Targets *GetAllObjectsNearby(Scriptable* Sender, Object* oC, int ga_flags)
|
||||
{
|
||||
Game *game = core->GetGame();
|
||||
size_t mc = game->GetLoadedMapCount();
|
||||
while(mc--) {
|
||||
Map *map = game->GetMap(mc);
|
||||
if (map==Sender->GetCurrentArea()) continue;
|
||||
Targets *tgts = GetAllObjects(map, Sender, oC, ga_flags);
|
||||
if (tgts) {
|
||||
return tgts;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}*/
|
||||
|
||||
Targets *GetAllActors(Scriptable *Sender, int ga_flags)
|
||||
{
|
||||
Map *map = Sender->GetCurrentArea();
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "exports.h"
|
||||
|
||||
Targets* GetAllObjects(Map *map, Scriptable* Sender, Object* oC, int ga_flags);
|
||||
GEM_EXPORT Targets* GetAllObjects(Map *map, Scriptable* Sender, Object* oC, int ga_flags);
|
||||
Targets* GetAllActors(Scriptable* Sender, int ga_flags);
|
||||
Scriptable* GetActorFromObject(Scriptable* Sender, Object* oC, int ga_flags = 0);
|
||||
Scriptable* GetStoredActorFromObject(Scriptable* Sender, Object* oC, int ga_flags = 0);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user