hedgewars/uLandTexture.pas
author koda
Sat, 03 Jul 2010 01:31:18 +0200
changeset 3612 b50215a8a43d
parent 3595 341e407e3754
child 3615 b78d7959540a
permissions -rw-r--r--
land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     1
(*
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     3
 * Copyright (c) 2009 Andrey Korotaev <unC0Rr@gmail.com>
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     4
 *
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     8
 *
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    12
 * GNU General Public License for more details.
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    13
 *
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    17
 *)
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    18
2599
c7153d2348f3 move compiler directives to standard pascal
koda
parents: 2592
diff changeset
    19
{$INCLUDE "options.inc"}
2587
0dfa56a8513c fix a segfault in the iphone simulator by moving options.inc at the beginning of the file
koda
parents: 2376
diff changeset
    20
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    21
unit uLandTexture;
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    22
interface
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    23
uses SDLh;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    24
3612
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
    25
procedure initModule;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
    26
procedure freeModule;
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    27
procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    28
procedure DrawLand(dX, dY: LongInt);
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    29
procedure FreeLand;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    30
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    31
implementation
3165
3ec07a7d8456 just some very sane stuff for the iphone port (plus some macro on pascal files)
koda
parents: 3045
diff changeset
    32
uses uMisc, uLand, uStore, uConsts, GLunit;
2699
249adefa9c1c replace initialization/finalization statements with custom init functions
koda
parents: 2599
diff changeset
    33
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    34
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    35
const TEXSIZE = 256;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    36
3612
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
    37
type TLandRecord = record
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    38
            shouldUpdate: boolean;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    39
            tex: PTexture;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    40
            end;
3612
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
    41
var LandTextures: array of array of TLandRecord;
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    42
    tmpPixels: array [0..TEXSIZE - 1, 0..TEXSIZE - 1] of LongWord;
3612
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
    43
LANDTEXARW: LongWord;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
    44
    LANDTEXARH: LongWord;
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    45
function Pixels(x, y: Longword): Pointer;
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    46
var ty: Longword;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    47
begin
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    48
for ty:= 0 to TEXSIZE - 1 do
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    49
    Move(LandPixels[y * TEXSIZE + ty, x * TEXSIZE], tmpPixels[ty, 0], sizeof(Longword) * TEXSIZE);
2376
ece7b87f1334 Strip trailing spaces
nemo
parents: 2248
diff changeset
    50
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    51
Pixels:= @tmpPixels
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    52
end;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    53
1859
e071284b118e Pixels2 proc, which uses Land array when updating textures
unc0rr
parents: 1852
diff changeset
    54
function Pixels2(x, y: Longword): Pointer;
e071284b118e Pixels2 proc, which uses Land array when updating textures
unc0rr
parents: 1852
diff changeset
    55
var tx, ty: Longword;
e071284b118e Pixels2 proc, which uses Land array when updating textures
unc0rr
parents: 1852
diff changeset
    56
begin
e071284b118e Pixels2 proc, which uses Land array when updating textures
unc0rr
parents: 1852
diff changeset
    57
for ty:= 0 to TEXSIZE - 1 do
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    58
    for tx:= 0 to TEXSIZE - 1 do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    59
        tmpPixels[ty, tx]:= Land[y * TEXSIZE + ty, x * TEXSIZE + tx] or AMask;
2376
ece7b87f1334 Strip trailing spaces
nemo
parents: 2248
diff changeset
    60
1859
e071284b118e Pixels2 proc, which uses Land array when updating textures
unc0rr
parents: 1852
diff changeset
    61
Pixels2:= @tmpPixels
e071284b118e Pixels2 proc, which uses Land array when updating textures
unc0rr
parents: 1852
diff changeset
    62
end;
e071284b118e Pixels2 proc, which uses Land array when updating textures
unc0rr
parents: 1852
diff changeset
    63
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    64
procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    65
var tx, ty: Longword;
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    66
begin
3595
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    67
    if (Width <= 0) or (Height <= 0) then exit;
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    68
    TryDo((X >= 0) and (X < LAND_WIDTH), 'UpdateLandTexture: wrong X parameter', true);
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    69
    TryDo(X + Width <= LAND_WIDTH, 'UpdateLandTexture: wrong Width parameter', true);
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    70
    TryDo((Y >= 0) and (Y < LAND_HEIGHT), 'UpdateLandTexture: wrong Y parameter', true);
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    71
    TryDo(Y + Height <= LAND_HEIGHT, 'UpdateLandTexture: wrong Height parameter', true);
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    72
3595
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    73
    if (cReducedQuality and rqBlurryLand) = 0 then
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    74
        for ty:= Y div TEXSIZE to (Y + Height - 1) div TEXSIZE do
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    75
            for tx:= X div TEXSIZE to (X + Width - 1) div TEXSIZE do
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    76
                LandTextures[tx, ty].shouldUpdate:= true
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    77
    else
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    78
        for ty:= (Y div TEXSIZE) div 2 to ((Y + Height - 1) div TEXSIZE) div 2 do
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    79
            for tx:= (X div TEXSIZE) div 2 to ((X + Width - 1) div TEXSIZE) div 2 do
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
    80
                LandTextures[tx, ty].shouldUpdate:= true;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    81
