New icon. Bad redimension, mustfix
This commit is contained in:
19
main.cpp
19
main.cpp
@@ -166,7 +166,10 @@ void Init() {
|
||||
fread(old_map, old_map_width*old_map_height, 1, f);
|
||||
for (int y = 0; y < map_height; y++) {
|
||||
for (int x = 0; x < map_width; x++) {
|
||||
map[x + y*map_width] = old_map[x + y*old_map_width];
|
||||
map[x + y*map_width] = 0;
|
||||
if (old_map_width > x && old_map_height > y && (x + y*map_width) < (old_map_width*old_map_height)) {
|
||||
map[x + y*map_width] = old_map[x + y*(map_width)];
|
||||
}
|
||||
}
|
||||
}
|
||||
dialog = 2;
|
||||
@@ -403,10 +406,12 @@ void ShiftMap(int sx, int sy) {
|
||||
unsigned char* new_map = (unsigned char*)malloc(map_width*map_height);
|
||||
for (int y = 0; y < map_height; y++) {
|
||||
for (int x = 0; x < map_width; x++) {
|
||||
new_map[x + y*map_width] = map[x + y*map_width];
|
||||
new_map[x + y*map_width] = map[mod(x+sx, map_width) + mod(y+sy, map_height)*map_width];
|
||||
}
|
||||
}
|
||||
|
||||
free(map);
|
||||
map = new_map;
|
||||
UpdateMiniMap();
|
||||
}
|
||||
|
||||
void DoMiniMap() {
|
||||
@@ -441,10 +446,10 @@ void DoMiniMap() {
|
||||
}
|
||||
if (keyJustPressed == SDL_SCANCODE_E) state = STATE_TILEMAP;
|
||||
if (keyboard[SDL_SCANCODE_LCTRL]) {
|
||||
if (keyJustPressed == SDL_SCANCODE_A) ShiftMap(-1, 0);
|
||||
if (keyJustPressed == SDL_SCANCODE_D) ShiftMap(1, 0);
|
||||
if (keyJustPressed == SDL_SCANCODE_W) ShiftMap(0, -1);
|
||||
if (keyJustPressed == SDL_SCANCODE_S) ShiftMap(0, 1);
|
||||
if (keyJustPressed == SDL_SCANCODE_A) ShiftMap(1, 0);
|
||||
if (keyJustPressed == SDL_SCANCODE_D) ShiftMap(-1, 0);
|
||||
if (keyJustPressed == SDL_SCANCODE_W) ShiftMap(0, 1);
|
||||
if (keyJustPressed == SDL_SCANCODE_S) ShiftMap(0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,8 +87,15 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="font.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="stb_image.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="res.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\..\Users\Raimon\Dropbox\jailgames2016\Rise of the Bal1\utils\mappy\mappy.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -29,5 +29,18 @@
|
||||
<ClInclude Include="stb_image.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="res.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\..\Users\Raimon\Dropbox\jailgames2016\Rise of the Bal1\utils\mappy\mappy.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
BIN
resource.h
Normal file
BIN
resource.h
Normal file
Binary file not shown.
Reference in New Issue
Block a user