* Added "If a .dmod file is put in the Dink HD directory (where the .exe is), it will be automatically installed and then deleted" to readme.txt

* Dialog box rendering was off a few pixels due to me forgetting to remove some tests I did, fixed
* Black at index 255 and white at index 0 is now forced during bmp loading.  Windows does it, photoshop doesn't, but older versions of Dink (directx) seemed to do
it so going with that
* Invalid sprite sent to freeze/unfreeze will no longer crash the game (bug was also in original 1.08)
* Added hardening to check valid input on many script functions, will stop "sometimes" crashes based on bad scripting as well as log them
* Crash logging should show correct function names. I mean it this time!
- Some mobile related files added now that I'm starting to work on that side too

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1512 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2017-09-29 05:37:07 +00:00
parent 821e5f1651
commit ed55a08ab2
13 changed files with 3672 additions and 53 deletions

49
Info.plist Normal file
View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Dink HD</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleIconFiles</key>
<array>
<string>icon.png</string>
<string>Icon-72.png</string>
<string>icon@2x.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.rtsoft.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.8.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>162</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>NSMainNibFile~ipad</key>
<string>MainWindow-iPad</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

34
OSX/Info.plist Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>app.icns</string>
<key>CFBundleIdentifier</key>
<string>com.rtsoft.rtdink</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.8.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.8.3</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>MyApplication</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.role-playing-games</string>
</dict>
</plist>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rtsoft.rtdink"
android:versionCode="9"
android:versionName="1.8.3"
android:installLocation="preferExternal"
>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:icon="@drawable/icon"
>
<activity android:name="Main"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation"
android:screenOrientation="landscape"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" />
</manifest>

View file