end;
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    82
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    83
procedure RealLandTexUpdate;
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    84
var x, y: LongWord;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    85
begin
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
    86
if LandTextures[0, 0].tex = nil then
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    87
    for x:= 0 to LANDTEXARW -1 do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    88
        for y:= 0 to LANDTEXARH - 1 do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    89
            with LandTextures[x, y] do
3491
4619b1ae99b5 Engine:
smxx
parents: 3165
diff changeset
    90
                begin
4619b1ae99b5 Engine:
smxx
parents: 3165
diff changeset
    91
                    tex:= NewTexture(TEXSIZE, TEXSIZE, Pixels(x, y));
4619b1ae99b5 Engine:
smxx
parents: 3165
diff changeset
    92
                    glBindTexture(GL_TEXTURE_2D, tex^.id);
4619b1ae99b5 Engine:
smxx
parents: 3165
diff changeset
    93
                    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, tpHigh);
4619b1ae99b5 Engine:
smxx
parents: 3165
diff changeset
    94
                end
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
    95
else
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    96
    for x:= 0 to LANDTEXARW -1 do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    97
        for y:= 0 to LANDTEXARH - 1 do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    98
            with LandTextures[x, y] do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
    99
                if shouldUpdate then
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   100
                    begin
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   101
                    shouldUpdate:= false;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   102
                    glBindTexture(GL_TEXTURE_2D, tex^.id);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   103
                    glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TEXSIZE, TEXSIZE, GL_RGBA, GL_UNSIGNED_BYTE, Pixels(x, y));
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   104
                    end
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
   105
end;
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
   106
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   107
procedure DrawLand(dX, dY: LongInt);
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   108
var x, y: LongInt;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
   109
begin
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
   110
RealLandTexUpdate;
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   111
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   112
for x:= 0 to LANDTEXARW -1 do
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   113
    for y:= 0 to LANDTEXARH - 1 do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   114
        with LandTextures[x, y] do
3595
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
   115
            if (cReducedQuality and rqBlurryLand) = 0 then
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
   116
                DrawTexture(dX + x * TEXSIZE, dY + y * TEXSIZE, tex)
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
   117
            else
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
   118
                DrawTexture(dX + x * TEXSIZE * 2, dY + y * TEXSIZE * 2, tex, 2.0)
341e407e3754 partially removing DOWNSCALE ifdef -- only two remain and their removal requires dynamic allocation (btw this breaks low quality mode)
koda
parents: 3513
diff changeset
   119
1807
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   120
end;
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   121
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   122
procedure FreeLand;
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   123
var x, y: LongInt;
795f97007833 Split land texture into small ones:
unc0rr
parents: 1806
diff changeset
   124
begin
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   125
    for x:= 0 to LANDTEXARW -1 do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   126
        for y:= 0 to LANDTEXARH - 1 do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   127
            with LandTextures[x, y] do
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   128
            begin
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   129
                FreeTexture(tex);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   130
                tex:= nil;
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2716
diff changeset
   131
            end;
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3509
diff changeset
   132
    if LandBackSurface <> nil then
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3509
diff changeset
   133
        SDL_FreeSurface(LandBackSurface);
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3509
diff changeset
   134
    LandBackSurface:= nil;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
   135
end;
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
   136
3612
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   137
procedure initModule;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   138
begin
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   139
    if (cReducedQuality and rqBlurryLand) = 0 then
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   140
    begin
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   141
        LANDTEXARW:= LAND_WIDTH div TEXSIZE;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   142
        LANDTEXARH:= LAND_HEIGHT div TEXSIZE;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   143
    end
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   144
    else
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   145
    begin
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   146
        LANDTEXARW:= (LAND_WIDTH div TEXSIZE) div 2;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   147
        LANDTEXARH:= (LAND_HEIGHT div TEXSIZE) div 2;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   148
    end;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   149
    
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   150
    SetLength(LandTextures, LANDTEXARW, LANDTEXARH);
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   151
end;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   152
    
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   153
procedure freeModule;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   154
begin
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   155
    LandTextures:= nil;
b50215a8a43d land arrays are allocated dynamically, so DOWNSCALE and LOWRES macros are now removed and replaced by run time flags rqBlurryLand and rqLowRes
koda
parents: 3595
diff changeset
   156
end;
1806
3c4f0886c123 More reorganization
unc0rr
parents:
diff changeset
   157
end.