Merge pull request #30 from GabrielRavier/improveAToE

Improve files starting with A to E
This commit is contained in:
Clownacy 2019-05-12 19:56:01 +00:00 committed by GitHub
commit 106f81130c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 18 deletions

View file

@ -36,8 +36,7 @@ BOOL InitBack(const char *fName, int type)
#ifdef NONPORTABLE #ifdef NONPORTABLE
// This is ridiculously platform-dependant: // This is ridiculously platform-dependant:
// It should break on big-endian CPUs, and platforms // It should break on big-endian CPUs, and platforms where short isn't 16-bit and long isn't 32-bit.
// where short isn't 16-bit and long isn't 32-bit.
unsigned short bmp_header_buffer[7]; // These names aren't the original. This ruins the stack frame layout. unsigned short bmp_header_buffer[7]; // These names aren't the original. This ruins the stack frame layout.
unsigned long bmp_header_buffer2[10]; unsigned long bmp_header_buffer2[10];

View file

@ -523,7 +523,7 @@ void ActBossChar_MonstX(void)
gBoss[2].direct = 2; gBoss[2].direct = 2;
gBoss[3].cond = 0x80; gBoss[3].cond = 0x80;
gBoss[3].life = 60; gBoss[3].life = 60;
gBoss[3].size = 3; // Redundant: this get overwriten a few lines later gBoss[3].size = 3; // Redundant: this get overwritten a few lines later
gBoss[3].hit_voice = 54; gBoss[3].hit_voice = 54;
gBoss[3].destroy_voice = 71; gBoss[3].destroy_voice = 71;
gBoss[3].size = 2; gBoss[3].size = 2;

View file

@ -16,44 +16,44 @@ static const char* const config_magic = "DOUKUTSU20041206"; // Not the original
BOOL LoadConfigData(CONFIG *conf) BOOL LoadConfigData(CONFIG *conf)
{ {
//Clear old config data // Clear old configuration data
memset(conf, 0, sizeof(CONFIG)); memset(conf, 0, sizeof(CONFIG));
//Get path // Get path
char path[PATH_LENGTH]; char path[PATH_LENGTH];
sprintf(path, "%s/%s", gModulePath, config_filename); sprintf(path, "%s/%s", gModulePath, config_filename);
//Open file // Open file
FILE *fp = fopen(path, "rb"); FILE *fp = fopen(path, "rb");
if (fp == NULL) if (fp == NULL)
return FALSE; return FALSE;
//Read data // Read data
#ifdef NONPORTABLE #ifdef NONPORTABLE
size_t fread_result = fread(conf, sizeof(CONFIG), 1, fp); // Not the original name size_t fread_result = fread(conf, sizeof(CONFIG), 1, fp); // Not the original name
#else #else
//Read the version id and font name // Read the version id and font name
fread(conf->proof, sizeof(conf->proof), 1, fp); fread(conf->proof, sizeof(conf->proof), 1, fp);
fread(conf->font_name, sizeof(conf->font_name), 1, fp); fread(conf->font_name, sizeof(conf->font_name), 1, fp);
//Read control settings // Read control settings
conf->move_button_mode = File_ReadLE32(fp); conf->move_button_mode = File_ReadLE32(fp);
conf->attack_button_mode = File_ReadLE32(fp); conf->attack_button_mode = File_ReadLE32(fp);
conf->ok_button_mode = File_ReadLE32(fp); conf->ok_button_mode = File_ReadLE32(fp);
//Read display mode (320x240, 640x480, 24-bit fullscreen, 32-bit fullscreen) TODO: add more things? // Read display mode (320x240, 640x480, 24-bit fullscreen, 32-bit fullscreen) TODO: add more things?
conf->display_mode = File_ReadLE32(fp); conf->display_mode = File_ReadLE32(fp);
//Read joystick configuration (if enabled, and mappings) // Read joystick configuration (if enabled, and mappings)
conf->bJoystick = File_ReadLE32(fp); conf->bJoystick = File_ReadLE32(fp);
for (int button = 0; button < 8; button++) for (int button = 0; button < 8; button++)
conf->joystick_button[button] = File_ReadLE32(fp); conf->joystick_button[button] = File_ReadLE32(fp);
#endif #endif
//Close file // Close file
fclose(fp); fclose(fp);
//Check if version is not correct, and return if it failed // Check if version is not correct, and return if it failed
#ifdef NONPORTABLE #ifdef NONPORTABLE
if (fread_result != 1 || strcmp(conf->proof, config_magic)) if (fread_result != 1 || strcmp(conf->proof, config_magic))
#else #else
@ -69,13 +69,13 @@ BOOL LoadConfigData(CONFIG *conf)
void DefaultConfigData(CONFIG *conf) void DefaultConfigData(CONFIG *conf)
{ {
//Clear old config data // Clear old configuration data
memset(conf, 0, sizeof(CONFIG)); memset(conf, 0, sizeof(CONFIG));
//Fun fact: The Linux port added this line: // Fun fact: The Linux port added this line:
//conf->display_mode = 1; // conf->display_mode = 1;
//Reset joystick settings (as these can't simply be set to 0) // Reset joystick settings (as these can't simply be set to 0)
conf->bJoystick = 1; conf->bJoystick = 1;
conf->joystick_button[0] = 2; conf->joystick_button[0] = 2;
conf->joystick_button[1] = 1; conf->joystick_button[1] = 1;

View file

@ -443,7 +443,7 @@ static void DrawBitmap(RECT *rcView, int x, int y, RECT *rect, Surface_Ids surf_
SDL_Rect clipRect = RectToSDLRectScaled(rcView); SDL_Rect clipRect = RectToSDLRectScaled(rcView);
SDL_Rect frameRect = RectToSDLRectScaled(rect); SDL_Rect frameRect = RectToSDLRectScaled(rect);
// Get dest rect // Get destination rect
SDL_Rect destRect = {x * magnification, y * magnification, frameRect.w, frameRect.h}; SDL_Rect destRect = {x * magnification, y * magnification, frameRect.w, frameRect.h};
// Set cliprect // Set cliprect