@ -0,0 +1,269 @@
;NSIS Modern User Interface version 1.70
;Header Bitmap Example Script
;Written by Joost Verburg
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;General
SetCompressor lzma
!define _TITLE_ "Dink Smallwood HD"
!define _VERSION_ "$%C_TEXT_VERSION%"
!define _COMPILE_DATE_ "${__DATE__}"
;Name and file
Name "${_TITLE_}"
; Icon
!define MUI_ICON "dink.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\classic-uninstall.ico"
RequestExecutionLevel user
OutFile "..\$%C_FILENAME%"
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome_side.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "welcome_side.bmp"
;Default installation folder
InstallDir "$LOCALAPPDATA\DinkSmallwoodHD"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\RTSOFT\DINK" "path"
BrandingText " "
;InitPluginsDir
; File /oname=$PLUGINSDIR\splash.bmp "path\to\your\bitmap.bmp"
; advsplash::show 1000 600 400 -1 $PLUGINSDIR\splash
; Pop $0
;--------------------------------
;Interface Configuration
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "header.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "header.bmp"
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${_TITLE_}. (${_VERSION_} released on ${_COMPILE_DATE_})\r\n\r\nClick Next to continue."
!define MUI_WELCOMEPAGE_TITLE "${_TITLE_} ${_VERSION_} Installer"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "readme.txt"
;Customize component texts
!define MUI_COMPONENTSPAGE_TEXT_COMPLIST "Select extra components to install."
!define MUI_COMPONENTSPAGE_TEXT_TOP "Here, you can choose whether or not you want a desktop icon in addition to the normal start menu options."
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_LINK "Click here to visit the RTsoft website"
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.rtsoft.com/"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
;Remove the - part in from of Main Game if you don't want it to be hidden...
Section "-Main Game" SecMain
SectionIn RO
SetOutPath "$INSTDIR"
File "..\..\bin\dink.exe"
;dink.pdf is optional, it's like 11 MB but it allows auto logged crash stacks to contain useful info
File "..\..\bin\dink.pdb"
File "..\..\bin\fmod.dll"
File "..\..\bin\zlib1.dll"
SetOutPath "$INSTDIR\audio\"
File /r "..\..\bin\audio\"
SetOutPath "$INSTDIR"
SetOutPath "$INSTDIR\dink\"
File /r /x TimGM6mbTiny.dls "..\..\bin\dink\"
SetOutPath "$INSTDIR\interface\"
File /r "..\..\bin\interface\ipad"
File /r "..\..\bin\interface\large"
File /r "..\..\bin\interface\particle"
File /r "..\..\bin\interface\win"
File "..\..\bin\interface\*.*"
;to create the dir
SetOutPath "$INSTDIR\dmods\"
File "..\..\bin\dmods\info.txt"
SetOutPath "$INSTDIR"
;File /r "..\bin\base"
;AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "GenericRead + GenericWrite + DeleteChild"
CreateDirectory "$SMPROGRAMS\${_TITLE_}"
;ok, this will create a Folder in your Start menue
;Store installation folder
WriteRegStr HKCU "Software\RTSOFT\DINK" "path" $INSTDIR
;write uninstall strings
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${_TITLE_}" "DisplayName" "${_TITLE_} (remove only)"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${_TITLE_}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateShortCut "$SMPROGRAMS\${_TITLE_}\${_TITLE_}.lnk" "$INSTDIR\dink.exe" "" "$INSTDIR\dink.exe"
WriteIniStr "$SMPROGRAMS\${_TITLE_}\Report a bug or make a comment.url" "InternetShortcut" "URL" "http://www.rtsoft.com/pages/feedback_app.htm?game=${_TITLE_}&version=${_VERSION_}"
WriteIniStr "$SMPROGRAMS\${_TITLE_}\Robinson Technologies Website.url" "InternetShortcut" "URL" "http://www.rtsoft.com"
WriteIniStr "$SMPROGRAMS\${_TITLE_}\Visit the Dink Network.url" "InternetShortcut" "URL" "http://www.dinknetwork.com"
;CreateShortCut "$SMPROGRAMS\${_TITLE_}\Quick Help.lnk" "$INSTDIR\help\documentation.htm" ; use defaults for parameters, icon, etc.
CreateShortCut "$SMPROGRAMS\${_TITLE_}\Uninstall ${_TITLE_}.lnk" "$INSTDIR\Uninstall.exe" ; use defaults for parameters, icon, etc.
; file associations
/*
; back up old value of .opt
!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".dmod" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "DinkAddon" "${Index}-NoBackup"
WriteRegStr HKCR ".dmod" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".dmod" "" "DinkAddon"
ReadRegStr $0 HKCR "DinkAddon" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "DinkAddon" "" "DinkAddon"
WriteRegStr HKCR "DinkAddon\shell" "" "open"
WriteRegStr HKCR "DinkAddon\DefaultIcon" "" "$INSTDIR\dink.exe,0"
"${Index}-Skip:"
WriteRegStr HKCR "DinkAddon\shell\open\command" "" \
'"$INSTDIR\dink.exe" "%1"'
System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
!undef Index
*/
SectionEnd
;Installer Sections
Section "Desktop Icon" SecDesktopIcon
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\${_TITLE_}.lnk" "$INSTDIR\dink.exe"
SectionEnd
Function LaunchLink
ExecShell "" "$INSTDIR\dink.exe"
FunctionEnd
;--------------------------------
;Descriptions
;Language strings
LangString DESC_SecMain ${LANG_ENGLISH} "The main game files, these are required to play the game."
LangString DESC_SecDesktopIcon ${LANG_ENGLISH} "This option will throw one of those handy desktop icons on the main menu for easy access to the program."
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecMain} $(DESC_SecMain)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopIcon} $(DESC_SecDesktopIcon)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;default delete
Delete "$INSTDIR\dink.exe"
;dink.pdf is optional, it's like 11 MB but it allows auto logged crash stacks to contain useful info
Delete "$INSTDIR\dink.pdb"
Delete "$INSTDIR\Uninstall.exe"
Delete "$INSTDIR\fmodex.dll"
Delete "$INSTDIR\zlib1.dll"
RMDir /r "$INSTDIR\audio"
RMDir /r "$INSTDIR\interface"
RMDir /r "$INSTDIR\dink\dink"
RMDir /r "$INSTDIR\dink\graphics"
RMDir /r "$INSTDIR\dink\midi"
RMDir /r "$INSTDIR\dink\sound"
RMDir /r "$INSTDIR\dink\story"
RMDir /r "$INSTDIR\dink\tiles"
RMDir /r "$INSTDIR\dink\tiles"
Delete "$INSTDIR\dink\dmod.diz"
Delete "$INSTDIR\dink\dink.ini"
Delete "$INSTDIR\dink\hard.dat"
Delete "$INSTDIR\dink\map.dat"
Delete "$INSTDIR\dink\dink.dat"
RMDir "$INSTDIR\dink"
Delete "$INSTDIR\dmods\info.txt"
RMDir "$INSTDIR\dmods"
; RMDir /r "$INSTDIR\base"
DeleteRegKey HKCU "Software\RTSOFT\DINK\path"
DeleteRegKey /ifempty HKCU "Software\RTSOFT\DINK"
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${_TITLE_}"
Delete "$SMPROGRAMS\${_TITLE_}\*.*"
RMDir "$SMPROGRAMS\${_TITLE_}"
Delete "$DESKTOP\${_TITLE_}.lnk"
;delete user stuff too?
MessageBox MB_YESNO "Would you like to also delete all saved games and installed DMOD addons?" IDNO skip_it
;RMDir /r "$INSTDIR\worlds"
RMDir /r "$INSTDIR"
skip_it:
;start of restore script
/*
!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".dmod" ""
StrCmp $1 "DinkAddon" 0 "${Index}-NoOwn" ; only do this if we own it
ReadRegStr $1 HKCR ".dmod" "backup_val"
StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key
DeleteRegKey HKCR ".dmod"
Goto "${Index}-NoOwn"
"${Index}-Restore:"
WriteRegStr HKCR ".dmod" "" $1
DeleteRegValue HKCR ".dmod" "backup_val"
DeleteRegKey HKCR "DinkAddon" ;Delete key with association settings
System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
"${Index}-NoOwn:"
!undef Index
*/
;rest of script
SectionEnd

