Skip to content

Commit

Permalink
Clean up some warnings and get the Windows build working
Browse files Browse the repository at this point in the history
See title
  • Loading branch information
barbalet committed Jul 18, 2015
1 parent 3b1a7ec commit 18dccee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
8 changes: 4 additions & 4 deletions sim/entity/being.c 100644 → 100755
Expand Up @@ -223,7 +223,7 @@ void being_honor_delta(noble_being * value, n_int delta)
return;
}
}
value->delta.honor += delta;
value->delta.honor += (n_byte)delta;
}

n_byte being_honor(noble_being * value)
Expand Down Expand Up @@ -370,7 +370,7 @@ void being_remove_parasites(noble_being * value, n_int number_of_parasites)
{
if (value->delta.parasites > number_of_parasites)
{
value->delta.parasites -= number_of_parasites;
value->delta.parasites -= (n_byte)number_of_parasites;
}
else
{
Expand Down Expand Up @@ -466,7 +466,7 @@ void being_energy_delta(noble_being * value, n_int delta)
value->delta.stored_energy = (n_byte2) total;
}

n_int being_drive(noble_being * value, enum drives_definition drive)
n_byte being_drive(noble_being * value, enum drives_definition drive)
{
return value->wrong.drives[drive];
}
Expand Down Expand Up @@ -1286,7 +1286,7 @@ static noble_being * being_find_closest(noble_simulation * sim, noble_being * ac
typedef struct
{
n_uint comparison_best;
n_int max_age;
n_uint max_age;
n_genetics * genetics;
noble_being * return_value;
} being_find_child_struct;
Expand Down
2 changes: 1 addition & 1 deletion sim/entity/entity.h 100644 → 100755
Expand Up @@ -224,7 +224,7 @@ void being_add_parasites(noble_being * value);

void being_remove_parasites(noble_being * value, n_int number_of_parasites);

n_int being_drive(noble_being * value, enum drives_definition drive);
n_byte being_drive(noble_being * value, enum drives_definition drive);

n_int being_height(noble_being * value);

Expand Down
6 changes: 5 additions & 1 deletion sim/gui/shared.c
Expand Up @@ -581,6 +581,10 @@ n_byte * shared_legacy_pointer(n_byte fIdentification)

void shared_draw(n_byte * outputBuffer, n_byte fIdentification, n_int dim_x, n_int dim_y)
{
#ifdef _WIN32
n_byte * index = draw_pointer(fIdentification);
io_copy(index, outputBuffer, dim_x * dim_y);
#else
n_int ly = 0;
n_int loop = 0;
n_int loopColors = 0;
Expand Down Expand Up @@ -674,7 +678,7 @@ void shared_draw(n_byte * outputBuffer, n_byte fIdentification, n_int dim_x, n_i
}
ly++;
}

#endif
}


Expand Down
15 changes: 8 additions & 7 deletions sim/win/platform.c
Expand Up @@ -240,7 +240,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,

offscreen[loop] = CreateDIBitmap(hdc[loop], (const struct tagBITMAPINFOHEADER *)bmp_info[loop], 0, NULL, NULL, DIB_RGB_COLORS);

SetBitmapDimensionEx(offscreen[loop], 512, 512-loop, NULL);
SetBitmapDimensionEx(offscreen[loop], 512, 512 /*-loop*/, NULL);

ShowWindow (global_hwnd[loop], iCmdShow) ;
UpdateWindow (global_hwnd[loop]) ;
Expand Down Expand Up @@ -274,7 +274,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM

case WM_PAINT:
{
n_uint local_time = time(0L);
n_uint local_time = (n_uint)time(0L);
shared_cycle(local_time, NUM_VIEW, 512, 512);
shared_cycle(local_time, NUM_TERRAIN, 512, 512);

Expand All @@ -297,6 +297,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_MOUSEMOVE:
if (firedown != -1)
{
shared_mouseOption(firecontrol);
shared_mouseReceived(LOWORD(lParam), HIWORD(lParam), (n_byte)firedown);
}
return 0;
Expand Down Expand Up @@ -465,7 +466,7 @@ static void plat_update()

shared_draw(value, window_definition[lp], 512, 512);

SetDIBits(hdcMem, offscreen[lp], 0, 512-lp, value, bmp_info[lp], DIB_RGB_COLORS);
SetDIBits(hdcMem, offscreen[lp], 0, 512/*-lp*/, value, bmp_info[lp], DIB_RGB_COLORS);

SelectObject(hdcMem, offscreen[lp]);
BitBlt(hdc[lp], 0, 0, sz.cx, sz.cy, hdcMem, 0, 0, SRCCOPY);
Expand Down Expand Up @@ -500,9 +501,9 @@ static void plat_file_open(n_byte script)
opf.hwndOwner = global_hwnd[WINDOW_ONE];
opf.lpstrFilter = TEXT(NOBLE_APE_FILE_OPEN);
opf.nFilterIndex = 1;
opf.lpstrFile = (LPCWSTR)(current_file_name);
opf.lpstrFile = (LPWSTR)(current_file_name);
opf.nMaxFile = sizeof(current_file_name);
opf.lpstrFileTitle = (LPCWSTR)actual_file_name;
opf.lpstrFileTitle = (LPWSTR)actual_file_name;
opf.nMaxFileTitle = sizeof(actual_file_name);
opf.lpstrInitialDir = NULL;
opf.lpstrTitle = TEXT("Noble Ape File Open...");
Expand Down Expand Up @@ -573,10 +574,10 @@ static unsigned char plat_file_save_as(void)
opf.hwndOwner = global_hwnd[WINDOW_ONE];
opf.lpstrFilter = TEXT(NOBLE_APE_FILE_SAVE);
opf.nFilterIndex = 1;
opf.lpstrFile = (LPCWSTR)current_file_name;
opf.lpstrFile = (LPWSTR)current_file_name;
opf.nMaxFile = sizeof(current_file_name);

opf.lpstrFileTitle = (LPCWSTR)actual_file_name;
opf.lpstrFileTitle = (LPWSTR)actual_file_name;
opf.nMaxFileTitle = sizeof(actual_file_name);

opf.lpstrInitialDir = NULL;
Expand Down

0 comments on commit 18dccee

Please sign in to comment.