ref: 1d0129e6818fbd6e84b858f58d827f762dbf3000
parent: 71015da19b825a3ab3b5db431f737b3fd2e97565
author: Gabriel Ravier <gabravier@gmail.com>
date: Wed May 8 05:28:44 EDT 2019
Corrected formatting in Map.cpp Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
--- a/src/Map.cpp
+++ b/src/Map.cpp
@@ -29,16 +29,16 @@
{
unsigned char dum;
- //Get path
+ // Get path
char path[PATH_LENGTH];
sprintf(path, "%s/%s", gDataPath, path_map);
- //Open file
+ // Open file
FILE *fp = fopen(path, "rb");
if (fp == NULL)
return FALSE;
- //Make sure file begins with "PXM"
+ // Make sure file begins with "PXM"
char check[3];
fread(check, 1, 3, fp);
@@ -50,10 +50,9 @@
else
{
fread(&dum, 1, 1, fp);
- //Get width and height
+ // Get width and height
#ifdef NONPORTABLE
- // This fails on big-endian hardware, and platforms
- // where short is not two bytes long.
+ // This fails on big-endian hardware, and platforms where short is not two bytes long.
fread(&gMap.width, 2, 1, fp);
fread(&gMap.length, 2, 1, fp);
#else
@@ -68,7 +67,7 @@
}
else
{
- //Read tiledata
+ // Read tiledata
fread(gMap.data, 1, gMap.length * gMap.width, fp);
fclose(fp);
return TRUE;
@@ -80,7 +79,7 @@
BOOL LoadAttributeData(const char *path_atrb)
{
- //Open file
+ // Open file
char path[PATH_LENGTH];
sprintf(path, "%s/%s", gDataPath, path_atrb);
@@ -88,7 +87,7 @@
if (fp == NULL)
return FALSE;
- //Read data
+ // Read data
fread(gMap.atrb, 1, 0x100, fp);
fclose(fp);
return TRUE;
@@ -158,7 +157,7 @@
RECT rect;
int num_x;
- //Get range to draw
+ // Get range to draw
num_x = ((WINDOW_WIDTH + 0xF) / 0x10) + 1;
num_y = ((WINDOW_HEIGHT + 0xF) / 0x10) + 1;
put_x = (fx / 0x200 + 8) / 0x10;
@@ -168,7 +167,7 @@
{
for (i = put_x; i < put_x + num_x; i++)
{
- //Get attribute
+ // Get attribute
offset = i + j * gMap.width;
atrb = GetAttribute(i, j);
@@ -175,7 +174,7 @@
if (atrb >= 0x20)
continue;
- //Draw tile
+ // Draw tile
rect.left = 16 * (gMap.data[offset] % 0x10);
rect.top = 16 * (gMap.data[offset] / 0x10);
rect.right = rect.left + 16;
@@ -199,7 +198,7 @@
RECT rect;
int num_x;
- //Get range to draw
+ // Get range to draw
num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1;
num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1;
put_x = (fx / 0x200 + 8) / 16;
@@ -209,7 +208,7 @@
{
for (i = put_x; i < put_x + num_x; i++)
{
- //Get attribute
+ // Get attribute
offset = i + j * gMap.width;
atrb = GetAttribute(i, j);
@@ -216,7 +215,7 @@
if (atrb < 0x40 || atrb >= 0x80)
continue;
- //Draw tile
+ // Draw tile
rect.left = 16 * (gMap.data[offset] % 0x10);
rect.top = 16 * (gMap.data[offset] / 0x10);
rect.right = rect.left + 16;
@@ -242,11 +241,11 @@
RECT rect;
int num_x;
- //Animate the wind
+ // Animate the wind
static unsigned char count = 0;
count += 2;
- //Get range to draw
+ // Get range to draw
num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1;
num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1;
put_x = (fx / 0x200 + 8) / 16;
@@ -256,7 +255,7 @@
{
for (i = put_x; i < put_x + num_x; i++)
{
- //Get attribute
+ // Get attribute
offset = i + j * gMap.width;
atrb = GetAttribute(i, j);