View file

@ -28,6 +28,7 @@ Supported command line options:
-game <dmod directory> (Example: dink.exe -game c:\dmods\island ) (this also sets -dmodpath automatically to the dmods parent directory)
-dmodpath or --refdir <dir containing DMOD dirs> (Example: dink.exe -game c:\dmods )
Note: If a .dmod file is put in the Dink HD directory (where the .exe is) it will be automatically installed and then deleted
------------- BETA VERSION -----------------
@ -228,3 +229,14 @@ I also added the CD and splash.bmp that were missing
* Fixed issue where music might not play on the title screen
* Raised "memory of dead background sprites" to 300 from 100 for Windows, up to 200 for mobile
* Doubled memory Dink is allowed to use before uncaching graphics not used recently (could probably be disabled entirely for Windows but whatever)
------ Change log for 1.8.3 ----------
* Added "If a .dmod file is put in the Dink HD directory (where the .exe is), it will be automatically installed and then deleted" to readme.txt
* Dialog box rendering was off a few pixels due to me forgetting to remove some tests I did, fixed
* Black at index 255 and white at index 0 is now forced during bmp loading. Windows does it, photoshop doesn't, but older versions of Dink (directx) seemed to do
it so going with that
* Invalid sprite sent to freeze/unfreeze will no longer crash the game (bug was also in original 1.08)
* Added hardening to check valid input on many script functions, will stop "sometimes" crashes based on bad scripting as well as log them
* Crash logging should show correct function names. I mean it this time!

View file

@ -184,8 +184,8 @@ App::App()
m_bDidPostInit = false;
m_bHasDMODSupport = true;
//for mobiles
m_version = 1.82f;
m_versionString = "V1.8.2";
m_version = 1.83f;
m_versionString = "V1.8.3";
m_build = 1;
m_bCheatsEnabled = false;

View file

@ -75,7 +75,7 @@ void OnVersionDownloadHTTPFinish(VariantList *pVList)
TextScanner t((char*)pVList->m_variant[1].GetString().c_str());
string line;
LogMsg(t.GetAll().c_str());
//LogMsg(t.GetAll().c_str());
// ShowScoreMessage(pMenu, t.GetParmString("msg",1));
//GetApp()->GetVar("score_msg")->Set(t.GetParmString("msg",1));

View file

