* Mobile GUI tweaks

* Added option to disable screen scroll transitions, one of my Android test devices has the slowest glread in the world, it's like 1 full second to walk to the next screen because of it.  This might make dmods that 
use timing (Myster island camera sequence for example) easier though, not sure.
* Fixed issue where behavior of two load_sequence commands in a row on the same sequence differed from 1.08 (in 1.08, max frame is set to the second one as long as the first one wasn't actually loaded yet.  key now shows up in TGKA)
* Fixed regression where offsets in Mayhem were incorrect on the hand mouse pointer
* Upped max frames per seq to 100 instead of 50, fixes Echoes of the Ancient.  I should probably make it dynamic but changing one const number is much easier!
* Now gives a clear warning in the log.txt if a seq tries to go beyond what it can handle and will truncate it (better than breaking the whole sequence as it did before)
* Added support for a weird bmp header type, fixes incorrect palette issue in the dmod The Orb of Darkness
* Fixed life/exp/health to correctly interpolate between values like the original dink, huge thanks to Dan's detailed bug report on this, he even made a mod which made testing the fix a breeze!

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1520 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2017-10-08 04:12:51 +00:00
parent 7e962c97e0
commit 20f8a6a856
17 changed files with 18805 additions and 18568 deletions

View file

@ -17,7 +17,7 @@
<string>icon@2x.png</string> <string>icon@2x.png</string>
</array> </array>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.rtsoft.${PRODUCT_NAME:identifier}</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@ -25,7 +25,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.8.2</string> <string>1.8.8</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>

View file

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.8.7</string> <string>1.8.8</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.8.7</string> <string>1.8.8</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string> <string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>

View file

@ -196,7 +196,9 @@
5DD878261261BDC000EB4365 /* FileManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DD878201261BDC000EB4365 /* FileManager.cpp */; }; 5DD878261261BDC000EB4365 /* FileManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DD878201261BDC000EB4365 /* FileManager.cpp */; };
5DD878391261BEC500EB4365 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 5DD878351261BEC500EB4365 /* unzip.c */; }; 5DD878391261BEC500EB4365 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 5DD878351261BEC500EB4365 /* unzip.c */; };
5DD8783A1261BEC500EB4365 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 5DD878371261BEC500EB4365 /* ioapi.c */; }; 5DD8783A1261BEC500EB4365 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 5DD878371261BEC500EB4365 /* ioapi.c */; };
5DD87D1A1263069600EB4365 /* dmods in Resources */ = {isa = PBXBuildFile; fileRef = 5DD8791A1263069200EB4365 /* dmods */; }; 5DDA4DEF1F8609EF0079D738 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5DDA4DEE1F8609EE0079D738 /* Default-568h@2x.png */; };
5DDA4DF21F862F3F0079D738 /* RenderScissorComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DDA4DF01F862F3E0079D738 /* RenderScissorComponent.cpp */; };
5DDA5C781F8642080079D738 /* dmods_include in Resources */ = {isa = PBXBuildFile; fileRef = 5DDA5C771F8642080079D738 /* dmods_include */; };
5DDEC25F1294E63200C42C5E /* ExpiredMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DDEC25E1294E63200C42C5E /* ExpiredMenu.cpp */; }; 5DDEC25F1294E63200C42C5E /* ExpiredMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DDEC25E1294E63200C42C5E /* ExpiredMenu.cpp */; };
5DE39F1114C3F9B300163EA1 /* dink in Resources */ = {isa = PBXBuildFile; fileRef = 5DE39F1014C3F9B300163EA1 /* dink */; }; 5DE39F1114C3F9B300163EA1 /* dink in Resources */ = {isa = PBXBuildFile; fileRef = 5DE39F1014C3F9B300163EA1 /* dink */; };
5DE5068310EC800400CEAA3C /* FFReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DE5068110EC800400CEAA3C /* FFReader.cpp */; }; 5DE5068310EC800400CEAA3C /* FFReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DE5068110EC800400CEAA3C /* FFReader.cpp */; };
@ -542,8 +544,11 @@
5DD878361261BEC500EB4365 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ioapi.h; path = util/unzip/ioapi.h; sourceTree = "<group>"; }; 5DD878361261BEC500EB4365 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ioapi.h; path = util/unzip/ioapi.h; sourceTree = "<group>"; };
5DD878371261BEC500EB4365 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = util/unzip/ioapi.c; sourceTree = "<group>"; }; 5DD878371261BEC500EB4365 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = util/unzip/ioapi.c; sourceTree = "<group>"; };
5DD878381261BEC500EB4365 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crypt.h; path = util/unzip/crypt.h; sourceTree = "<group>"; }; 5DD878381261BEC500EB4365 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crypt.h; path = util/unzip/crypt.h; sourceTree = "<group>"; };
5DD8791A1263069200EB4365 /* dmods */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dmods; path = bin/dmods; sourceTree = "<group>"; };
5DD9544D0E960962004E403D /* PlatformSetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformSetup.h; sourceTree = "<group>"; }; 5DD9544D0E960962004E403D /* PlatformSetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformSetup.h; sourceTree = "<group>"; };
5DDA4DEE1F8609EE0079D738 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
5DDA4DF01F862F3E0079D738 /* RenderScissorComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderScissorComponent.cpp; path = Entity/RenderScissorComponent.cpp; sourceTree = "<group>"; };
5DDA4DF11F862F3F0079D738 /* RenderScissorComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderScissorComponent.h; path = Entity/RenderScissorComponent.h; sourceTree = "<group>"; };
5DDA5C771F8642080079D738 /* dmods_include */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dmods_include; path = bin/dmods_include; sourceTree = "<group>"; };
5DDEC25D1294E63200C42C5E /* ExpiredMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExpiredMenu.h; path = source/GUI/ExpiredMenu.h; sourceTree = "<group>"; }; 5DDEC25D1294E63200C42C5E /* ExpiredMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExpiredMenu.h; path = source/GUI/ExpiredMenu.h; sourceTree = "<group>"; };
5DDEC25E1294E63200C42C5E /* ExpiredMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpiredMenu.cpp; path = source/GUI/ExpiredMenu.cpp; sourceTree = "<group>"; }; 5DDEC25E1294E63200C42C5E /* ExpiredMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpiredMenu.cpp; path = source/GUI/ExpiredMenu.cpp; sourceTree = "<group>"; };
5DE39F1014C3F9B300163EA1 /* dink */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dink; path = bin/dink; sourceTree = "<group>"; }; 5DE39F1014C3F9B300163EA1 /* dink */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dink; path = bin/dink; sourceTree = "<group>"; };
@ -624,6 +629,7 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5DDA4DEE1F8609EE0079D738 /* Default-568h@2x.png */,
5D2F53D515A7F29700B8CED1 /* SystemConfiguration.framework */, 5D2F53D515A7F29700B8CED1 /* SystemConfiguration.framework */,
5DC692580E947EBD00E5AC44 /* shared */, 5DC692580E947EBD00E5AC44 /* shared */,
29B97315FDCFA39411CA2CEA /* Source */, 29B97315FDCFA39411CA2CEA /* Source */,
@ -640,6 +646,7 @@
29B97315FDCFA39411CA2CEA /* Source */ = { 29B97315FDCFA39411CA2CEA /* Source */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5DDA5C771F8642080079D738 /* dmods_include */,
5D7AB8F010CF3ED000398F0F /* Dink */, 5D7AB8F010CF3ED000398F0F /* Dink */,
5DF1D5771045019100826147 /* Component */, 5DF1D5771045019100826147 /* Component */,
5D4760860FBB1D04008400E3 /* GUI */, 5D4760860FBB1D04008400E3 /* GUI */,
@ -654,7 +661,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5DE39F1014C3F9B300163EA1 /* dink */, 5DE39F1014C3F9B300163EA1 /* dink */,
5DD8791A1263069200EB4365 /* dmods */,
5D10469D1224D9E700BFC249 /* Icon-72.png */, 5D10469D1224D9E700BFC249 /* Icon-72.png */,
5D6E8C18121A75F2008F1D26 /* icon@2x.png */, 5D6E8C18121A75F2008F1D26 /* icon@2x.png */,
5D6E8C1A121A75F2008F1D26 /* Default@2x.png */, 5D6E8C1A121A75F2008F1D26 /* Default@2x.png */,
@ -876,6 +882,8 @@
5D82C88E0FF4BB660082EBE7 /* Components */ = { 5D82C88E0FF4BB660082EBE7 /* Components */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5DDA4DF01F862F3E0079D738 /* RenderScissorComponent.cpp */,
5DDA4DF11F862F3F0079D738 /* RenderScissorComponent.h */,
5DEB1A0212CC6FAD00A3A6DB /* EmitVirtualKeyComponent.h */, 5DEB1A0212CC6FAD00A3A6DB /* EmitVirtualKeyComponent.h */,
5DEB1A0312CC6FAD00A3A6DB /* EmitVirtualKeyComponent.cpp */, 5DEB1A0312CC6FAD00A3A6DB /* EmitVirtualKeyComponent.cpp */,
5D8CA6AD128ACA3E00188DA6 /* CustomInputComponent.h */, 5D8CA6AD128ACA3E00188DA6 /* CustomInputComponent.h */,
@ -1258,6 +1266,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = { 29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 0900;
TargetAttributes = { TargetAttributes = {
1D6058900D05DD3D006BFB54 = { 1D6058900D05DD3D006BFB54 = {
ProvisioningStyle = Automatic; ProvisioningStyle = Automatic;
@ -1296,11 +1305,12 @@
5D82C8C50FF4C1500082EBE7 /* audio in Resources */, 5D82C8C50FF4C1500082EBE7 /* audio in Resources */,
5D7C32B910BBB755009C5324 /* game in Resources */, 5D7C32B910BBB755009C5324 /* game in Resources */,
5D9BA548116232830008E859 /* MainWindow-iPad.xib in Resources */, 5D9BA548116232830008E859 /* MainWindow-iPad.xib in Resources */,
5DDA4DEF1F8609EF0079D738 /* Default-568h@2x.png in Resources */,
5D6E8C1B121A75F2008F1D26 /* icon@2x.png in Resources */, 5D6E8C1B121A75F2008F1D26 /* icon@2x.png in Resources */,
5D6E8C1D121A75F2008F1D26 /* Default@2x.png in Resources */, 5D6E8C1D121A75F2008F1D26 /* Default@2x.png in Resources */,
5D6E8C1F121A765F008F1D26 /* Default-Landscape.png in Resources */, 5D6E8C1F121A765F008F1D26 /* Default-Landscape.png in Resources */,
5D10469E1224D9E700BFC249 /* Icon-72.png in Resources */, 5D10469E1224D9E700BFC249 /* Icon-72.png in Resources */,
5DD87D1A1263069600EB4365 /* dmods in Resources */, 5DDA5C781F8642080079D738 /* dmods_include in Resources */,
5DE39F1114C3F9B300163EA1 /* dink in Resources */, 5DE39F1114C3F9B300163EA1 /* dink in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -1412,6 +1422,7 @@
5D7B11C510FC50D800997135 /* CursorComponent.cpp in Sources */, 5D7B11C510FC50D800997135 /* CursorComponent.cpp in Sources */,
5D7B11DA10FCD26400997135 /* InventoryComponent.cpp in Sources */, 5D7B11DA10FCD26400997135 /* InventoryComponent.cpp in Sources */,
5D2E40151109B94800A76983 /* LogMenu.cpp in Sources */, 5D2E40151109B94800A76983 /* LogMenu.cpp in Sources */,
5DDA4DF21F862F3F0079D738 /* RenderScissorComponent.cpp in Sources */,
5D8A5321110B0E7A007F5CF4 /* ScriptAccelerator.cpp in Sources */, 5D8A5321110B0E7A007F5CF4 /* ScriptAccelerator.cpp in Sources */,
5DBFC66F11144967009195F6 /* vec1.cpp in Sources */, 5DBFC66F11144967009195F6 /* vec1.cpp in Sources */,
5DBFC70411144AFD009195F6 /* mat3.cpp in Sources */, 5DBFC70411144AFD009195F6 /* mat3.cpp in Sources */,
@ -1508,7 +1519,6 @@
1D6058940D05DD3E006BFB54 /* Debug */ = { 1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
CODE_SIGN_IDENTITY = "iPhone Developer: Seth Robinson (MX6953T2FS)"; CODE_SIGN_IDENTITY = "iPhone Developer: Seth Robinson (MX6953T2FS)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
@ -1539,6 +1549,7 @@
); );
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-lfmod_$PLATFORM_NAME"; OTHER_LDFLAGS = "-lfmod_$PLATFORM_NAME";
PRODUCT_BUNDLE_IDENTIFIER = "com.rtsoft.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = RTDink; PRODUCT_NAME = RTDink;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -1548,16 +1559,30 @@
5D8733740FA9A0BC001DB559 /* AdHoc */ = { 5D8733740FA9A0BC001DB559 /* AdHoc */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = ( CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
armv7, CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
armv6, CLANG_WARN_BOOL_CONVERSION = YES;
); CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = Entitlements.plist; CODE_SIGN_ENTITLEMENTS = Entitlements.plist;
CODE_SIGN_IDENTITY = "Don't Code Sign"; CODE_SIGN_IDENTITY = "Don't Code Sign";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Seth Robinson (638X6EAY9H)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Seth Robinson (638X6EAY9H)";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_AUTO_VECTORIZATION = YES; GCC_AUTO_VECTORIZATION = YES;
GCC_C_LANGUAGE_STANDARD = c99; GCC_C_LANGUAGE_STANDARD = c11;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 3; GCC_OPTIMIZATION_LEVEL = 3;
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ../shared/PlatformPrecomp.h; GCC_PREFIX_HEADER = ../shared/PlatformPrecomp.h;
@ -1569,7 +1594,11 @@
); );
GCC_THUMB_SUPPORT = NO; GCC_THUMB_SUPPORT = NO;
GCC_VERSION = ""; GCC_VERSION = "";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
source, source,
@ -1604,7 +1633,6 @@
5D8733750FA9A0BC001DB559 /* AdHoc */ = { 5D8733750FA9A0BC001DB559 /* AdHoc */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
CODE_SIGN_IDENTITY = "iPhone Developer: Seth Robinson (MX6953T2FS)"; CODE_SIGN_IDENTITY = "iPhone Developer: Seth Robinson (MX6953T2FS)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
@ -1638,6 +1666,7 @@
/Users/Seth/dev/rtsvn/projects/proton/api/lowlevel/lib, /Users/Seth/dev/rtsvn/projects/proton/api/lowlevel/lib,
); );
OTHER_LDFLAGS = "-lfmod_$PLATFORM_NAME"; OTHER_LDFLAGS = "-lfmod_$PLATFORM_NAME";
PRODUCT_BUNDLE_IDENTIFIER = "com.rtsoft.${PRODUCT_NAME:identifier}";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
}; };
@ -1646,11 +1675,29 @@
C01FCF4F08A954540054247B /* Debug */ = { C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Seth Robinson (638X6EAY9H)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Seth Robinson (638X6EAY9H)";
GCC_C_LANGUAGE_STANDARD = c99; ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ../shared/PlatformPrecomp.h; GCC_PREFIX_HEADER = ../shared/PlatformPrecomp.h;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
@ -1661,7 +1708,11 @@
); );
GCC_THUMB_SUPPORT = NO; GCC_THUMB_SUPPORT = NO;
GCC_VERSION = ""; GCC_VERSION = "";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
source, source,
@ -1673,7 +1724,7 @@
); );
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LIBRARY_SEARCH_PATHS = ../shared/iOS/fmod/api/lib; LIBRARY_SEARCH_PATHS = ../shared/iOS/fmod/api/lib;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"-lfmodex_$PLATFORM_NAME", "-lfmodex_$PLATFORM_NAME",
"-weak_library", "-weak_library",

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rtsoft.rtdink" package="com.rtsoft.rtdink"
android:versionCode="9" android:versionCode="9"
android:versionName="1.8.7" android:versionName="1.8.8"
android:installLocation="preferExternal" android:installLocation="preferExternal"
> >