@ -3543,7 +3543,8 @@ void decipher(char *crap, int script)
if (compare(crap, (char*)"&current_sprite"))
{
sprintf(crap, "%d",g_scriptInstance[script]->sprite);
//Msg("cur sprite returning %s, ",crap);
LogMsg("cur sprite returning %s, ",crap);
return;
}
@ -5208,6 +5209,13 @@ void draw_sprite_game(LPDIRECTDRAWSURFACE lpdest,int h)
void changedir( int dir1, int k,int base)
{
if (k < 0 || k >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("Illegal change dir (to %d) command on sprite %d which is invalid", base + dir1, k);
return;
}
int hspeed;
int speed_hold = g_sprite[k].speed;
if (k > 1) if (g_sprite[k].brain != 9) if (g_sprite[k].brain != 10)
@ -6907,9 +6915,18 @@ pass:
int32 p[20] = {1,0,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
//Msg("UnFreeze called for %d.", nlist[0]);
if (g_sprite[g_nlist[0]].active) g_sprite[g_nlist[0]].freeze = 0; else
LogMsg("Couldn't unfreeze sprite %d in script %d, it doesn't exist.", g_nlist[0], script);
//LogMsg("UnFreeze called for %d.", g_nlist[0]);
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("Crash averted: Couldn't unfreeze sprite %d in script %d, it doesn't exist.", g_nlist[0], script);
}
else
{
if (g_sprite[g_nlist[0]].active) g_sprite[g_nlist[0]].freeze = 0; else
LogMsg("Couldn't unfreeze sprite %d in script %d, it doesn't exist.", g_nlist[0], script);
}
}
@ -6925,8 +6942,17 @@ pass:
if (get_parms(ev[1], script, h, p))
{
if (g_sprite[g_nlist[0]].active) g_sprite[g_nlist[0]].freeze = script; else
LogMsg("Couldn't freeze sprite %d in script %d, it doesn't exist.", g_nlist[0], script);
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("Crash averted: Couldn't unfreeze sprite %d in script %d, it doesn't exist.", g_nlist[0], script);
}
else
{
if (g_sprite[g_nlist[0]].active) g_sprite[g_nlist[0]].freeze = script; else
LogMsg("Couldn't freeze sprite %d in script %d, it doesn't exist.", g_nlist[0], script);
}
}
@ -7586,13 +7612,20 @@ pass:
int32 p[20] = {1,1,1,1,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("Illegal move command on sprite %d", g_nlist[0]);
}
else
{
g_sprite[g_nlist[0]].move_active = true;
g_sprite[g_nlist[0]].move_dir = g_nlist[1];
g_sprite[g_nlist[0]].move_num = g_nlist[2];
g_sprite[g_nlist[0]].move_nohard = g_nlist[3];
g_sprite[g_nlist[0]].move_script = 0;
if (g_script_debug_mode) LogMsg("Moving: Sprite %d, dir %d, num %d", g_nlist[0], g_nlist[1], g_nlist[2]);
g_sprite[g_nlist[0]].move_active = true;
g_sprite[g_nlist[0]].move_dir = g_nlist[1];
g_sprite[g_nlist[0]].move_num = g_nlist[2];
g_sprite[g_nlist[0]].move_nohard = g_nlist[3];
g_sprite[g_nlist[0]].move_script = 0;
if (g_script_debug_mode) LogMsg("Moving: Sprite %d, dir %d, num %d", g_nlist[0],g_nlist[1], g_nlist[2]);
}
}
@ -8058,15 +8091,24 @@ pass:
int32 p[20] = {1,1,1,1,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
//Msg("Move stop running %d to %d..", nlist[0], nlist[0]);
g_sprite[g_nlist[0]].move_active = true;
g_sprite[g_nlist[0]].move_dir = g_nlist[1];
g_sprite[g_nlist[0]].move_num = g_nlist[2];
g_sprite[g_nlist[0]].move_nohard = g_nlist[3];
g_sprite[g_nlist[0]].move_script = script;
strcpy(pLineIn, h);
if (g_script_debug_mode) LogMsg("Move_stop: Sprite %d, dir %d, num %d", g_nlist[0],g_nlist[1], g_nlist[2]);
return(2);
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("Invalid move_stop command on sprite %d", g_nlist[0]);
}
else
{
//Msg("Move stop running %d to %d..", nlist[0], nlist[0]);
g_sprite[g_nlist[0]].move_active = true;
g_sprite[g_nlist[0]].move_dir = g_nlist[1];
g_sprite[g_nlist[0]].move_num = g_nlist[2];
g_sprite[g_nlist[0]].move_nohard = g_nlist[3];
g_sprite[g_nlist[0]].move_script = script;
strcpy(pLineIn, h);
if (g_script_debug_mode) LogMsg("Move_stop: Sprite %d, dir %d, num %d", g_nlist[0], g_nlist[1], g_nlist[2]);
return(2);
}
}
@ -8202,24 +8244,32 @@ pass:
int32 p[20] = {1,1,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
// Set the value
if ( g_nlist[1] == 0 )
{
g_sprite[g_nlist[0]].freeze = 0;
}
else if ( g_nlist[1] == 1 )
{
g_sprite[g_nlist[0]].freeze = script;
}
// Return the value
if ( g_sprite[g_nlist[0]].freeze > 0 )
if (g_nlist[0] < 0 || g_nlist[0] > C_MAX_SPRITES_AT_ONCE)
{
g_dglos.g_returnint = 1;
LogMsg("sp_freeze ignored, sprite %d is no good", g_nlist[0]);
}
else
{
g_dglos.g_returnint = 0;
// Set the value
if (g_nlist[1] == 0)
{
g_sprite[g_nlist[0]].freeze = 0;
}
else if (g_nlist[1] == 1)
{
g_sprite[g_nlist[0]].freeze = script;
}
// Return the value
if (g_sprite[g_nlist[0]].freeze > 0)
{
g_dglos.g_returnint = 1;
}
else
{
g_dglos.g_returnint = 0;
}
}
}
@ -8435,7 +8485,10 @@ pass:
if (get_parms(ev[1], script, h, p))
{
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
return 0;
}
g_dglos.g_returnint = g_sprite[g_nlist[0]].script;
}
@ -8937,6 +8990,11 @@ pass:
int32 p[20] = {1,0,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
g_dglos.g_returnint = 0;
return 0;
}
g_dglos.g_returnint = g_sprite[g_nlist[0]].sp_index;
return(0);
}
@ -8950,12 +9008,21 @@ pass:
int32 p[20] = {1,1,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
g_dglos.g_returnint = change_sprite(g_nlist[0], g_nlist[1], &g_sprite[g_nlist[0]].brain);
if (g_nlist[1] == 13)
{
//a mouse brain was set...
g_dglo.SetViewOverride(DinkGlobals::VIEW_FULL);
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("so_brain sent bad sprite %d", g_nlist[0]);
}
else
{
g_dglos.g_returnint = change_sprite(g_nlist[0], g_nlist[1], &g_sprite[g_nlist[0]].brain);
if (g_nlist[1] == 13)
{
//a mouse brain was set...
g_dglo.SetViewOverride(DinkGlobals::VIEW_FULL);
}
}
return(0);
}
@ -9134,6 +9201,13 @@ pass:
//redink1 fix for freeze if hurt value is less than 0
if (g_nlist[1] < 0)
return(0);
if (g_nlist[0] <0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("hurt command used on sprite %d, ignoring", g_nlist[0]);
return 0;
}
if (hurt_thing(g_nlist[0], g_nlist[1], 0) > 0)
random_blood(g_sprite[g_nlist[0]].x, g_sprite[g_nlist[0]].y-40, g_nlist[0]);
if (g_sprite[g_nlist[0]].nohit != 1)
@ -9166,11 +9240,20 @@ pass:
int32 p[20] = {1,1,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
g_dglos.g_returnint = change_sprite(g_nlist[0], g_nlist[1], &g_sprite[g_nlist[0]].hard);
if (g_sprite[g_nlist[0]].sp_index != 0) if (g_nlist[1] != -1)
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("Bad sprite %d sent to sp_hard", g_nlist[0]);
g_dglos.g_returnint = -1;
return 0;
}
else
{
g_dglos.g_returnint = change_sprite(g_nlist[0], g_nlist[1], &g_sprite[g_nlist[0]].hard);
if (g_sprite[g_nlist[0]].sp_index != 0) if (g_nlist[1] != -1)
{
g_dglos.g_smallMap.sprite[g_sprite[g_nlist[0]].sp_index].hard = g_dglos.g_returnint;
g_dglos.g_smallMap.sprite[g_sprite[g_nlist[0]].sp_index].hard = g_dglos.g_returnint;
}
}
return(0);
}
@ -9212,7 +9295,14 @@ pass:
int32 p[20] = {1,0,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
g_sprite[g_nlist[0]].wait = 0;
if (g_nlist[0] < 0 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("sp_kill_wait sent invalid %d sprite", g_nlist[0]);
}
else
{
g_sprite[g_nlist[0]].wait = 0;
}
return(0);
}
g_dglos.g_returnint = -1;
@ -9224,7 +9314,7 @@ pass:
int32 p[20] = {1,1,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
if (g_nlist[0] < C_MAX_SPRITES_AT_ONCE) //SETH this fixes crash when killing milder
if (g_nlist[0] < C_MAX_SPRITES_AT_ONCE && g_nlist[0] >= 0) //SETH this fixes crash when killing milder
{
g_sprite[g_nlist[0]].kill = g_nlist[1];
return(0);
@ -9604,9 +9694,9 @@ LogMsg("%d scripts used", g_dglos.g_returnint);
{
g_dglos.g_returnint = 0;
if (g_nlist[0] == 0)
if (g_nlist[0] < 1 || g_nlist[0] >= C_MAX_SPRITES_AT_ONCE)
{
LogMsg("Error: Can't compare sprite script for sprite 0!??!?!");
LogMsg("Error: Can't compare sprite script for sprite %d!??!?!", g_nlist[0]);
return(0);
}
if (g_sprite[g_nlist[0]].active)
@ -14606,11 +14696,19 @@ void process_talk()
&g_dglos.g_picInfo[g_dglos.g_seq[30].frame[2]].box , DDBLTFAST_SRCCOLORKEY );
ddrval = lpDDSBack->BltFast(px + 169, py + 42, g_pSpriteSurface[g_dglos.g_seq[30].frame[3]],
&g_dglos.g_picInfo[g_dglos.g_seq[30].frame[3]].box, DDBLTFAST_SRCCOLORKEY);
ddrval = lpDDSBack->BltFast(px + 169 + 180, py + 1, g_pSpriteSurface[g_dglos.g_seq[30].frame[4]],
&g_dglos.g_picInfo[g_dglos.g_seq[30].frame[4]].box, DDBLTFAST_SRCCOLORKEY);
/*
ddrval = lpDDSBack->BltFast( px+170, py+42, g_pSpriteSurface[g_dglos.g_seq[30].frame[3]],
&g_dglos.g_picInfo[g_dglos.g_seq[30].frame[3]].box , DDBLTFAST_SRCCOLORKEY );
ddrval = lpDDSBack->BltFast( px+170+181, py+1, g_pSpriteSurface[g_dglos.g_seq[30].frame[4]],
&g_dglos.g_picInfo[g_dglos.g_seq[30].frame[4]].box , DDBLTFAST_SRCCOLORKEY );
*/
}

View file

@ -37,6 +37,8 @@ IDirectDrawSurface * LoadBitmapIntoSurface(const char *pName, eTransparencyType
pSurf->m_pSurf = new SoftSurface;
//bUseCheckerboardFix = true;
pSurf->m_pSurf->SetForceBlackAndWhiteOnBmpPalettes(true);
if (pMem)
{
#ifdef _DEBUG

View file

@ -443,11 +443,12 @@
<AdditionalDependencies>opengl32.lib;fmod_vc.lib;zdll.lib;ws2_32.lib;dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\shared\win\lib;..\dxsdk\Lib\x86;..\..\shared\win\fmodstudio\api\lowlevel\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
<FullProgramDatabaseFile>false</FullProgramDatabaseFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release GL|x64'">

View file

@ -30,8 +30,7 @@
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release GL|Win32'">
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>-game dmods/tdabeta</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release GL AkikoBox|Win32'">