View file

@ -270,3 +270,15 @@ a specific speed, but by choosing rather snappy speed hopefully mystery island a
* Misc work on touch controls to prepare for the mobile releases * Misc work on touch controls to prepare for the mobile releases
* Added some names to credits (if you notice I added anybody twice or would rather be credited a different way or not at all, let me know!) * Added some names to credits (if you notice I added anybody twice or would rather be credited a different way or not at all, let me know!)
* Fixed bug that could sort of over-write random data if more than 100 sprites were active.. wow, bad * Fixed bug that could sort of over-write random data if more than 100 sprites were active.. wow, bad
------ Change log for 1.8.8 ----------
* Mobile GUI tweaks
* Added option to disable screen scroll transitions, one of my Android test devices has the slowest glread in the world, it's like 1 full second to walk to the next screen because of it. This might make dmods that
use timing (Myster island camera sequence for example) easier though, not sure.
* Fixed issue where behavior of two load_sequence commands in a row on the same sequence differed from 1.08 (in 1.08, max frame is set to the second one as long as the first one wasn't actually loaded yet. key now shows up in TGKA)
* Fixed regression where offsets in Mayhem were incorrect on the hand mouse pointer
* Upped max frames per seq to 100 instead of 50, fixes Echoes of the Ancient. I should probably make it dynamic but changing one const number is much easier!
* Now gives a clear warning in the log.txt if a seq tries to go beyond what it can handle and will truncate it (better than breaking the whole sequence as it did before)
* Added support for a weird bmp header type, fixes incorrect palette issue in the dmod The Orb of Darkness
* Fixed life/exp/health to correctly interpolate between values like the original dink, huge thanks to Dan's detailed bug report on this, he even made a mod which made testing the fix a breeze!

View file

@ -184,8 +184,8 @@ App::App()
m_bDidPostInit = false; m_bDidPostInit = false;
m_bHasDMODSupport = true; m_bHasDMODSupport = true;
//for mobiles //for mobiles
m_version = 1.87f; m_version = 1.88f;
m_versionString = "V1.8.7"; m_versionString = "V1.8.8";
m_build = 1; m_build = 1;
m_bCheatsEnabled = false; m_bCheatsEnabled = false;

View file

@ -76,7 +76,7 @@ void ActionButtonComponent::OnRender(VariantList *pVList)
if (IsLargeScreen()) if (IsLargeScreen())
{ {
dstRect = rtRectf(0,0, 90,90); dstRect = rtRectf(0,0, 68,68);
} else } else
{ {
@ -88,7 +88,7 @@ void ActionButtonComponent::OnRender(VariantList *pVList)
dstRect.AdjustPosition(vFinalPos.x, vFinalPos.y); dstRect.AdjustPosition(vFinalPos.x, vFinalPos.y);
if (IsLargeScreen()) if (IsLargeScreen())
{ {
dstRect.AdjustPosition(19, 25); dstRect.AdjustPosition(30, 31);
} else } else
{ {
dstRect.AdjustPosition(9, 12); dstRect.AdjustPosition(9, 12);

View file

@ -191,7 +191,7 @@ void AboutMenuAddScrollContent(Entity *pParent)
string msg = string msg =
GetAppName()+string("`$ ")+GetApp()->GetVersionString()+" Build "+toString(GetApp()->GetBuild())+"``\nCopyright (c) 2012 Robinson Technologies\n"\ GetAppName()+string("`$ ")+GetApp()->GetVersionString()+" Build "+toString(GetApp()->GetBuild())+"``\nCopyright (c) 1997-2017 Robinson Technologies\n"\
"\nDink Script Version: `$1.10``\n\n"\ "\nDink Script Version: `$1.10``\n\n"\
; ;
@ -432,8 +432,8 @@ msg += \
"Chris Black\n"\ "Chris Black\n"\
"Erik Harrison\n"\ "Erik Harrison\n"\
"James Hutt\n" \ "James Hutt\n" \
"Robj\n"\ "Robert J. Deans\n"\
"liquid141\n"\ "liquidsnakehpks\n"\
"Tal\n"\ "Tal\n"\
"Quiztis\n"\ "Quiztis\n"\
"rabidwolf9\n"\ "rabidwolf9\n"\

View file

@ -268,6 +268,16 @@ void UpdateBrowseControlButtons(Entity *pParent)
} }
bool DmodEntrySortByName(const DMODEntry& lhs, const DMODEntry& rhs)
{
return lhs.m_name < rhs.m_name;
}
bool DmodEntrySortByDate(const DMODEntry& lhs, const DMODEntry& rhs)
{
return lhs.m_date < rhs.m_date;
}
void BrowseMenuAddScrollContent(Entity *pParent, TextScanner *t) void BrowseMenuAddScrollContent(Entity *pParent, TextScanner *t)
{ {
pParent = pParent->GetEntityByName("scroll_child"); pParent = pParent->GetEntityByName("scroll_child");
@ -339,18 +349,12 @@ void BrowseMenuAddScrollContent(Entity *pParent, TextScanner *t)
{ {
case DMOD_SORT_ALPHABETICAL: case DMOD_SORT_ALPHABETICAL:
sort(g_dmodData.begin(), g_dmodData.end(), [](const DMODEntry& lhs, const DMODEntry& rhs) sort(g_dmodData.begin(), g_dmodData.end(), DmodEntrySortByName);
{
return lhs.m_name < rhs.m_name;
});
break; break;
case DMOD_SORT_DATE: case DMOD_SORT_DATE:
sort(g_dmodData.rbegin(), g_dmodData.rend(), [](const DMODEntry& lhs, const DMODEntry& rhs) sort(g_dmodData.rbegin(), g_dmodData.rend(), DmodEntrySortByDate);
{
return lhs.m_date < rhs.m_date;
});
break; break;
default: default:

View file

@ -402,6 +402,7 @@ struct DMODDisplayEntry
}; };
bool DmodSortByName(const DMODDisplayEntry& lhs, const DMODDisplayEntry& rhs) { return lhs.dmodName < rhs.dmodName; }
void DMODMenuAddScrollContent(Entity *pParent) void DMODMenuAddScrollContent(Entity *pParent)
{ {
@ -472,10 +473,7 @@ void DMODMenuAddScrollContent(Entity *pParent)
} }
//sort them by DMOD name rather than filename //sort them by DMOD name rather than filename
sort(entries.begin(), entries.end(), [](const DMODDisplayEntry& lhs, const DMODDisplayEntry& rhs) sort(entries.begin(), entries.end(), DmodSortByName);
{
return lhs.dmodName < rhs.dmodName;
});
for (int i = 0; i < entries.size(); i++) for (int i = 0; i < entries.size(); i++)

View file

@ -4,6 +4,7 @@
#include "dink/dink.h" #include "dink/dink.h"
#include "LogMenu.h" #include "LogMenu.h"
#include "GameMenu.h" #include "GameMenu.h"
#include "PopUpMenu.h"
extern bool g_script_debug_mode; extern bool g_script_debug_mode;
@ -135,6 +136,7 @@ Entity * DebugMenuCreate(Entity *pParentEnt)
//Entity *pBG = CreateOverlayEntity(pParentEnt, "DebugMenu", "interface/generic_bg.rttex", 0,0); //Entity *pBG = CreateOverlayEntity(pParentEnt, "DebugMenu", "interface/generic_bg.rttex", 0,0);
Entity *pBG = CreateOverlayRectEntity(pParentEnt, CL_Vec2f(0,0), GetScreenSize(), MAKE_RGBA(0,0,0,140)); Entity *pBG = CreateOverlayRectEntity(pParentEnt, CL_Vec2f(0,0), GetScreenSize(), MAKE_RGBA(0,0,0,140));
pBG->SetName("CheatMenu");
AddFocusIfNeeded(pBG); AddFocusIfNeeded(pBG);
@ -198,6 +200,13 @@ if (GetApp()->GetCheatsEnabled())
} }
SlideScreen(pBG, true, 500); SlideScreen(pBG, true, 500);
if (GetApp()->GetVarWithDefault("cheat_warning", uint32(0))->GetUINT32() == 0)
{
GetApp()->GetVar("cheat_warning")->Set(uint32(1));
PopUpCreate(pBG, "`4WARNING!``\n\nUsing cheats may break the game in strange ways and is only for testing or if you're desperate!", "", "cancel", "I get it", "", "", true);
}
return pBG; return pBG;
} }

View file

@ -131,6 +131,14 @@ void GameOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent fr
} }
} }
//clicked the attack button
if (g_dglo.m_lastSubGameMode == DINK_SUB_GAME_MODE_DIALOG)
{
//meh, skip it. On dialog menus we have a button labeled "select" over the punch button we use instead
return;
}
g_dglo.m_dirInput[DINK_INPUT_BUTTON1] = true; g_dglo.m_dirInput[DINK_INPUT_BUTTON1] = true;
return; return;
} }
@ -546,7 +554,10 @@ void BuildInventoryControls(float fadeTimeMS)
float trans = 0.0f; float trans = 0.0f;
Entity *pButtonEntity; Entity *pButtonEntity;
pButtonEntity = CreateButtonHotspot(pBG, "attack", iPhoneMap(113, 272), iPhoneMap(55, 46)); CL_Vec2f vButtonSize = DinkToNativeCoords(CL_Vec2f(152 + 64, 412 + 54)) - DinkToNativeCoords(CL_Vec2f(152, 412));
pButtonEntity = CreateButtonHotspot(pBG, "magic", DinkToNativeCoords(CL_Vec2f(152, 412)), vButtonSize);
pButtonEntity->GetVar("alpha")->Set(trans); pButtonEntity->GetVar("alpha")->Set(trans);
pButtonEntity->GetShared()->GetFunction("OnOverStart")->sig_function.connect(&GameOnSelect); pButtonEntity->GetShared()->GetFunction("OnOverStart")->sig_function.connect(&GameOnSelect);
pButtonEntity->GetShared()->GetFunction("OnOverEnd")->sig_function.connect(&GameOnStopSelect); pButtonEntity->GetShared()->GetFunction("OnOverEnd")->sig_function.connect(&GameOnStopSelect);
@ -554,7 +565,7 @@ void BuildInventoryControls(float fadeTimeMS)
SetButtonClickSound(pButtonEntity, ""); //no sound SetButtonClickSound(pButtonEntity, ""); //no sound
//I made this touchspot too big on purpose, easier to hit it. //I made this touchspot too big on purpose, easier to hit it.
pButtonEntity = CreateButtonHotspot(pBG, "attack", iPhoneMap(412, 272), iPhoneMap(62, 46)); pButtonEntity = CreateButtonHotspot(pBG, "attack", DinkToNativeCoords(CL_Vec2f(556, 412)), vButtonSize);
pButtonEntity->GetVar("alpha")->Set(trans); pButtonEntity->GetVar("alpha")->Set(trans);
pButtonEntity->GetShared()->GetFunction("OnOverStart")->sig_function.connect(&GameOnSelect); pButtonEntity->GetShared()->GetFunction("OnOverStart")->sig_function.connect(&GameOnSelect);
@ -693,17 +704,6 @@ void BuildControls(float fadeTimeMS)
if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED && IsDrawingDinkStatusBar()) if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED && IsDrawingDinkStatusBar())
{ {
//make it so touching the actual game icons on the bottom of the screen do stuff //make it so touching the actual game icons on the bottom of the screen do stuff
#ifdef _DEBUG
//trans = 0.7f;
#endif
/*
RecomputeAspectRatio();
ApplyAspectRatioGLMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
*/
CL_Vec2f vButtonSize = DinkToNativeCoords(CL_Vec2f(152+64, 412+54)) - DinkToNativeCoords(CL_Vec2f(152, 412)); CL_Vec2f vButtonSize = DinkToNativeCoords(CL_Vec2f(152+64, 412+54)) - DinkToNativeCoords(CL_Vec2f(152, 412));
pButtonEntity = CreateButtonHotspot(pBG, "magic", DinkToNativeCoords(CL_Vec2f(152, 412)), vButtonSize, Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH); pButtonEntity = CreateButtonHotspot(pBG, "magic", DinkToNativeCoords(CL_Vec2f(152, 412)), vButtonSize, Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH);
@ -813,6 +813,8 @@ void BuildControls(float fadeTimeMS)
void BuildDialogModeControls(float fadeTimeMS) void BuildDialogModeControls(float fadeTimeMS)
{ {
Entity *pBG = GetEntityRoot()->GetEntityByName("GameMenu"); Entity *pBG = GetEntityRoot()->GetEntityByName("GameMenu");
if (!pBG) if (!pBG)
@ -938,12 +940,22 @@ void BuildDialogModeControls(float fadeTimeMS)
if (IsDrawingDinkStatusBar()) if (IsDrawingDinkStatusBar())
{ {
//let's let the punch icon also select, it just feels natural //let's let the punch icon also select, it just feels natural
pButtonEntity = CreateButtonHotspot(pBG, "select", CL_Vec2f(iPhoneMapX(412), iPhoneMapY(272)), CL_Vec2f(iPhoneMapX(62), iPhoneMapY(46))); //pButtonEntity = CreateButtonHotspot(pBG, "select", CL_Vec2f(iPhoneMapX(412), iPhoneMapY(272)), CL_Vec2f(iPhoneMapX(62), iPhoneMapY(46)));
CL_Vec2f vButtonSize = DinkToNativeCoords(CL_Vec2f(152 + 64, 412 + 54)) - DinkToNativeCoords(CL_Vec2f(152, 412));
pButtonEntity = CreateButtonHotspot(pBG, "select", DinkToNativeCoords(CL_Vec2f(556, 412)), vButtonSize);
pButtonEntity->GetVar("alpha")->Set(trans); pButtonEntity->GetVar("alpha")->Set(trans);
pButtonEntity->GetShared()->GetFunction("OnOverStart")->sig_function.connect(&GameOnSelect); pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&GameOnSelect);
pButtonEntity->GetShared()->GetFunction("OnOverEnd")->sig_function.connect(&GameOnStopSelect); // pButtonEntity->GetShared()->GetFunction("OnOverEnd")->sig_function.connect(&GameOnStopSelect);
SetButtonClickSound(pButtonEntity, ""); //no sound SetButtonClickSound(pButtonEntity, ""); //no sound
DisableComponentByName(pButtonEntity, "Button2D");
EnableComponentByName(pButtonEntity, "Button2D", 1000);
} }
} }

View file

@ -105,6 +105,7 @@ void OptionsMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity
GetApp()->UpdateVideoSettings(); GetApp()->UpdateVideoSettings();
} }
if (pEntClicked->GetName() == "smoothing_0") if (pEntClicked->GetName() == "smoothing_0")
{ {
GetApp()->GetShared()->GetVar("smoothing")->Set(uint32(1)); GetApp()->GetShared()->GetVar("smoothing")->Set(uint32(1));
@ -144,6 +145,17 @@ void OptionsMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity
DinkOnForeground(); DinkOnForeground();
} }
//if (GetEmulatedPlatformID() == PLATFORM_ID_ANDROID)
{
if (pEntClicked->GetName() == "allow_glread")
{
bool bChecked = IsCheckboxChecked(pEntClicked);
GetApp()->GetVar("disable_glread")->Set(uint32(!bChecked));
}
}
#ifdef WINAPI #ifdef WINAPI
if (pEntClicked->GetName() == "check_borderless") if (pEntClicked->GetName() == "check_borderless")
{ {
@ -331,7 +343,7 @@ void OptionsMenuAddScrollContent(Entity *pParent)
float startX = iPhoneMapX(28); float startX = iPhoneMapX(28);
float offsetX = iPhoneMapX(0); float offsetX = iPhoneMapX(0);
float spacerX = iPhoneMapX(46); float spacerX = iPhoneMapX(46);
float spacerY = iPhoneMapY(40); float spacerY = iPhoneMapY(27.5);
float columnX = 140; float columnX = 140;
eFont fontID = FONT_SMALL; eFont fontID = FONT_SMALL;
@ -482,6 +494,13 @@ void OptionsMenuAddScrollContent(Entity *pParent)
y += GetSize2DEntity(pEnt).y; y += GetSize2DEntity(pEnt).y;
y += spacerY; y += spacerY;
bool bDisableRead = GetApp()->GetVar("disable_glread")->GetUINT32() != 0;
pEnt = CreateCheckbox(pBG, "allow_glread", "Enable screen scroll effect", startX, y, !bDisableRead, FONT_SMALL, 1.0f);
pEnt->GetFunction("OnButtonSelected")->sig_function.connect(&OptionsMenuOnSelect);
y += GetSize2DEntity(pEnt).y;
y += spacerY;
/* /*
//fps limit //fps limit
pEnt = CreateTextLabelEntity(pBG, "", startX, y, "Lock to 30 FPS:"); pEnt = CreateTextLabelEntity(pBG, "", startX, y, "Lock to 30 FPS:");
@ -503,7 +522,7 @@ void OptionsMenuAddScrollContent(Entity *pParent)
if (GetPlatformID() != PLATFORM_ID_IOS) if (GetPlatformID() != PLATFORM_ID_IOS)
{ {
y += spacerY; //y += spacerY;
//audio on/off button //audio on/off button
pEnt = CreateTextLabelEntity(pBG, "", startX, y, "Audio:"); pEnt = CreateTextLabelEntity(pBG, "", startX, y, "Audio:");

View file

@ -15,12 +15,12 @@ const int C_DINK_MAX_MAGICS = 8;
void ThinkSprite(int h, bool get_frame); void ThinkSprite(int h, bool get_frame);
void ApplyAspectRatioGLMatrix(); void ApplyAspectRatioGLMatrix();
void ScanSeqFilesIfNeeded(int seq);
bool pre_figure_out(const char *line, int load_seq, bool bLoadSpriteOnly); bool pre_figure_out(const char *line, int load_seq, bool bLoadSpriteOnly);
#define C_DINK_SCREEN_TRANSITION_TIME_MS 400 #define C_DINK_SCREEN_TRANSITION_TIME_MS 400
const float SAVE_FORMAT_VERSION = 3.0f; const float SAVE_FORMAT_VERSION = 3.1f;
const int C_DINK_FADE_TIME_MS = 300; const int C_DINK_FADE_TIME_MS = 300;
const float G_TRANSITION_SCALE_TRICK = 1.01f; const float G_TRANSITION_SCALE_TRICK = 1.01f;
@ -522,10 +522,10 @@ void setup_anim (int seq, int sequence,int delay)
} }
#ifdef _DEBUG #ifdef _DEBUG
if (seq == 452) if (seq == 855)
{ {
//LogMsg("yo, yo!"); LogMsg("yo, yo!");
} }
#endif #endif
@ -883,6 +883,11 @@ LogMsg("Loading tilescreen %s", fName.c_str());
} }
//this is completely different than how the original dink worked. The original Dink used GetTickCount() which drastically changed
//depending on when you last rebooted your computer. The new way just uses the clock in the save game which is accurate, but the result
//is if we continue a save created with another version of dink, it's likely sprites will never come back.
void fix_dead_sprites( void ) void fix_dead_sprites( void )
{ {
@ -890,7 +895,14 @@ void fix_dead_sprites( void )
{ {
if (g_dglos.g_playerInfo.spmap[*pmap].type[i] == 6) if (g_dglos.g_playerInfo.spmap[*pmap].type[i] == 6)
{ {
if (g_dglos.g_playerInfo.spmap[*pmap].last_time > GetApp()->GetGameTick())
{
#ifdef _DEBUG
LogMsg("Woah, crazy time on dead map sprite (%d) detected", i);
#endif
//g_dglos.g_playerInfo.spmap[*pmap].last_time = GetApp()->GetGameTick();
//I don't think this is needed, because it's reset elsewhere to the current time if visited
}
if ((g_dglos.g_dinkTick > (g_dglos.g_playerInfo.spmap[*pmap].last_time + 300000)) || if ((g_dglos.g_dinkTick > (g_dglos.g_playerInfo.spmap[*pmap].last_time + 300000)) ||
(g_dglos.g_dinkTick +400000 < g_dglos.g_playerInfo.spmap[*pmap].last_time + 300000) ) (g_dglos.g_dinkTick +400000 < g_dglos.g_playerInfo.spmap[*pmap].last_time + 300000) )
{ {
@ -1556,7 +1568,9 @@ bool LoadSpriteSingleFrame(string fNameBase, int seq, int oo, int picIndex, eTra
{ {
if (pMem && oo > g_dglos.g_seq[seq].m_spaceAllowed) if (pMem && oo > g_dglos.g_seq[seq].m_spaceAllowed)
{ {
//LogMsg("Truncating anim to fit in existing seq %d", seq); #ifdef _DEBUG
LogMsg("Truncating anim to fit in existing seq %d", seq);
#endif
SAFE_DELETE_ARRAY(pMem); SAFE_DELETE_ARRAY(pMem);
} }
} }
@ -1607,9 +1621,9 @@ bool LoadSpriteSingleFrame(string fNameBase, int seq, int oo, int picIndex, eTra
} }
#ifdef _DEBUG #ifdef _DEBUG
if (seq == 181 && oo == 11) if (seq == 868 && oo == 17)
{ {
LogMsg("hey"); //LogMsg("hey");
} }
#endif #endif
@ -1776,9 +1790,9 @@ bool load_sprites(char org[512], int seq, int speed, int xoffset, int yoffset, r
static FFReader reader; static FFReader reader;
#ifdef _DEBUG #ifdef _DEBUG
if (seq == 314 ) if (seq == 868 )
{ {
//LogMsg("Yeah"); LogMsg("Yeah");
} }
#endif #endif
reader.Init(g_dglo.m_gameDir, g_dglo.m_dmodGamePathWithDir, GetPathFromString(tempStr), g_dglo.m_bUsingDinkPak); reader.Init(g_dglo.m_gameDir, g_dglo.m_dmodGamePathWithDir, GetPathFromString(tempStr), g_dglo.m_bUsingDinkPak);
@ -1804,7 +1818,7 @@ bool load_sprites(char org[512], int seq, int speed, int xoffset, int yoffset, r
return true; return true;
} }
g_dglos.g_seq[seq].m_bDidFileScan = true;
// redink1 added to fix bug where loading sequences over others wouldn't work quite right. // redink1 added to fix bug where loading sequences over others wouldn't work quite right.
int save_cur = g_dglos.g_curPicIndex; int save_cur = g_dglos.g_curPicIndex;
bool reload = false; bool reload = false;
@ -1818,6 +1832,8 @@ bool load_sprites(char org[512], int seq, int speed, int xoffset, int yoffset, r
//LogMsg("Reloading: Temp g_curPicIndex is %d", g_curPicIndex); //LogMsg("Reloading: Temp g_curPicIndex is %d", g_curPicIndex);
#endif #endif
reload = true; reload = true;
//g_dglos.g_seq[seq].last = 0;
//g_dglos.g_seq[seq].m_spaceAllowed = 0; //forget the limits
} else } else
{ {
//LogMsg("Not reloading.."); //LogMsg("Not reloading..");
@ -1832,7 +1848,7 @@ bool load_sprites(char org[512], int seq, int speed, int xoffset, int yoffset, r
return true; return true;
} }
for (int oo = 1; oo <= C_MAX_SPRITE_FRAMES; oo++) for (int oo = 1; oo <= C_MAX_SPRITE_FRAMES+1; oo++) //the +1 is so we can detect when we go over our limit
{ {
if (oo < 10) strcpy(hold, "0"); else strcpy(hold,""); if (oo < 10) strcpy(hold, "0"); else strcpy(hold,"");
@ -1842,7 +1858,7 @@ bool load_sprites(char org[512], int seq, int speed, int xoffset, int yoffset, r
// LogMsg("Loading seq %d frame %d", seq, oo); // LogMsg("Loading seq %d frame %d", seq, oo);
} }
#endif #endif
if (reader.DoesFileExist(fNameBase+string(hold)+toString(oo)+".bmp", fNameBase + "01.bmp")) if (oo <= C_MAX_SPRITE_FRAMES && reader.DoesFileExist(fNameBase+string(hold)+toString(oo)+".bmp", fNameBase + "01.bmp"))
{ {
g_dglos.g_curPicIndex++; g_dglos.g_curPicIndex++;
@ -1853,6 +1869,10 @@ bool load_sprites(char org[512], int seq, int speed, int xoffset, int yoffset, r
LogMsg("load_sprites: Anim %s not found.",tempStr.c_str()); LogMsg("load_sprites: Anim %s not found.",tempStr.c_str());
//assert(0); //assert(0);
} }
if (oo == C_MAX_SPRITE_FRAMES+1)
{
LogMsg("Warning: Sequence %d tries to use over %d frames which is the max we can load!", seq, oo);
}
g_dglos.g_seq[seq].m_spaceAllowed = (oo - 1); g_dglos.g_seq[seq].m_spaceAllowed = (oo - 1);
g_dglos.g_seq[seq].last = (oo - 1); g_dglos.g_seq[seq].last = (oo - 1);
@ -1860,6 +1880,8 @@ bool load_sprites(char org[512], int seq, int speed, int xoffset, int yoffset, r
break; break;
} }
} }
if (bScanOnly) if (bScanOnly)
return true; return true;
} }
@ -1870,7 +1892,7 @@ bool load_sprites(char org[512], int seq, int speed, int xoffset, int yoffset, r
if (seq == 424) if (seq == 424)
{ {
LogMsg("hey"); //LogMsg("hey");
} }
#endif #endif
@ -2040,6 +2062,12 @@ bool ReloadSequence(int seqID, int frame, bool bScanOnly)
//handle a possible case where we need to always load frame 1 before any other frame to get the correct offset for anims //handle a possible case where we need to always load frame 1 before any other frame to get the correct offset for anims
if (frame > 1 && !bScanOnly && g_dglos.g_seq[seqID].m_bIsAnim) if (frame > 1 && !bScanOnly && g_dglos.g_seq[seqID].m_bIsAnim)
{ {
#ifdef _DEBUG
if (seqID == 855)
{
// LogMsg("Hey");
}
#endif
if (g_pSpriteSurface[g_dglos.g_seq[seqID].s+1] == 0) //make sure it's not already loaded if (g_pSpriteSurface[g_dglos.g_seq[seqID].s+1] == 0) //make sure it's not already loaded
ReloadSequence(seqID, 1, bScanOnly); ReloadSequence(seqID, 1, bScanOnly);
} }
@ -2104,7 +2132,7 @@ bool figure_out(const char *line, int load_seq)
int seqID = atol(ev[3]); int seqID = atol(ev[3]);
#ifdef _DEBUG #ifdef _DEBUG
if (seqID == 131) if (seqID == 439)
{ {
LogMsg("Loading sand stuff"); LogMsg("Loading sand stuff");
@ -2136,7 +2164,10 @@ bool figure_out(const char *line, int load_seq)
} }
ReadFromLoadSequenceString(ev); ReadFromLoadSequenceString(ev);
//ScanSeqFilesIfNeeded(seqID);
FreeSequence(seqID); //force a full reload, the anim probably changed FreeSequence(seqID); //force a full reload, the anim probably changed
ReloadSequence(seqID); ReloadSequence(seqID);
} }
@ -2184,7 +2215,7 @@ bool pre_figure_out(const char *line, int load_seq, bool bLoadSpriteOnly)
int seqID = atol(ev[3]); int seqID = atol(ev[3]);
#ifdef _DEBUG #ifdef _DEBUG
if (seqID == 131) if (seqID == 439)
{ {
LogMsg("Loading sand stuff prefigure out"); LogMsg("Loading sand stuff prefigure out");
@ -2209,11 +2240,19 @@ bool pre_figure_out(const char *line, int load_seq, bool bLoadSpriteOnly)
ReadFromLoadSequenceString(ev); ReadFromLoadSequenceString(ev);
if (compare(ev[1], "LOAD_SEQUENCE_NOW"))
// if ( (load_seq == -1) | (load_seq == atol(ev[3])) )
{
bReturn = load_sprites(g_dglos.g_seq[seqID].m_fileName, seqID, g_dglos.g_seq[seqID].m_speed, g_dglos.g_seq[seqID].m_xoffset, g_dglos.g_seq[seqID].m_yoffset, g_dglos.g_seq[seqID].m_hardbox bReturn = load_sprites(g_dglos.g_seq[seqID].m_fileName, seqID, g_dglos.g_seq[seqID].m_speed, g_dglos.g_seq[seqID].m_xoffset, g_dglos.g_seq[seqID].m_yoffset, g_dglos.g_seq[seqID].m_hardbox
, g_dglos.g_seq[seqID].m_transType, g_dglos.g_seq[seqID].m_bLeftAlign, true); //Crap , g_dglos.g_seq[seqID].m_transType, g_dglos.g_seq[seqID].m_bLeftAlign, true);
return bReturn; return bReturn;
} }
//ScanSeqFilesIfNeeded(seqID);
return 1;
}
return true; return true;
} }
@ -2226,11 +2265,15 @@ bool pre_figure_out(const char *line, int load_seq, bool bLoadSpriteOnly)
if (compare(ev[1],"SET_SPRITE_INFO")) if (compare(ev[1],"SET_SPRITE_INFO"))
{ {
// name seq speed offsetx offsety hardx hardy // name seq speed offsetx offsety hardx hardy
//if (k[seq[myseq].frame[myframe]].frame = 0) Msg("Changing sprite that doesn't exist..."); //if (k[seq[myseq].frame[myframe]].frame = 0) Msg("Changing sprite that doesn't exist...");
myseq = atol(ev[2]); myseq = atol(ev[2]);
myframe = atol(ev[3]); myframe = atol(ev[3]);
ScanSeqFilesIfNeeded(myseq);
g_dglos.g_picInfo[g_dglos.g_seq[myseq].frame[myframe]].xoffset = atol(ev[4]); g_dglos.g_picInfo[g_dglos.g_seq[myseq].frame[myframe]].xoffset = atol(ev[4]);
g_dglos.g_picInfo[g_dglos.g_seq[myseq].frame[myframe]].yoffset = atol(ev[5]); g_dglos.g_picInfo[g_dglos.g_seq[myseq].frame[myframe]].yoffset = atol(ev[5]);
g_dglos.g_picInfo[g_dglos.g_seq[myseq].frame[myframe]].hardbox.left = atol(ev[6]); g_dglos.g_picInfo[g_dglos.g_seq[myseq].frame[myframe]].hardbox.left = atol(ev[6]);
@ -2274,10 +2317,14 @@ bool pre_figure_out(const char *line, int load_seq, bool bLoadSpriteOnly)
// name seq speed offsetx offsety hardx hardy // name seq speed offsetx offsety hardx hardy
//if (k[seq[myseq].frame[myframe]].frame = 0) Msg("Changing sprite that doesn't exist..."); //if (k[seq[myseq].frame[myframe]].frame = 0) Msg("Changing sprite that doesn't exist...");
myseq = atol(ev[2]); myseq = atol(ev[2]);
myframe = atol(ev[3]); myframe = atol(ev[3]);
special = atol(ev[4]); special = atol(ev[4]);
ScanSeqFilesIfNeeded(myseq);
g_dglos.g_seq[myseq].delay[myframe] = special; g_dglos.g_seq[myseq].delay[myframe] = special;
//LogMsg("Set delay. %d %d %d",myseq, myframe, special); //LogMsg("Set delay. %d %d %d",myseq, myframe, special);
} }
@ -2303,6 +2350,10 @@ bool pre_figure_out(const char *line, int load_seq, bool bLoadSpriteOnly)
special2 = atol(ev[5]); special2 = atol(ev[5]);
ScanSeqFilesIfNeeded(myseq);
if (myseq != special && special > 0)
ScanSeqFilesIfNeeded(special);
#ifdef _DEBUG #ifdef _DEBUG
//LogMsg("Set frame. %d %d %d",myseq, myframe, special); //LogMsg("Set frame. %d %d %d",myseq, myframe, special);
@ -2549,9 +2600,9 @@ void draw_bar(int life, int seqman)
void draw_health() void draw_health()
{ {
g_dglos.g_guiLifeMax = *plifemax; //g_dglos.g_guiLifeMax = *plifemax;
draw_bar(g_dglos.g_guiLifeMax, 190); draw_bar(g_dglos.g_guiLifeMax, 190);
g_dglos.g_guiLife = *plife; //g_dglos.g_guiLife = *plife;
draw_bar(g_dglos.g_guiLife, 451); draw_bar(g_dglos.g_guiLife, 451);
} }
@ -2590,8 +2641,19 @@ void draw_icons()
seq = g_dglos.g_playerInfo.g_MagicData[*pcur_magic].seq; seq = g_dglos.g_playerInfo.g_MagicData[*pcur_magic].seq;
frame = g_dglos.g_playerInfo.g_MagicData[*pcur_magic].frame; frame = g_dglos.g_playerInfo.g_MagicData[*pcur_magic].frame;
#ifdef _DEBUG
if (seq == 437)
{
// LogMsg("Hey");
}
#endif
if (!check_seq_status(seq, frame)) return; if (!check_seq_status(seq, frame)) return;
if (!g_pSpriteSurface[g_dglos.g_seq[seq].frame[frame]])
{
LogMsg("Bad magic item frame of %d", frame);
return;
}
DrawFilledRect(153, 413, DrawFilledRect(153, 413,
g_pSpriteSurface[g_dglos.g_seq[seq].frame[frame]]->m_pSurf->GetWidth() g_pSpriteSurface[g_dglos.g_seq[seq].frame[frame]]->m_pSurf->GetWidth()
,g_pSpriteSurface[g_dglos.g_seq[seq].frame[frame]]->m_pSurf->GetHeight(), MAKE_RGBA(0,0,0,255)); ,g_pSpriteSurface[g_dglos.g_seq[seq].frame[frame]]->m_pSurf->GetHeight(), MAKE_RGBA(0,0,0,255));
@ -2692,6 +2754,7 @@ void draw_status_all(void)
g_forceBuildBackgroundFromScratch = true; g_forceBuildBackgroundFromScratch = true;
ClearBitmapCopy(); ClearBitmapCopy();
g_dglos.g_guiStrength = *pstrength; g_dglos.g_guiStrength = *pstrength;
g_dglos.g_guiMagic = *pmagic; g_dglos.g_guiMagic = *pmagic;
g_dglos.g_guiGold = *pgold; g_dglos.g_guiGold = *pgold;
@ -2749,6 +2812,9 @@ void BlitGUIOverlay()
return; return;
} }
/*
g_dglos.g_guiRaise = next_raise(); g_dglos.g_guiRaise = next_raise();
if ( *pexper < g_dglos.g_guiRaise ) if ( *pexper < g_dglos.g_guiRaise )
{ {
@ -2759,6 +2825,8 @@ void BlitGUIOverlay()
g_dglos.g_guiExp = g_dglos.g_guiRaise - 1; g_dglos.g_guiExp = g_dglos.g_guiRaise - 1;
} }
*/
/* /*
g_dglos.g_guiStrength = *pstrength; g_dglos.g_guiStrength = *pstrength;
g_dglos.g_guiMagic = *pmagic; g_dglos.g_guiMagic = *pmagic;
@ -2987,8 +3055,24 @@ bool get_box (int spriteID, rtRect32 * pDstRect, rtRect32 * pSrcRect )
// txoffset = g_dglos.g_picInfo[picID].xoffset; // txoffset = g_dglos.g_picInfo[picID].xoffset;
//tyoffset = g_dglos.g_picInfo[picID].yoffset; //tyoffset = g_dglos.g_picInfo[picID].yoffset;
//this is.. probably not a good solution. Some dmods want the original offset, others want to keep the offset of the frame they are replacing. If speed == 0, it's probably not a real anim and we'll
//be happy with the replacement pics offset. I think.
//this works for the dmod mayhem
if (g_dglos.g_seq[g_dglos.g_picInfo[originalSurfPic].m_parentSeq].m_speed == 0)
{
txoffset = g_dglos.g_picInfo[originalSurfPic].xoffset;
tyoffset = g_dglos.g_picInfo[originalSurfPic].yoffset;
}
else
{
//but this works with cast awakening 5, the sycth guy swings that have frame sets in them
txoffset = g_dglos.g_picInfo[picID].xoffset; txoffset = g_dglos.g_picInfo[picID].xoffset;
tyoffset = g_dglos.g_picInfo[picID].yoffset; tyoffset = g_dglos.g_picInfo[picID].yoffset;
}
} }
else else
@ -3259,6 +3343,7 @@ int load_script(const char *pScript, int sprite, bool set_sprite, bool bQuietErr
string fName = "story/"+ToLowerCaseString(pScript); string fName = "story/"+ToLowerCaseString(pScript);
StringReplace("\\", "/", fName);
int script; int script;
FILE *stream; FILE *stream;
bool comp = false; bool comp = false;
@ -4107,6 +4192,17 @@ bool check_pic_status(int picID)
return check_seq_status(g_dglos.g_picInfo[picID].m_parentSeq); return check_seq_status(g_dglos.g_picInfo[picID].m_parentSeq);
} }
void ScanSeqFilesIfNeeded(int seq)
{
if (!g_dglos.g_seq[seq].m_bDidFileScan)
{
//LogMsg("Need to scan it now");
load_sprites(g_dglos.g_seq[seq].m_fileName, seq, g_dglos.g_seq[seq].m_speed, g_dglos.g_seq[seq].m_xoffset, g_dglos.g_seq[seq].m_yoffset, g_dglos.g_seq[seq].m_hardbox,
g_dglos.g_seq[seq].m_transType, g_dglos.g_seq[seq].m_bLeftAlign, true);
}
}
bool check_seq_status(int seq, int frame) bool check_seq_status(int seq, int frame)
{ {
@ -4123,6 +4219,7 @@ LogMsg("Seq %d missing?", seq);
return true; return true;
} }
#ifdef _DEBUG #ifdef _DEBUG
if (seq == 180) if (seq == 180)
{ {
@ -4139,6 +4236,8 @@ LogMsg("Seq %d missing?", seq);
return true; //avoid crash return true; //avoid crash
} }
ScanSeqFilesIfNeeded(seq);
if (frame != 0) if (frame != 0)
{ {
if (g_pSpriteSurface[g_dglos.g_seq[seq].frame[frame]]) return true; if (g_pSpriteSurface[g_dglos.g_seq[seq].frame[frame]]) return true;
@ -5176,6 +5275,10 @@ void draw_sprite_game(LPDIRECTDRAWSURFACE lpdest,int h)
//check to see if we need a 32 bit buffer for this or not //check to see if we need a 32 bit buffer for this or not
if (lpdest->m_pSurf && lpdest->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_PALETTE_8BIT) if (lpdest->m_pSurf && lpdest->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_PALETTE_8BIT)
{ {
#ifdef _DEBUG
SoftSurface *pSoftTemp = g_pSpriteSurface[getpic(h)]->m_pSurf;
#endif
if (g_pSpriteSurface[getpic(h)]->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA) if (g_pSpriteSurface[getpic(h)]->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA)
{ {
//yep, convert what we've got to 32 bit. We don't lose what we've done so far. //yep, convert what we've got to 32 bit. We don't lose what we've done so far.
@ -5461,6 +5564,10 @@ void update_play_changes( void )
void update_status_all(void) void update_status_all(void)
{ {
#ifdef _DEBUG
//LogMsg("Updating status... %d", g_dglos.g_dinkTick);
#endif
bool drawexp = false; bool drawexp = false;
int next = next_raise(); int next = next_raise();
int script; int script;
@ -5761,7 +5868,7 @@ void place_sprites_game(bool bBackgroundOnly )
if (strlen(g_dglos.g_smallMap.sprite[j].script) > 1) if (strlen(g_dglos.g_smallMap.sprite[j].script) > 1)
{ {
#ifdef _DEBUG #ifdef _DEBUG
//LogMsg("Sprite %d is requesting that script %s is loaded when the map is drawn, vision is %d", j, g_dglos.g_smallMap.sprite[j].script, *pvision); LogMsg("Sprite %d is requesting that script %s is loaded when the map is drawn, vision is %d", j, g_dglos.g_smallMap.sprite[j].script, *pvision);
#endif #endif
g_sprite[sprite].script = load_script(g_dglos.g_smallMap.sprite[j].script, sprite, true); g_sprite[sprite].script = load_script(g_dglos.g_smallMap.sprite[j].script, sprite, true);
} }
@ -6116,6 +6223,8 @@ void update_sound(void)
int playbank( int sound, int min,int plus, int sound3d, bool repeat, int forceBank = 0 ) int playbank( int sound, int min,int plus, int sound3d, bool repeat, int forceBank = 0 )
{ {
if (g_soundInfo[sound].m_fileName.empty()) return 0;
if (GetEmulatedPlatformID() == PLATFORM_ID_ANDROID) if (GetEmulatedPlatformID() == PLATFORM_ID_ANDROID)
{ {
if (repeat) if (repeat)
@ -8035,7 +8144,7 @@ pass:
fill_screen(g_nlist[0]); fill_screen(g_nlist[0]);
SetBitmapCopy(""); //no bitmap, but it will trigger the no status bar rendering until "something happens" SetBitmapCopy(""); //no bitmap, but it will trigger the no status bar rendering until "something happens"
//g_dglos.m_bRenderBackgroundOnLoad = true; g_dglos.m_bRenderBackgroundOnLoad = false;
} }
@ -8149,7 +8258,7 @@ pass:
if (sound_on) if (sound_on)
{ {
#ifdef _DEBUG #ifdef _DEBUG
LogMsg("getting %s..",slist[0]); LogMsg("getting %s",slist[0]);
#endif #endif
CreateBufferFromWaveFile(slist[0],g_nlist[1]); CreateBufferFromWaveFile(slist[0],g_nlist[1]);
} }
@ -12717,15 +12826,33 @@ void StartScreenScrollTransition(int direction)
CheckTransitionSurface(); CheckTransitionSurface();
//remember this for later //remember this for later
if (GetApp()->GetVar("disable_glread")->GetUINT32() == 1)
{
//no_transition = true;
return;
}
//remove the aspect ratio hack //remove the aspect ratio hack
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glPopMatrix(); glPopMatrix();
//g_transitionSurf.InitBlankSurface(GetPrimaryGLX(), GetPrimaryGLY());
UpdateFrameWithoutTransitionAndThinking(); UpdateFrameWithoutTransitionAndThinking();
if (GetApp()->GetVar("disable_glread")->GetUINT32() == 1)
{
g_transitionSurf.FillColor(glColorBytes(0, 0, 0, 255));
}
else
{
g_transitionSurf.CopyFromScreen(); g_transitionSurf.CopyFromScreen();
}
ApplyAspectRatioGLMatrix(); ApplyAspectRatioGLMatrix();
if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED) if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED)
{ {
//clear background if needed //clear background if needed
@ -12735,8 +12862,6 @@ void StartScreenScrollTransition(int direction)
//redraw it the correct way, otherwise we can see a flash //redraw it the correct way, otherwise we can see a flash
UpdateFrameWithoutTransitionAndThinking(); UpdateFrameWithoutTransitionAndThinking();
g_bInitiateScreenMove = true; g_bInitiateScreenMove = true;
g_bTransitionActive = true; g_bTransitionActive = true;
g_dglo.m_transitionTimer = 0; g_dglo.m_transitionTimer = 0;
@ -12783,6 +12908,8 @@ void ProcessTransition(void)
float inverseProg = 1.0f - g_dglo.m_transitionProgress; float inverseProg = 1.0f - g_dglo.m_transitionProgress;
if (g_dglo.m_transitionProgress >= 1) if (g_dglo.m_transitionProgress >= 1)
{ {
g_bTransitionActive = false; g_bTransitionActive = false;
@ -12799,6 +12926,7 @@ void ProcessTransition(void)
//LogMsg("Trans: %.2f", g_dglo.m_transitionProgress); //LogMsg("Trans: %.2f", g_dglo.m_transitionProgress);
//glScalef(G_TRANSITION_SCALE_TRICK,G_TRANSITION_SCALE_TRICK,1); //glScalef(G_TRANSITION_SCALE_TRICK,G_TRANSITION_SCALE_TRICK,1);
} }
void EndProcessTransition() void EndProcessTransition()
@ -16906,6 +17034,8 @@ void DinkGlobals::SetView( eView view )
{ {
case VIEW_ZOOMED: case VIEW_ZOOMED:
g_dglo.m_aspectRatioModX = g_dglo.m_aspectRatioModY = 1.0f;
g_dglo.m_centeringOffset = CL_Vec2f(0, 0);
g_dglo.m_nativeGameArea = rtRectf(0,0,GetScreenSizeX(),GetScreenSizeY()); g_dglo.m_nativeGameArea = rtRectf(0,0,GetScreenSizeX(),GetScreenSizeY());
g_dglo.m_gameArea = rtRect32 (20, 0, 620, 400); g_dglo.m_gameArea = rtRect32 (20, 0, 620, 400);
g_dglo.m_orthoRenderRect = rtRect32 (20, 0, 620, 400); g_dglo.m_orthoRenderRect = rtRect32 (20, 0, 620, 400);
@ -16926,7 +17056,7 @@ void DinkGlobals::SetView( eView view )
g_dglo.m_nativeGameArea = rtRectf(float(g_dglo.m_gameArea.left)/ aspect,0,float(g_dglo.m_gameArea.right)/aspect,float(g_dglo.m_gameArea.bottom)/aspectY); g_dglo.m_nativeGameArea = rtRectf(float(g_dglo.m_gameArea.left)/ aspect,0,float(g_dglo.m_gameArea.right)/aspect,float(g_dglo.m_gameArea.bottom)/aspectY);
g_dglo.m_orthoRenderRect = rtRect32 (0, 0, 640, 480); g_dglo.m_orthoRenderRect = rtRect32 (0, 0, 640, 480);
RecomputeAspectRatio();
#ifdef _DEBUG #ifdef _DEBUG
LogMsg("Rect %s AspectX: %.4f, Aspect Y: %.4f", PrintRect(g_dglo.m_nativeGameArea).c_str(), aspect, aspectY); LogMsg("Rect %s AspectX: %.4f, Aspect Y: %.4f", PrintRect(g_dglo.m_nativeGameArea).c_str(), aspect, aspectY);
@ -17620,7 +17750,7 @@ float DinkGetHealthPercent()
{ {
if (*plifemax > 0) if (*plifemax > 0)
{ {
return float(*plife)/ float(*plifemax); return float(g_dglos.g_guiLife)/ float(g_dglos.g_guiLifeMax);
} }
return 0; return 0;
} }
@ -17734,9 +17864,6 @@ void ApplyAspectRatioGLMatrix()
glTranslatef(g_dglo.m_centeringOffset.x, g_dglo.m_centeringOffset.y, 0); glTranslatef(g_dglo.m_centeringOffset.x, g_dglo.m_centeringOffset.y, 0);
//glGetFloatv(GL_PROJECTION_MATRIX, &Matrix); //glGetFloatv(GL_PROJECTION_MATRIX, &Matrix);
} }
void RecomputeAspectRatio() void RecomputeAspectRatio()

View file

@ -178,7 +178,7 @@ const int32 C_MAX_SPRITES_AT_ONCE = 300; //don't change, there are still hardcod
const int32 C_MAX_SCRIPT_CALLBACKS = 100; const int32 C_MAX_SCRIPT_CALLBACKS = 100;
const int32 max_vars = 250; const int32 max_vars = 250;
#define C_MAX_SPRITE_FRAMES 51 #define C_MAX_SPRITE_FRAMES 100
#define C_SPRITE_MAX_FILENAME_SIZE 64 #define C_SPRITE_MAX_FILENAME_SIZE 64
const int32 C_MAX_SCRIPTS = 200; const int32 C_MAX_SCRIPTS = 200;
@ -206,6 +206,8 @@ struct sequence
byte m_spaceAllowed; byte m_spaceAllowed;
byte m_bFrameSetUsed; byte m_bFrameSetUsed;
byte m_bIsAnim; byte m_bIsAnim;
byte m_bDidFileScan;
}; };
const int32 C_DINK_VERSION = 110; const int32 C_DINK_VERSION = 110;

View file

@ -293,6 +293,8 @@ void IDirectDrawSurface::UpdateShadowSurface()
if (m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_PALETTE_8BIT) if (m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_PALETTE_8BIT)
{ {
SoftSurface s; SoftSurface s;
s.Init(m_pSurf->GetWidth(), m_pSurf->GetHeight(), SoftSurface::SURFACE_RGBA); s.Init(m_pSurf->GetWidth(), m_pSurf->GetHeight(), SoftSurface::SURFACE_RGBA);
s.FillColor(glColorBytes(0,0,0,0)); s.FillColor(glColorBytes(0,0,0,0));
@ -318,6 +320,7 @@ void IDirectDrawSurface::UpdateShadowSurface()
} }
else else
{ {
assert(m_pSurf); assert(m_pSurf);
assert(m_pGLSurf); assert(m_pGLSurf);
assert(m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA); assert(m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA);

View file

@ -7,7 +7,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GL|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GL|Win32'">
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory> <LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>-game dmods/tdabeta</LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>-game dmods/status</LocalDebuggerCommandArguments>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Common Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Common Debug|Win32'">
<LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>